aboutsummaryrefslogtreecommitdiffstats
path: root/src/wayland-server.h
diff options
context:
space:
mode:
authorJason Ekstrand <jason@jlekstrand.net>2013-06-27 20:09:20 -0500
committerKristian Høgsberg <krh@bitplanet.net>2013-07-02 17:01:23 -0400
commit4917a967bdcd33b7ad264af9c984c3957d87f569 (patch)
treecc8e65fb1da5b52c62d1070c6981bf90479ebf3b /src/wayland-server.h
parentAdd version information to wl_message signatures. (diff)
downloadwayland-4917a967bdcd33b7ad264af9c984c3957d87f569.tar
wayland-4917a967bdcd33b7ad264af9c984c3957d87f569.tar.gz
wayland-4917a967bdcd33b7ad264af9c984c3957d87f569.tar.bz2
wayland-4917a967bdcd33b7ad264af9c984c3957d87f569.tar.lz
wayland-4917a967bdcd33b7ad264af9c984c3957d87f569.tar.xz
wayland-4917a967bdcd33b7ad264af9c984c3957d87f569.tar.zst
wayland-4917a967bdcd33b7ad264af9c984c3957d87f569.zip
Add wl_resource_create() and a version field to wl_resource
A new function, wl_resource_create(), lets the compositor create a wl_resource for a given version of the interface. Passing 0 for the object ID will allocate a new ID. The implementation, user data and destructor can be set with wl_resource_set_implementation(). These two functions deprecates wl_client_add/new_object and the main difference and motivation is the ability to provide a version number for the resource. This lets the compositor track which version of the interface a client has created and we'll use that to verify incoming requests. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/wayland-server.h')
-rw-r--r--src/wayland-server.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wayland-server.h b/src/wayland-server.h
index df771e9..e20ade5 100644
--- a/src/wayland-server.h
+++ b/src/wayland-server.h
@@ -242,6 +242,16 @@ void wl_resource_post_no_memory(struct wl_resource *resource);
struct wl_display *
wl_client_get_display(struct wl_client *client);
+struct wl_resource *
+wl_resource_create(struct wl_client *client,
+ const struct wl_interface *interface,
+ int version, uint32_t id);
+void
+wl_resource_set_implementation(struct wl_resource *resource,
+ const void *implementation,
+ void *data,
+ wl_resource_destroy_func_t destroy);
+
void
wl_resource_destroy(struct wl_resource *resource);
uint32_t
@@ -258,6 +268,8 @@ void
wl_resource_set_user_data(struct wl_resource *resource, void *data);
void *
wl_resource_get_user_data(struct wl_resource *resource);
+int
+wl_resource_get_version(struct wl_resource *resource);
void
wl_resource_set_destructor(struct wl_resource *resource,
wl_resource_destroy_func_t destroy);