[gtkmm] Added new methods to Gdk::Device.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Added new methods to Gdk::Device.
- Date: Tue, 28 Dec 2010 22:41:47 +0000 (UTC)
commit d948cf1e5dbe34fbd4921a1a2c0f524c243c9cc3
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Tue Dec 28 23:40:43 2010 +0100
Added new methods to Gdk::Device.
* gdk/src/gdk_methods.defs: Regenerated with h2def.py.
* gdk/src/device.[hg|ccg]: Added get_position() and
get_window_at_position() which are counterparts of
previously removed methods in Gdk::Display.
ChangeLog | 9 +++++
gdk/src/device.ccg | 11 ++++++
gdk/src/device.hg | 10 +++++
gdk/src/gdk_methods.defs | 83 +++++++++++----------------------------------
4 files changed, 51 insertions(+), 62 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8d36110..c335ce2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2010-12-28 Krzesimir Nowak <qdlacz gmail com>
+ Added new methods to Gdk::Device.
+
+ * gdk/src/gdk_methods.defs: Regenerated with h2def.py.
+ * gdk/src/device.[hg|ccg]: Added get_position() and
+ get_window_at_position() which are counterparts of
+ previously removed methods in Gdk::Display.
+
+2010-12-28 Krzesimir Nowak <qdlacz gmail com>
+
Quickly fix the build with latest Gdk.
* gdk/src/device.hg: Remove set_source() method.
diff --git a/gdk/src/device.ccg b/gdk/src/device.ccg
index 0107bb1..5a77766 100644
--- a/gdk/src/device.ccg
+++ b/gdk/src/device.ccg
@@ -25,6 +25,17 @@
namespace Gdk
{
+void Device::get_position(int& x, int& y) const
+{
+ gdk_device_get_position(const_cast<GdkDevice*>(gobj()), 0, &x, &y);
+}
+
+void Device::get_position(Glib::RefPtr<Screen>& screen, int& x, int& y) const
+{
+ GdkScreen* cScreen = 0;
+ gdk_device_get_position(const_cast<GdkDevice*>(gobj()), &cScreen, &x, &y);
+ screen = Glib::wrap(cScreen, true);
+}
} // namespace Gdk
diff --git a/gdk/src/device.hg b/gdk/src/device.hg
index 93f2520..432854c 100644
--- a/gdk/src/device.hg
+++ b/gdk/src/device.hg
@@ -82,6 +82,16 @@ public:
_WRAP_METHOD(GrabStatus grab(const Glib::RefPtr<Window>& window, GrabOwnership grab_ownership, bool owner_events, EventMask event_mask, const Glib::RefPtr<Cursor>& cursor, guint32 time_), gdk_device_grab)
_WRAP_METHOD(void ungrab(guint32 time_), gdk_device_ungrab)
+
+ // TODO: docs.
+ void get_position(int& x, int& y) const;
+ // TODO: docs.
+ void get_position(Glib::RefPtr<Screen>& screen, int& x, int& y) const;
+ _IGNORE(gdk_device_get_position)
+
+ _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)
};
} // namespace Gdk
diff --git a/gdk/src/gdk_methods.defs b/gdk/src/gdk_methods.defs
index ad44da0..cca3b01 100644
--- a/gdk/src/gdk_methods.defs
+++ b/gdk/src/gdk_methods.defs
@@ -832,15 +832,6 @@
(return-type "GdkInputSource")
)
-(define-method set_source
- (of-object "GdkDevice")
- (c-name "gdk_device_set_source")
- (return-type "none")
- (parameters
- '("GdkInputSource" "source")
- )
-)
-
(define-method get_mode
(of-object "GdkDevice")
(c-name "gdk_device_get_mode")
@@ -914,6 +905,27 @@
)
)
+(define-method get_position
+ (of-object "GdkDevice")
+ (c-name "gdk_device_get_position")
+ (return-type "none")
+ (parameters
+ '("GdkScreen**" "screen")
+ '("gint*" "x")
+ '("gint*" "y")
+ )
+)
+
+(define-method get_window_at_position
+ (of-object "GdkDevice")
+ (c-name "gdk_device_get_window_at_position")
+ (return-type "GdkWindow*")
+ (parameters
+ '("gint*" "win_x")
+ '("gint*" "win_y")
+ )
+)
+
(define-method get_history
(of-object "GdkDevice")
(c-name "gdk_device_get_history")
@@ -1276,30 +1288,6 @@
)
)
-(define-method get_device_state
- (of-object "GdkDisplay")
- (c-name "gdk_display_get_device_state")
- (return-type "none")
- (parameters
- '("GdkDevice*" "device")
- '("GdkScreen**" "screen")
- '("gint*" "x")
- '("gint*" "y")
- '("GdkModifierType*" "mask")
- )
-)
-
-(define-method get_window_at_device_position
- (of-object "GdkDisplay")
- (c-name "gdk_display_get_window_at_device_position")
- (return-type "GdkWindow*")
- (parameters
- '("GdkDevice*" "device")
- '("gint*" "win_x")
- '("gint*" "win_y")
- )
-)
-
(define-method set_pointer_hooks
(of-object "GdkDisplay")
(c-name "gdk_display_set_pointer_hooks")
@@ -2093,30 +2081,6 @@
-;; From gdkinput.h
-
-(define-function gdk_devices_list
- (c-name "gdk_devices_list")
- (return-type "GList*")
-)
-
-(define-function gdk_device_get_core_pointer
- (c-name "gdk_device_get_core_pointer")
- (return-type "GdkDevice*")
-)
-
-(define-function gdk_input_set_extension_events
- (c-name "gdk_input_set_extension_events")
- (return-type "none")
- (parameters
- '("GdkWindow*" "window")
- '("gint" "mask")
- '("GdkExtensionMode" "mode")
- )
-)
-
-
-
;; From gdkkeys.h
(define-function gdk_keymap_get_type
@@ -2352,11 +2316,6 @@
(return-type "none")
)
-(define-function gdk_enable_multidevice
- (c-name "gdk_enable_multidevice")
- (return-type "none")
-)
-
(define-function gdk_get_program_class
(c-name "gdk_get_program_class")
(return-type "const-gchar*")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]