aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/layout.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2017-11-19 17:04:28 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2017-11-19 17:04:28 -0500
commitdb4fb1c85c132e001fb1ae18f03f7585def1ae19 (patch)
tree91da84c9476e6ec34c65f3f8923961fd893fa721 /sway/tree/layout.c
parentMove everything to sway/old/ (diff)
downloadsway-db4fb1c85c132e001fb1ae18f03f7585def1ae19.tar.gz
sway-db4fb1c85c132e001fb1ae18f03f7585def1ae19.tar.zst
sway-db4fb1c85c132e001fb1ae18f03f7585def1ae19.zip
Add outputs to the tree
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r--sway/tree/layout.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
new file mode 100644
index 00000000..06200bbf
--- /dev/null
+++ b/sway/tree/layout.c
@@ -0,0 +1,35 @@
1#define _POSIX_C_SOURCE 200809L
2#include <stdbool.h>
3#include <string.h>
4#include <wlr/types/wlr_output_layout.h>
5#include "sway/container.h"
6#include "list.h"
7#include "log.h"
8
9swayc_t root_container;
10
11void init_layout(void) {
12 root_container.id = 0; // normally assigned in new_swayc()
13 root_container.type = C_ROOT;
14 root_container.layout = L_NONE;
15 root_container.name = strdup("root");
16 root_container.children = create_list();
17 root_container.output_layout = wlr_output_layout_create();
18}
19
20void add_child(swayc_t *parent, swayc_t *child) {
21 sway_log(L_DEBUG, "Adding %p (%d, %fx%f) to %p (%d, %fx%f)",
22 child, child->type, child->width, child->height,
23 parent, parent->type, parent->width, parent->height);
24 list_add(parent->children, child);
25 child->parent = parent;
26 // set focus for this container
27 if (!parent->focused) {
28 parent->focused = child;
29 }
30 /* TODO WLR
31 if (parent->type == C_WORKSPACE && child->type == C_VIEW && (parent->workspace_layout == L_TABBED || parent->workspace_layout == L_STACKED)) {
32 child = new_container(child, parent->workspace_layout);
33 }
34 */
35}