summaryrefslogtreecommitdiffstats
path: root/include/container.h
diff options
context:
space:
mode:
authorLibravatar Half-Shot <half-shot@molrams.com>2015-08-20 21:32:08 +0100
committerLibravatar Half-Shot <half-shot@molrams.com>2015-08-20 21:32:08 +0100
commit5a9ba261bca4ca709ec7a14d2019b55d9ce06994 (patch)
treefe1a924cf8055b2b722566db6ab98295dcf08ce7 /include/container.h
parentBasic left right move command implemented. (diff)
parentMerge pull request #104 from minus7/ipc-get-messages (diff)
downloadsway-5a9ba261bca4ca709ec7a14d2019b55d9ce06994.tar.gz
sway-5a9ba261bca4ca709ec7a14d2019b55d9ce06994.tar.zst
sway-5a9ba261bca4ca709ec7a14d2019b55d9ce06994.zip
Merge branch 'master' of https://github.com/SirCmpwn/sway
Diffstat (limited to 'include/container.h')
-rw-r--r--include/container.h20
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
60swayc_t *new_output(wlc_handle handle); 61swayc_t *new_output(wlc_handle handle);
61swayc_t *new_workspace(swayc_t *output, const char *name); 62swayc_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
67swayc_t *new_floating_view(wlc_handle handle); 68swayc_t *new_floating_view(wlc_handle handle);
68 69
70// Container Destroying
69 71
70swayc_t *destroy_output(swayc_t *output); 72swayc_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
72swayc_t *destroy_workspace(swayc_t *workspace); 74swayc_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
73swayc_t *destroy_container(swayc_t *container); 77swayc_t *destroy_container(swayc_t *container);
78// Destroys view and all empty parent containers. return topmost non-empty
79// parent
74swayc_t *destroy_view(swayc_t *view); 80swayc_t *destroy_view(swayc_t *view);
75 81
82// Container Lookup
83
84swayc_t *swayc_parent_by_type(swayc_t *container, enum swayc_types);
85swayc_t *swayc_parent_by_layout(swayc_t *container, enum swayc_layouts);
86
76swayc_t *find_container(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data); 87swayc_t *find_container(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data);
77void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *); 88void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *);
78 89
79 90
80// Mappings 91// Mappings
81void set_view_visibility(swayc_t *view, void *data); 92void set_view_visibility(swayc_t *view, void *data);
93void reset_gaps(swayc_t *view, void *data);
82 94
83#endif 95#endif