aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/tree
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/tree
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/tree')
-rw-r--r--include/sway/tree/container.h45
-rw-r--r--include/sway/tree/layout.h7
-rw-r--r--include/sway/tree/workspace.h14
3 files changed, 35 insertions, 31 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
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