diff options
Diffstat (limited to 'include/container.h')
-rw-r--r-- | include/container.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/container.h b/include/container.h index 63529e44..79e023fe 100644 --- a/include/container.h +++ b/include/container.h | |||
@@ -11,7 +11,7 @@ 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 | ||
@@ -23,7 +23,7 @@ enum swayc_layouts{ | |||
23 | L_STACKED, | 23 | L_STACKED, |
24 | L_TABBED, | 24 | L_TABBED, |
25 | L_FLOATING, | 25 | L_FLOATING, |
26 | //Keep last | 26 | // Keep last |
27 | L_LAYOUTS, | 27 | L_LAYOUTS, |
28 | }; | 28 | }; |
29 | 29 | ||
@@ -45,10 +45,10 @@ struct sway_container { | |||
45 | bool is_floating; | 45 | bool is_floating; |
46 | bool is_focused; | 46 | bool is_focused; |
47 | 47 | ||
48 | int weight; | ||
49 | |||
50 | char *name; | 48 | char *name; |
51 | 49 | ||
50 | int gaps; | ||
51 | |||
52 | list_t *children; | 52 | list_t *children; |
53 | list_t *floating; | 53 | list_t *floating; |
54 | 54 | ||
@@ -56,6 +56,7 @@ struct sway_container { | |||
56 | struct sway_container *focused; | 56 | struct sway_container *focused; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | // Container Creation | ||
59 | 60 | ||
60 | swayc_t *new_output(wlc_handle handle); | 61 | swayc_t *new_output(wlc_handle handle); |
61 | swayc_t *new_workspace(swayc_t *output, const char *name); | 62 | swayc_t *new_workspace(swayc_t *output, const char *name); |
@@ -66,18 +67,29 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle); | |||
66 | // 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 |
67 | swayc_t *new_floating_view(wlc_handle handle); | 68 | swayc_t *new_floating_view(wlc_handle handle); |
68 | 69 | ||
70 | // Container Destroying | ||
69 | 71 | ||
70 | swayc_t *destroy_output(swayc_t *output); | 72 | swayc_t *destroy_output(swayc_t *output); |
71 | // Destroys workspace if empty and returns parent pointer, else returns NULL | 73 | // Destroys workspace if empty and returns parent pointer, else returns NULL |
72 | 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 | ||
73 | 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 | ||
74 | swayc_t *destroy_view(swayc_t *view); | 80 | swayc_t *destroy_view(swayc_t *view); |
75 | 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 | |||
76 | 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); |
77 | void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *); | 88 | void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *); |
78 | 89 | ||
79 | 90 | ||
80 | // Mappings | 91 | // Mappings |
81 | 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); | ||
82 | 94 | ||
83 | #endif | 95 | #endif |