diff options
Diffstat (limited to 'include/sway/tree/layout.h')
-rw-r--r-- | include/sway/tree/layout.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h new file mode 100644 index 00000000..49ae00e4 --- /dev/null +++ b/include/sway/tree/layout.h | |||
@@ -0,0 +1,78 @@ | |||
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 | |||
7 | enum movement_direction { | ||
8 | MOVE_LEFT, | ||
9 | MOVE_RIGHT, | ||
10 | MOVE_UP, | ||
11 | MOVE_DOWN, | ||
12 | MOVE_PARENT, | ||
13 | MOVE_CHILD, | ||
14 | }; | ||
15 | |||
16 | enum resize_edge { | ||
17 | RESIZE_EDGE_LEFT, | ||
18 | RESIZE_EDGE_RIGHT, | ||
19 | RESIZE_EDGE_TOP, | ||
20 | RESIZE_EDGE_BOTTOM, | ||
21 | }; | ||
22 | |||
23 | struct sway_container; | ||
24 | |||
25 | struct sway_root { | ||
26 | struct wlr_output_layout *output_layout; | ||
27 | |||
28 | struct wl_listener output_layout_change; | ||
29 | |||
30 | struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link | ||
31 | |||
32 | struct wlr_texture *debug_tree; | ||
33 | |||
34 | struct { | ||
35 | struct wl_signal new_container; | ||
36 | } events; | ||
37 | }; | ||
38 | |||
39 | void layout_init(void); | ||
40 | |||
41 | void container_add_child(struct sway_container *parent, | ||
42 | struct sway_container *child); | ||
43 | |||
44 | struct sway_container *container_add_sibling(struct sway_container *parent, | ||
45 | struct sway_container *child); | ||
46 | |||
47 | struct sway_container *container_remove_child(struct sway_container *child); | ||
48 | |||
49 | struct sway_container *container_replace_child(struct sway_container *child, | ||
50 | struct sway_container *new_child); | ||
51 | |||
52 | struct sway_container *container_set_layout(struct sway_container *container, | ||
53 | enum sway_container_layout layout); | ||
54 | |||
55 | void container_move_to(struct sway_container* container, | ||
56 | struct sway_container* destination); | ||
57 | |||
58 | void container_move(struct sway_container *container, | ||
59 | enum movement_direction dir, int move_amt); | ||
60 | |||
61 | enum sway_container_layout container_get_default_layout( | ||
62 | struct sway_container *con); | ||
63 | |||
64 | void container_sort_workspaces(struct sway_container *output); | ||
65 | |||
66 | void arrange_windows(struct sway_container *container, | ||
67 | double width, double height); | ||
68 | |||
69 | struct sway_container *container_get_in_direction(struct sway_container | ||
70 | *container, struct sway_seat *seat, enum movement_direction dir); | ||
71 | |||
72 | struct sway_container *container_split(struct sway_container *child, | ||
73 | enum sway_container_layout layout); | ||
74 | |||
75 | void container_recursive_resize(struct sway_container *container, | ||
76 | double amount, enum resize_edge edge); | ||
77 | |||
78 | #endif | ||