[gtk+/wip/wayland-tablet-v2: 5/19] wayland: Add wayland-specific method to retrieve a device node path



commit 8226f9d4c7b7402afadce27c28f72c27d4657062
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Aug 4 18:59:09 2016 +0200

    wayland: Add wayland-specific method to retrieve a device node path
    
    This will be useful at least for g-c-c, in order to match libwacom
    data with GdkDevices.

 gdk/wayland/gdkdevice-wayland.c |   18 ++++++++++++++++++
 gdk/wayland/gdkwaylanddevice.h  |    2 ++
 2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 76f839d..1849803 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -4474,3 +4474,21 @@ gdk_wayland_device_get_drop_context (GdkDevice *device)
 
   return GDK_WAYLAND_SEAT (seat)->drop_context;
 }
+
+const gchar *
+gdk_wayland_device_get_node_path (GdkDevice *device)
+{
+  GdkWaylandTabletData *tablet;
+
+  GdkSeat *seat;
+
+  g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
+
+  seat = gdk_device_get_seat (device);
+  tablet = gdk_wayland_device_manager_find_tablet (GDK_WAYLAND_SEAT (seat),
+                                                   device);
+  if (tablet)
+    return tablet->path;
+
+  return NULL;
+}
diff --git a/gdk/wayland/gdkwaylanddevice.h b/gdk/wayland/gdkwaylanddevice.h
index a5b8ea0..b02ceeb 100644
--- a/gdk/wayland/gdkwaylanddevice.h
+++ b/gdk/wayland/gdkwaylanddevice.h
@@ -55,6 +55,8 @@ struct wl_keyboard  *gdk_wayland_device_get_wl_keyboard     (GdkDevice *device);
 GDK_AVAILABLE_IN_3_20
 struct wl_seat      *gdk_wayland_seat_get_wl_seat           (GdkSeat   *seat);
 
+GDK_AVAILABLE_IN_3_22
+const gchar         *gdk_wayland_device_get_node_path       (GdkDevice *device);
 
 G_END_DECLS
 


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