aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-01-20 16:21:45 -0500
committerTony Crisci <tony@dubstepdish.com>2018-01-20 16:21:45 -0500
commit6a1d71b8b8f33bdea3fb41bcd0de9439c0452682 (patch)
tree3ebbb611bb34864f9e86ceed87b6e32c73b93f84 /sway/tree
parentc353e01c85049cfbc09510657e453b6aa5fd9c2d (diff)
downloadsway-6a1d71b8b8f33bdea3fb41bcd0de9439c0452682.tar.xz
basic command criteria
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/container.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index d241f69a..e224539f 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -321,3 +321,25 @@ swayc_t *swayc_at(swayc_t *parent, double lx, double ly,
return NULL;
}
+
+void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) {
+ if (container) {
+ int i;
+ if (container->children) {
+ for (i = 0; i < container->children->length; ++i) {
+ swayc_t *child = container->children->items[i];
+ container_map(child, f, data);
+ }
+ }
+ // TODO
+ /*
+ if (container->floating) {
+ for (i = 0; i < container->floating->length; ++i) {
+ swayc_t *child = container->floating->items[i];
+ container_map(child, f, data);
+ }
+ }
+ */
+ f(container, data);
+ }
+}