[gtkmm] Wrap some new functions.



commit d3601f004a3d9dff657b0c61908c72d229f15083
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Sep 2 13:02:30 2010 +0200

    Wrap some new functions.
    
    * gtk/src/application.hg: Added create_window().
    * gtk/src/messagedialog.hg: Remove the buttons property because it is
      write-only and construct.
      Added get_message_area().
    * gtk/src/treepath.[hg|ccg]: Ignore gtk_tree_path_get_indices_with_depth() too.
    * gtk/src/widget.hg: Add device_is_shadowed(), set_device_events(),
      add_device_events(), set/get_support_multidevice(), get_device_event().

 ChangeLog                |   12 ++++++++++++
 gtk/src/application.hg   |   18 ++++++++++--------
 gtk/src/messagedialog.hg |   10 ++++++----
 gtk/src/treepath.ccg     |    9 ++++-----
 gtk/src/treepath.hg      |   15 ++++++++-------
 gtk/src/widget.hg        |   14 ++++++++++++--
 6 files changed, 52 insertions(+), 26 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a2c32b2..c694521 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2010-09-02  Murray Cumming  <murrayc murrayc com>
 
+	Wrap some new functions.
+
+	* gtk/src/application.hg: Added create_window().
+	* gtk/src/messagedialog.hg: Remove the buttons property because it is
+  write-only and construct.
+  Added get_message_area().
+	* gtk/src/treepath.[hg|ccg]: Ignore gtk_tree_path_get_indices_with_depth() too.
+	* gtk/src/widget.hg: Add device_is_shadowed(), set_device_events(),
+  add_device_events(), set/get_support_multidevice(), get_device_event().
+
+2010-09-02  Murray Cumming  <murrayc murrayc com>
+
 	Fix build with latest GTK+.
 
 	* gtk/src/gtk_enums.defs: Regenerated with enums.pl.
diff --git a/gtk/src/application.hg b/gtk/src/application.hg
index 7846410..1104458 100644
--- a/gtk/src/application.hg
+++ b/gtk/src/application.hg
@@ -40,25 +40,27 @@ public:
 #m4 _CONVERSION(`int& ',`gint**',`&($3)')
 #m4 _CONVERSION(`char**&',`gchar***',`&($3)')
   _WRAP_METHOD(static Glib::RefPtr<Application> create(const Glib::ustring& appid, int& argc, char**& argv), gtk_application_new)
-  
+
   //TODO: Documentation
   static Glib::RefPtr<Application> create(const Glib::ustring& appid);
-  
+
   _WRAP_METHOD(void set_action_group(const Glib::RefPtr<ActionGroup>& group), gtk_application_set_action_group)
-  
+
+  _WRAP_METHOD(Window* create_window(), gtk_application_create_window)
+
   _WRAP_METHOD(Window* get_window(), gtk_application_get_window)
-  _WRAP_METHOD(const Window* get_window() const, gtk_application_get_window)
-  
+  _WRAP_METHOD(const Window* get_window() const, gtk_application_get_window, constversion)
+
 #m4 _CONVERSION(`const GSList*',`Glib::SListHandle<Window*>',`$2(const_cast<GSList*>($3), Glib::OWNERSHIP_NONE)')
   _WRAP_METHOD(Glib::SListHandle<Window*> get_windows(), gtk_application_get_windows)
-  
+
 #m4 _CONVERSION(`const GSList*',`Glib::SListHandle<const Window*>',`$2(const_cast<GSList*>($3), Glib::OWNERSHIP_NONE)')
   _WRAP_METHOD(Glib::SListHandle<const Window*> get_windows() const, gtk_application_get_windows)
-    
+
   _WRAP_METHOD(void add_window(Window& window), gtk_application_add_window)
   _WRAP_METHOD(void run(), gtk_application_run)
   _WRAP_METHOD(void quit(), gtk_application_quit)
-  
+
   _WRAP_PROPERTY("window", Gtk::Window*);
 };
 
diff --git a/gtk/src/messagedialog.hg b/gtk/src/messagedialog.hg
index d8cec3e..d155ec8 100644
--- a/gtk/src/messagedialog.hg
+++ b/gtk/src/messagedialog.hg
@@ -38,7 +38,7 @@ _WRAP_ENUM(ButtonsType, GtkButtonsType)
  * of message (Error, Question, etc.) alongside some message text. It's
  * simply a convenience widget; you could construct the equivalent of
  * Gtk::MessageDialog from Gtk::Dialog without too much effort, but
- * Gtk::MessageDialog saves typing. 
+ * Gtk::MessageDialog saves typing.
  *
  * A MessageDialog looks like this:
  * @image html messagedialog1.png
@@ -67,7 +67,7 @@ public:
    */
   void set_message(const Glib::ustring& message, bool use_markup = false);
   _IGNORE()
