From ecf65fe0411403d57d6d2418782bd741b6d9e034 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 18 Sep 2009 09:49:21 -0400 Subject: [PATCH] Implement user_data for surface Not sure if we need more than one piece of user_data per surface. And this should be a general feature of any proxy object. --- wayland-client.c | 13 +++++++++++++ wayland-client.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/wayland-client.c b/wayland-client.c index 3c977b2..e60d028 100644 --- a/wayland-client.c +++ b/wayland-client.c @@ -64,6 +64,7 @@ struct wl_proxy { struct wl_object base; struct wl_display *display; struct wl_list listener_list; + void *user_data; }; struct wl_compositor { @@ -618,3 +619,15 @@ wl_surface_damage(struct wl_surface *surface, wl_proxy_marshal(&surface->proxy, WL_SURFACE_DAMAGE, x, y, width, height); } + +WL_EXPORT void +wl_surface_set_user_data(struct wl_surface *surface, void *user_data) +{ + surface->proxy.user_data = user_data; +} + +WL_EXPORT void * +wl_surface_get_user_data(struct wl_surface *surface) +{ + return surface->proxy.user_data; +} diff --git a/wayland-client.h b/wayland-client.h index cb2bd29..13b4776 100644 --- a/wayland-client.h +++ b/wayland-client.h @@ -95,6 +95,9 @@ void wl_surface_copy(struct wl_surface *surface, int32_t dst_x, int32_t dst_y, void wl_surface_damage(struct wl_surface *surface, int32_t x, int32_t y, int32_t width, int32_t height); +void wl_surface_set_user_data(struct wl_surface *surface, void *user_data); +void *wl_surface_get_user_data(struct wl_surface *surface); + struct wl_output; struct wl_output_listener { void (*geometry)(void *data, -- 2.7.4