[gtkmm] Wrap GtkPopover



commit abdc0b061ff777c1fa0370f83e27ec41c87ac460
Author: Juan R. GarcĂ­a Blanco <juanrgar gmail com>
Date:   Thu Jan 30 20:59:07 2014 +0100

    Wrap GtkPopover

 gtk/gtkmm.h                               |    1 +
 gtk/src/filelist.am                       |    1 +
 gtk/src/popover.ccg                       |   25 ++++++++
 gtk/src/popover.hg                        |   89 +++++++++++++++++++++++++++++
 tools/extra_defs_gen/generate_defs_gtk.cc |    1 +
 5 files changed, 117 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index 8e31248..5081fa8 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -207,6 +207,7 @@ extern const int gtkmm_micro_version;
 #endif
 #include <gtkmm/papersize.h>
 #include <gtkmm/placessidebar.h>
+#include <gtkmm/popover.h>
 #include <gtkmm/printcontext.h>
 #ifndef G_OS_WIN32
 # include <gtkmm/printer.h>
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index b3234f8..0d60c2c 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -117,6 +117,7 @@ gtkmm_files_any_hg =                \
        paned.hg                \
        papersize.hg            \
        placessidebar.hg        \
+       popover.hg      \
        printcontext.hg         \
        printoperation.hg       \
        printoperationpreview.hg\
diff --git a/gtk/src/popover.ccg b/gtk/src/popover.ccg
new file mode 100644
index 0000000..0b15ffe
--- /dev/null
+++ b/gtk/src/popover.ccg
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2013 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <gtk/gtk.h>
+
+
+namespace Gtk
+{
+} // namespace Gtk
+
diff --git a/gtk/src/popover.hg b/gtk/src/popover.hg
new file mode 100644
index 0000000..50a706b
--- /dev/null
+++ b/gtk/src/popover.hg
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2013 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <gtkmm/bin.h>
+#include <cairomm/types.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/bin_p.h)
+
+namespace Gtk
+{
+
+/** Context dependent bubbles.
+ *
+ * Gtk::Popover is a bubble-like context window, primarily meant to
+ * provide context-dependent information or options. Popovers are
+ * attached to a widget, passed at construction time on Gtk::Popover(),
+ * or updated afterwards through Gtk::Popover::set_relative_to(), by
+ * default they will point to the whole widget area, although this
+ * behavior can be changed through Gtk::Popover::set_pointing_to().
+ *
+ * The position of a popover relative to the widget it is attached to
+ * can also be changed through Gtk::Popover::set_position().
+ *
+ * By default, Gtk::Popover performs a GTK+ grab, in order to ensure
+ * input events get redirected to it while it is shown, and also so
+ * the popover is dismissed in the expected situations (clicks outside
+ * the popover, or the Esc key being pressed). If no such modal behavior
+ * is desired on a popover, Gtk::Popover::set_modal() may be called on it
+ * to tweak its behavior.
+ *
+ * @ingroup Widgets
+ * @newin{3,12}
+ */
+class Popover
+  : public Bin
+{
+  _CLASS_GTKOBJECT(Popover, GtkPopover, GTK_POPOVER, Gtk::Bin, GtkBin)
+public:
+
+  /** Creates a new popover to point to @a relative_to
+   *
+   * @param relative_to The Gtk::Widget the popover is related to
+   */
+  _WRAP_CTOR(Popover(const Widget& relative_to), gtk_popover_new)
+
+
+  _WRAP_METHOD(void set_relative_to(const Widget& relative_to), gtk_popover_set_relative_to)
+  // transfer none
+  _WRAP_METHOD(Widget* get_relative_to(), gtk_popover_get_relative_to)
+  _WRAP_METHOD(const Widget* get_relative_to() const, gtk_popover_get_relative_to, constversion)
+
+#m4 _CONVERSION(`Cairo::RectangleInt&',`cairo_rectangle_int_t*', 
`reinterpret_cast<cairo_rectangle_int_t*>(&$3)')
+#m4 _CONVERSION(`const Cairo::RectangleInt&',`cairo_rectangle_int_t*', `const_cast<cairo_rectangle_int_t* 
(reinterpret_cast<const cairo_rectangle_int_t* >(&$3))')
+  _WRAP_METHOD(void set_pointing_to(const Cairo::RectangleInt& rect), gtk_popover_set_pointing_to)
+  _WRAP_METHOD(bool get_pointing_to(Cairo::RectangleInt& rect) const, gtk_popover_get_pointing_to)
+
+  _WRAP_METHOD(void set_position(PositionType position = POS_TOP), gtk_popover_set_position)
+  _WRAP_METHOD(PositionType get_position() const, gtk_popover_get_position)
+
+  _WRAP_METHOD(void set_modal(bool modal = true), gtk_popover_set_modal)
+  _WRAP_METHOD(bool get_modal() const, gtk_popover_get_modal)
+
+
+  _WRAP_PROPERTY("relative-to", Widget*)
+// TODO
+//  _WRAP_PROPERTY("pointing-to", Cairo::RectangleInt)
+  _WRAP_PROPERTY("position", PositionType)
+  _WRAP_PROPERTY("modal", bool)
+
+  // Gtk::Popover has no signals nor vfuncs as of 3.12.
+};
+
+} // namespace Gtk
diff --git a/tools/extra_defs_gen/generate_defs_gtk.cc b/tools/extra_defs_gen/generate_defs_gtk.cc
index ce3b9e0..7648feb 100644
--- a/tools/extra_defs_gen/generate_defs_gtk.cc
+++ b/tools/extra_defs_gen/generate_defs_gtk.cc
@@ -149,6 +149,7 @@ int main(int argc, char** argv)
 #ifdef GDK_WINDOWING_X11
             << get_defs( GTK_TYPE_PLUG )
 #endif
+            << get_defs( GTK_TYPE_POPOVER )
 #if !defined(G_OS_WIN32) 
             << get_defs( GTK_TYPE_PRINTER )
             << get_defs( GTK_TYPE_PRINT_JOB )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]