[clutter/wip/wayland-compositor-help: 1/5] ClutterInputDevice: add new API for querying the modifier state



commit e5de61a9b1c399d6be60eb74d192526b291e6aed
Author: Giovanni Campagna <gcampagn redhat com>
Date:   Wed Aug 14 16:49:00 2013 +0200

    ClutterInputDevice: add new API for querying the modifier state
    
    This way, the full state of the device is exposed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706494

 clutter/clutter-input-device.c |   14 ++++++++++++++
 clutter/clutter-input-device.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-input-device.c b/clutter/clutter-input-device.c
index 2e3afee..d396601 100644
--- a/clutter/clutter-input-device.c
+++ b/clutter/clutter-input-device.c
@@ -467,6 +467,20 @@ _clutter_input_device_set_state (ClutterInputDevice  *device,
   device->current_state = state;
 }
 
+/**
+ * clutter_input_device_get_modifier_state:
+ * @device: a #ClutterInputDevice
+ *
+ * Retrieves the last known modifiers state of the device
+ */
+ClutterModifierType
+clutter_input_device_get_modifier_state (ClutterInputDevice *device)
+{
+  g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), 0);
+
+  return device->current_state;
+}
+
 /*< private >
  * clutter_input_device_set_time:
  * @device: a #ClutterInputDevice
diff --git a/clutter/clutter-input-device.h b/clutter/clutter-input-device.h
index 1a5a4a1..f12bb1f 100644
--- a/clutter/clutter-input-device.h
+++ b/clutter/clutter-input-device.h
@@ -56,6 +56,7 @@ CLUTTER_AVAILABLE_IN_1_12
 gboolean                clutter_input_device_get_coords        (ClutterInputDevice   *device,
                                                                 ClutterEventSequence *sequence,
                                                                 ClutterPoint         *point);
+ClutterModifierType     clutter_input_device_get_modifier_state (ClutterInputDevice  *device);
 ClutterActor *          clutter_input_device_get_pointer_actor  (ClutterInputDevice  *device);
 ClutterStage *          clutter_input_device_get_pointer_stage  (ClutterInputDevice  *device);
 const gchar *           clutter_input_device_get_device_name    (ClutterInputDevice  *device);


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