aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-04-03 13:16:23 -0400
committerTony Crisci <tony@dubstepdish.com>2018-04-03 13:16:23 -0400
commit065887bb7b25c1cf7d39459c79387a24e600085f (patch)
tree7958aed61c6c3c47fc3849434ad09dcbd6b53f65
parentfcbcbf34adbcfbfc4107c5e0050639828265e122 (diff)
move container_set_layout to layout.h
-rw-r--r--include/sway/tree/container.h4
-rw-r--r--include/sway/tree/layout.h5
-rw-r--r--sway/tree/container.c13
-rw-r--r--sway/tree/layout.c13
4 files changed, 17 insertions, 18 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index 88ca67e9..23014dbe 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -132,10 +132,6 @@ struct sway_container *container_destroy(struct sway_container *container);
struct sway_container *container_close(struct sway_container *container);
-// TODO move to layout.c
-struct sway_container *container_set_layout(struct sway_container *container,
- enum sway_container_layout layout);
-
// TODO rename to container_descendants_for_each()
void container_descendants(struct sway_container *root,
enum sway_container_type type,
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h
index 9d33d561..725422c6 100644
--- a/include/sway/tree/layout.h
+++ b/include/sway/tree/layout.h
@@ -41,10 +41,13 @@ struct sway_container *container_add_sibling(struct sway_container *parent,
struct sway_container *container_remove_child(struct sway_container *child);
// TODO PRIVATE in tree.h
-
struct sway_container *container_replace_child(struct sway_container *child,
struct sway_container *new_child);
+// TODO move to layout.c
+struct sway_container *container_set_layout(struct sway_container *container,
+ enum sway_container_layout layout);
+
// TODO move to tree.h
void container_move_to(struct sway_container* container,
struct sway_container* destination);
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 7cc8caa6..a79bc22c 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -441,19 +441,6 @@ struct sway_container *container_view_create(struct sway_container *sibling,
return swayc;
}
-struct sway_container *container_set_layout(struct sway_container *container,
- enum sway_container_layout layout) {
- if (container->type == C_WORKSPACE) {
- container->workspace_layout = layout;
- if (layout == L_HORIZ || layout == L_VERT) {
- container->layout = layout;
- }
- } else {
- container->layout = layout;
- }
- return container;
-}
-
void container_descendants(struct sway_container *root,
enum sway_container_type type,
void (*func)(struct sway_container *item, void *data), void *data) {
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index 487f895f..dfcdbb9c 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -47,6 +47,19 @@ static void output_layout_change_notify(struct wl_listener *listener,
arrange_windows(&root_container, -1, -1);
}
+struct sway_container *container_set_layout(struct sway_container *container,
+ enum sway_container_layout layout) {
+ if (container->type == C_WORKSPACE) {
+ container->workspace_layout = layout;
+ if (layout == L_HORIZ || layout == L_VERT) {
+ container->layout = layout;
+ }
+ } else {
+ container->layout = layout;
+ }
+ return container;
+}
+
void layout_init(void) {
root_container.id = 0; // normally assigned in new_swayc()
root_container.type = C_ROOT;