diff options
Diffstat (limited to 'include/sway/tree/container.h')
-rw-r--r-- | include/sway/tree/container.h | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 5a2ae349..5def5e71 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h | |||
@@ -6,9 +6,7 @@ | |||
6 | #include <wlr/types/wlr_surface.h> | 6 | #include <wlr/types/wlr_surface.h> |
7 | #include "list.h" | 7 | #include "list.h" |
8 | 8 | ||
9 | typedef struct sway_container swayc_t; | 9 | extern struct sway_container root_container; |
10 | |||
11 | extern swayc_t root_container; | ||
12 | 10 | ||
13 | struct sway_view; | 11 | struct sway_view; |
14 | struct sway_seat; | 12 | struct sway_seat; |
@@ -89,48 +87,53 @@ struct sway_container { | |||
89 | } events; | 87 | } events; |
90 | }; | 88 | }; |
91 | 89 | ||
92 | void swayc_descendants_of_type(swayc_t *root, enum swayc_types type, | 90 | void swayc_descendants_of_type(struct sway_container *root, |
93 | void (*func)(swayc_t *item, void *data), void *data); | 91 | enum swayc_types type, |
92 | void (*func)(struct sway_container *item, void *data), void *data); | ||
94 | 93 | ||
95 | // TODO only one container create function and pass the type? | 94 | // TODO only one container create function and pass the type? |
96 | swayc_t *new_output(struct sway_output *sway_output); | 95 | struct sway_container *new_output(struct sway_output *sway_output); |
97 | 96 | ||
98 | swayc_t *new_workspace(swayc_t *output, const char *name); | 97 | struct sway_container *new_workspace(struct sway_container *output, |
98 | const char *name); | ||
99 | 99 | ||
100 | swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view); | 100 | struct sway_container *new_view(struct sway_container *sibling, |
101 | struct sway_view *sway_view); | ||
101 | 102 | ||
102 | swayc_t *destroy_output(swayc_t *output); | 103 | struct sway_container *destroy_output(struct sway_container *output); |
103 | swayc_t *destroy_view(swayc_t *view); | 104 | struct sway_container *destroy_view(struct sway_container *view); |
104 | 105 | ||
105 | swayc_t *next_view_sibling(struct sway_seat *seat); | 106 | struct sway_container *next_view_sibling(struct sway_seat *seat); |
106 | 107 | ||
107 | /** | 108 | /** |
108 | * Finds a container based on test criteria. Returns the first container that | 109 | * Finds a container based on test criteria. Returns the first container that |
109 | * passes the test. | 110 | * passes the test. |
110 | */ | 111 | */ |
111 | swayc_t *swayc_by_test(swayc_t *container, | 112 | struct sway_container *swayc_by_test(struct sway_container *container, |
112 | bool (*test)(swayc_t *view, void *data), void *data); | 113 | bool (*test)(struct sway_container *view, void *data), void *data); |
113 | 114 | ||
114 | /** | 115 | /** |
115 | * Finds a parent container with the given swayc_type. | 116 | * Finds a parent container with the given swayc_type. |
116 | */ | 117 | */ |
117 | swayc_t *swayc_parent_by_type(swayc_t *container, enum swayc_types type); | 118 | struct sway_container *swayc_parent_by_type(struct sway_container *container, |
119 | enum swayc_types type); | ||
118 | 120 | ||
119 | /** | 121 | /** |
120 | * Maps a container's children over a function. | 122 | * Maps a container's children over a function. |
121 | */ | 123 | */ |
122 | void container_map(swayc_t *container, | 124 | void container_map(struct sway_container *container, |
123 | void (*f)(swayc_t *view, void *data), void *data); | 125 | void (*f)(struct sway_container *view, void *data), void *data); |
124 | 126 | ||
125 | swayc_t *swayc_at(swayc_t *parent, double lx, double ly, | 127 | struct sway_container *swayc_at(struct sway_container *parent, double lx, |
126 | struct wlr_surface **surface, double *sx, double *sy); | 128 | double ly, struct wlr_surface **surface, double *sx, double *sy); |
127 | 129 | ||
128 | /** | 130 | /** |
129 | * Apply the function for each child of the container breadth first. | 131 | * Apply the function for each child of the container breadth first. |
130 | */ | 132 | */ |
131 | void container_for_each_bfs(swayc_t *con, void (*f)(swayc_t *con, void *data), | 133 | void container_for_each_bfs(struct sway_container *con, void (*f)(struct |
132 | void *data); | 134 | sway_container *con, void *data), void *data); |
133 | 135 | ||
134 | swayc_t *swayc_change_layout(swayc_t *container, enum swayc_layouts layout); | 136 | struct sway_container *swayc_change_layout(struct sway_container *container, |
137 | enum swayc_layouts layout); | ||
135 | 138 | ||
136 | #endif | 139 | #endif |