2015-08-11 06:31:23 +10:00
|
|
|
#include "container.h"
|
|
|
|
#include "layout.h"
|
|
|
|
|
|
|
|
void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) {
|
|
|
|
if (!container->children) {
|
2015-08-11 08:50:47 +10:00
|
|
|
return;
|
2015-08-11 06:31:23 +10:00
|
|
|
}
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < container->children->length; ++i) {
|
|
|
|
swayc_t *child = container->children->items[i];
|
|
|
|
f(child, data);
|
|
|
|
|
2015-08-11 08:50:47 +10:00
|
|
|
if (child->children) {
|
2015-08-11 06:31:23 +10:00
|
|
|
container_map(child, f, data);
|
2015-08-11 08:50:47 +10:00
|
|
|
}
|
2015-08-11 06:31:23 +10:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|