Update wl_desktop_shell for recent wayland changes

- wl_client functions have been deprecated. replaced with wl_resource
functions

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-07-09 10:26:40 +01:00
parent a67d211e09
commit ce0b069b51
1 changed files with 14 additions and 13 deletions

View File

@ -6,7 +6,7 @@
/* shell function prototypes */ /* shell function prototypes */
static void _e_wl_shell_cb_destroy(struct wl_listener *listener, void *data EINA_UNUSED); static void _e_wl_shell_cb_destroy(struct wl_listener *listener, void *data EINA_UNUSED);
static void _e_wl_shell_cb_bind(struct wl_client *client, void *data, unsigned int version EINA_UNUSED, unsigned int id); static void _e_wl_shell_cb_bind(struct wl_client *client, void *data, unsigned int version, unsigned int id);
static void _e_wl_shell_cb_ping(E_Wayland_Surface *ews, unsigned int serial); static void _e_wl_shell_cb_ping(E_Wayland_Surface *ews, unsigned int serial);
static void _e_wl_shell_cb_pointer_focus(struct wl_listener *listener EINA_UNUSED, void *data); static void _e_wl_shell_cb_pointer_focus(struct wl_listener *listener EINA_UNUSED, void *data);
@ -248,7 +248,7 @@ _e_wl_shell_cb_destroy(struct wl_listener *listener, void *data EINA_UNUSED)
} }
static void static void
_e_wl_shell_cb_bind(struct wl_client *client, void *data, unsigned int version EINA_UNUSED, unsigned int id) _e_wl_shell_cb_bind(struct wl_client *client, void *data, unsigned int version, unsigned int id)
{ {
E_Wayland_Desktop_Shell *shell = NULL; E_Wayland_Desktop_Shell *shell = NULL;
struct wl_resource *res = NULL; struct wl_resource *res = NULL;
@ -257,21 +257,22 @@ _e_wl_shell_cb_bind(struct wl_client *client, void *data, unsigned int version E
if (!(shell = data)) return; if (!(shell = data)) return;
/* try to add the shell to the client */ /* try to add the shell to the client */
wl_client_add_object(client, &wl_shell_interface, res = wl_resource_create(client, &wl_shell_interface, 1, id);
&_e_shell_interface, id, shell); if (res)
wl_resource_set_implementation(res, &_e_shell_interface, shell, NULL);
/* try to add the desktop shell to the client */ /* try to add the desktop shell to the client */
if (!(res = wl_client_new_object(client, &e_desktop_shell_interface, if (!(res =
&_e_desktop_shell_interface, shell))) wl_resource_create(client, &e_desktop_shell_interface,
MIN(version, 2), id)))
{ {
wl_resource_post_error(res, WL_DISPLAY_ERROR_INVALID_OBJECT, wl_resource_post_error(res, WL_DISPLAY_ERROR_INVALID_OBJECT,
"Permission Denied"); "Permission Denied");
wl_resource_destroy(res); wl_resource_destroy(res);
return; return;
} }
wl_resource_set_implementation(res, &_e_desktop_shell_interface, shell,
/* set desktop shell destroy callback */ _e_wl_desktop_shell_cb_unbind);
wl_resource_set_destructor(res, _e_wl_desktop_shell_cb_unbind);
shell->wl.resource = res; shell->wl.resource = res;
} }
@ -457,10 +458,10 @@ _e_wl_shell_cb_shell_surface_get(struct wl_client *client, struct wl_resource *r
} }
ewss->wl.resource = ewss->wl.resource =
wl_client_add_object(client, &wl_shell_surface_interface, wl_resource_create(client, &wl_shell_surface_interface, 1, id);
&_e_shell_surface_interface, id, ewss); wl_resource_set_implementation(ewss->wl.resource,
wl_resource_set_destructor(ewss->wl.resource, &_e_shell_surface_interface, ewss,
_e_wl_shell_shell_surface_destroy); _e_wl_shell_shell_surface_destroy);
} }
/* desktop shell functions */ /* desktop shell functions */