-  
+
   /** Sets the secondary text of the message dialog.
    * Note that setting a secondary text makes the primary text become bold, unless you have provided explicit markup.
    *
@@ -79,8 +79,11 @@ public:
   void set_secondary_text(const Glib::ustring& text, bool use_markup = false);
   _IGNORE(gtk_message_dialog_format_secondary_text, gtk_message_dialog_format_secondary_markup)
 
+  _WRAP_METHOD(VBox* get_message_area(), gtk_message_dialog_get_message_area)
+  _WRAP_METHOD(const VBox* get_message_area() const, gtk_message_dialog_get_message_area, constversion)
+
   _WRAP_PROPERTY("message-type", MessageType)
-  _WRAP_PROPERTY("buttons", ButtonsType)
+  //Not wrapped because it is write-only and construct: _WRAP_PROPERTY("buttons", ButtonsType)
   _WRAP_PROPERTY("text", Glib::ustring)
   _WRAP_PROPERTY("use-markup", bool)
   _WRAP_PROPERTY("secondary-text", Glib::ustring)
@@ -90,4 +93,3 @@ public:
 };
 
 } // namespace Gtk
-
diff --git a/gtk/src/treepath.ccg b/gtk/src/treepath.ccg
index 25d6bba..e137c28 100644
--- a/gtk/src/treepath.ccg
+++ b/gtk/src/treepath.ccg
@@ -108,14 +108,14 @@ TreePath::const_iterator TreePath::end() const
   return gtk_tree_path_get_indices(gobject_) + gtk_tree_path_get_depth(gobject_);
 }
 
-bool TreePath::get_from_selection_data(const SelectionData& selection_data, Glib::RefPtr<TreeModel>& model, TreePath& path) //static 
+bool TreePath::get_from_selection_data(const SelectionData& selection_data, Glib::RefPtr<TreeModel>& model, TreePath& path) //static
 {
   GtkTreeModel* src_model = 0;
   GtkTreePath* src_path = 0;
   gboolean result = gtk_tree_get_row_drag_data(const_cast<GtkSelectionData*>(selection_data.gobj()), &src_model, &src_path);
 
   model = Glib::wrap(src_model, true /* take_copy=true */);
-  
+
   //gtk_tree_get_row_drag_data gives us ownership of src_path.
   path = Glib::wrap(src_path, false /* take_copy=false */);
 
@@ -136,8 +136,7 @@ bool TreePath::get_from_selection_data(const SelectionData& selection_data, Tree
 
 bool TreePath::set_in_selection_data(SelectionData& selection_data, const Glib::RefPtr<const TreeModel>& model) const
 {
-  return gtk_tree_set_row_drag_data(selection_data.gobj(), const_cast<GtkTreeModel*>(model->gobj()), const_cast<GtkTreePath*>(gobj()));  
+  return gtk_tree_set_row_drag_data(selection_data.gobj(), const_cast<GtkTreeModel*>(model->gobj()), const_cast<GtkTreePath*>(gobj()));
 }
-  
-} // namespace Gtk
 
+} // namespace Gtk
diff --git a/gtk/src/treepath.hg b/gtk/src/treepath.hg
index d3d9f51..c3a5535 100644
--- a/gtk/src/treepath.hg
+++ b/gtk/src/treepath.hg
@@ -43,7 +43,7 @@ namespace Gtk
 class TreePath
 {
   _CLASS_BOXEDTYPE(TreePath, GtkTreePath, gtk_tree_path_new, gtk_tree_path_copy, gtk_tree_path_free)
-  _IGNORE(gtk_tree_path_copy, gtk_tree_path_free, gtk_tree_path_compare, gtk_tree_path_get_indices)
+  _IGNORE(gtk_tree_path_copy, gtk_tree_path_free, gtk_tree_path_compare)
 
 public:
   typedef unsigned int  size_type;
@@ -100,6 +100,8 @@ public:
   reference       operator[](size_type i);
   const_reference operator[](size_type i) const;
 
+  _IGNORE(gtk_tree_path_get_indices,  gtk_tree_path_get_indices_with_depth)
+
   iterator begin();
   iterator end();
   const_iterator begin() const;
@@ -135,7 +137,7 @@ public:
   _IGNORE(gtk_tree_path_append_index) //replaced by push_back()
   _IGNORE(gtk_tree_path_prepend_index) //replaced by push_front()
   _IGNORE(gtk_tree_path_get_depth) //replaced by size()
-   
+
   /**
    * Obtains a Gtk::TreeModel and Gtk::TreeModel::Path from selection data of target type
    * "GTK_TREE_MODEL_ROW". Normally called from a drag_data_received handler.
@@ -144,7 +146,7 @@ public:
    * is being passed around. If you aren't in the same process, then you'll
    * get memory corruption. In the Gtk::TreeDragDest drag_data_received signal handler,
    * you can assume that selection data of type "GTK_TREE_MODEL_ROW" is
-   * from the current process. 
+   * from the current process.
    *
    * @param selection_data a #SelectionData
    * @param model a Gtk::TreeModel
@@ -155,7 +157,7 @@ public:
    **/
   static bool get_from_selection_data(const SelectionData& selection_data, Glib::RefPtr<TreeModel>& model, TreePath& path);
   //TODO: Add an override that takes a const TreeModel (and deprecate the current version).
-  
+
   /// See description in the other overload.
   static bool get_from_selection_data(const SelectionData& selection_data, TreePath& path);
 
@@ -210,14 +212,13 @@ struct TreePath_Traits
     { return item; }
 
   static CppType to_cpp_type(CType item)
-    { return CppType(const_cast<CTypeNonConst>(item)); } 
+    { return CppType(const_cast<CTypeNonConst>(item)); }
 
   static void release_c_type(CType item)
-    { gtk_tree_path_free(const_cast<CTypeNonConst>(item)); }  
+    { gtk_tree_path_free(const_cast<CTypeNonConst>(item)); }
 };
 
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
 
 } // namespace Gtk
