From 8872956dfd43d36e4165d15cb50d8ef4f81fbe0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 8 Oct 2012 13:25:52 -0400 Subject: [PATCH] scanner: Generate client stubs for wl_display requests We used to special case this because of the untyped new-id argument in the bind request. Now that the scanner can handle that, we can remove the special case. Switching to the generated stubs does bring an API change since we now also take the interface version that the client expects as an argument. Previously we would take this from the interface struct, but the application may implement a lower version than what the interface struct provides. To make sure we don't try to dispatch event the client doesn't implement handlers for, we have to use a client supplied version number. --- src/scanner.c | 4 ---- src/wayland-client.c | 31 ------------------------------- src/wayland-client.h | 17 ----------------- 3 files changed, 52 deletions(-) diff --git a/src/scanner.c b/src/scanner.c index 3f91916f..d68c9528 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -538,10 +538,6 @@ emit_stubs(struct wl_list *message_list, struct interface *interface) struct arg *a, *ret; int has_destructor, has_destroy; - /* We provide a hand written functions for the display object */ - if (strcmp(interface->name, "wl_display") == 0) - return; - printf("static inline void\n" "%s_set_user_data(struct %s *%s, void *user_data)\n" "{\n" diff --git a/src/wayland-client.c b/src/wayland-client.c index e88228a0..fb751ef1 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -711,37 +711,6 @@ wl_display_flush(struct wl_display *display) return ret; } -WL_EXPORT void * -wl_display_bind(struct wl_display *display, - uint32_t name, const struct wl_interface *interface) -{ - struct wl_proxy *proxy; - - proxy = wl_proxy_create(&display->proxy, interface); - if (proxy == NULL) - return NULL; - - wl_proxy_marshal(&display->proxy, WL_DISPLAY_BIND, - name, interface->name, interface->version, proxy); - - return proxy; -} - -WL_EXPORT struct wl_callback * -wl_display_sync(struct wl_display *display) -{ - struct wl_proxy *proxy; - - proxy = wl_proxy_create(&display->proxy, &wl_callback_interface); - - if (!proxy) - return NULL; - - wl_proxy_marshal(&display->proxy, WL_DISPLAY_SYNC, proxy); - - return (struct wl_callback *) proxy; -} - WL_EXPORT void wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data) { diff --git a/src/wayland-client.h b/src/wayland-client.h index fbbee098..aa92afbf 100644 --- a/src/wayland-client.h +++ b/src/wayland-client.h @@ -51,23 +51,6 @@ void *wl_proxy_get_user_data(struct wl_proxy *proxy); uint32_t wl_proxy_get_id(struct wl_proxy *proxy); void wl_proxy_set_queue(struct wl_proxy *proxy, struct wl_event_queue *queue); -void *wl_display_bind(struct wl_display *display, - uint32_t name, const struct wl_interface *interface); - -static inline void -wl_display_set_user_data(struct wl_display *display, void *user_data) -{ - wl_proxy_set_user_data((struct wl_proxy *) display, user_data); -} - -static inline void * -wl_display_get_user_data(struct wl_display *display) -{ - return wl_proxy_get_user_data((struct wl_proxy *) display); -} - -struct wl_callback *wl_display_sync(struct wl_display *display); - #include "wayland-client-protocol.h" typedef int (*wl_display_update_func_t)(uint32_t mask, void *data);