diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-01-30 23:09:21 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-01-30 23:09:21 -0500 |
commit | b28602aa7425cf435150e6008624429737e037d3 (patch) | |
tree | dafe7d23c48457299f33803832f6b89e09a915ce /include | |
parent | Remove include/sway/old/ (diff) | |
download | sway-b28602aa7425cf435150e6008624429737e037d3.tar.gz sway-b28602aa7425cf435150e6008624429737e037d3.tar.zst sway-b28602aa7425cf435150e6008624429737e037d3.zip |
Implement workspaces
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/container.h | 19 | ||||
-rw-r--r-- | include/sway/input/input-manager.h | 4 | ||||
-rw-r--r-- | include/sway/workspace.h | 14 |
3 files changed, 35 insertions, 2 deletions
diff --git a/include/sway/container.h b/include/sway/container.h index a99e2694..0c66932d 100644 --- a/include/sway/container.h +++ b/include/sway/container.h | |||
@@ -11,6 +11,7 @@ typedef struct sway_container swayc_t; | |||
11 | extern swayc_t root_container; | 11 | extern swayc_t root_container; |
12 | 12 | ||
13 | struct sway_view; | 13 | struct sway_view; |
14 | struct sway_seat; | ||
14 | 15 | ||
15 | /** | 16 | /** |
16 | * Different kinds of containers. | 17 | * Different kinds of containers. |
@@ -140,11 +141,25 @@ swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view); | |||
140 | swayc_t *destroy_output(swayc_t *output); | 141 | swayc_t *destroy_output(swayc_t *output); |
141 | swayc_t *destroy_view(swayc_t *view); | 142 | swayc_t *destroy_view(swayc_t *view); |
142 | 143 | ||
144 | swayc_t *next_view_sibling(struct sway_seat *seat); | ||
145 | |||
146 | /** | ||
147 | * Finds a container based on test criteria. Returns the first container that | ||
148 | * passes the test. | ||
149 | */ | ||
150 | swayc_t *swayc_by_test(swayc_t *container, | ||
151 | bool (*test)(swayc_t *view, void *data), void *data); | ||
152 | /** | ||
153 | * Finds a parent container with the given swayc_type. | ||
154 | */ | ||
143 | swayc_t *swayc_parent_by_type(swayc_t *container, enum swayc_types type); | 155 | swayc_t *swayc_parent_by_type(swayc_t *container, enum swayc_types type); |
156 | /** | ||
157 | * Maps a container's children over a function. | ||
158 | */ | ||
159 | void container_map(swayc_t *container, | ||
160 | void (*f)(swayc_t *view, void *data), void *data); | ||
144 | 161 | ||
145 | swayc_t *swayc_at(swayc_t *parent, double lx, double ly, | 162 | swayc_t *swayc_at(swayc_t *parent, double lx, double ly, |
146 | struct wlr_surface **surface, double *sx, double *sy); | 163 | struct wlr_surface **surface, double *sx, double *sy); |
147 | 164 | ||
148 | void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data); | ||
149 | |||
150 | #endif | 165 | #endif |
diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h index 63806b8e..66ace262 100644 --- a/include/sway/input/input-manager.h +++ b/include/sway/input/input-manager.h | |||
@@ -48,4 +48,8 @@ struct sway_seat *sway_input_manager_get_default_seat( | |||
48 | 48 | ||
49 | struct sway_seat *input_manager_get_seat(struct sway_input_manager *input, | 49 | struct sway_seat *input_manager_get_seat(struct sway_input_manager *input, |
50 | const char *seat_name); | 50 | const char *seat_name); |
51 | |||
52 | /** Gets the last seat the user interacted with */ | ||
53 | struct sway_seat *input_manager_current_seat(struct sway_input_manager *input); | ||
54 | |||
51 | #endif | 55 | #endif |
diff --git a/include/sway/workspace.h b/include/sway/workspace.h index 04b2ea4e..30bbdaa8 100644 --- a/include/sway/workspace.h +++ b/include/sway/workspace.h | |||
@@ -1,6 +1,20 @@ | |||
1 | #ifndef _SWAY_WORKSPACE_H | 1 | #ifndef _SWAY_WORKSPACE_H |
2 | #define _SWAY_WORKSPACE_H | 2 | #define _SWAY_WORKSPACE_H |
3 | 3 | ||
4 | struct sway_container; | ||
5 | |||
6 | extern char *prev_workspace_name; | ||
7 | |||
4 | char *workspace_next_name(const char *output_name); | 8 | char *workspace_next_name(const char *output_name); |
9 | swayc_t *workspace_create(const char *name); | ||
10 | bool workspace_switch(swayc_t *workspace); | ||
11 | |||
12 | struct sway_container *workspace_by_number(const char* name); | ||
13 | swayc_t *workspace_by_name(const char*); | ||
14 | |||
15 | struct sway_container *workspace_output_next(struct sway_container *current); | ||
16 | struct sway_container *workspace_next(struct sway_container *current); | ||
17 | struct sway_container *workspace_output_prev(struct sway_container *current); | ||
18 | struct sway_container *workspace_prev(struct sway_container *current); | ||
5 | 19 | ||
6 | #endif | 20 | #endif |