-
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 14f24ea..b987c00 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -205,6 +205,8 @@ public:
   _WRAP_METHOD(void set_receives_default(bool receives_default = true), gtk_widget_set_receives_default)
   _WRAP_METHOD(bool get_receives_default() const, gtk_widget_get_receives_default)
   _WRAP_METHOD(bool has_grab() const, gtk_widget_has_grab)
+  _WRAP_METHOD(bool device_is_shadowed(const Glib::RefPtr<const Gdk::Device>& device), gtk_widget_device_is_shadowed)
+
 
   /** Block events to everything else than this widget and its children. This
    * way you can get modal behaviour (usually not recommended). One practical
@@ -282,6 +284,10 @@ public:
 
   _WRAP_METHOD(void set_events(Gdk::EventMask events), gtk_widget_set_events)
   _WRAP_METHOD(void add_events(Gdk::EventMask events), gtk_widget_add_events)
+
+  _WRAP_METHOD(void set_device_events(const Glib::RefPtr<const Gdk::Device>& device, Gdk::EventMask events), gtk_widget_set_device_events)
+  _WRAP_METHOD(void add_device_events(const Glib::RefPtr<const Gdk::Device>& device, Gdk::EventMask events), gtk_widget_add_device_events)
+
   _WRAP_METHOD(void set_extension_events(Gdk::ExtensionMode mode), gtk_widget_set_extension_events)
 
   _WRAP_METHOD(Gdk::ExtensionMode get_extension_events() const, gtk_widget_get_extension_events)
@@ -314,6 +320,9 @@ public:
 
   _WRAP_METHOD(Glib::RefPtr<Gdk::Pixmap> get_snapshot(Gdk::Rectangle& clip_rect) const, gtk_widget_get_snapshot)
 
+  _WRAP_METHOD(bool get_support_multidevice() const, gtk_widget_get_support_multidevice)
+  _WRAP_METHOD(void set_support_multidevice(bool support_multidevice = true), gtk_widget_set_support_multidevice)
+
  /** Create a Gdk::Pixmap of the contents of the widget and its children.
   *
   * Works even if the widget is obscured. The depth and visual of the
@@ -340,6 +349,7 @@ public:
 
   _WRAP_METHOD(void set_colormap(const Glib::RefPtr<const Gdk::Colormap> &colormap), gtk_widget_set_colormap)
   _WRAP_METHOD(Gdk::EventMask get_events() const, gtk_widget_get_events)
+  _WRAP_METHOD(Gdk::EventMask get_device_events(const Glib::RefPtr<const Gdk::Device>& device) const, gtk_widget_get_device_events)
   _WRAP_METHOD(void get_pointer(int &x, int &y) const, gtk_widget_get_pointer)
   _WRAP_METHOD(bool is_ancestor(Widget &ancestor) const, gtk_widget_is_ancestor)
 
@@ -427,6 +437,8 @@ public:
    */
   _WRAP_METHOD(void modify_font(const Pango::FontDescription& font_desc), gtk_widget_modify_font)
 
+  _WRAP_METHOD(void modify_symbolic_color(const Glib::ustring& name, const Gdk::Color& color), gtk_widget_modify_symbolic_color)
+
   /** Undo the effect of previous calls to modify_fg() for a particular state.
    * All other style values are left untouched. See also modify_style().
    */
@@ -590,8 +602,6 @@ public:
   _WRAP_METHOD(bool is_composited() const, gtk_widget_is_composited)
 
   _IGNORE(gtk_widget_get_action) //deprecated
-  _WRAP_METHOD(Glib::RefPtr<Action> get_related_action(), gtk_widget_get_related_action, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Action> get_related_action() const, gtk_widget_get_related_action, refreturn, constversion)
 
   //TODO: Move this to protected when we can break API:
   /**  Retrieves the widget's requisition.



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