mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
Merge pull request #825 from emersion/surface-iterators
Add surface iterators
This commit is contained in:
commit
ae4cef9e41
9 changed files with 303 additions and 158 deletions
|
|
@ -93,9 +93,13 @@ struct wlr_surface {
|
|||
|
||||
// wlr_subsurface::parent_pending_link
|
||||
struct wl_list subsurface_pending_list;
|
||||
|
||||
void *data;
|
||||
};
|
||||
|
||||
typedef void (*wlr_surface_iterator_func_t)(struct wlr_surface *surface,
|
||||
int sx, int sy, void *data);
|
||||
|
||||
struct wlr_renderer;
|
||||
struct wlr_surface *wlr_surface_create(struct wl_resource *res,
|
||||
struct wlr_renderer *renderer);
|
||||
|
|
@ -160,4 +164,12 @@ void wlr_surface_set_role_committed(struct wlr_surface *surface,
|
|||
|
||||
struct wlr_surface *wlr_surface_from_resource(struct wl_resource *resource);
|
||||
|
||||
/**
|
||||
* Call `iterator` on each surface in the surface tree, with the surface's
|
||||
* positon relative to the root surface. The function is called from root to
|
||||
* leaves (in rendering order).
|
||||
*/
|
||||
void wlr_surface_for_each_surface(struct wlr_surface *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -155,4 +155,12 @@ bool wlr_surface_is_wl_shell_surface(struct wlr_surface *surface);
|
|||
struct wlr_wl_surface *wlr_wl_shell_surface_from_wlr_surface(
|
||||
struct wlr_surface *surface);
|
||||
|
||||
/**
|
||||
* Call `iterator` on each surface in the shell surface tree, with the surface's
|
||||
* positon relative to the root xdg-surface. The function is called from root to
|
||||
* leaves (in rendering order).
|
||||
*/
|
||||
void wlr_wl_shell_surface_for_each_surface(struct wlr_wl_shell_surface *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -234,4 +234,12 @@ bool wlr_surface_is_xdg_surface(struct wlr_surface *surface);
|
|||
struct wlr_xdg_surface *wlr_xdg_surface_from_wlr_surface(
|
||||
struct wlr_surface *surface);
|
||||
|
||||
/**
|
||||
* Call `iterator` on each surface in the xdg-surface tree, with the surface's
|
||||
* positon relative to the root xdg-surface. The function is called from root to
|
||||
* leaves (in rendering order).
|
||||
*/
|
||||
void wlr_xdg_surface_for_each_surface(struct wlr_xdg_surface *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -294,4 +294,12 @@ bool wlr_surface_is_xdg_surface_v6(struct wlr_surface *surface);
|
|||
struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6_from_wlr_surface(
|
||||
struct wlr_surface *surface);
|
||||
|
||||
/**
|
||||
* Call `iterator` on each surface in the xdg-surface tree, with the surface's
|
||||
* positon relative to the root xdg-surface. The function is called from root to
|
||||
* leaves (in rendering order).
|
||||
*/
|
||||
void wlr_xdg_surface_v6_for_each_surface(struct wlr_xdg_surface_v6 *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue