[gtkmm] Gtk::Widget: Add methods for child widgets
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Gtk::Widget: Add methods for child widgets
- Date: Fri, 27 Jan 2017 11:48:08 +0000 (UTC)
commit 289ad48982159be4638799898cb4d68f93048dbf
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Fri Jan 27 12:44:36 2017 +0100
Gtk::Widget: Add methods for child widgets
Add get_first_child(), get_last_child(), get_next_sibling(),
get_prev_sibling(), snapshot_child(). Add property_css_name().
gtk/src/widget.ccg | 1 +
gtk/src/widget.hg | 17 ++++++++++++++++-
tools/m4/convert_gtk.m4 | 3 +++
3 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/gtk/src/widget.ccg b/gtk/src/widget.ccg
index 0501b4c..a2dc89d 100644
--- a/gtk/src/widget.ccg
+++ b/gtk/src/widget.ccg
@@ -24,6 +24,7 @@
#include <gtkmm/container.h>
#include <gtkmm/selectiondata_private.h>
#include <gtkmm/tooltip.h>
+#include <gtkmm/snapshot.h>
#include <gtk/gtk.h>
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index ed387b4..0cd95ff 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -67,6 +67,7 @@ class Adjustment;
class Window;
class Container;
class Settings;
+class Snapshot;
class Tooltip;
// Gtk::Allocation is a typedef of Gdk::Rectangle because GtkAllocation is
@@ -519,6 +520,20 @@ public:
_WRAP_METHOD(Glib::RefPtr<Pango::FontMap> get_font_map(), gtk_widget_get_font_map, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Pango::FontMap> get_font_map() const, gtk_widget_get_font_map, refreturn,
constversion)
+ _WRAP_METHOD(Widget* get_first_child(), gtk_widget_get_first_child)
+ _WRAP_METHOD(const Widget* get_first_child() const, gtk_widget_get_first_child, constversion)
+ _WRAP_METHOD(Widget* get_last_child(), gtk_widget_get_last_child)
+ _WRAP_METHOD(const Widget* get_last_child() const, gtk_widget_get_last_child, constversion)
+ _WRAP_METHOD(Widget* get_next_sibling(), gtk_widget_get_next_sibling)
+ _WRAP_METHOD(const Widget* get_next_sibling() const, gtk_widget_get_next_sibling, constversion)
+ _WRAP_METHOD(Widget* get_prev_sibling(), gtk_widget_get_prev_sibling)
+ _WRAP_METHOD(const Widget* get_prev_sibling() const, gtk_widget_get_prev_sibling, constversion)
+
+ //TODO: gtk_widget_set_focus_child() is not documented. Wrap or _IGNORE?
+ //_WRAP_METHOD(void set_focus_child(Widget& child), gtk_widget_set_focus_child)
+ //void unset_focus_child();
+ _WRAP_METHOD(void snapshot_child(Widget& child, Snapshot& snapshot), gtk_widget_snapshot_child)
+
_WRAP_SIGNAL(void show(),"show")
_WRAP_SIGNAL(void hide(),"hide", custom_c_callback)
@@ -706,6 +721,7 @@ _CONVERSION(`GdkScreen*',`const Glib::RefPtr<Gdk::Screen>&',`Glib::wrap($3, true
_WRAP_PROPERTY("expand", bool)
_WRAP_PROPERTY("opacity", double)
_WRAP_PROPERTY("scale-factor", int)
+ _WRAP_PROPERTY("css-name", Glib::ustring)
protected:
@@ -729,7 +745,6 @@ protected:
// Custom widgets that need the snapshot vfunc must use a custom rendering widget
// that wraps the snapshot vfunc.
// https://bugzilla.gnome.org/show_bug.cgi?id=774778
-//#m4 _CONVERSION(`Snapshot&',`GtkSnapshot*',`($3).gobj()')
//#m4 _CONVERSION(`GtkSnapshot*',`Snapshot&',`*Glib::wrap($3)')
//_WRAP_VFUNC(void snapshot(Snapshot& snapshot), snapshot)
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 419e3da..b58258b 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -539,6 +539,9 @@ _CONVERSION(`GtkShortcutsWindow*',`ShortcutsWindow*',__RP2P)
_CONVERSION(`GtkShortcutsWindow*',`const ShortcutsWindow*',__RP2P)
_CONVERSION(`ShortcutsWindow&',`GtkShortcutsWindow*',__FR2P)
+_CONVERSION(`Snapshot&',`GtkSnapshot*',__FR2P)
+_CONVERSION(`Gtk::Snapshot&',`GtkSnapshot*',__FR2P)
+
#FlowBoxChild
_CONVERSION(`GtkFlowBoxChild*',`FlowBoxChild*',__RP2P)
_CONVERSION(`GtkFlowBoxChild*',`const FlowBoxChild*',__RP2P)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]