[gtkmm] Wrap GtkOverlay widget



commit fc2073cdc9e46a6e5d94a84544837ff029634a2e
Author: Juan R. García Blanco <juanrgar gmail com>
Date:   Sat Jun 21 12:45:27 2014 +0200

    Wrap GtkOverlay widget
    
        * Create gtk/src/overlay.{hg,ccg}
        * Update gtk/src/filelist.am
        * Add "get-child-position" signal to gtk/src/gtk_signals.defs
        * Add GTK_TYPE_OVERLAY to
        tools/extra_defs_gen/generate_defs_gtk.cc
        * Add overlay.h to gtkmm.h

 .gitignore                                |    2 +
 gtk/gtkmm.h                               |    1 +
 gtk/src/filelist.am                       |    1 +
 gtk/src/gtk_signals.defs                  |   12 +++++
 gtk/src/overlay.ccg                       |   25 +++++++++++
 gtk/src/overlay.hg                        |   68 +++++++++++++++++++++++++++++
 tools/extra_defs_gen/generate_defs_gtk.cc |    1 +
 7 files changed, 110 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index cee5dca..264ce7e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -334,6 +334,8 @@ gtk/gtkmm/offscreenwindow.cc
 gtk/gtkmm/offscreenwindow.h
 gtk/gtkmm/orientable.cc
 gtk/gtkmm/orientable.h
+gtk/gtkmm/overlay.cc
+gtk/gtkmm/overlay.h
 gtk/gtkmm/pagesetup.cc
 gtk/gtkmm/pagesetup.h
 gtk/gtkmm/pagesetupunixdialog.cc
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index 6b662dd..9f4dda1 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -202,6 +202,7 @@ extern const int gtkmm_micro_version;
 #include <gtkmm/numerableicon.h>
 #include <gtkmm/object.h>
 #include <gtkmm/offscreenwindow.h>
+#include <gtkmm/overlay.h>
 #include <gtkmm/paned.h>
 #include <gtkmm/pagesetup.h>
 #ifndef G_OS_WIN32
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 839add8..48f8e6f 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -112,6 +112,7 @@ gtkmm_files_any_hg =                \
        notebook.hg             \
        offscreenwindow.hg      \
        orientable.hg           \
+       overlay.hg              \
        pagesetup.hg            \
        paned.hg                \
        papersize.hg            \
diff --git a/gtk/src/gtk_signals.defs b/gtk/src/gtk_signals.defs
index bb88dd8..72ce905 100644
--- a/gtk/src/gtk_signals.defs
+++ b/gtk/src/gtk_signals.defs
@@ -6105,6 +6105,18 @@
   (construct-only #f)
 )
 
+;; From GtkOverlay
+
+(define-signal get-child-position
+  (of-object "GtkOverlay")
+  (return-type "gboolean")
+  (when "last")
+  (parameters
+    '("GtkWidget*" "p0")
+    '("GdkRectangle*" "p1")
+  )
+)
+
 ;; From GtkPaned
 
 (define-signal cycle-child-focus
diff --git a/gtk/src/overlay.ccg b/gtk/src/overlay.ccg
new file mode 100644
index 0000000..8bbc623
--- /dev/null
+++ b/gtk/src/overlay.ccg
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2014 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/overlay.hg b/gtk/src/overlay.hg
new file mode 100644
index 0000000..79f4025
--- /dev/null
+++ b/gtk/src/overlay.hg
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2014 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>
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/bin_p.h)
+
+namespace Gtk
+{
+
+/** A container which overlays widgets on top of each other.
+ *
+ * Gtk::Overlay is a container which contains a single main child, on top
+ * of which it can place “overlay” widgets. The
+ * position of each overlay widget is determined by its Gtk::Widget:halign
+ * and Gtk::Widget:valign properties. E.g. a widget with both alignments
+ * set to Gtk::ALIGN_START will be placed at the top left corner of the
+ * main widget, whereas an overlay with halign set to Gtk::ALIGN_CENTER
+ * and valign set to Gtk::ALIGN_END will be placed a the bottom edge of
+ * the main widget, horizontally centered. The position can be adjusted
+ * by setting the margin properties of the child to non-zero values.
+ *
+ * More complicated placement of overlays is possible by connecting
+ * to the Gtk::Overlay::get-child-position signal.
+ *
+ * The Gtk::Overlay implementation of the Gtk::Buildable interface
+ * supports placing a child as an overlay by specifying “overlay” as
+ * the “type” attribute of a `<child>` element.
+ *
+ * @ingroup Containers
+ * @newin{3,2}
+ */
+
+class Overlay
+  : public Bin
+{
+  _CLASS_GTKOBJECT(Overlay, GtkOverlay, GTK_OVERLAY, Gtk::Bin, GtkBin)
+public:
+
+  /** Creates a new Overlay.
+   */
+  _CTOR_DEFAULT
+
+
+  _WRAP_METHOD(void add_overlay(Gtk::Widget& widget), gtk_overlay_add_overlay)
+
+#m4 _CONVERSION(`GdkRectangle*',`Gdk::Rectangle&',`Glib::wrap($3)')
+  _WRAP_SIGNAL(bool get_child_position(Gtk::Widget* widget, Gdk::Rectangle& allocation), 
"get-child-position")
+
+  // Gtk::Overlay has no properties nor vfuncs as of 3.2.
+};
+
+} // namespace Gtk
diff --git a/tools/extra_defs_gen/generate_defs_gtk.cc b/tools/extra_defs_gen/generate_defs_gtk.cc
index 01db454..a2a4d9d 100644
--- a/tools/extra_defs_gen/generate_defs_gtk.cc
+++ b/tools/extra_defs_gen/generate_defs_gtk.cc
@@ -146,6 +146,7 @@ int main(int argc, char** argv)
             << get_defs( GTK_TYPE_NUMERABLE_ICON )
             << get_defs( GTK_TYPE_OFFSCREEN_WINDOW )
             << get_defs( GTK_TYPE_ORIENTABLE )
+            << get_defs( GTK_TYPE_OVERLAY )
             << get_defs( GTK_TYPE_PANED )
             << get_defs( GTK_TYPE_PLACES_SIDEBAR )
 #ifdef GDK_WINDOWING_X11


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