summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <RyanDwyer@users.noreply.github.com>2018-08-25 13:06:04 +1000
committerLibravatar GitHub <noreply@github.com>2018-08-25 13:06:04 +1000
commit4b9ad9c2382db9b2a9a224e9ebc60b6298843aa9 (patch)
treef1ed7e866d4e34f5ef9b8f72ec8095369619aaa7 /include
parentcommands: implement move absolute (diff)
parentMerge pull request #2499 from RyanDwyer/refactor-destroy-functions (diff)
downloadsway-4b9ad9c2382db9b2a9a224e9ebc60b6298843aa9.tar.gz
sway-4b9ad9c2382db9b2a9a224e9ebc60b6298843aa9.tar.zst
sway-4b9ad9c2382db9b2a9a224e9ebc60b6298843aa9.zip
Merge branch 'master' into commands
Diffstat (limited to 'include')
-rw-r--r--include/sway/output.h6
-rw-r--r--include/sway/tree/container.h30
-rw-r--r--include/sway/tree/layout.h10
-rw-r--r--include/sway/tree/root.h1
-rw-r--r--include/sway/tree/view.h4
-rw-r--r--include/sway/tree/workspace.h9
-rw-r--r--include/swaynag/swaynag.h2
7 files changed, 24 insertions, 38 deletions
diff --git a/include/sway/output.h b/include/sway/output.h
index d0d034b3..098540fb 100644
--- a/include/sway/output.h
+++ b/include/sway/output.h
@@ -39,6 +39,12 @@ struct sway_output {
39 } events; 39 } events;
40}; 40};
41 41
42struct sway_container *output_create(struct sway_output *sway_output);
43
44void output_destroy(struct sway_container *output);
45
46void output_begin_destroy(struct sway_container *output);
47
42typedef void (*sway_surface_iterator_func_t)(struct sway_output *output, 48typedef void (*sway_surface_iterator_func_t)(struct sway_output *output,
43 struct wlr_surface *surface, struct wlr_box *box, float rotation, 49 struct wlr_surface *surface, struct wlr_box *box, float rotation,
44 void *user_data); 50 void *user_data);
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index cd886cd0..2cb23d3c 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -176,27 +176,6 @@ struct sway_container *container_create(enum sway_container_type type);
176 176
177const char *container_type_to_str(enum sway_container_type type); 177const char *container_type_to_str(enum sway_container_type type);
178 178
179struct sway_container *output_create(struct sway_output *sway_output);
180
181/**
182 * Create a new container container. A container container can be a a child of
183 * a workspace container or another container container.
184 */
185struct sway_container *container_container_create();
186
187/**
188 * Create a new output. Outputs are children of the root container and have no
189 * order in the tree structure.
190 */
191struct sway_container *output_create(struct sway_output *sway_output);
192
193/**
194 * Create a new workspace container. Workspaces are children of an output
195 * container and are ordered alphabetically by name.
196 */
197struct sway_container *workspace_create(struct sway_container *output,
198 const char *name);
199
200/* 179/*
201 * Create a new view container. A view can be a child of a workspace container 180 * Create a new view container. A view can be a child of a workspace container
202 * or a container container and are rendered in the order and structure of 181 * or a container container and are rendered in the order and structure of
@@ -205,9 +184,9 @@ struct sway_container *workspace_create(struct sway_container *output,
205struct sway_container *container_view_create( 184struct sway_container *container_view_create(
206 struct sway_container *sibling, struct sway_view *sway_view); 185 struct sway_container *sibling, struct sway_view *sway_view);
207 186
208void container_free(struct sway_container *cont); 187void container_destroy(struct sway_container *con);
209 188
210struct sway_container *container_destroy(struct sway_container *container); 189void container_begin_destroy(struct sway_container *con);
211 190
212struct sway_container *container_close(struct sway_container *container); 191struct sway_container *container_close(struct sway_container *container);
213 192
@@ -255,10 +234,7 @@ void container_update_textures_recursive(struct sway_container *con);
255 234
256void container_damage_whole(struct sway_container *container); 235void container_damage_whole(struct sway_container *container);
257 236
258bool container_reap_empty(struct sway_container *con); 237struct sway_container *container_reap_empty(struct sway_container *con);
259
260struct sway_container *container_reap_empty_recursive(
261 struct sway_container *con);
262 238
263struct sway_container *container_flatten(struct sway_container *container); 239struct sway_container *container_flatten(struct sway_container *container);
264 240
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h
index 5b803dfe..519189d9 100644
--- a/include/sway/tree/layout.h
+++ b/include/sway/tree/layout.h
@@ -15,13 +15,7 @@ enum movement_direction {
15 MOVE_CHILD, 15 MOVE_CHILD,
16}; 16};
17 17
18enum resize_edge { 18enum wlr_edges;
19 RESIZE_EDGE_NONE = 0,
20 RESIZE_EDGE_LEFT = 1,
21 RESIZE_EDGE_RIGHT = 2,
22 RESIZE_EDGE_TOP = 4,
23 RESIZE_EDGE_BOTTOM = 8,
24};
25 19
26struct sway_container; 20struct sway_container;
27 21
@@ -52,7 +46,7 @@ struct sway_container *container_split(struct sway_container *child,
52 enum sway_container_layout layout); 46 enum sway_container_layout layout);
53 47
54void container_recursive_resize(struct sway_container *container, 48void container_recursive_resize(struct sway_container *container,
55 double amount, enum resize_edge edge); 49 double amount, enum wlr_edges edge);
56 50
57void container_swap(struct sway_container *con1, struct sway_container *con2); 51void container_swap(struct sway_container *con1, struct sway_container *con2);
58 52
diff --git a/include/sway/tree/root.h b/include/sway/tree/root.h
index d1f04a96..ee4bd836 100644
--- a/include/sway/tree/root.h
+++ b/include/sway/tree/root.h
@@ -24,6 +24,7 @@ struct sway_root {
24 struct wl_list outputs; // sway_output::link 24 struct wl_list outputs; // sway_output::link
25 25
26 list_t *scratchpad; // struct sway_container 26 list_t *scratchpad; // struct sway_container
27 list_t *saved_workspaces; // For when there's no connected outputs
27 28
28 struct { 29 struct {
29 struct wl_signal new_container; 30 struct wl_signal new_container;
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index 5fdecc2b..f73ce571 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -284,10 +284,10 @@ void view_for_each_popup(struct sway_view *view,
284void view_init(struct sway_view *view, enum sway_view_type type, 284void view_init(struct sway_view *view, enum sway_view_type type,
285 const struct sway_view_impl *impl); 285 const struct sway_view_impl *impl);
286 286
287void view_free(struct sway_view *view);
288
289void view_destroy(struct sway_view *view); 287void view_destroy(struct sway_view *view);
290 288
289void view_begin_destroy(struct sway_view *view);
290
291void view_map(struct sway_view *view, struct wlr_surface *wlr_surface); 291void view_map(struct sway_view *view, struct wlr_surface *wlr_surface);
292 292
293void view_unmap(struct sway_view *view); 293void view_unmap(struct sway_view *view);
diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h
index 35c91017..efcb7c69 100644
--- a/include/sway/tree/workspace.h
+++ b/include/sway/tree/workspace.h
@@ -18,6 +18,15 @@ extern char *prev_workspace_name;
18 18
19struct sway_container *workspace_get_initial_output(const char *name); 19struct sway_container *workspace_get_initial_output(const char *name);
20 20
21struct sway_container *workspace_create(struct sway_container *output,
22 const char *name);
23
24void workspace_destroy(struct sway_container *workspace);
25
26void workspace_begin_destroy(struct sway_container *workspace);
27
28void workspace_consider_destroy(struct sway_container *ws);
29
21char *workspace_next_name(const char *output_name); 30char *workspace_next_name(const char *output_name);
22 31
23bool workspace_switch(struct sway_container *workspace, 32bool workspace_switch(struct sway_container *workspace,
diff --git a/include/swaynag/swaynag.h b/include/swaynag/swaynag.h
index 1bf8b640..a32d1503 100644
--- a/include/swaynag/swaynag.h
+++ b/include/swaynag/swaynag.h
@@ -58,7 +58,7 @@ struct swaynag_details {
58 int offset; 58 int offset;
59 int visible_lines; 59 int visible_lines;
60 int total_lines; 60 int total_lines;
61 struct swaynag_button button_details; 61 struct swaynag_button *button_details;
62 struct swaynag_button button_up; 62 struct swaynag_button button_up;
63 struct swaynag_button button_down; 63 struct swaynag_button button_down;
64}; 64};