[mutter/wip/tablet-protocol-v2: 142/149] wayland: Add method to relate a pad strip to its group



commit 58152598971d5fc256283274db271b1d4b4b7f49
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jun 30 18:38:01 2016 +0200

    wayland: Add method to relate a pad strip to its group

 src/wayland/meta-wayland-tablet-pad-strip.c |   12 ++++++++++++
 src/wayland/meta-wayland-tablet-pad-strip.h |    4 ++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-tablet-pad-strip.c b/src/wayland/meta-wayland-tablet-pad-strip.c
index 3bd245d..0487b70 100644
--- a/src/wayland/meta-wayland-tablet-pad-strip.c
+++ b/src/wayland/meta-wayland-tablet-pad-strip.c
@@ -33,6 +33,7 @@
 #include "meta-surface-actor-wayland.h"
 #include "meta-wayland-private.h"
 #include "meta-wayland-tablet-pad.h"
+#include "meta-wayland-tablet-pad-group.h"
 #include "meta-wayland-tablet-pad-strip.h"
 
 static void
@@ -208,3 +209,14 @@ meta_wayland_tablet_pad_strip_sync_focus (MetaWaylandTabletPadStrip *strip)
                                  wl_resource_get_client (strip->pad->focus_surface->resource));
     }
 }
+
+void
+meta_wayland_tablet_pad_strip_set_group (MetaWaylandTabletPadStrip *strip,
+                                         MetaWaylandTabletPadGroup *group)
+{
+  /* Group is static, can only be set once */
+  g_assert (strip->group == NULL);
+
+  strip->group = group;
+  group->strips = g_list_append (group->strips, strip);
+}
diff --git a/src/wayland/meta-wayland-tablet-pad-strip.h b/src/wayland/meta-wayland-tablet-pad-strip.h
index 788c535..fcbf3d9 100644
--- a/src/wayland/meta-wayland-tablet-pad-strip.h
+++ b/src/wayland/meta-wayland-tablet-pad-strip.h
@@ -32,6 +32,7 @@
 struct _MetaWaylandTabletPadStrip
 {
   MetaWaylandTabletPad *pad;
+  MetaWaylandTabletPadGroup *group;
 
   struct wl_list resource_list;
   struct wl_list focus_resource_list;
@@ -42,6 +43,9 @@ struct _MetaWaylandTabletPadStrip
 MetaWaylandTabletPadStrip * meta_wayland_tablet_pad_strip_new  (MetaWaylandTabletPad      *pad);
 void                        meta_wayland_tablet_pad_strip_free (MetaWaylandTabletPadStrip *strip);
 
+void                        meta_wayland_tablet_pad_strip_set_group (MetaWaylandTabletPadStrip *strip,
+                                                                     MetaWaylandTabletPadGroup *group);
+
 struct wl_resource *
              meta_wayland_tablet_pad_strip_create_new_resource (MetaWaylandTabletPadStrip *strip,
                                                                 struct wl_client          *client,


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