summaryrefslogtreecommitdiffstats
path: root/include/sway
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-03-29 14:31:10 -0400
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-03-29 14:31:10 -0400
commit83d09cf5945ba10a703dc5cc977a6d2814f0fd64 (patch)
treeda290b9033e91b295fd01fcf84ca4e74c9a37c1a /include/sway
parentmove tree includes to their own directory (diff)
downloadsway-83d09cf5945ba10a703dc5cc977a6d2814f0fd64.tar.gz
sway-83d09cf5945ba10a703dc5cc977a6d2814f0fd64.tar.zst
sway-83d09cf5945ba10a703dc5cc977a6d2814f0fd64.zip
remove swayc_t typedef
Diffstat (limited to 'include/sway')
-rw-r--r--include/sway/config.h5
-rw-r--r--include/sway/criteria.h4
-rw-r--r--include/sway/input/input-manager.h4
-rw-r--r--include/sway/input/seat.h11
-rw-r--r--include/sway/ipc-json.h4
-rw-r--r--include/sway/ipc-server.h2
-rw-r--r--include/sway/tree/container.h45
-rw-r--r--include/sway/tree/layout.h7
-rw-r--r--include/sway/tree/workspace.h14
9 files changed, 51 insertions, 45 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);
417struct output_config *new_output_config(const char *name); 417struct output_config *new_output_config(const char *name);
418void merge_output_config(struct output_config *dst, struct output_config *src); 418void merge_output_config(struct output_config *dst, struct output_config *src);
419void apply_output_config(struct output_config *oc, swayc_t *output); 419void apply_output_config(struct output_config *oc,
420 struct sway_container *output);
420void free_output_config(struct output_config *oc); 421void 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.
34list_t *criteria_for(swayc_t *cont); 34list_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.
37list_t *container_for_crit_tokens(list_t *tokens); 37list_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
40bool criteria_any(swayc_t *cont, list_t *criteria); 40bool 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
33bool sway_input_manager_has_focus(struct sway_input_manager *input, 33bool sway_input_manager_has_focus(struct sway_input_manager *input,
34 swayc_t *container); 34 struct sway_container *container);
35 35
36void sway_input_manager_set_focus(struct sway_input_manager *input, 36void sway_input_manager_set_focus(struct sway_input_manager *input,
37 swayc_t *container); 37 struct sway_container *container);
38 38
39void sway_input_manager_configure_xcursor(struct sway_input_manager *input); 39void 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
15struct sway_seat_container { 15struct 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
55void sway_seat_configure_xcursor(struct sway_seat *seat); 55void sway_seat_configure_xcursor(struct sway_seat *seat);
56 56
57void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container); 57void sway_seat_set_focus(struct sway_seat *seat, struct sway_container *container);
58 58
59swayc_t *sway_seat_get_focus(struct sway_seat *seat); 59struct 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 */
70swayc_t *sway_seat_get_focus_inactive(struct sway_seat *seat, swayc_t *container); 70struct sway_container *sway_seat_get_focus_inactive(struct sway_seat *seat,
71 struct sway_container *container);
71 72
72swayc_t *sway_seat_get_focus_by_type(struct sway_seat *seat, 73struct sway_container *sway_seat_get_focus_by_type(struct sway_seat *seat,
73 enum swayc_types type); 74 enum swayc_types type);
74 75
75void sway_seat_set_config(struct sway_seat *seat, struct seat_config *seat_config); 76void 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
7json_object *ipc_json_get_version(); 7json_object *ipc_json_get_version();
8 8
9json_object *ipc_json_describe_container(swayc_t *c); 9json_object *ipc_json_describe_container(struct sway_container *c);
10json_object *ipc_json_describe_container_recursive(swayc_t *c); 10json_object *ipc_json_describe_container_recursive(struct sway_container *c);
11json_object *ipc_json_describe_input(struct sway_input_device *device); 11json_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
13struct sockaddr_un *ipc_user_sockaddr(void); 13struct sockaddr_un *ipc_user_sockaddr(void);
14 14
15void ipc_event_window(swayc_t *window, const char *change); 15void 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
9typedef struct sway_container swayc_t; 9extern struct sway_container root_container;
10
11extern swayc_t root_container;
12 10
13struct sway_view; 11struct sway_view;
14struct sway_seat; 12struct sway_seat;
@@ -89,48 +87,53 @@ struct sway_container {
89 } events; 87 } events;
90}; 88};
91 89
92void swayc_descendants_of_type(swayc_t *root, enum swayc_types type, 90void 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?
96swayc_t *new_output(struct sway_output *sway_output); 95struct sway_container *new_output(struct sway_output *sway_output);
97 96
98swayc_t *new_workspace(swayc_t *output, const char *name); 97struct sway_container *new_workspace(struct sway_container *output,
98 const char *name);
99 99
100swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view); 100struct sway_container *new_view(struct sway_container *sibling,
101 struct sway_view *sway_view);
101 102
102swayc_t *destroy_output(swayc_t *output); 103struct sway_container *destroy_output(struct sway_container *output);
103swayc_t *destroy_view(swayc_t *view); 104struct sway_container *destroy_view(struct sway_container *view);
104 105
105swayc_t *next_view_sibling(struct sway_seat *seat); 106struct 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 */
111swayc_t *swayc_by_test(swayc_t *container, 112struct 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 */
117swayc_t *swayc_parent_by_type(swayc_t *container, enum swayc_types type); 118struct 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 */
122void container_map(swayc_t *container, 124void 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
125swayc_t *swayc_at(swayc_t *parent, double lx, double ly, 127struct 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 */
131void container_for_each_bfs(swayc_t *con, void (*f)(swayc_t *con, void *data), 133void container_for_each_bfs(struct sway_container *con, void (*f)(struct
132 void *data); 134 sway_container *con, void *data), void *data);
133 135
134swayc_t *swayc_change_layout(swayc_t *container, enum swayc_layouts layout); 136struct 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
35void add_child(struct sway_container *parent, struct sway_container *child); 35void add_child(struct sway_container *parent, struct sway_container *child);
36 36
37swayc_t *add_sibling(swayc_t *parent, swayc_t *child); 37struct sway_container *add_sibling(struct sway_container *parent,
38 struct sway_container *child);
38 39
39struct sway_container *remove_child(struct sway_container *child); 40struct sway_container *remove_child(struct sway_container *child);
40 41
@@ -45,7 +46,7 @@ void sort_workspaces(struct sway_container *output);
45void arrange_windows(struct sway_container *container, 46void arrange_windows(struct sway_container *container,
46 double width, double height); 47 double width, double height);
47 48
48swayc_t *get_swayc_in_direction(swayc_t *container, 49struct 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
8char *workspace_next_name(const char *output_name); 8char *workspace_next_name(const char *output_name);
9 9
10swayc_t *workspace_create(const char *name); 10struct sway_container *workspace_create(const char *name);
11 11
12bool workspace_switch(swayc_t *workspace); 12bool workspace_switch(struct sway_container *workspace);
13 13
14struct sway_container *workspace_by_number(const char* name); 14struct sway_container *workspace_by_number(const char* name);
15 15
16swayc_t *workspace_by_name(const char*); 16struct sway_container *workspace_by_name(const char*);
17 17
18struct sway_container *workspace_output_next(swayc_t *current); 18struct sway_container *workspace_output_next(struct sway_container *current);
19 19
20struct sway_container *workspace_next(swayc_t *current); 20struct sway_container *workspace_next(struct sway_container *current);
21 21
22struct sway_container *workspace_output_prev(swayc_t *current); 22struct sway_container *workspace_output_prev(struct sway_container *current);
23 23
24struct sway_container *workspace_prev(swayc_t *current); 24struct sway_container *workspace_prev(struct sway_container *current);
25 25
26#endif 26#endif