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

This commit is contained in:
Carlos Garnacho 2016-06-30 18:37:49 +02:00
parent 05a5c86203
commit 1f7c7bdeaa
2 changed files with 15 additions and 0 deletions

View File

@ -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-ring.h"
static void
@ -209,3 +210,14 @@ meta_wayland_tablet_pad_ring_sync_focus (MetaWaylandTabletPadRing *ring)
wl_resource_get_client (ring->pad->focus_surface->resource));
}
}
void
meta_wayland_tablet_pad_ring_set_group (MetaWaylandTabletPadRing *ring,
MetaWaylandTabletPadGroup *group)
{
/* Group is static, can only be set once */
g_assert (ring->group == NULL);
ring->group = group;
group->rings = g_list_append (group->rings, ring);
}

View File

@ -32,6 +32,7 @@
struct _MetaWaylandTabletPadRing
{
MetaWaylandTabletPad *pad;
MetaWaylandTabletPadGroup *group;
struct wl_list resource_list;
struct wl_list focus_resource_list;
@ -42,6 +43,8 @@ struct _MetaWaylandTabletPadRing
MetaWaylandTabletPadRing * meta_wayland_tablet_pad_ring_new (MetaWaylandTabletPad *pad);
void meta_wayland_tablet_pad_ring_free (MetaWaylandTabletPadRing *ring);
void meta_wayland_tablet_pad_ring_set_group (MetaWaylandTabletPadRing *ring,
MetaWaylandTabletPadGroup *group);
struct wl_resource *
meta_wayland_tablet_pad_ring_create_new_resource (MetaWaylandTabletPadRing *ring,
struct wl_client *client,