mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
server: add wl_global_get_version
Add a helper to check the advertised version of a global. This can be handy when checking whether a compositor feature is supported, instead of having to store the version passed to wl_global_create separately. Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
parent
b19488c715
commit
d01868413f
2 changed files with 17 additions and 0 deletions
|
|
@ -279,6 +279,9 @@ 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_version(const struct wl_global *global);
|
||||
|
||||
struct wl_display *
|
||||
wl_global_get_display(const struct wl_global *global);
|
||||
|
||||
|
|
|
|||
|
|
@ -1315,6 +1315,20 @@ wl_global_get_interface(const struct wl_global *global)
|
|||
return global->interface;
|
||||
}
|
||||
|
||||
/** Get the version of the given global.
|
||||
*
|
||||
* \param global The global object.
|
||||
* \return The version advertised by the global.
|
||||
*
|
||||
* \memberof wl_global
|
||||
* \since 1.21
|
||||
*/
|
||||
WL_EXPORT uint32_t
|
||||
wl_global_get_version(const struct wl_global *global)
|
||||
{
|
||||
return global->version;
|
||||
}
|
||||
|
||||
/** Get the display object for the given global
|
||||
*
|
||||
* \param global The global object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue