[clutter/clutter-1.20] evdev: Add clutter_evdev_event_sequence_get_slot()



commit 9510d6ac95c5be5846c9fe626710e3ad12125a37
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Apr 25 20:14:01 2014 +0200

    evdev: Add clutter_evdev_event_sequence_get_slot()
    
    This function helps know the libinput slot used by a sequence.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728968

 clutter/evdev/clutter-evdev.h              |    3 +++
 clutter/evdev/clutter-input-device-evdev.c |   20 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/clutter/evdev/clutter-evdev.h b/clutter/evdev/clutter-evdev.h
index 8b49ab9..c76cc72 100644
--- a/clutter/evdev/clutter-evdev.h
+++ b/clutter/evdev/clutter-evdev.h
@@ -116,6 +116,9 @@ void clutter_evdev_remove_filter (ClutterEvdevFilterFunc func,
 CLUTTER_AVAILABLE_IN_1_20
 struct libinput_device * clutter_evdev_input_device_get_libinput_device (ClutterInputDevice *device);
 
+CLUTTER_AVAILABLE_IN_1_20
+gint32 clutter_evdev_event_sequence_get_slot (const ClutterEventSequence *sequence);
+
 G_END_DECLS
 
 #endif /* __CLUTTER_EVDEV_H__ */
diff --git a/clutter/evdev/clutter-input-device-evdev.c b/clutter/evdev/clutter-input-device-evdev.c
index f7ac657..4b94ae9 100644
--- a/clutter/evdev/clutter-input-device-evdev.c
+++ b/clutter/evdev/clutter-input-device-evdev.c
@@ -222,3 +222,23 @@ clutter_evdev_input_device_get_libinput_device (ClutterInputDevice *device)
 
   return device_evdev->libinput_device;
 }
+
+/**
+ * clutter_evdev_event_sequence_get_slot:
+ * @sequence: a #ClutterEventSequence
+ *
+ * Retrieves the touch slot triggered by this @sequence
+ *
+ * Returns: the libinput touch slot.
+ *
+ * Since: 1.20
+ * Stability: unstable
+ **/
+gint32
+clutter_evdev_event_sequence_get_slot (const ClutterEventSequence *sequence)
+{
+  if (!sequence)
+    return -1;
+
+  return GPOINTER_TO_INT (sequence) - 1;
+}


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