summaryrefslogtreecommitdiffstats
path: root/src/wayland-server.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-06-27 20:09:18 -0500
committerKristian Høgsberg <krh@bitplanet.net>2013-07-02 15:52:47 -0400
commitd94a8722cb29d8b897672be66ff3c9ff79eab6fe (patch)
tree4314f9c98913c36a12525062680440a336a88092 /src/wayland-server.c
parentprotocol: add no_keymap format to keymap formats (diff)
downloadwayland-d94a8722cb29d8b897672be66ff3c9ff79eab6fe.tar
wayland-d94a8722cb29d8b897672be66ff3c9ff79eab6fe.tar.gz
wayland-d94a8722cb29d8b897672be66ff3c9ff79eab6fe.tar.bz2
wayland-d94a8722cb29d8b897672be66ff3c9ff79eab6fe.tar.lz
wayland-d94a8722cb29d8b897672be66ff3c9ff79eab6fe.tar.xz
wayland-d94a8722cb29d8b897672be66ff3c9ff79eab6fe.tar.zst
wayland-d94a8722cb29d8b897672be66ff3c9ff79eab6fe.zip
server: Make wl_object and wl_resource opaque structs
With the work to add wl_resource accessors and port weston to use them, we're ready to make wl_resource and wl_object opaque structs. We keep wl_buffer in the header for EGL stacks to use, but don't expose it by default. In time we'll remove it completely, but for now it provides a transition paths for code that still uses wl_buffer. Reviewed-by: Jason Ekstrand<jason@jlekstrand.net>
Diffstat (limited to 'src/wayland-server.c')
-rw-r--r--src/wayland-server.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/wayland-server.c b/src/wayland-server.c
index 7907283..0c3fbc9 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -102,6 +102,15 @@ struct wl_global {
struct wl_list link;
};
+struct wl_resource {
+ struct wl_object object;
+ wl_resource_destroy_func_t destroy;
+ struct wl_list link;
+ struct wl_signal destroy_signal;
+ struct wl_client *client;
+ void *data;
+};
+
static int wl_debug = 0;
static void
@@ -373,6 +382,10 @@ wl_client_get_credentials(struct wl_client *client,
*gid = client->ucred.gid;
}
+uint32_t
+wl_client_add_resource(struct wl_client *client,
+ struct wl_resource *resource) WL_DEPRECATED;
+
WL_EXPORT uint32_t
wl_client_add_resource(struct wl_client *client,
struct wl_resource *resource)
@@ -996,9 +1009,15 @@ wl_client_add_object(struct wl_client *client,
return NULL;
}
- wl_resource_init(resource, interface, implementation, id, data);
- resource->client = client;
+ resource->object.id = id;
+ resource->object.interface = interface;
+ resource->object.implementation = implementation;
+
+ wl_signal_init(&resource->destroy_signal);
+
resource->destroy = NULL;
+ resource->client = client;
+ resource->data = data;
if (wl_map_insert_at(&client->objects, 0, resource->object.id, resource) < 0) {
wl_resource_post_error(client->display_resource,