Merge pull request #1253 from RyanDwyer/multi-for-each-backend
Introduce wlr_multi_for_each_backend
This commit is contained in:
commit
842368ec98
|
@ -207,3 +207,13 @@ bool wlr_multi_is_empty(struct wlr_backend *_backend) {
|
||||||
struct wlr_multi_backend *backend = (struct wlr_multi_backend *)_backend;
|
struct wlr_multi_backend *backend = (struct wlr_multi_backend *)_backend;
|
||||||
return wl_list_length(&backend->backends) < 1;
|
return wl_list_length(&backend->backends) < 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wlr_multi_for_each_backend(struct wlr_backend *_backend,
|
||||||
|
void (*callback)(struct wlr_backend *backend, void *data), void *data) {
|
||||||
|
assert(wlr_backend_is_multi(_backend));
|
||||||
|
struct wlr_multi_backend *backend = (struct wlr_multi_backend *)_backend;
|
||||||
|
struct subbackend_state *sub;
|
||||||
|
wl_list_for_each(sub, &backend->backends, link) {
|
||||||
|
callback(sub->backend, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -31,4 +31,7 @@ bool wlr_backend_is_multi(struct wlr_backend *backend);
|
||||||
struct wlr_session *wlr_multi_get_session(struct wlr_backend *base);
|
struct wlr_session *wlr_multi_get_session(struct wlr_backend *base);
|
||||||
bool wlr_multi_is_empty(struct wlr_backend *backend);
|
bool wlr_multi_is_empty(struct wlr_backend *backend);
|
||||||
|
|
||||||
|
void wlr_multi_for_each_backend(struct wlr_backend *backend,
|
||||||
|
void (*callback)(struct wlr_backend *backend, void *data), void *data);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue