[gtkmm] Device: Added get_window_at_position() with no parameters.



commit 245c52fb3f4a60ee7657164c926b1a378fbf5735
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Jan 4 01:48:12 2011 +0100

    Device: Added get_window_at_position() with no parameters.
    
    * gdk/src/device.[hg|ccg]: Added get_window_at_position(void) overloads to
    match the previous Display::get_window_at_pointer(void) overloads.

 ChangeLog          |    7 +++++++
 gdk/src/device.ccg |   14 ++++++++++++++
 gdk/src/device.hg  |    7 +++++++
 3 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a1182b7..ddd8016 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2011-01-04  Murray Cumming  <murrayc murrayc com>
 
+	Device: Added get_window_at_position() with no parameters.
+
+	* gdk/src/device.[hg|ccg]: Added get_window_at_position(void) overloads to 
+	match the previous Display::get_window_at_pointer(void) overloads.
+
+2011-01-04  Murray Cumming  <murrayc murrayc com>
+
 	Fix the build with the latest GTK+ from git master.
 
 	* gdk/src/device.hg: Added warp().
diff --git a/gdk/src/device.ccg b/gdk/src/device.ccg
index 5a77766..46ac624 100644
--- a/gdk/src/device.ccg
+++ b/gdk/src/device.ccg
@@ -37,5 +37,19 @@ void Device::get_position(Glib::RefPtr<Screen>& screen, int& x, int& y) const
   screen = Glib::wrap(cScreen, true);
 }
 
+Glib::RefPtr<Window> Device::get_window_at_position()
+{
+  Glib::RefPtr<Window> retvalue = Glib::wrap(gdk_device_get_window_at_position(gobj(), 0, 0));
+  if(retvalue)
+    retvalue->reference(); //The function does not do a ref for us.
+  return retvalue;
+}
+
+Glib::RefPtr<const Window> Device::get_window_at_position() const
+{
+  return const_cast<Device*>(this)->get_window_at_position();
+}
+
+
 } // namespace Gdk
 
diff --git a/gdk/src/device.hg b/gdk/src/device.hg
index 37fb5fc..837aba9 100644
--- a/gdk/src/device.hg
+++ b/gdk/src/device.hg
@@ -94,6 +94,13 @@ public:
   _WRAP_METHOD(Glib::RefPtr<Window> get_window_at_position(int& win_x, int& win_y), gdk_device_get_window_at_position, refreturn)
 
   _WRAP_METHOD(Glib::RefPtr<const Window> get_window_at_position(int& win_x, int& win_y) const, gdk_device_get_window_at_position, refreturn, constversion)
+  
+  //TODO: Documentation
+  Glib::RefPtr<Window> get_window_at_position();
+  
+  //TODO: Documentation
+  Glib::RefPtr<const Window> get_window_at_position() const;
+  
 };
 
 } // namespace Gdk



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