[mutter/wip/tablet-protocol: 9/17] wayland: Add wl_tablet cursor rendering and management functions



commit d4be577ff6fda35a0a72e85dd9c8b039328e2f82
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Feb 4 20:03:46 2015 +0100

    wayland: Add wl_tablet cursor rendering and management functions

 src/wayland/meta-wayland-tablet.c |   12 ++++++++++++
 src/wayland/meta-wayland-tablet.h |    5 +++++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-tablet.c b/src/wayland/meta-wayland-tablet.c
index 7a0f317..3d8eea4 100644
--- a/src/wayland/meta-wayland-tablet.c
+++ b/src/wayland/meta-wayland-tablet.c
@@ -51,6 +51,9 @@ meta_wayland_tablet_new (ClutterInputDevice       *device,
   tablet->device = device;
   tablet->manager = manager;
 
+  tablet->cursor_renderer = meta_cursor_renderer_new ();
+  meta_cursor_renderer_set_cursor (tablet->cursor_renderer, NULL);
+
   return tablet;
 }
 
@@ -65,6 +68,7 @@ meta_wayland_tablet_free (MetaWaylandTablet *tablet)
       wl_resource_destroy (resource);
     }
 
+  g_object_unref (tablet->cursor_renderer);
   g_slice_free (MetaWaylandTablet, tablet);
 }
 
@@ -145,6 +149,14 @@ meta_wayland_tablet_create_new_resource (MetaWaylandTablet  *tablet,
   return resource;
 }
 
+void
+meta_wayland_tablet_update_cursor_position (MetaWaylandTablet *tablet,
+                                            int                new_x,
+                                            int                new_y)
+{
+  meta_cursor_renderer_set_position (tablet->cursor_renderer, new_x, new_y);
+}
+
 struct wl_resource *
 meta_wayland_tablet_lookup_resource (MetaWaylandTablet *tablet,
                                      struct wl_client  *client)
diff --git a/src/wayland/meta-wayland-tablet.h b/src/wayland/meta-wayland-tablet.h
index 3eba8bd..34bc399 100644
--- a/src/wayland/meta-wayland-tablet.h
+++ b/src/wayland/meta-wayland-tablet.h
@@ -36,6 +36,8 @@ struct _MetaWaylandTablet
 
   struct wl_list resource_list;
 
+  MetaCursorRenderer *cursor_renderer;
+
   MetaWaylandSurface *current;
 };
 
@@ -57,5 +59,8 @@ struct wl_resource *
              meta_wayland_tablet_lookup_resource     (MetaWaylandTablet  *tablet,
                                                       struct wl_client   *client);
 
+void         meta_wayland_tablet_update_cursor_position (MetaWaylandTablet *tablet,
+                                                         int                new_x,
+                                                         int                new_y);
 
 #endif /* META_WAYLAND_TABLET_H */


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