[gtkmm] gdkmm: Window: Added new methods.



commit 521453fc3e9b0abeedb0e74ee000002963b35cf6
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Sep 4 22:34:00 2010 +0200

    gdkmm: Window: Added new methods.
    
    	* gdk/src/window.[hg|ccg]: Added set_device_cursor(), get_device_position(),
    	get_device_events(), set_device_events(), get_support_multidevice(),
    	set_support_multidevice().
    	* tools/m4/convert_gdk.m4: Added necessary conversion.

 ChangeLog               |    9 +++++++++
 gdk/src/window.ccg      |    6 ++++++
 gdk/src/window.hg       |   20 ++++++++++++++++++--
 tools/m4/convert_gdk.m4 |    1 +
 4 files changed, 34 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index acd30b1..929554f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2010-09-04  Murray Cumming  <murrayc murrayc com>
 
+	gdkmm: Window: Added new methods.
+
+	* gdk/src/window.[hg|ccg]: Added set_device_cursor(), get_device_position(), 
+	get_device_events(), set_device_events(), get_support_multidevice(), 
+	set_support_multidevice().
+	* tools/m4/convert_gdk.m4: Added necessary conversion.
+
+2010-09-04  Murray Cumming  <murrayc murrayc com>
+
 	AboutDialog: Added get/set_license_type().
 
 	* gtk/src/aboutdialog.hg: Added License enum and get/set_license_type().
diff --git a/gdk/src/window.ccg b/gdk/src/window.ccg
index 0170653..c0109cb 100644
--- a/gdk/src/window.ccg
+++ b/gdk/src/window.ccg
@@ -21,6 +21,7 @@
 #include <gdk/gdk.h>
 #include <gdkmm/pixmap.h>
 #include <gdkmm/cursor.h>
+#include <gdkmm/device.h>
 #include <gdkmm/types.h>
 
 
@@ -39,6 +40,11 @@ void Window::set_cursor()
   gdk_window_set_cursor(gobj(), 0);
 }
 
+void Window::set_device_cursor(const Glib::RefPtr<Gdk::Device>& device)
+{
+  gdk_window_set_device_cursor(gobj(), Glib::unwrap(device), 0);
+}
+
 GrabStatus Window::pointer_grab(bool owner_events, EventMask event_mask, const Cursor& cursor, guint32 timestamp)
 {
   return ((GrabStatus)(gdk_pointer_grab(gobj(), static_cast<int>(owner_events), ((GdkEventMask)(event_mask)), 0, (cursor).gobj_copy(), timestamp)));
diff --git a/gdk/src/window.hg b/gdk/src/window.hg
index 5c29f32..1835027 100644
--- a/gdk/src/window.hg
+++ b/gdk/src/window.hg
@@ -50,6 +50,7 @@ _WRAP_ENUM(Gravity, GdkGravity)
 _WRAP_ENUM(GrabStatus, GdkGrabStatus)
 
 class Cursor;
+class Device;
 
 /** A Gdk::Window is a rectangular region on the screen. It's a low-level object, used to implement high-level objects such
  * as Gtk::Widget and Gtk::Window on the GTK+ level. A Gtk::Window is a toplevel window, the thing a user might think of as
@@ -170,11 +171,18 @@ public:
 
 #m4 _CONVERSION(const Cursor&,GdkCursor*,const_cast<GdkCursor*>(($3).gobj()))
   _WRAP_METHOD(void set_cursor(const Cursor& cursor), gdk_window_set_cursor)
-
+  
   /** Use the parent window's cursor.
    * For top-level windows this means that it will use the default cursor for the ROOT window.
    */
   void set_cursor();
+  
+  _WRAP_METHOD(void set_device_cursor(const Glib::RefPtr<Device>& device, const Cursor& cursor), gdk_window_set_device_cursor)
+
+  /** Use the parent window's cursor.
+   * For top-level windows this means that it will use the default cursor for the ROOT window.
+   */
+  void set_device_cursor(const Glib::RefPtr<Device>& device);
 
   //TODO: GdkCursor is a ref-counted boxed type,
   //so we could add a copy constructor and then return by value.
@@ -197,6 +205,8 @@ public:
   _WRAP_METHOD(Glib::RefPtr<const Window> get_parent() const, gdk_window_get_parent, refreturn, constversion)
   _WRAP_METHOD(Glib::RefPtr<Window> get_toplevel(), gdk_window_get_toplevel, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Window> get_toplevel() const, gdk_window_get_toplevel, refreturn, constversion)
+  
+  _WRAP_METHOD(Glib::RefPtr<Window> get_device_position(const Glib::RefPtr<const Device>& device, int& x, int& y, ModifierType& mask) const, gdk_window_get_device_position, refreturn)
 
   _WRAP_METHOD(Glib::RefPtr<Window> get_effective_parent(), gdk_window_get_effective_parent, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Window> get_effective_parent() const, gdk_window_get_effective_parent, refreturn, constversion)
@@ -209,7 +219,10 @@ public:
 
   _WRAP_METHOD(EventMask get_events() const, gdk_window_get_events)
   _WRAP_METHOD(void set_events(EventMask event_mask), gdk_window_set_events)
-
+  
+  _WRAP_METHOD(EventMask get_device_events(const Glib::RefPtr<const Device>& device) const, gdk_window_get_device_events)
+  _WRAP_METHOD(void set_device_events(const Glib::RefPtr<Device>& device, EventMask event_mask), gdk_window_set_device_events)
+                                            
   _WRAP_METHOD(void set_icon_list(const Glib::ListHandle< Glib::RefPtr<Gdk::Pixbuf> >& pixbufs), gdk_window_set_icon_list)
   _WRAP_METHOD(void set_icon(const Glib::RefPtr<Window>& icon_window, const Glib::RefPtr<Pixmap>& pixmap, const Glib::RefPtr<Bitmap>& mask), gdk_window_set_icon)
   void set_icon(const Glib::RefPtr<Window>& icon_window, const Glib::RefPtr<Pixmap>& pixmap);
@@ -336,6 +349,9 @@ public:
   _WRAP_METHOD(void remove_redirection(), gdk_window_remove_redirection)
 
   _WRAP_METHOD(void geometry_changed(), gdk_window_geometry_changed)
+
+  _WRAP_METHOD(void set_support_multidevice(bool support_multidevice = true), gdk_window_set_support_multidevice)
+  _WRAP_METHOD(bool get_support_multidevice(), gdk_window_get_support_multidevice)
 };
 
 } // namespace Gdk
diff --git a/tools/m4/convert_gdk.m4 b/tools/m4/convert_gdk.m4
index 90bae3f..cb233e4 100644
--- a/tools/m4/convert_gdk.m4
+++ b/tools/m4/convert_gdk.m4
@@ -134,6 +134,7 @@ _CONVERSION(`const Glib::RefPtr<Gdk::Screen>&',`GdkScreen*',__CONVERT_REFPTR_TO_
 _CONVERSION(`const Glib::RefPtr<Screen>&',`GdkScreen*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<Gdk::Device>&',`GdkDevice*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<Device>&',`GdkDevice*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<const Device>&',`GdkDevice*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Device))
 _CONVERSION(`const Glib::RefPtr<const Gdk::Screen>&',`GdkScreen*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Screen))
 
 define(`__CFR2P',`const_cast<$`'2>($`'3.gobj())')



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