mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-03 09:01:42 -05:00
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: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
parent
d915447365
commit
65b773e51f
2 changed files with 18 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue