compositor: introduce wlr_surface_set_role_object()

This commit is contained in:
Kirill Primak 2023-06-22 15:05:34 +03:00 committed by Simon Ser
parent 0040c78c0b
commit 0f67580aab
12 changed files with 58 additions and 33 deletions

View file

@ -230,17 +230,22 @@ typedef void (*wlr_surface_iterator_func_t)(struct wlr_surface *surface,
int sx, int sy, void *data);
/**
* Set the lifetime role for this surface. Returns true on success or false if
* the role cannot be set.
* Set the lifetime role for this surface.
*
* If the role is represented by an object, role_data must be non-NULL.
* Alternatively, if the role isn't represented by any object, role_data must
* be NULL.
* If the surface already has a different role and/or has a role object set,
* the function fails and sends an error to the client.
*
* Returns true on success, false otherwise.
*/
bool wlr_surface_set_role(struct wlr_surface *surface,
const struct wlr_surface_role *role, void *role_data,
bool wlr_surface_set_role(struct wlr_surface *surface, const struct wlr_surface_role *role,
struct wl_resource *error_resource, uint32_t error_code);
/**
* Set the role object for this surface. The surface must have a role and
* no already set role object.
*/
void wlr_surface_set_role_object(struct wlr_surface *surface, void *role_data);
/**
* Destroy the object representing the surface's role. If it doesn't exist,
* this function is no-op.