summaryrefslogtreecommitdiffstats
path: root/include/sway
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-03-29 16:17:55 -0400
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-03-29 16:40:40 -0400
commitb90099b4b7df8068446c658ab99b58ff83648954 (patch)
treea822ef3605ce98f9d8633c24f6927bb11effbdcc /include/sway
parentremove swayc_t typedef (diff)
downloadsway-b90099b4b7df8068446c658ab99b58ff83648954.tar.gz
sway-b90099b4b7df8068446c658ab99b58ff83648954.tar.zst
sway-b90099b4b7df8068446c658ab99b58ff83648954.zip
rename container functions
Diffstat (limited to 'include/sway')
-rw-r--r--include/sway/config.h8
-rw-r--r--include/sway/input/seat.h2
-rw-r--r--include/sway/tree/container.h70
-rw-r--r--include/sway/tree/layout.h2
4 files changed, 45 insertions, 37 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index e9910be4..7fdd0be0 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -299,8 +299,8 @@ struct sway_config {
299 char *floating_scroll_down_cmd; 299 char *floating_scroll_down_cmd;
300 char *floating_scroll_left_cmd; 300 char *floating_scroll_left_cmd;
301 char *floating_scroll_right_cmd; 301 char *floating_scroll_right_cmd;
302 enum swayc_layouts default_orientation; 302 enum sway_container_layout default_orientation;
303 enum swayc_layouts default_layout; 303 enum sway_container_layout default_layout;
304 char *font; 304 char *font;
305 int font_height; 305 int font_height;
306 306
@@ -324,8 +324,8 @@ struct sway_config {
324 list_t *config_chain; 324 list_t *config_chain;
325 const char *current_config; 325 const char *current_config;
326 326
327 enum swayc_border_types border; 327 enum sway_container_border border;
328 enum swayc_border_types floating_border; 328 enum sway_container_border floating_border;
329 int border_thickness; 329 int border_thickness;
330 int floating_border_thickness; 330 int floating_border_thickness;
331 enum edge_border_types hide_edge_borders; 331 enum edge_border_types hide_edge_borders;
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index e43e6fd4..496bfd5d 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -71,7 +71,7 @@ struct sway_container *sway_seat_get_focus_inactive(struct sway_seat *seat,
71 struct sway_container *container); 71 struct sway_container *container);
72 72
73struct sway_container *sway_seat_get_focus_by_type(struct sway_seat *seat, 73struct sway_container *sway_seat_get_focus_by_type(struct sway_seat *seat,
74 enum swayc_types type); 74 enum sway_container_type type);
75 75
76void 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);
77 77
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index 5def5e71..0dfed455 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -17,7 +17,7 @@ struct sway_seat;
17 * This enum is in order. A container will never be inside of a container below 17 * This enum is in order. A container will never be inside of a container below
18 * it on this list. 18 * it on this list.
19 */ 19 */
20enum swayc_types { 20enum sway_container_type {
21 C_ROOT, 21 C_ROOT,
22 C_OUTPUT, 22 C_OUTPUT,
23 C_WORKSPACE, 23 C_WORKSPACE,
@@ -27,7 +27,7 @@ enum swayc_types {
27 C_TYPES, 27 C_TYPES,
28}; 28};
29 29
30enum swayc_layouts { 30enum sway_container_layout {
31 L_NONE, 31 L_NONE,
32 L_HORIZ, 32 L_HORIZ,
33 L_VERT, 33 L_VERT,
@@ -39,7 +39,7 @@ enum swayc_layouts {
39 L_LAYOUTS, 39 L_LAYOUTS,
40}; 40};
41 41
42enum swayc_border_types { 42enum sway_container_border {
43 B_NONE, 43 B_NONE,
44 B_PIXEL, 44 B_PIXEL,
45 B_NORMAL, 45 B_NORMAL,
@@ -65,10 +65,10 @@ struct sway_container {
65 65
66 char *name; 66 char *name;
67 67
68 enum swayc_types type; 68 enum sway_container_type type;
69 enum swayc_layouts layout; 69 enum sway_container_layout layout;
70 enum swayc_layouts prev_layout; 70 enum sway_container_layout prev_layout;
71 enum swayc_layouts workspace_layout; 71 enum sway_container_layout workspace_layout;
72 72
73 // TODO convert to layout coordinates 73 // TODO convert to layout coordinates
74 double x, y; 74 double x, y;
@@ -87,53 +87,61 @@ struct sway_container {
87 } events; 87 } events;
88}; 88};
89 89
90void swayc_descendants_of_type(struct sway_container *root,
91 enum swayc_types type,
92 void (*func)(struct sway_container *item, void *data), void *data);
93
94// TODO only one container create function and pass the type? 90// TODO only one container create function and pass the type?
95struct sway_container *new_output(struct sway_output *sway_output); 91struct sway_container *sway_container_output_create(
92 struct sway_output *sway_output);
93
94struct sway_container *sway_container_workspace_create(
95 struct sway_container *output, const char *name);
96 96
97struct sway_container *new_workspace(struct sway_container *output, 97struct sway_container *sway_container_view_create(
98 const char *name); 98 struct sway_container *sibling, struct sway_view *sway_view);
99 99
100struct sway_container *new_view(struct sway_container *sibling, 100struct sway_container *sway_container_output_destroy(
101 struct sway_view *sway_view); 101 struct sway_container *output);
102 102
103struct sway_container *destroy_output(struct sway_container *output); 103struct sway_container *sway_container_view_destroy(struct sway_container *view);
104struct sway_container *destroy_view(struct sway_container *view);
105 104
105struct sway_container *sway_container_set_layout(
106 struct sway_container *container, enum sway_container_layout layout);
107
108void sway_container_descendents(struct sway_container *root,
109 enum sway_container_type type,
110 void (*func)(struct sway_container *item, void *data), void *data);
111
112// XXX: what is this?
106struct sway_container *next_view_sibling(struct sway_seat *seat); 113struct sway_container *next_view_sibling(struct sway_seat *seat);
107 114
108/** 115/**
109 * Finds a container based on test criteria. Returns the first container that 116 * Finds a container based on test criteria. Returns the first container that
110 * passes the test. 117 * passes the test.
111 */ 118 */
112struct sway_container *swayc_by_test(struct sway_container *container, 119struct sway_container *sway_container_find(struct sway_container *container,
113 bool (*test)(struct sway_container *view, void *data), void *data); 120 bool (*test)(struct sway_container *view, void *data), void *data);
114 121
115/** 122/**
116 * Finds a parent container with the given swayc_type. 123 * Finds a parent container with the given struct sway_containerype.
117 */ 124 */
118struct sway_container *swayc_parent_by_type(struct sway_container *container, 125struct sway_container *sway_container_parent(struct sway_container *container,
119 enum swayc_types type); 126 enum sway_container_type type);
120 127
121/** 128/**
122 * Maps a container's children over a function. 129 * Run a function for each child.
123 */ 130 */
124void container_map(struct sway_container *container, 131void sway_container_for_each(struct sway_container *container,
125 void (*f)(struct sway_container *view, void *data), void *data); 132 void (*f)(struct sway_container *view, void *data), void *data);
126 133
127struct sway_container *swayc_at(struct sway_container *parent, double lx, 134/**
128 double ly, struct wlr_surface **surface, double *sx, double *sy); 135 * Find a container at the given coordinates.
136 */
137struct sway_container *sway_container_at(struct sway_container *parent,
138 double lx, double ly, struct wlr_surface **surface,
139 double *sx, double *sy);
129 140
130/** 141/**
131 * Apply the function for each child of the container breadth first. 142 * Apply the function for each child of the container breadth first.
132 */ 143 */
133void container_for_each_bfs(struct sway_container *con, void (*f)(struct 144void sway_container_for_each_bfs(struct sway_container *container,
134 sway_container *con, void *data), void *data); 145 void (*f)(struct sway_container *container, void *data), void *data);
135
136struct sway_container *swayc_change_layout(struct sway_container *container,
137 enum swayc_layouts layout);
138 146
139#endif 147#endif
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h
index 8bb9e075..f73b3880 100644
--- a/include/sway/tree/layout.h
+++ b/include/sway/tree/layout.h
@@ -39,7 +39,7 @@ struct sway_container *add_sibling(struct sway_container *parent,
39 39
40struct sway_container *remove_child(struct sway_container *child); 40struct sway_container *remove_child(struct sway_container *child);
41 41
42enum swayc_layouts default_layout(struct sway_container *output); 42enum sway_container_layout default_layout(struct sway_container *output);
43 43
44void sort_workspaces(struct sway_container *output); 44void sort_workspaces(struct sway_container *output);
45 45