From ac73a74f43bada3e6ed8e7e49e9f5e02b22f7d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 27 Apr 2012 11:28:06 -0400 Subject: [PATCH] Add wl_client_get_object() --- src/wayland-server.c | 6 ++++++ src/wayland-server.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/wayland-server.c b/src/wayland-server.c index 97d89182..b19e05bb 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -374,6 +374,12 @@ wl_client_add_resource(struct wl_client *client, wl_signal_init(&resource->destroy_signal); } +WL_EXPORT struct wl_resource * +wl_client_get_object(struct wl_client *client, uint32_t id) +{ + return wl_map_lookup(&client->objects, id); +} + WL_EXPORT void wl_resource_post_no_memory(struct wl_resource *resource) { diff --git a/src/wayland-server.h b/src/wayland-server.h index 249cfa86..6be68976 100644 --- a/src/wayland-server.h +++ b/src/wayland-server.h @@ -118,6 +118,8 @@ struct wl_resource * wl_client_new_object(struct wl_client *client, const struct wl_interface *interface, const void *implementation, void *data); +struct wl_resource * +wl_client_get_object(struct wl_client *client, uint32_t id); struct wl_listener { struct wl_list link;