aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sway/tree/container.h22
-rw-r--r--include/sway/tree/layout.h17
-rw-r--r--include/sway/tree/output.h0
-rw-r--r--include/sway/tree/workspace.h2
4 files changed, 12 insertions, 29 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index 464f80c4..277165ea 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -91,13 +91,11 @@ struct sway_container {
91 } events; 91 } events;
92}; 92};
93 93
94// TODO make private and use the container-specific create functions
95struct sway_container *container_create(enum sway_container_type type); 94struct sway_container *container_create(enum sway_container_type type);
96 95
97const char *container_type_to_str(enum sway_container_type type); 96const char *container_type_to_str(enum sway_container_type type);
98 97
99// TODO only one container create function and pass the type? 98struct sway_container *output_create(
100struct sway_container *container_output_create(
101 struct sway_output *sway_output); 99 struct sway_output *sway_output);
102 100
103/** 101/**
@@ -110,35 +108,26 @@ struct sway_container *container_container_create();
110 * Create a new output. Outputs are children of the root container and have no 108 * Create a new output. Outputs are children of the root container and have no
111 * order in the tree structure. 109 * order in the tree structure.
112 */ 110 */
113struct sway_container *container_output_create(struct sway_output *sway_output); 111struct sway_container *output_create(struct sway_output *sway_output);
114 112
115/** 113/**
116 * Create a new workspace container. Workspaces are children of an output 114 * Create a new workspace container. Workspaces are children of an output
117 * container and are ordered alphabetically by name. 115 * container and are ordered alphabetically by name.
118 */ 116 */
119struct sway_container *container_workspace_create(struct sway_container *output, const char *name); 117struct sway_container *workspace_create(struct sway_container *output, const char *name);
120 118
121/* 119/*
122 * Create a new view container. A view can be a child of a workspace container 120 * Create a new view container. A view can be a child of a workspace container
123 * or a container container and are rendered in the order and structure of 121 * or a container container and are rendered in the order and structure of
124 * how they are attached to the tree. 122 * how they are attached to the tree.
125 */ 123 */
126// TODO view containers should be created in a detached state.
127struct sway_container *container_view_create( 124struct sway_container *container_view_create(
128 struct sway_container *sibling, struct sway_view *sway_view); 125 struct sway_container *sibling, struct sway_view *sway_view);
129 126
130// TODO don't return the parent on destroy
131struct sway_container *container_destroy(struct sway_container *container); 127struct sway_container *container_destroy(struct sway_container *container);
132 128
133struct sway_container *container_workspace_destroy(struct sway_container *container); 129struct sway_container *container_close(struct sway_container *container);
134struct sway_container *container_output_destroy(struct sway_container *container);
135struct sway_container *container_view_destroy(struct sway_container *container);
136 130
137// TODO move to layout.c
138struct sway_container *container_set_layout(struct sway_container *container,
139 enum sway_container_layout layout);
140
141// TODO rename to container_descendants_for_each()
142void container_descendants(struct sway_container *root, 131void container_descendants(struct sway_container *root,
143 enum sway_container_type type, 132 enum sway_container_type type,
144 void (*func)(struct sway_container *item, void *data), void *data); 133 void (*func)(struct sway_container *item, void *data), void *data);
@@ -153,7 +142,6 @@ struct sway_container *container_find(struct sway_container *container,
153/** 142/**
154 * Finds a parent container with the given struct sway_containerype. 143 * Finds a parent container with the given struct sway_containerype.
155 */ 144 */
156// TODO rename to container_parent_of_type()
157struct sway_container *container_parent(struct sway_container *container, 145struct sway_container *container_parent(struct sway_container *container,
158 enum sway_container_type type); 146 enum sway_container_type type);
159 147
@@ -190,4 +178,6 @@ bool container_has_anscestor(struct sway_container *container,
190bool container_has_child(struct sway_container *con, 178bool container_has_child(struct sway_container *con,
191 struct sway_container *child); 179 struct sway_container *child);
192 180
181void container_create_notify(struct sway_container *container);
182
193#endif 183#endif
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h
index 8badb244..784dcc9b 100644
--- a/include/sway/tree/layout.h
+++ b/include/sway/tree/layout.h
@@ -29,42 +29,37 @@ struct sway_root {
29 29
30void layout_init(void); 30void layout_init(void);
31 31
32// TODO move to tree.h
33void container_add_child(struct sway_container *parent, 32void container_add_child(struct sway_container *parent,
34 struct sway_container *child); 33 struct sway_container *child);
35 34
36// TODO move to tree.h
37struct sway_container *container_add_sibling(struct sway_container *parent, 35struct sway_container *container_add_sibling(struct sway_container *parent,
38 struct sway_container *child); 36 struct sway_container *child);
39 37
40// TODO move to tree.h
41struct sway_container *container_remove_child(struct sway_container *child); 38struct sway_container *container_remove_child(struct sway_container *child);
42 39
43// TODO PRIVATE in tree.h 40struct sway_container *container_replace_child(struct sway_container *child,
44struct sway_container *container_reap_empty(struct sway_container *container); 41 struct sway_container *new_child);
42
43struct sway_container *container_set_layout(struct sway_container *container,
44 enum sway_container_layout layout);
45 45
46// TODO move to tree.h
47void container_move_to(struct sway_container* container, 46void container_move_to(struct sway_container* container,
48 struct sway_container* destination); 47 struct sway_container* destination);
49 48
50void container_move(struct sway_container *container, 49void container_move(struct sway_container *container,
51 enum movement_direction dir, int move_amt); 50 enum movement_direction dir, int move_amt);
52 51
53// TODO move to output.c
54enum sway_container_layout container_get_default_layout( 52enum sway_container_layout container_get_default_layout(
55 struct sway_container *output); 53 struct sway_container *con);
56 54
57// TODO move to output.c
58void container_sort_workspaces(struct sway_container *output); 55void container_sort_workspaces(struct sway_container *output);
59 56
60void arrange_windows(struct sway_container *container, 57void arrange_windows(struct sway_container *container,
61 double width, double height); 58 double width, double height);
62 59
63// TODO move to container.h
64struct sway_container *container_get_in_direction(struct sway_container 60struct sway_container *container_get_in_direction(struct sway_container
65 *container, struct sway_seat *seat, enum movement_direction dir); 61 *container, struct sway_seat *seat, enum movement_direction dir);
66 62
67// TODO move to tree.h
68struct sway_container *container_split(struct sway_container *child, 63struct sway_container *container_split(struct sway_container *child,
69 enum sway_container_layout layout); 64 enum sway_container_layout layout);
70 65
diff --git a/include/sway/tree/output.h b/include/sway/tree/output.h
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/include/sway/tree/output.h
diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h
index 4e4c3450..8d49fefb 100644
--- a/include/sway/tree/workspace.h
+++ b/include/sway/tree/workspace.h
@@ -7,8 +7,6 @@ extern char *prev_workspace_name;
7 7
8char *workspace_next_name(const char *output_name); 8char *workspace_next_name(const char *output_name);
9 9
10struct sway_container *workspace_create(const char *name);
11
12bool workspace_switch(struct sway_container *workspace); 10bool workspace_switch(struct sway_container *workspace);
13 11
14struct sway_container *workspace_by_number(const char* name); 12struct sway_container *workspace_by_number(const char* name);