[gtk+/xi2: 323/324] GdkDevice: Add gdk_device_get_n_axes().



commit adb3a98f898b2a6baf7a675b1ba3b8abb9aded78
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu May 20 16:19:26 2010 +0200

    GdkDevice: Add gdk_device_get_n_axes().

 gdk/gdk.symbols |    1 +
 gdk/gdkdevice.c |   16 ++++++++++++++++
 gdk/gdkdevice.h |    1 +
 3 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 168f142..9ae15f7 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -417,6 +417,7 @@ gdk_device_get_has_cursor
 gdk_device_get_history
 gdk_device_get_key
 gdk_device_get_mode
+gdk_device_get_n_axes
 gdk_device_get_name
 gdk_device_get_source
 gdk_device_get_type G_GNUC_CONST
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index d326753..bba2786 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -782,6 +782,22 @@ gdk_device_get_device_type (GdkDevice *device)
 }
 
 /**
+ * gdk_device_get_n_axes:
+ * @device: a #GdkDevice
+ *
+ * Returns the number of axes the device currently has.
+ *
+ * Returns: the number of axes.
+ **/
+guint
+gdk_device_get_n_axes (GdkDevice *device)
+{
+  g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
+
+  return device->num_axes;
+}
+
+/**
  * gdk_device_list_axes:
  * @device: a #GdkDevice
  *
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index 5e6791c..3b1581a 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -247,6 +247,7 @@ gboolean gdk_device_get_history  (GdkDevice         *device,
 void     gdk_device_free_history (GdkTimeCoord     **events,
 				  gint               n_events);
 
+guint    gdk_device_get_n_axes     (GdkDevice       *device);
 GList *  gdk_device_list_axes      (GdkDevice       *device);
 gboolean gdk_device_get_axis_value (GdkDevice       *device,
                                     gdouble         *axes,



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