[server] Add quint32 Resource::id() const
Wrapper for wl_resource_get_id.
This commit is contained in:
parent
1d5a032803
commit
272904313b
2 changed files with 15 additions and 0 deletions
|
@ -100,5 +100,13 @@ wl_resource *Resource::parentResource() const
|
|||
return d->parentResource;
|
||||
}
|
||||
|
||||
quint32 Resource::id() const
|
||||
{
|
||||
if (!d->resource) {
|
||||
return 0;
|
||||
}
|
||||
return wl_resource_get_id(d->resource);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,13 @@ public:
|
|||
ClientConnection *client();
|
||||
Global *global();
|
||||
wl_resource *parentResource() const;
|
||||
/**
|
||||
* @returns The id of this Resource if it is created, otherwise @c 0.
|
||||
*
|
||||
* This is a convenient wrapper for wl_resource_get_id.
|
||||
* @since 5.3
|
||||
**/
|
||||
quint32 id() const;
|
||||
|
||||
protected:
|
||||
class Private;
|
||||
|
|
Loading…
Reference in a new issue