[gtkmm] gtkmm: Added some new methods.



commit 72e073bb2ff710c353627cce416f4f24969f4588
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Jan 12 01:32:32 2011 +0100

    gtkmm: Added some new methods.
    
    * gtk/src/menuitem.hg: Added get/set_reserve_indicator().
    * gtk/src/menushell.hg: Added get_selected_item() and get_parent_shell().
    * gtk/src/stylecontext.hg: Added get/set_path() and get_screen().
    * gtk/src/treeview.[hg|ccg]: Added is_blank_at_pos().
    * tools/m4/convert_gdk.m4: Added necessary conversion.

 ChangeLog               |   10 ++++++++++
 gtk/src/menuitem.hg     |    3 +++
 gtk/src/menushell.hg    |    8 +++++++-
 gtk/src/stylecontext.hg |   11 +++++++----
 gtk/src/treemodel.hg    |    2 +-
 gtk/src/treeview.ccg    |   16 ++++++++++++++++
 gtk/src/treeview.hg     |    8 ++++++++
 tools/m4/convert_gdk.m4 |    2 ++
 8 files changed, 54 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5048753..0925131 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2011-01-12  Murray Cumming  <murrayc murrayc com>
 
+	gtkmm: Added some new methods.
+
+	* gtk/src/menuitem.hg: Added get/set_reserve_indicator().
+	* gtk/src/menushell.hg: Added get_selected_item() and get_parent_shell().
+	* gtk/src/stylecontext.hg: Added get/set_path() and get_screen().
+	* gtk/src/treeview.[hg|ccg]: Added is_blank_at_pos().
+	* tools/m4/convert_gdk.m4: Added necessary conversion.
+
+2011-01-12  Murray Cumming  <murrayc murrayc com>
+
 	Regenerate gdk-pixbufs defs.
 
 	* gdk/src/gdk_pixbuf_methods.defs: Regenerated with h2defs.py.
diff --git a/gtk/src/menuitem.hg b/gtk/src/menuitem.hg
index eba02d6..fd974b9 100644
--- a/gtk/src/menuitem.hg
+++ b/gtk/src/menuitem.hg
@@ -78,6 +78,9 @@ public:
   _WRAP_METHOD(Glib::ustring get_label() const, gtk_menu_item_get_label)
   _WRAP_METHOD(void set_use_underline(bool setting = true), gtk_menu_item_set_use_underline)
   _WRAP_METHOD(bool get_use_underline() const, gtk_menu_item_get_use_underline)
+  
+  _WRAP_METHOD(void set_reserve_indicator(bool reserve = true), gtk_menu_item_set_reserve_indicator)
+  _WRAP_METHOD(bool get_reserve_indicator() const, gtk_menu_item_get_reserve_indicator)
 
   _WRAP_SIGNAL(void activate(), "activate")
   _WRAP_SIGNAL(void activate_item(), "activate_item")
diff --git a/gtk/src/menushell.hg b/gtk/src/menushell.hg
index 21ef968..5c24b68 100644
--- a/gtk/src/menushell.hg
+++ b/gtk/src/menushell.hg
@@ -113,7 +113,13 @@ public:
 
   _WRAP_METHOD(bool get_take_focus() const, gtk_menu_shell_get_take_focus)
   _WRAP_METHOD(void set_take_focus(bool take_focus = true), gtk_menu_shell_set_take_focus)
-
+  
+  _WRAP_METHOD(Widget* get_selected_item(), gtk_menu_shell_get_selected_item)
+  _WRAP_METHOD(const Widget* get_selected_item() const, gtk_menu_shell_get_selected_item)
+  
+  _WRAP_METHOD(Widget* get_parent_shell(), gtk_menu_shell_get_parent_shell)
+  _WRAP_METHOD(const Widget* get_parent_shell() const, gtk_menu_shell_get_parent_shell)
+  
   _WRAP_PROPERTY("take-focus", bool)
 
 protected:
diff --git a/gtk/src/stylecontext.hg b/gtk/src/stylecontext.hg
index 7adea8a..6bd867c 100644
--- a/gtk/src/stylecontext.hg
+++ b/gtk/src/stylecontext.hg
@@ -28,6 +28,7 @@ _PINCLUDE(gtk/gtk.h)
 #include <gtkmm/enums.h>
 #include <gtkmm/iconsource.h>
 #include <gtkmm/iconset.h>
+#include <gtkmm/widgetpath.h>
 #include <gtkmmconfig.h>
 
 
@@ -78,8 +79,10 @@ public:
 
   _WRAP_METHOD(bool state_is_running(StateType state, gdouble* progress), gtk_style_context_state_is_running)
 
