[gtk+/xi2] GdkDevice: Add gdk_device_get_axis_use().



commit affc7e60759e0ec43ca6eaf7dd73c76e0cc48d73
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Mar 13 15:20:18 2010 +0100

    GdkDevice: Add gdk_device_get_axis_use().

 gdk/gdk.symbols |    1 +
 gdk/gdkdevice.c |   21 +++++++++++++++++++++
 gdk/gdkdevice.h |    2 ++
 3 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 05db588..f073d0a 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -408,6 +408,7 @@ gdk_device_manager_list_devices
 gdk_device_free_history
 gdk_device_get_associated_device
 gdk_device_get_axis
+gdk_device_get_axis_use
 gdk_device_get_has_cursor
 gdk_device_get_history
 gdk_device_get_key
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index d0fbd7b..eea1ab3 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -615,6 +615,27 @@ gdk_device_set_key (GdkDevice      *device,
 }
 
 /**
+ * gdk_device_get_axis_use:
+ * @device: a #GdkDevice.
+ * @index: the index of the axis.
+ *
+ * Returns the axis use for @index.
+ *
+ * Returns: a #GdkAxisUse specifying how the axis is used.
+ *
+ * Since: 2.20
+ **/
+GdkAxisUse
+gdk_device_get_axis_use (GdkDevice *device,
+                         guint      index)
+{
+  g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_AXIS_IGNORE);
+  g_return_val_if_fail (index < device->num_axes, GDK_AXIS_IGNORE);
+
+  return device->axes[index].use;
+}
+
+/**
  * gdk_device_set_axis_use:
  * @device: a #GdkDevice.
  * @index: the index of the axis.
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index 94ee630..5e6791c 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -227,6 +227,8 @@ void           gdk_device_set_key       (GdkDevice      *device,
 					 guint           keyval,
 					 GdkModifierType modifiers);
 
+GdkAxisUse     gdk_device_get_axis_use  (GdkDevice         *device,
+                                         guint              index);
 void           gdk_device_set_axis_use  (GdkDevice         *device,
                                          guint              index_,
                                          GdkAxisUse         use);



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