Commit 65b773e5 authored by Olivier Fourdan's avatar Olivier Fourdan Committed by Pekka Paalanen

wayland-server: Add functions to wl_global

When using a wl_global, a server may need to retrieve the associated
wl_interface and user data.

Add a couple of convenient functions wl_global_get_interface() and
wl_global_get_user_data() for this purpose.
Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
Reviewed-by: default avatarYong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
parent d9154473
......@@ -193,6 +193,12 @@ wl_display_set_global_filter(struct wl_display *display,
wl_display_global_filter_func_t filter,
void *data);
const struct wl_interface *
wl_global_get_interface(const struct wl_global *global);
void *
wl_global_get_user_data(const struct wl_global *global);
struct wl_client *
wl_client_create(struct wl_display *display, int fd);
......
......@@ -1113,6 +1113,18 @@ wl_global_destroy(struct wl_global *global)
free(global);
}
WL_EXPORT const struct wl_interface *
wl_global_get_interface(const struct wl_global *global)
{
return global->interface;
}
WL_EXPORT void *
wl_global_get_user_data(const struct wl_global *global)
{
return global->data;
}
/** Get the current serial number
*
* \param display The display object
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment