From f66d0f4e14818b12d2c02f924237a2e8a90de720 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 2 Sep 2010 20:27:16 -0400 Subject: [PATCH] Get rid of wl_client_add_surface() special case --- compositor.c | 10 ++++++++-- wayland-server.c | 16 ---------------- wayland-server.h | 6 ------ 3 files changed, 8 insertions(+), 24 deletions(-) diff --git a/compositor.c b/compositor.c index 32f9d11..1959ed2 100644 --- a/compositor.c +++ b/compositor.c @@ -635,8 +635,14 @@ compositor_create_surface(struct wl_client *client, wl_list_insert(ec->surface_list.prev, &surface->link); surface->base.base.destroy = destroy_surface; - wl_client_add_surface(client, &surface->base, - &surface_interface, id); + + surface->base.base.base.id = id; + surface->base.base.base.interface = &wl_surface_interface; + surface->base.base.base.implementation = + (void (**)(void)) &surface_interface; + surface->base.client = client; + + wl_client_add_resource(client, &surface->base.base); } static void diff --git a/wayland-server.c b/wayland-server.c index 869bdd9..eb003fc 100644 --- a/wayland-server.c +++ b/wayland-server.c @@ -262,22 +262,6 @@ wl_client_destroy(struct wl_client *client) free(client); } -WL_EXPORT int -wl_client_add_surface(struct wl_client *client, - struct wl_surface *surface, - const struct wl_surface_interface *implementation, - uint32_t id) -{ - surface->base.base.id = id; - surface->base.base.interface = &wl_surface_interface; - surface->base.base.implementation = (void (**)(void)) implementation; - surface->client = client; - - wl_client_add_resource(client, &surface->base); - - return 0; -} - WL_EXPORT void wl_client_send_acknowledge(struct wl_client *client, struct wl_compositor *compositor, diff --git a/wayland-server.h b/wayland-server.h index 4292be0..ee2906d 100644 --- a/wayland-server.h +++ b/wayland-server.h @@ -156,12 +156,6 @@ wl_display_set_compositor(struct wl_display *display, struct wl_compositor *compositor, const struct wl_compositor_interface *implementation); -int -wl_client_add_surface(struct wl_client *client, - struct wl_surface *surface, - const struct wl_surface_interface *implementation, - uint32_t id); - void wl_client_send_acknowledge(struct wl_client *client, struct wl_compositor *compositor, -- 2.7.4