aboutsummaryrefslogtreecommitdiff
path: root/backend/multi
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-09-19 21:53:51 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-09-19 21:53:51 +1000
commit691a63d66bdf45bc30e427b59958e7e12440e53e (patch)
tree426844dd138cf430a1af62b4d8a4d6a1d6faff16 /backend/multi
parent3693fae0c44d83cab2c701bd44b80d8f6242781e (diff)
Introduce wlr_multi_for_each_backend
Diffstat (limited to 'backend/multi')
-rw-r--r--backend/multi/backend.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/backend/multi/backend.c b/backend/multi/backend.c
index 1665bf28..3707fe34 100644
--- a/backend/multi/backend.c
+++ b/backend/multi/backend.c
@@ -207,3 +207,13 @@ bool wlr_multi_is_empty(struct wlr_backend *_backend) {
struct wlr_multi_backend *backend = (struct wlr_multi_backend *)_backend;
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);
+ }
+}