[gtk+/gtk-2-24] gdk: add gdk_device_get_n_keys() to access the sealed num_keys member



commit d0f2b1330990b75d6ee8f078b35c61d9b555dd26
Author: Michael Natterer <mitch gimp org>
Date:   Wed Nov 24 20:15:29 2010 +0100

    gdk: add gdk_device_get_n_keys() to access the sealed num_keys member

 gdk/directfb/gdkinput-directfb.c |    8 ++++++++
 gdk/gdk.symbols                  |    1 +
 gdk/gdkinput.h                   |    1 +
 gdk/quartz/gdkinput.c            |    8 ++++++++
 gdk/win32/gdkinput.c             |    8 ++++++++
 gdk/x11/gdkinput.c               |   18 ++++++++++++++++++
 6 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/gdk/directfb/gdkinput-directfb.c b/gdk/directfb/gdkinput-directfb.c
index 363fd2c..f4e4179 100644
--- a/gdk/directfb/gdkinput-directfb.c
+++ b/gdk/directfb/gdkinput-directfb.c
@@ -281,6 +281,14 @@ gdk_device_get_axis_use (GdkDevice *device,
   return device->axes[index].use;
 }
 
+gint
+gdk_device_get_n_keys (GdkDevice *device)
+{
+  g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
+
+  return device->num_keys;
+}
+
 /**
  * gdk_device_get_n_axes:
  * @device: a #GdkDevice.
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index bf05ba2..aa3db9d 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -388,6 +388,7 @@ gdk_device_get_key
 gdk_device_get_mode
 gdk_device_get_name
 gdk_device_get_n_axes
+gdk_device_get_n_keys
 gdk_device_get_source
 gdk_device_get_type G_GNUC_CONST
 gdk_device_set_axis_use
diff --git a/gdk/gdkinput.h b/gdk/gdkinput.h
index c8907c1..3799d5d 100644
--- a/gdk/gdkinput.h
+++ b/gdk/gdkinput.h
@@ -141,6 +141,7 @@ void                  gdk_device_get_key        (GdkDevice       *device,
                                                  GdkModifierType *modifiers);
 GdkAxisUse            gdk_device_get_axis_use   (GdkDevice       *device,
                                                  guint            index);
+gint                  gdk_device_get_n_keys     (GdkDevice       *device);
 gint                  gdk_device_get_n_axes     (GdkDevice       *device);
 
 /* Functions to configure a device */
diff --git a/gdk/quartz/gdkinput.c b/gdk/quartz/gdkinput.c
index 212638d..fe256d1 100644
--- a/gdk/quartz/gdkinput.c
+++ b/gdk/quartz/gdkinput.c
@@ -199,6 +199,14 @@ gdk_device_get_axis_use (GdkDevice *device,
 }
 
 gint
+gdk_device_get_n_keys (GdkDevice *device)
+{
+  g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
+
+  return device->num_keys;
+}
+
+gint
 gdk_device_get_n_axes (GdkDevice *device)
 {
   g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
diff --git a/gdk/win32/gdkinput.c b/gdk/win32/gdkinput.c
index e4aabda..143f375 100644
--- a/gdk/win32/gdkinput.c
+++ b/gdk/win32/gdkinput.c
@@ -194,6 +194,14 @@ gdk_device_get_axis_use (GdkDevice *device,
 }
 
 gint
+gdk_device_get_n_keys (GdkDevice *device)
+{
+  g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
+
+  return device->num_keys;
+}
+
+gint
 gdk_device_get_n_axes (GdkDevice *device)
 {
   g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
diff --git a/gdk/x11/gdkinput.c b/gdk/x11/gdkinput.c
index 2468c59..4052979 100644
--- a/gdk/x11/gdkinput.c
+++ b/gdk/x11/gdkinput.c
@@ -318,6 +318,24 @@ gdk_device_get_axis_use (GdkDevice *device,
 }
 
 /**
+ * gdk_device_get_n_keys:
+ * @device: a #GdkDevice.
+ *
+ * Gets the number of keys of a device.
+ *
+ * Returns: the number of keys of @device
+ *
+ * Since: 2.24
+ **/
+gint
+gdk_device_get_n_keys (GdkDevice *device)
+{
+  g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
+
+  return device->num_keys;
+}
+
+/**
  * gdk_device_get_n_axes:
  * @device: a #GdkDevice.
  *



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