diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/config.h | 2 | ||||
-rw-r--r-- | include/sway/tree/arrange.h | 6 | ||||
-rw-r--r-- | include/sway/tree/container.h | 32 | ||||
-rw-r--r-- | include/sway/tree/layout.h | 52 | ||||
-rw-r--r-- | include/sway/tree/workspace.h | 4 | ||||
-rw-r--r-- | include/util.h | 14 |
6 files changed, 50 insertions, 60 deletions
diff --git a/include/sway/config.h b/include/sway/config.h index c2eaea1b..18d10faa 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -8,8 +8,8 @@ | |||
8 | #include <xkbcommon/xkbcommon.h> | 8 | #include <xkbcommon/xkbcommon.h> |
9 | #include "list.h" | 9 | #include "list.h" |
10 | #include "swaynag.h" | 10 | #include "swaynag.h" |
11 | #include "tree/layout.h" | ||
12 | #include "tree/container.h" | 11 | #include "tree/container.h" |
12 | #include "sway/tree/root.h" | ||
13 | #include "wlr-layer-shell-unstable-v1-protocol.h" | 13 | #include "wlr-layer-shell-unstable-v1-protocol.h" |
14 | 14 | ||
15 | // TODO: Refactor this shit | 15 | // TODO: Refactor this shit |
diff --git a/include/sway/tree/arrange.h b/include/sway/tree/arrange.h index d6abcc81..346103d3 100644 --- a/include/sway/tree/arrange.h +++ b/include/sway/tree/arrange.h | |||
@@ -4,12 +4,6 @@ | |||
4 | 4 | ||
5 | struct sway_container; | 5 | struct sway_container; |
6 | 6 | ||
7 | // Remove gaps around container | ||
8 | void remove_gaps(struct sway_container *c); | ||
9 | |||
10 | // Add gaps around container | ||
11 | void add_gaps(struct sway_container *c); | ||
12 | |||
13 | /** | 7 | /** |
14 | * Arrange layout for all the children of the given container. | 8 | * Arrange layout for all the children of the given container. |
15 | */ | 9 | */ |
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 2cedb613..e4071cfe 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h | |||
@@ -53,6 +53,9 @@ struct sway_output; | |||
53 | struct sway_workspace; | 53 | struct sway_workspace; |
54 | struct sway_view; | 54 | struct sway_view; |
55 | 55 | ||
56 | enum movement_direction; | ||
57 | enum wlr_direction; | ||
58 | |||
56 | struct sway_container_state { | 59 | struct sway_container_state { |
57 | // Container/swayc properties | 60 | // Container/swayc properties |
58 | enum sway_container_layout layout; | 61 | enum sway_container_layout layout; |
@@ -335,6 +338,35 @@ struct sway_output *container_get_effective_output(struct sway_container *con); | |||
335 | 338 | ||
336 | void container_discover_outputs(struct sway_container *con); | 339 | void container_discover_outputs(struct sway_container *con); |
337 | 340 | ||
341 | void container_remove_gaps(struct sway_container *container); | ||
342 | |||
343 | void container_add_gaps(struct sway_container *container); | ||
344 | |||
338 | int container_sibling_index(const struct sway_container *child); | 345 | int container_sibling_index(const struct sway_container *child); |
339 | 346 | ||
347 | void container_handle_fullscreen_reparent(struct sway_container *con, | ||
348 | struct sway_container *old_parent); | ||
349 | |||
350 | void container_add_child(struct sway_container *parent, | ||
351 | struct sway_container *child); | ||
352 | |||
353 | void container_insert_child(struct sway_container *parent, | ||
354 | struct sway_container *child, int i); | ||
355 | |||
356 | struct sway_container *container_add_sibling(struct sway_container *parent, | ||
357 | struct sway_container *child); | ||
358 | |||
359 | struct sway_container *container_remove_child(struct sway_container *child); | ||
360 | |||
361 | struct sway_container *container_replace_child(struct sway_container *child, | ||
362 | struct sway_container *new_child); | ||
363 | |||
364 | bool sway_dir_to_wlr(enum movement_direction dir, enum wlr_direction *out); | ||
365 | |||
366 | enum sway_container_layout container_get_default_layout( | ||
367 | struct sway_container *con); | ||
368 | |||
369 | struct sway_container *container_split(struct sway_container *child, | ||
370 | enum sway_container_layout layout); | ||
371 | |||
340 | #endif | 372 | #endif |
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h deleted file mode 100644 index 5c834ad2..00000000 --- a/include/sway/tree/layout.h +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | #ifndef _SWAY_LAYOUT_H | ||
2 | #define _SWAY_LAYOUT_H | ||
3 | #include <wlr/types/wlr_output_layout.h> | ||
4 | #include <wlr/render/wlr_texture.h> | ||
5 | #include "sway/tree/container.h" | ||
6 | #include "sway/tree/root.h" | ||
7 | #include "config.h" | ||
8 | |||
9 | enum movement_direction { | ||
10 | MOVE_LEFT, | ||
11 | MOVE_RIGHT, | ||
12 | MOVE_UP, | ||
13 | MOVE_DOWN, | ||
14 | MOVE_PARENT, | ||
15 | MOVE_CHILD, | ||
16 | }; | ||
17 | |||
18 | enum wlr_edges; | ||
19 | |||
20 | struct sway_container; | ||
21 | |||
22 | void container_handle_fullscreen_reparent(struct sway_container *con, | ||
23 | struct sway_container *old_parent); | ||
24 | |||
25 | void container_add_child(struct sway_container *parent, | ||
26 | struct sway_container *child); | ||
27 | |||
28 | void container_insert_child(struct sway_container *parent, | ||
29 | struct sway_container *child, int i); | ||
30 | |||
31 | struct sway_container *container_add_sibling(struct sway_container *parent, | ||
32 | struct sway_container *child); | ||
33 | |||
34 | struct sway_container *container_remove_child(struct sway_container *child); | ||
35 | |||
36 | struct sway_container *container_replace_child(struct sway_container *child, | ||
37 | struct sway_container *new_child); | ||
38 | |||
39 | bool sway_dir_to_wlr(enum movement_direction dir, enum wlr_direction *out); | ||
40 | |||
41 | enum sway_container_layout container_get_default_layout( | ||
42 | struct sway_container *con); | ||
43 | |||
44 | struct sway_container *container_split(struct sway_container *child, | ||
45 | enum sway_container_layout layout); | ||
46 | |||
47 | void container_recursive_resize(struct sway_container *container, | ||
48 | double amount, enum wlr_edges edge); | ||
49 | |||
50 | void container_swap(struct sway_container *con1, struct sway_container *con2); | ||
51 | |||
52 | #endif | ||
diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h index efcb7c69..04325919 100644 --- a/include/sway/tree/workspace.h +++ b/include/sway/tree/workspace.h | |||
@@ -75,4 +75,8 @@ struct sway_container *workspace_wrap_children(struct sway_container *ws); | |||
75 | void workspace_add_floating(struct sway_container *workspace, | 75 | void workspace_add_floating(struct sway_container *workspace, |
76 | struct sway_container *con); | 76 | struct sway_container *con); |
77 | 77 | ||
78 | void workspace_remove_gaps(struct sway_container *ws); | ||
79 | |||
80 | void workspace_add_gaps(struct sway_container *ws); | ||
81 | |||
78 | #endif | 82 | #endif |
diff --git a/include/util.h b/include/util.h index 9277fa6e..46ed1533 100644 --- a/include/util.h +++ b/include/util.h | |||
@@ -4,9 +4,19 @@ | |||
4 | #include <stdint.h> | 4 | #include <stdint.h> |
5 | #include <stdbool.h> | 5 | #include <stdbool.h> |
6 | #include <unistd.h> | 6 | #include <unistd.h> |
7 | #include <sys/types.h> | 7 | #include <sys/types.h> |
8 | #include <wlr/types/wlr_output_layout.h> | ||
8 | #include <xkbcommon/xkbcommon.h> | 9 | #include <xkbcommon/xkbcommon.h> |
9 | 10 | ||
11 | enum movement_direction { | ||
12 | MOVE_LEFT, | ||
13 | MOVE_RIGHT, | ||
14 | MOVE_UP, | ||
15 | MOVE_DOWN, | ||
16 | MOVE_PARENT, | ||
17 | MOVE_CHILD, | ||
18 | }; | ||
19 | |||
10 | /** | 20 | /** |
11 | * Wrap i into the range [0, max[ | 21 | * Wrap i into the range [0, max[ |
12 | */ | 22 | */ |
@@ -71,4 +81,6 @@ char* resolve_path(const char* path); | |||
71 | char *b64_encode(const char* binaryData, size_t len, size_t *flen); | 81 | char *b64_encode(const char* binaryData, size_t len, size_t *flen); |
72 | unsigned char *b64_decode(const char *ascii, size_t len, size_t *flen); | 82 | unsigned char *b64_decode(const char *ascii, size_t len, size_t *flen); |
73 | 83 | ||
84 | bool sway_dir_to_wlr(enum movement_direction dir, enum wlr_direction *out); | ||
85 | |||
74 | #endif | 86 | #endif |