diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-08-16 11:02:56 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-08-16 11:02:56 -0400 |
commit | 7f8ebb7d0dcb687574554b877a0e84f48718df37 (patch) | |
tree | 9a58f9276059d3c88cb3a92d8229a911b33b0faf /include/container.h | |
parent | Add split [h|v|horizontal|vertical] command (diff) | |
download | sway-7f8ebb7d0dcb687574554b877a0e84f48718df37.tar.gz sway-7f8ebb7d0dcb687574554b877a0e84f48718df37.tar.zst sway-7f8ebb7d0dcb687574554b877a0e84f48718df37.zip |
Move headers to include/
Diffstat (limited to 'include/container.h')
-rw-r--r-- | include/container.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/include/container.h b/include/container.h new file mode 100644 index 00000000..a54e016a --- /dev/null +++ b/include/container.h | |||
@@ -0,0 +1,71 @@ | |||
1 | #ifndef _SWAY_CONTAINER_H | ||
2 | #define _SWAY_CONTAINER_H | ||
3 | #include <wlc/wlc.h> | ||
4 | typedef struct sway_container swayc_t; | ||
5 | |||
6 | #include "layout.h" | ||
7 | |||
8 | enum swayc_types{ | ||
9 | C_ROOT, | ||
10 | C_OUTPUT, | ||
11 | C_WORKSPACE, | ||
12 | C_CONTAINER, | ||
13 | C_VIEW, | ||
14 | //Keep last | ||
15 | C_TYPES, | ||
16 | }; | ||
17 | |||
18 | enum swayc_layouts{ | ||
19 | L_NONE, | ||
20 | L_HORIZ, | ||
21 | L_VERT, | ||
22 | L_STACKED, | ||
23 | L_TABBED, | ||
24 | L_FLOATING, | ||
25 | //Keep last | ||
26 | L_LAYOUTS, | ||
27 | }; | ||
28 | |||
29 | struct sway_container { | ||
30 | wlc_handle handle; | ||
31 | |||
32 | enum swayc_types type; | ||
33 | |||
34 | enum swayc_layouts layout; | ||
35 | |||
36 | // Not including borders or margins | ||
37 | int width, height; | ||
38 | |||
39 | int x, y; | ||
40 | |||
41 | bool visible; | ||
42 | |||
43 | int weight; | ||
44 | |||
45 | char *name; | ||
46 | |||
47 | list_t *children; | ||
48 | |||
49 | struct sway_container *parent; | ||
50 | struct sway_container *focused; | ||
51 | }; | ||
52 | |||
53 | |||
54 | swayc_t *new_output(wlc_handle handle); | ||
55 | swayc_t *new_workspace(swayc_t * output, const char *name); | ||
56 | //Creates container Around child (parent child) -> (parent (container child)) | ||
57 | swayc_t *new_container(swayc_t *child, enum swayc_layouts layout); | ||
58 | //Creates view as a sibling of current focused container, or as child of a workspace | ||
59 | swayc_t *new_view(swayc_t *sibling, wlc_handle handle); | ||
60 | |||
61 | |||
62 | swayc_t *destroy_output(swayc_t *output); | ||
63 | //destroys workspace if empty and returns parent pointer, else returns NULL | ||
64 | swayc_t *destroy_workspace(swayc_t *workspace); | ||
65 | swayc_t *destroy_container(swayc_t *container); | ||
66 | swayc_t *destroy_view(swayc_t *view); | ||
67 | |||
68 | swayc_t *find_container(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data); | ||
69 | void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *); | ||
70 | |||
71 | #endif | ||