diff options
Diffstat (limited to 'include/container.h')
-rw-r--r-- | include/container.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/container.h b/include/container.h index 186ee8b6..79e023fe 100644 --- a/include/container.h +++ b/include/container.h | |||
@@ -11,10 +11,11 @@ enum swayc_types{ | |||
11 | C_WORKSPACE, | 11 | C_WORKSPACE, |
12 | C_CONTAINER, | 12 | C_CONTAINER, |
13 | C_VIEW, | 13 | C_VIEW, |
14 | //Keep last | 14 | // Keep last |
15 | C_TYPES, | 15 | C_TYPES, |
16 | }; | 16 | }; |
17 | 17 | ||
18 | |||
18 | enum swayc_layouts{ | 19 | enum swayc_layouts{ |
19 | L_NONE, | 20 | L_NONE, |
20 | L_HORIZ, | 21 | L_HORIZ, |
@@ -22,7 +23,7 @@ enum swayc_layouts{ | |||
22 | L_STACKED, | 23 | L_STACKED, |
23 | L_TABBED, | 24 | L_TABBED, |
24 | L_FLOATING, | 25 | L_FLOATING, |
25 | //Keep last | 26 | // Keep last |
26 | L_LAYOUTS, | 27 | L_LAYOUTS, |
27 | }; | 28 | }; |
28 | 29 | ||
@@ -44,10 +45,10 @@ struct sway_container { | |||
44 | bool is_floating; | 45 | bool is_floating; |
45 | bool is_focused; | 46 | bool is_focused; |
46 | 47 | ||
47 | int weight; | ||
48 | |||
49 | char *name; | 48 | char *name; |
50 | 49 | ||
50 | int gaps; | ||
51 | |||
51 | list_t *children; | 52 | list_t *children; |
52 | list_t *floating; | 53 | list_t *floating; |
53 | 54 | ||
@@ -55,6 +56,7 @@ struct sway_container { | |||
55 | struct sway_container *focused; | 56 | struct sway_container *focused; |
56 | }; | 57 | }; |
57 | 58 | ||
59 | // Container Creation | ||
58 | 60 | ||
59 | swayc_t *new_output(wlc_handle handle); | 61 | swayc_t *new_output(wlc_handle handle); |
60 | swayc_t *new_workspace(swayc_t *output, const char *name); | 62 | swayc_t *new_workspace(swayc_t *output, const char *name); |
@@ -65,17 +67,29 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle); | |||
65 | // Creates view as a new floating view which is in the active workspace | 67 | // Creates view as a new floating view which is in the active workspace |
66 | swayc_t *new_floating_view(wlc_handle handle); | 68 | swayc_t *new_floating_view(wlc_handle handle); |
67 | 69 | ||
70 | // Container Destroying | ||
68 | 71 | ||
69 | swayc_t *destroy_output(swayc_t *output); | 72 | swayc_t *destroy_output(swayc_t *output); |
70 | // Destroys workspace if empty and returns parent pointer, else returns NULL | 73 | // Destroys workspace if empty and returns parent pointer, else returns NULL |
71 | swayc_t *destroy_workspace(swayc_t *workspace); | 74 | swayc_t *destroy_workspace(swayc_t *workspace); |
75 | // Destroyes container and all parent container if they are empty, returns | ||
76 | // topmost non-empty parent. returns NULL otherwise | ||
72 | swayc_t *destroy_container(swayc_t *container); | 77 | swayc_t *destroy_container(swayc_t *container); |
78 | // Destroys view and all empty parent containers. return topmost non-empty | ||
79 | // parent | ||
73 | swayc_t *destroy_view(swayc_t *view); | 80 | swayc_t *destroy_view(swayc_t *view); |
74 | 81 | ||
82 | // Container Lookup | ||
83 | |||
84 | swayc_t *swayc_parent_by_type(swayc_t *container, enum swayc_types); | ||
85 | swayc_t *swayc_parent_by_layout(swayc_t *container, enum swayc_layouts); | ||
86 | |||
75 | swayc_t *find_container(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data); | 87 | swayc_t *find_container(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data); |
76 | void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *); | 88 | void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *); |
77 | 89 | ||
90 | |||
78 | // Mappings | 91 | // Mappings |
79 | void set_view_visibility(swayc_t *view, void *data); | 92 | void set_view_visibility(swayc_t *view, void *data); |
93 | void reset_gaps(swayc_t *view, void *data); | ||
80 | 94 | ||
81 | #endif | 95 | #endif |