mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
wayland-server: Add method to get global name
This is useful for protocol designs where globals need to be referenced in some manner. Signed-off-by: Andri Yngvason <andri@yngvason.is>
This commit is contained in:
parent
d443241635
commit
d16d39f74a
2 changed files with 21 additions and 0 deletions
|
|
@ -279,6 +279,10 @@ wl_display_set_global_filter(struct wl_display *display,
|
|||
const struct wl_interface *
|
||||
wl_global_get_interface(const struct wl_global *global);
|
||||
|
||||
uint32_t
|
||||
wl_global_get_name(const struct wl_global *global,
|
||||
const struct wl_client *client);
|
||||
|
||||
uint32_t
|
||||
wl_global_get_version(const struct wl_global *global);
|
||||
|
||||
|
|
|
|||
|
|
@ -1369,6 +1369,23 @@ wl_global_get_interface(const struct wl_global *global)
|
|||
return global->interface;
|
||||
}
|
||||
|
||||
/** Get the name of the global.
|
||||
*
|
||||
* \param global The global object.
|
||||
* \param client Client for which to look up the global.
|
||||
* \return The name of the global, or 0 if the global is not visible to the
|
||||
* client.
|
||||
*
|
||||
* \memberof wl_global
|
||||
* \since 1.22
|
||||
*/
|
||||
WL_EXPORT uint32_t
|
||||
wl_global_get_name(const struct wl_global *global,
|
||||
const struct wl_client *client)
|
||||
{
|
||||
return wl_global_is_visible(client, global) ? global->name : 0;
|
||||
}
|
||||
|
||||
/** Get the version of the given global.
|
||||
*
|
||||
* \param global The global object.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue