[gtkmm] WidgetPath: Add some methods.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] WidgetPath: Add some methods.
- Date: Fri, 15 Jun 2012 10:36:58 +0000 (UTC)
commit 43dce4844ba329d3622f73dcc88a861f5f0bc04b
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Jun 15 12:35:44 2012 +0200
WidgetPath: Add some methods.
* gtk/src/widgetpath.hg:
Add to_string(), iter_get_siblings() and iter_list_regions().
iter_clear_classes(), iter_clear_regions(): Add a -1 defaut value for pos.
* tools/m4/convert_gtk.m4: Add a necessary conversion.
ChangeLog | 9 +++++++++
gtk/src/widgetpath.hg | 18 +++++++++++++-----
tools/m4/convert_gtk.m4 | 1 +
3 files changed, 23 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4755213..16fe95a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2012-06-15 Murray Cumming <murrayc murrayc com>
+ WidgetPath: Add some methods.
+
+ * gtk/src/widgetpath.hg:
+ Add to_string(), iter_get_siblings() and iter_list_regions().
+ iter_clear_classes(), iter_clear_regions(): Add a -1 defaut value for pos.
+ * tools/m4/convert_gtk.m4: Add a necessary conversion.
+
+2012-06-15 Murray Cumming <murrayc murrayc com>
+
Add some new methods.
* gdk/src/screen.[hg|ccg]: Add get_monitor_workarea().
diff --git a/gtk/src/widgetpath.hg b/gtk/src/widgetpath.hg
index be9f220..77e3551 100644
--- a/gtk/src/widgetpath.hg
+++ b/gtk/src/widgetpath.hg
@@ -40,6 +40,7 @@ class WidgetPath
_IGNORE(gtk_widget_path_new, gtk_widget_path_copy, gtk_widget_path_free)
public:
+ _WRAP_METHOD(Glib::ustring to_string() const, gtk_widget_path_to_string)
_WRAP_METHOD(int path_length() const, gtk_widget_path_length)
_WRAP_METHOD(int path_append_type(GType type), gtk_widget_path_append_type)
@@ -53,18 +54,25 @@ public:
_WRAP_METHOD(bool iter_has_name(int pos, const Glib::ustring& name) const, gtk_widget_path_iter_has_name)
//TODO: _WRAP_METHOD(bool iter_has_qname(int pos, GQuark qname) const, gtk_widget_path_iter_has_qname)
+
+ _WRAP_METHOD(WidgetPath iter_get_siblings(int pos = -1) const, gtk_widget_path_iter_get_siblings)
+ _WRAP_METHOD(guint get_sibling_index(int pos = -1), gtk_widget_path_iter_get_sibling_index)
+
_WRAP_METHOD(void iter_add_class(int pos, const Glib::ustring& name), gtk_widget_path_iter_add_class)
_WRAP_METHOD(void iter_remove_class(int pos, const Glib::ustring& name), gtk_widget_path_iter_remove_class)
- _WRAP_METHOD(void iter_clear_classes(int pos), gtk_widget_path_iter_clear_classes)
- //TODO: _WRAP_METHOD(GSList * gtk_widget_path_iter_list_classes(const GtkWidgetPath *path, int pos), gtk_widget_path_iter_list_classes)
+ _WRAP_METHOD(void iter_clear_classes(int pos = -1), gtk_widget_path_iter_clear_classes)
+
+#m4 _CONVERSION(`GSList*',`std::vector<Glib::ustring>',`Glib::SListHandler<Glib::ustring>::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<Glib::ustring> iter_list_classes(int pos = -1) const, gtk_widget_path_iter_list_classes)
+
_WRAP_METHOD(bool iter_has_class(int pos, const Glib::ustring& name) const, gtk_widget_path_iter_has_class)
//TODOL_WRAP_METHOD(bool iter_has_qclass(int pos, GQuark qname) const, gtk_widget_path_iter_has_qclass)
- _WRAP_METHOD(void iter_add_region(int pos, const Glib::ustring& name, RegionFlags flags), gtk_widget_path_iter_add_region)
+ _WRAP_METHOD(void iter_add_region(int pos, const Glib::ustring& name, RegionFlags flags), gtk_widget_path_iter_add_region)
_WRAP_METHOD(void iter_remove_region(int pos, const Glib::ustring& name), gtk_widget_path_iter_remove_region)
- _WRAP_METHOD(void iter_clear_regions(int pos), gtk_widget_path_iter_clear_regions)
+ _WRAP_METHOD(void iter_clear_regions(int pos = -1), gtk_widget_path_iter_clear_regions)
- //TODO: _WRAP_METHOD(GSList* iter_list_regions(int pos), gtk_widget_path_iter_list_regions)
+ _WRAP_METHOD(std::vector<Glib::ustring> iter_list_regions(int pos = -1) const, gtk_widget_path_iter_list_regions)
_WRAP_METHOD(bool iter_has_region(int pos, const Glib::ustring& name, RegionFlags& flags) const, gtk_widget_path_iter_has_region)
//TODO: _WRAP_METHOD(bool iter_has_qregion(int pos, GQuark qname, RegionFlags& flags), gtk_widget_path_iter_has_qregion)
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 983ab6e..6a88aa1 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -692,3 +692,4 @@ _CONVERSION(`GMenuModel*',`Glib::RefPtr<const Gio::MenuModel>',`Glib::wrap($3)')
_CONVERSION(`GtkDragResult',`DragResult',`($2)$3')
_CONVERSION(`GtkWidgetPath*',`WidgetPath',`Glib::wrap($3, true)')
+_CONVERSION(`const GtkWidgetPath*',`WidgetPath',`Glib::wrap(const_cast<GtkWidgetPath*>($3), true)')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]