-  //TODO: _WRAP_METHOD(void set_path(GtkWidgetPath* path), gtk_style_context_set_path)
-  //TODO: _WRAP_METHOD(const GtkWidgetPath* get_path(), gtk_style_context_get_path)
+  _WRAP_METHOD(void set_path(const WidgetPath& path), gtk_style_context_set_path)
+  
+#m4 _CONVERSION(`const GtkWidgetPath*',`WidgetPath',`WidgetPath(const_cast<GtkWidgetPath*>($3), true)')
+  _WRAP_METHOD(WidgetPath get_path() const, gtk_style_context_get_path)
 
   //TODO: _WRAP_METHOD(GList * list_classes (), gtk_style_context_list_classes)
 
@@ -112,8 +115,8 @@ public:
 
   _WRAP_METHOD(void set_screen(const Glib::RefPtr<Gdk::Screen>& screen), gtk_style_context_set_screen)
                                           
-  //TODO: _WRAP_METHOD(Glib::RefPtr<Gdk::Screen> get_screen(), gtk_style_context_get_screen, refreturn)
-  //TODO: _WRAP_METHOD(Glib::RefPtr<const Gdk::Screen> get_screen() const , gtk_style_context_get_screen, refreturn, constversion)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::Screen> get_screen(), gtk_style_context_get_screen, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gdk::Screen> get_screen() const, gtk_style_context_get_screen, refreturn, constversion)
 
   _WRAP_METHOD(void set_direction(TextDirection direction), gtk_style_context_set_direction)
   _WRAP_METHOD(TextDirection get_direction() const, gtk_style_context_get_direction)
diff --git a/gtk/src/treemodel.hg b/gtk/src/treemodel.hg
index 78e3f5a..252f5e2 100644
--- a/gtk/src/treemodel.hg
+++ b/gtk/src/treemodel.hg
@@ -86,7 +86,7 @@ class TreeModel : public Glib::Interface
       gtk_tree_model_get_iter_from_string, gtk_tree_model_get_string_from_iter, 
       gtk_tree_model_iter_nth_child,
       gtk_tree_model_ref_node, gtk_tree_model_get_valist,
-      gtk_tree_model_iter_next, gtk_tree_model_iter_has_child,
+      gtk_tree_model_iter_next, gtk_tree_model_iter_previous, gtk_tree_model_iter_has_child,
       gtk_tree_model_unref_node, gtk_tree_model_iter_children,
       gtk_tree_model_iter_n_children, gtk_tree_model_get_iter_first,
       gtk_tree_model_get_value)
diff --git a/gtk/src/treeview.ccg b/gtk/src/treeview.ccg
index 96871f7..d3f16cc 100644
--- a/gtk/src/treeview.ccg
+++ b/gtk/src/treeview.ccg
@@ -461,4 +461,20 @@ TreeView::get_tooltip_context_iter(int& x, int& y,
   return result;
 }
 
+bool TreeView::is_blank_at_pos(int x, int y, TreePath& path, TreeViewColumn*& column, int& cell_x, int& cell_y) const
+{
+  GtkTreePath* cpath = 0;
+  GtkTreeViewColumn* pcolumn = 0;
+  const bool result = gtk_tree_view_is_blank_at_pos(const_cast<GtkTreeView*>(gobj()), x, y, &cpath, &pcolumn, &(cell_x), &(cell_y));
+  
+  path = TreePath(cpath, false /* take ownership instead of taking a copy */);
+  column = Glib::wrap(pcolumn);
+  return result;
+}
+
+bool TreeView::is_blank_at_pos(int x, int y) const
+{
+  return gtk_tree_view_is_blank_at_pos(const_cast<GtkTreeView*>(gobj()), x, y, 0, 0, 0, 0);
+}
+
 } // namespace Gtk
diff --git a/gtk/src/treeview.hg b/gtk/src/treeview.hg
index 903b988..341d641 100644
--- a/gtk/src/treeview.hg
+++ b/gtk/src/treeview.hg
@@ -544,6 +544,14 @@ public:
 
    bool get_visible_range(TreeModel::Path& start_path, TreeModel::Path& end_path) const;
   _IGNORE(gtk_tree_view_get_visible_range)
+  
+  //TODO: Documentation
+  bool is_blank_at_pos(int x, int y, TreePath& path, TreeViewColumn*& column, int& cell_x, int& cell_y) const;
+  _IGNORE(gtk_tree_view_is_blank_at_pos)
+  
+  //TODO: Documentation
+  bool is_blank_at_pos(int x, int y) const;
+                                                                    
 
 /* Drag-and-Drop support */
   _IGNORE(gtk_tree_view_enable_model_drag_source)
diff --git a/tools/m4/convert_gdk.m4 b/tools/m4/convert_gdk.m4
index ecd66f9..e0338fe 100644
--- a/tools/m4/convert_gdk.m4
+++ b/tools/m4/convert_gdk.m4
@@ -273,3 +273,5 @@ _CONVERSION(`GdkEvent*',`const GdkEvent*',`($2)($3)')
 
 
 _CONVERSION(`GdkDragContext*',`Glib::RefPtr<Gdk::DragContext>',Glib::wrap($3, true))
+
+_CONVERSION(`const Widgetpath&',`GtkWidgetPath*',`const_cast<WidgetPath&>($3).gobj()')



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