[gtkmm] Wrap GtkHeaderBar



commit f8d1b8f0372ba6efc3531928d9074423a36124f9
Author: Juan Rafael GarcĂ­a Blanco <juanrgar FedoraMacBook localdomain>
Date:   Mon Sep 16 22:52:09 2013 +0200

    Wrap GtkHeaderBar
    
    Bug #708194

 gtk/gtkmm.h                               |    1 +
 gtk/src/filelist.am                       |    1 +
 gtk/src/gtk_signals.defs                  |   47 ++++++++++++++++++
 gtk/src/headerbar.ccg                     |   25 ++++++++++
 gtk/src/headerbar.hg                      |   74 +++++++++++++++++++++++++++++
 tools/extra_defs_gen/generate_defs_gtk.cc |    1 +
 6 files changed, 149 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index 3aae998..e6e616a 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -159,6 +159,7 @@ extern const int gtkmm_micro_version;
 #include <gtkmm/frame.h>
 #include <gtkmm/grid.h>
 #include <gtkmm/handlebox.h>
+#include <gtkmm/headerbar.h>
 #include <gtkmm/hvbox.h>
 #include <gtkmm/hvbuttonbox.h>
 #include <gtkmm/hvpaned.h>
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 6450f7f..1063a3b 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -83,6 +83,7 @@ gtkmm_files_any_hg =          \
        fontchooserwidget.hg    \
        frame.hg                \
        grid.hg                 \
+       headerbar.hg    \
        hvbox.hg                \
        iconinfo.hg             \
        icontheme.hg            \
diff --git a/gtk/src/gtk_signals.defs b/gtk/src/gtk_signals.defs
index 8099d50..d07242c 100644
--- a/gtk/src/gtk_signals.defs
+++ b/gtk/src/gtk_signals.defs
@@ -4320,6 +4320,53 @@
   (construct-only #f)
 )
 
+;; From GtkHeaderBar
+
+(define-property title
+  (of-object "GtkHeaderBar")
+  (prop-type "GParamString")
+  (docs "The title to display")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property subtitle
+  (of-object "GtkHeaderBar")
+  (prop-type "GParamString")
+  (docs "The subtitle to display")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property custom-title
+  (of-object "GtkHeaderBar")
+  (prop-type "GParamObject")
+  (docs "Custom title widget to display")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property spacing
+  (of-object "GtkHeaderBar")
+  (prop-type "GParamInt")
+  (docs "The amount of space between children")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property show-close-button
+  (of-object "GtkHeaderBar")
+  (prop-type "GParamBoolean")
+  (docs "Whether to show a window close button")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
 ;; From GtkIconTheme
 
 (define-signal changed
diff --git a/gtk/src/headerbar.ccg b/gtk/src/headerbar.ccg
new file mode 100644
index 0000000..0b15ffe
--- /dev/null
+++ b/gtk/src/headerbar.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/headerbar.hg b/gtk/src/headerbar.hg
new file mode 100644
index 0000000..a326713
--- /dev/null
+++ b/gtk/src/headerbar.hg
@@ -0,0 +1,74 @@
+/*
+ * 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/container.h>
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/container_p.h)
+
+namespace Gtk
+{
+
+/** A box with a centered child.
+ *
+ * Gtk::HeaderBar is similar to a horizontal Gtk::Box, it allows
+ * to place children at the start or the end. In addition,
+ * it allows a title to be displayed. The title will be
+ * centered with respect to the width of the box, even if the children
+ * at either side take up different amounts of space.
+ *
+ * @ingroup Widgets
+ * @newin{3,10}
+ */
+class HeaderBar
+  : public Container
+{
+  _CLASS_GTKOBJECT(HeaderBar, GtkHeaderBar, GTK_HEADER_BAR, Gtk::Container, GtkContainer)
+public:
+
+  /** Create a new HeaderBar widget.
+   */
+  _CTOR_DEFAULT
+
+
+  _WRAP_METHOD(void set_title(const Glib::ustring& title), gtk_header_bar_set_title)
+  _WRAP_METHOD(Glib::ustring get_title() const, gtk_header_bar_get_title)
+
+  _WRAP_METHOD(void set_subtitle(const Glib::ustring& subtitle), gtk_header_bar_set_subtitle)
+  _WRAP_METHOD(Glib::ustring get_subtitle() const, gtk_header_bar_get_subtitle)
+
+  _WRAP_METHOD(void set_custom_title(Gtk::Widget& title_widget), gtk_header_bar_set_custom_title)
+  _WRAP_METHOD(Widget* get_custom_title(), gtk_header_bar_get_custom_title)
+  _WRAP_METHOD(const Widget* get_custom_title() const, gtk_header_bar_get_custom_title, constversion)
+
+  _WRAP_METHOD(void pack_start(Gtk::Widget& child), gtk_header_bar_pack_start)
+  _WRAP_METHOD(void pack_end(Gtk::Widget& child), gtk_header_bar_pack_end)
+
+  _WRAP_METHOD(void set_show_close_button(bool settings = true), gtk_header_bar_set_show_close_button)
+  _WRAP_METHOD(bool get_show_close_button(), gtk_header_bar_get_show_close_button)
+
+
+  _WRAP_PROPERTY("custom-title", Gtk::Widget*)
+  _WRAP_PROPERTY("show-close-button", bool)
+  _WRAP_PROPERTY("spacing", int)
+  _WRAP_PROPERTY("subtitle", Glib::ustring)
+  _WRAP_PROPERTY("title", Glib::ustring)
+
+  // Gtk::HeaderBar has no signals nor vfuncs as of 3.10.
+};
+
+} // namespace Gtk
diff --git a/tools/extra_defs_gen/generate_defs_gtk.cc b/tools/extra_defs_gen/generate_defs_gtk.cc
index 4c14b7f..9b510b4 100644
--- a/tools/extra_defs_gen/generate_defs_gtk.cc
+++ b/tools/extra_defs_gen/generate_defs_gtk.cc
@@ -118,6 +118,7 @@ int main(int argc, char** argv)
             << get_defs( GTK_TYPE_FRAME )
             << get_defs( GTK_TYPE_GRID )
             << get_defs( GTK_TYPE_HANDLE_BOX )
+            << get_defs( GTK_TYPE_HEADER_BAR )
             << get_defs( GTK_TYPE_ICON_THEME )
             << get_defs( GTK_TYPE_IMAGE )
             << get_defs( GTK_TYPE_IMAGE_MENU_ITEM )


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