diff options
-rw-r--r-- | include/sway/config.h | 5 | ||||
-rw-r--r-- | include/sway/criteria.h | 4 | ||||
-rw-r--r-- | include/sway/input/input-manager.h | 4 | ||||
-rw-r--r-- | include/sway/input/seat.h | 11 | ||||
-rw-r--r-- | include/sway/ipc-json.h | 4 | ||||
-rw-r--r-- | include/sway/ipc-server.h | 2 | ||||
-rw-r--r-- | include/sway/tree/container.h | 45 | ||||
-rw-r--r-- | include/sway/tree/layout.h | 7 | ||||
-rw-r--r-- | include/sway/tree/workspace.h | 14 | ||||
-rw-r--r-- | sway/input/input-manager.c | 4 |
10 files changed, 53 insertions, 47 deletions
diff --git a/include/sway/config.h b/include/sway/config.h index 48ebba3b..e9910be4 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -356,7 +356,7 @@ struct sway_config { | |||
356 | struct input_config *input_config; | 356 | struct input_config *input_config; |
357 | struct seat_config *seat_config; | 357 | struct seat_config *seat_config; |
358 | struct sway_seat *seat; | 358 | struct sway_seat *seat; |
359 | swayc_t *current_container; | 359 | struct sway_container *current_container; |
360 | } handler_context; | 360 | } handler_context; |
361 | }; | 361 | }; |
362 | 362 | ||
@@ -416,7 +416,8 @@ void output_get_identifier(char *identifier, size_t len, | |||
416 | struct sway_output *output); | 416 | struct sway_output *output); |
417 | struct output_config *new_output_config(const char *name); | 417 | struct output_config *new_output_config(const char *name); |
418 | void merge_output_config(struct output_config *dst, struct output_config *src); | 418 | void merge_output_config(struct output_config *dst, struct output_config *src); |
419 | void apply_output_config(struct output_config *oc, swayc_t *output); | 419 | void apply_output_config(struct output_config *oc, |
420 | struct sway_container *output); | ||
420 | void free_output_config(struct output_config *oc); | 421 | void free_output_config(struct output_config *oc); |
421 | 422 | ||
422 | /** | 423 | /** |
diff --git a/include/sway/criteria.h b/include/sway/criteria.h index 431cfa3a..ec256ddb 100644 --- a/include/sway/criteria.h +++ b/include/sway/criteria.h | |||
@@ -31,12 +31,12 @@ char *extract_crit_tokens(list_t *tokens, const char *criteria); | |||
31 | 31 | ||
32 | // Returns list of criteria that match given container. These criteria have | 32 | // Returns list of criteria that match given container. These criteria have |
33 | // been set with `for_window` commands and have an associated cmdlist. | 33 | // been set with `for_window` commands and have an associated cmdlist. |
34 | list_t *criteria_for(swayc_t *cont); | 34 | list_t *criteria_for(struct sway_container *cont); |
35 | 35 | ||
36 | // Returns a list of all containers that match the given list of tokens. | 36 | // Returns a list of all containers that match the given list of tokens. |
37 | list_t *container_for_crit_tokens(list_t *tokens); | 37 | list_t *container_for_crit_tokens(list_t *tokens); |
38 | 38 | ||
39 | // Returns true if any criteria in the given list matches this container | 39 | // Returns true if any criteria in the given list matches this container |
40 | bool criteria_any(swayc_t *cont, list_t *criteria); | 40 | bool criteria_any(struct sway_container *cont, list_t *criteria); |
41 | 41 | ||
42 | #endif | 42 | #endif |
diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h index eab7dc90..c6c73dba 100644 --- a/include/sway/input/input-manager.h +++ b/include/sway/input/input-manager.h | |||
@@ -31,10 +31,10 @@ struct sway_input_manager *sway_input_manager_create( | |||
31 | struct sway_server *server); | 31 | struct sway_server *server); |
32 | 32 | ||
33 | bool sway_input_manager_has_focus(struct sway_input_manager *input, | 33 | bool sway_input_manager_has_focus(struct sway_input_manager *input, |
34 | swayc_t *container); | 34 | struct sway_container *container); |
35 | 35 | ||
36 | void sway_input_manager_set_focus(struct sway_input_manager *input, | 36 | void sway_input_manager_set_focus(struct sway_input_manager *input, |
37 | swayc_t *container); | 37 | struct sway_container *container); |
38 | 38 | ||
39 | void sway_input_manager_configure_xcursor(struct sway_input_manager *input); | 39 | void sway_input_manager_configure_xcursor(struct sway_input_manager *input); |
40 | 40 | ||
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index 1d55bec7..e43e6fd4 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h | |||
@@ -14,7 +14,7 @@ struct sway_seat_device { | |||
14 | 14 | ||
15 | struct sway_seat_container { | 15 | struct sway_seat_container { |
16 | struct sway_seat *seat; | 16 | struct sway_seat *seat; |
17 | swayc_t *container; | 17 | struct sway_container *container; |
18 | 18 | ||
19 | struct wl_list link; // sway_seat::focus_stack | 19 | struct wl_list link; // sway_seat::focus_stack |
20 | 20 | ||
@@ -54,9 +54,9 @@ void sway_seat_remove_device(struct sway_seat *seat, | |||
54 | 54 | ||
55 | void sway_seat_configure_xcursor(struct sway_seat *seat); | 55 | void sway_seat_configure_xcursor(struct sway_seat *seat); |
56 | 56 | ||
57 | void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container); | 57 | void sway_seat_set_focus(struct sway_seat *seat, struct sway_container *container); |
58 | 58 | ||
59 | swayc_t *sway_seat_get_focus(struct sway_seat *seat); | 59 | struct sway_container *sway_seat_get_focus(struct sway_seat *seat); |
60 | 60 | ||
61 | /** | 61 | /** |
62 | * Return the last container to be focused for the seat (or the most recently | 62 | * Return the last container to be focused for the seat (or the most recently |
@@ -67,9 +67,10 @@ swayc_t *sway_seat_get_focus(struct sway_seat *seat); | |||
67 | * is destroyed, or focus moves to a container with children and we need to | 67 | * is destroyed, or focus moves to a container with children and we need to |
68 | * descend into the next leaf in focus order. | 68 | * descend into the next leaf in focus order. |
69 | */ | 69 | */ |
70 | swayc_t *sway_seat_get_focus_inactive(struct sway_seat *seat, swayc_t *container); | 70 | struct sway_container *sway_seat_get_focus_inactive(struct sway_seat *seat, |
71 | struct sway_container *container); | ||
71 | 72 | ||
72 | swayc_t *sway_seat_get_focus_by_type(struct sway_seat *seat, | 73 | struct sway_container *sway_seat_get_focus_by_type(struct sway_seat *seat, |
73 | enum swayc_types type); | 74 | enum swayc_types type); |
74 | 75 | ||
75 | void sway_seat_set_config(struct sway_seat *seat, struct seat_config *seat_config); | 76 | void sway_seat_set_config(struct sway_seat *seat, struct seat_config *seat_config); |
diff --git a/include/sway/ipc-json.h b/include/sway/ipc-json.h index 76b7d45b..3d2fdc4f 100644 --- a/include/sway/ipc-json.h +++ b/include/sway/ipc-json.h | |||
@@ -6,8 +6,8 @@ | |||
6 | 6 | ||
7 | json_object *ipc_json_get_version(); | 7 | json_object *ipc_json_get_version(); |
8 | 8 | ||
9 | json_object *ipc_json_describe_container(swayc_t *c); | 9 | json_object *ipc_json_describe_container(struct sway_container *c); |
10 | json_object *ipc_json_describe_container_recursive(swayc_t *c); | 10 | json_object *ipc_json_describe_container_recursive(struct sway_container *c); |
11 | json_object *ipc_json_describe_input(struct sway_input_device *device); | 11 | json_object *ipc_json_describe_input(struct sway_input_device *device); |
12 | 12 | ||
13 | #endif | 13 | #endif |
diff --git a/include/sway/ipc-server.h b/include/sway/ipc-server.h index db690b6e..d73006dc 100644 --- a/include/sway/ipc-server.h +++ b/include/sway/ipc-server.h | |||
@@ -12,6 +12,6 @@ void ipc_terminate(void); | |||
12 | 12 | ||
13 | struct sockaddr_un *ipc_user_sockaddr(void); | 13 | struct sockaddr_un *ipc_user_sockaddr(void); |
14 | 14 | ||
15 | void ipc_event_window(swayc_t *window, const char *change); | 15 | void ipc_event_window(struct sway_container *window, const char *change); |
16 | 16 | ||
17 | #endif | 17 | #endif |
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 |
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h index 39b7fb24..8bb9e075 100644 --- a/include/sway/tree/layout.h +++ b/include/sway/tree/layout.h | |||
@@ -34,7 +34,8 @@ void init_layout(void); | |||
34 | 34 | ||
35 | void add_child(struct sway_container *parent, struct sway_container *child); | 35 | void add_child(struct sway_container *parent, struct sway_container *child); |
36 | 36 | ||
37 | swayc_t *add_sibling(swayc_t *parent, swayc_t *child); | 37 | struct sway_container *add_sibling(struct sway_container *parent, |
38 | struct sway_container *child); | ||
38 | 39 | ||
39 | struct sway_container *remove_child(struct sway_container *child); | 40 | struct sway_container *remove_child(struct sway_container *child); |
40 | 41 | ||
@@ -45,7 +46,7 @@ void sort_workspaces(struct sway_container *output); | |||
45 | void arrange_windows(struct sway_container *container, | 46 | void arrange_windows(struct sway_container *container, |
46 | double width, double height); | 47 | double width, double height); |
47 | 48 | ||
48 | swayc_t *get_swayc_in_direction(swayc_t *container, | 49 | struct sway_container *get_swayc_in_direction(struct sway_container |
49 | struct sway_seat *seat, enum movement_direction dir); | 50 | *container, struct sway_seat *seat, enum movement_direction dir); |
50 | 51 | ||
51 | #endif | 52 | #endif |
diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h index c8ce40d1..d73b29c1 100644 --- a/include/sway/tree/workspace.h +++ b/include/sway/tree/workspace.h | |||
@@ -7,20 +7,20 @@ extern char *prev_workspace_name; | |||
7 | 7 | ||
8 | char *workspace_next_name(const char *output_name); | 8 | char *workspace_next_name(const char *output_name); |
9 | 9 | ||
10 | swayc_t *workspace_create(const char *name); | 10 | struct sway_container *workspace_create(const char *name); |
11 | 11 | ||
12 | bool workspace_switch(swayc_t *workspace); | 12 | bool workspace_switch(struct sway_container *workspace); |
13 | 13 | ||
14 | struct sway_container *workspace_by_number(const char* name); | 14 | struct sway_container *workspace_by_number(const char* name); |
15 | 15 | ||
16 | swayc_t *workspace_by_name(const char*); | 16 | struct sway_container *workspace_by_name(const char*); |
17 | 17 | ||
18 | struct sway_container *workspace_output_next(swayc_t *current); | 18 | struct sway_container *workspace_output_next(struct sway_container *current); |
19 | 19 | ||
20 | struct sway_container *workspace_next(swayc_t *current); | 20 | struct sway_container *workspace_next(struct sway_container *current); |
21 | 21 | ||
22 | struct sway_container *workspace_output_prev(swayc_t *current); | 22 | struct sway_container *workspace_output_prev(struct sway_container *current); |
23 | 23 | ||
24 | struct sway_container *workspace_prev(swayc_t *current); | 24 | struct sway_container *workspace_prev(struct sway_container *current); |
25 | 25 | ||
26 | #endif | 26 | #endif |
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 27c2c72e..d421a03f 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -278,7 +278,7 @@ struct sway_input_manager *sway_input_manager_create( | |||
278 | } | 278 | } |
279 | 279 | ||
280 | bool sway_input_manager_has_focus(struct sway_input_manager *input, | 280 | bool sway_input_manager_has_focus(struct sway_input_manager *input, |
281 | swayc_t *container) { | 281 | struct sway_container *container) { |
282 | struct sway_seat *seat = NULL; | 282 | struct sway_seat *seat = NULL; |
283 | wl_list_for_each(seat, &input->seats, link) { | 283 | wl_list_for_each(seat, &input->seats, link) { |
284 | if (sway_seat_get_focus(seat) == container) { | 284 | if (sway_seat_get_focus(seat) == container) { |
@@ -290,7 +290,7 @@ bool sway_input_manager_has_focus(struct sway_input_manager *input, | |||
290 | } | 290 | } |
291 | 291 | ||
292 | void sway_input_manager_set_focus(struct sway_input_manager *input, | 292 | void sway_input_manager_set_focus(struct sway_input_manager *input, |
293 | swayc_t *container) { | 293 | struct sway_container *container) { |
294 | struct sway_seat *seat ; | 294 | struct sway_seat *seat ; |
295 | wl_list_for_each(seat, &input->seats, link) { | 295 | wl_list_for_each(seat, &input->seats, link) { |
296 | sway_seat_set_focus(seat, container); | 296 | sway_seat_set_focus(seat, container); |