[gtk+/xi2] GdkDevice: Add sealing from patch in bug #592580.



commit 2284cb2f76842730fdbec84c62bf8d2844c6a844
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Mar 13 14:32:50 2010 +0100

    GdkDevice: Add sealing from patch in bug #592580.

 gdk/gdk.symbols |    4 +++
 gdk/gdkdevice.c |   72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 gdk/gdkdevice.h |   21 ++++++++++------
 3 files changed, 89 insertions(+), 8 deletions(-)
---
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 983810d..ff310ca 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -408,7 +408,11 @@ gdk_device_manager_list_devices
 gdk_device_free_history
 gdk_device_get_associated_device
 gdk_device_get_axis
+gdk_device_get_has_cursor
 gdk_device_get_history
+gdk_device_get_mode
+gdk_device_get_name
+gdk_device_get_source
 gdk_device_get_type G_GNUC_CONST
 gdk_device_get_state
 gdk_device_set_axis_use
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 9160b93..cf8af3b 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -433,6 +433,60 @@ gdk_device_free_history (GdkTimeCoord **events,
 }
 
 /**
+ * gdk_device_get_name:
+ * @display: a #GdkDisplay
+ *
+ * Determines the name of the device.
+ *
+ * Return value: a name
+ *
+ * Since: 2.20
+ **/
+const gchar *
+gdk_device_get_name (GdkDevice *device)
+{
+  g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
+
+  return device->name;
+}
+
+/**
+ * gdk_device_get_has_cursor:
+ * @display: a #GdkDisplay
+ *
+ * Determines whether the pointer follows device motion.
+ *
+ * Return value: %TRUE if the pointer follows device motion
+ *
+ * Since: 2.20
+ **/
+gboolean
+gdk_device_get_has_cursor (GdkDevice *device)
+{
+  g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE);
+
+  return device->has_cursor;
+}
+
+/**
+ * gdk_device_get_source:
+ * @display: a #GdkDisplay
+ *
+ * Determines the type of the device.
+ *
+ * Return value: a #GdkInputSource
+ *
+ * Since: 2.20
+ **/
+GdkInputSource
+gdk_device_get_source (GdkDevice *device)
+{
+  g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
+
+  return device->source;
+}
+
+/**
  * gdk_device_set_source:
  * @device: a #GdkDevice.
  * @source: the source type.
@@ -449,6 +503,24 @@ gdk_device_set_source (GdkDevice      *device,
 }
 
 /**
+ * gdk_device_get_mode:
+ * @display: a #GdkDisplay
+ *
+ * Determines the mode of the device.
+ *
+ * Return value: a #GdkInputSource
+ *
+ * Since: 2.20
+ **/
+GdkInputMode
+gdk_device_get_mode (GdkDevice *device)
+{
+  g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
+
+  return device->mode;
+}
+
+/**
  * gdk_device_set_mode:
  * @device: a #GdkDevice.
  * @mode: the input mode.
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index 3e7c44f..805b095 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -192,24 +192,29 @@ struct _GdkDevice
   GObject parent_instance;
 
   /* All fields are read-only */
-  gchar *name;
-  GdkInputSource source;
-  GdkInputMode mode;
-  gboolean has_cursor;	     /* TRUE if the X pointer follows device motion */
+  gchar *GSEAL (name);
+  GdkInputSource GSEAL (source);
+  GdkInputMode GSEAL (mode);
+  gboolean GSEAL (has_cursor);	     /* TRUE if a X pointer follows device motion */
 
-  gint num_axes;
-  GdkDeviceAxis *axes;
+  gint GSEAL (num_axes);
+  GdkDeviceAxis *GSEAL (axes);
 
-  gint num_keys;
-  GdkDeviceKey *keys;
+  gint GSEAL (num_keys);
+  GdkDeviceKey *GSEAL (keys);
 };
 
 GType gdk_device_get_type (void) G_GNUC_CONST;
 
+G_CONST_RETURN gchar *gdk_device_get_name       (GdkDevice *device);
+gboolean              gdk_device_get_has_cursor (GdkDevice *device);
+
 /* Functions to configure a device */
+GdkInputSource gdk_device_get_source    (GdkDevice      *device);
 void           gdk_device_set_source    (GdkDevice      *device,
 					 GdkInputSource  source);
 
+GdkInputMode   gdk_device_get_mode      (GdkDevice      *device);
 gboolean       gdk_device_set_mode      (GdkDevice      *device,
 					 GdkInputMode    mode);
 



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