aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/tree/container.h
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/container.h
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/container.h')
-rw-r--r--include/sway/tree/container.h45
1 files changed, 24 insertions, 21 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