[clutter/clutter-1.20] evdev: Add function to get the libinput_device from a ClutterInputDevice



commit 8857b19d4926a153cb2317951dc5cba6c04f79f5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Apr 25 19:58:43 2014 +0200

    evdev: Add function to get the libinput_device from a ClutterInputDevice
    
    This may be useful for deeper libinput integration that's not in the scope
    of Clutter.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728967

 clutter/evdev/clutter-evdev.h              |    3 +++
 clutter/evdev/clutter-input-device-evdev.c |   24 ++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/clutter/evdev/clutter-evdev.h b/clutter/evdev/clutter-evdev.h
index f85127f..8b49ab9 100644
--- a/clutter/evdev/clutter-evdev.h
+++ b/clutter/evdev/clutter-evdev.h
@@ -28,6 +28,7 @@
 #include <glib-object.h>
 #include <xkbcommon/xkbcommon.h>
 #include <clutter/clutter.h>
+#include <libinput.h>
 
 G_BEGIN_DECLS
 
@@ -112,6 +113,8 @@ void clutter_evdev_add_filter    (ClutterEvdevFilterFunc func,
 CLUTTER_AVAILABLE_IN_1_20
 void clutter_evdev_remove_filter (ClutterEvdevFilterFunc func,
                                   gpointer               data);
+CLUTTER_AVAILABLE_IN_1_20
+struct libinput_device * clutter_evdev_input_device_get_libinput_device (ClutterInputDevice *device);
 
 G_END_DECLS
 
diff --git a/clutter/evdev/clutter-input-device-evdev.c b/clutter/evdev/clutter-input-device-evdev.c
index 61e27ee..f7ac657 100644
--- a/clutter/evdev/clutter-input-device-evdev.c
+++ b/clutter/evdev/clutter-input-device-evdev.c
@@ -29,6 +29,7 @@
 
 #include "clutter/clutter-device-manager-private.h"
 #include "clutter-private.h"
+#include "clutter-evdev.h"
 
 #include "clutter-input-device-evdev.h"
 
@@ -198,3 +199,26 @@ _clutter_input_device_evdev_determine_type (struct libinput_device *ldev)
   else
     return CLUTTER_EXTENSION_DEVICE;
 }
+
+/**
+ * clutter_evdev_input_device_get_libinput_device:
+ * @device: a #ClutterInputDevice
+ *
+ * Retrieves the libinput_device struct held in @device.
+ *
+ * Returns: The libinput_device struct
+ *
+ * Since: 1.20
+ * Stability: unstable
+ **/
+struct libinput_device *
+clutter_evdev_input_device_get_libinput_device (ClutterInputDevice *device)
+{
+  ClutterInputDeviceEvdev *device_evdev;
+
+  g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE_EVDEV (device), NULL);
+
+  device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
+
+  return device_evdev->libinput_device;
+}


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