From ddd24761fd698f35671a0f649539a4b11705e9fa Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 3 Apr 2012 10:54:25 +0200 Subject: [PATCH] Add _gdk_device_get_axis_info This is needed for the win32 master/slave handling code. --- gdk/gdkdevice.c | 23 +++++++++++++++++++++++ gdk/gdkdeviceprivate.h | 7 +++++++ 2 files changed, 30 insertions(+) diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c index cd8bda2494..0abfffea93 100644 --- a/gdk/gdkdevice.c +++ b/gdk/gdkdevice.c @@ -1369,6 +1369,29 @@ _gdk_device_add_axis (GdkDevice *device, return pos; } +void +_gdk_device_get_axis_info (GdkDevice *device, + guint index_, + GdkAtom *label_atom, + GdkAxisUse *use, + gdouble *min_value, + gdouble *max_value, + gdouble *resolution) +{ + GdkAxisInfo *info; + + g_return_if_fail (GDK_IS_DEVICE (device)); + g_return_if_fail (index_ < device->axes->len); + + info = &g_array_index (device->axes, GdkAxisInfo, index_); + + *label_atom = info->label; + *use = info->use; + *min_value = info->min_value; + *max_value = info->max_value; + *resolution = info->resolution; +} + void _gdk_device_set_keys (GdkDevice *device, guint num_keys) diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h index ff92ea4b41..f30dbdb2a0 100644 --- a/gdk/gdkdeviceprivate.h +++ b/gdk/gdkdeviceprivate.h @@ -121,6 +121,13 @@ guint _gdk_device_add_axis (GdkDevice *device, gdouble min_value, gdouble max_value, gdouble resolution); +void _gdk_device_get_axis_info (GdkDevice *device, + guint index, + GdkAtom *label_atom, + GdkAxisUse *use, + gdouble *min_value, + gdouble *max_value, + gdouble *resolution); void _gdk_device_set_keys (GdkDevice *device, guint num_keys);