aboutsummaryrefslogtreecommitdiffstats
path: root/include/container.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/container.h')
-rw-r--r--include/container.h71
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>
4typedef struct sway_container swayc_t;
5
6#include "layout.h"
7
8enum 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
18enum 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
29struct 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
54swayc_t *new_output(wlc_handle handle);
55swayc_t *new_workspace(swayc_t * output, const char *name);
56//Creates container Around child (parent child) -> (parent (container child))
57swayc_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
59swayc_t *new_view(swayc_t *sibling, wlc_handle handle);
60
61
62swayc_t *destroy_output(swayc_t *output);
63//destroys workspace if empty and returns parent pointer, else returns NULL
64swayc_t *destroy_workspace(swayc_t *workspace);
65swayc_t *destroy_container(swayc_t *container);
66swayc_t *destroy_view(swayc_t *view);
67
68swayc_t *find_container(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data);
69void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *);
70
71#endif