diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-01-14 16:11:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-14 16:11:48 -0500 |
commit | 81102e8eacbf72ad0c5e81c935a957a8824a0922 (patch) | |
tree | f8b51dd1f5214966ad30b0bd7b561afa70dcb4dc /include/sway | |
parent | Merge pull request #1048 from dkess/proper-output-wrapping (diff) | |
parent | Move awesome config to contrib/ (diff) | |
download | sway-81102e8eacbf72ad0c5e81c935a957a8824a0922.tar.gz sway-81102e8eacbf72ad0c5e81c935a957a8824a0922.tar.zst sway-81102e8eacbf72ad0c5e81c935a957a8824a0922.zip |
Merge pull request #1024 from willakat/master
Add Awesome/Monad style automatic layouts to Sway
Diffstat (limited to 'include/sway')
-rw-r--r-- | include/sway/container.h | 20 | ||||
-rw-r--r-- | include/sway/focus.h | 6 | ||||
-rw-r--r-- | include/sway/layout.h | 7 |
3 files changed, 31 insertions, 2 deletions
diff --git a/include/sway/container.h b/include/sway/container.h index 2bedd136..ff65628c 100644 --- a/include/sway/container.h +++ b/include/sway/container.h | |||
@@ -37,6 +37,16 @@ enum swayc_layouts { | |||
37 | L_STACKED, | 37 | L_STACKED, |
38 | L_TABBED, | 38 | L_TABBED, |
39 | L_FLOATING, /**< A psuedo-container, removed from the tree, to hold floating windows */ | 39 | L_FLOATING, /**< A psuedo-container, removed from the tree, to hold floating windows */ |
40 | |||
41 | /* Awesome/Monad style auto layouts */ | ||
42 | L_AUTO_LEFT, | ||
43 | L_AUTO_RIGHT, | ||
44 | L_AUTO_TOP, | ||
45 | L_AUTO_BOTTOM, | ||
46 | |||
47 | L_AUTO_FIRST = L_AUTO_LEFT, | ||
48 | L_AUTO_LAST = L_AUTO_BOTTOM, | ||
49 | |||
40 | // Keep last | 50 | // Keep last |
41 | L_LAYOUTS, | 51 | L_LAYOUTS, |
42 | }; | 52 | }; |
@@ -144,6 +154,16 @@ struct sway_container { | |||
144 | struct wlc_geometry title_bar_geometry; | 154 | struct wlc_geometry title_bar_geometry; |
145 | struct wlc_geometry actual_geometry; | 155 | struct wlc_geometry actual_geometry; |
146 | int border_thickness; | 156 | int border_thickness; |
157 | |||
158 | /** | ||
159 | * Number of master views in auto layouts. | ||
160 | */ | ||
161 | size_t nb_master; | ||
162 | |||
163 | /** | ||
164 | * Number of slave groups (e.g. columns) in auto layouts. | ||
165 | */ | ||
166 | size_t nb_slave_groups; | ||
147 | }; | 167 | }; |
148 | 168 | ||
149 | enum visibility_mask { | 169 | enum visibility_mask { |
diff --git a/include/sway/focus.h b/include/sway/focus.h index b532edc2..652cdccc 100644 --- a/include/sway/focus.h +++ b/include/sway/focus.h | |||
@@ -6,7 +6,10 @@ enum movement_direction { | |||
6 | MOVE_UP, | 6 | MOVE_UP, |
7 | MOVE_DOWN, | 7 | MOVE_DOWN, |
8 | MOVE_PARENT, | 8 | MOVE_PARENT, |
9 | MOVE_CHILD | 9 | MOVE_CHILD, |
10 | MOVE_NEXT, | ||
11 | MOVE_PREV, | ||
12 | MOVE_FIRST | ||
10 | }; | 13 | }; |
11 | 14 | ||
12 | #include "container.h" | 15 | #include "container.h" |
@@ -40,4 +43,3 @@ extern bool suspend_workspace_cleanup; | |||
40 | bool move_focus(enum movement_direction direction); | 43 | bool move_focus(enum movement_direction direction); |
41 | 44 | ||
42 | #endif | 45 | #endif |
43 | |||
diff --git a/include/sway/layout.h b/include/sway/layout.h index b982365c..fbedcdb3 100644 --- a/include/sway/layout.h +++ b/include/sway/layout.h | |||
@@ -75,4 +75,11 @@ void swayc_log(log_importance_t verbosity, swayc_t *cont, const char* format, .. | |||
75 | */ | 75 | */ |
76 | enum swayc_layouts default_layout(swayc_t *output); | 76 | enum swayc_layouts default_layout(swayc_t *output); |
77 | 77 | ||
78 | bool is_auto_layout(enum swayc_layouts layout); | ||
79 | int auto_group_start_index(const swayc_t *container, int index); | ||
80 | int auto_group_end_index(const swayc_t *container, int index); | ||
81 | size_t auto_group_count(const swayc_t *container); | ||
82 | size_t auto_group_index(const swayc_t *container, int index); | ||
83 | bool auto_group_bounds(const swayc_t *container, size_t group_index, int *start, int *end); | ||
84 | |||
78 | #endif | 85 | #endif |