summaryrefslogtreecommitdiffstats
path: root/include/sway/tree/root.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/tree/root.h')
-rw-r--r--include/sway/tree/root.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/include/sway/tree/root.h b/include/sway/tree/root.h
index ec6516c9..a2d464f9 100644
--- a/include/sway/tree/root.h
+++ b/include/sway/tree/root.h
@@ -5,12 +5,14 @@
5#include <wlr/types/wlr_output_layout.h> 5#include <wlr/types/wlr_output_layout.h>
6#include <wlr/render/wlr_texture.h> 6#include <wlr/render/wlr_texture.h>
7#include "sway/tree/container.h" 7#include "sway/tree/container.h"
8#include "sway/tree/node.h"
8#include "config.h" 9#include "config.h"
9#include "list.h" 10#include "list.h"
10 11
11extern struct sway_container root_container; 12extern struct sway_root *root;
12 13
13struct sway_root { 14struct sway_root {
15 struct sway_node node;
14 struct wlr_output_layout *output_layout; 16 struct wlr_output_layout *output_layout;
15 17
16 struct wl_listener output_layout_change; 18 struct wl_listener output_layout_change;
@@ -24,17 +26,21 @@ struct sway_root {
24 // Includes disabled outputs 26 // Includes disabled outputs
25 struct wl_list all_outputs; // sway_output::link 27 struct wl_list all_outputs; // sway_output::link
26 28
29 double x, y;
30 double width, height;
31
32 list_t *outputs; // struct sway_output
27 list_t *scratchpad; // struct sway_container 33 list_t *scratchpad; // struct sway_container
28 list_t *saved_workspaces; // For when there's no connected outputs 34 list_t *saved_workspaces; // For when there's no connected outputs
29 35
30 struct { 36 struct {
31 struct wl_signal new_container; 37 struct wl_signal new_node;
32 } events; 38 } events;
33}; 39};
34 40
35void root_create(void); 41struct sway_root *root_create(void);
36 42
37void root_destroy(void); 43void root_destroy(struct sway_root *root);
38 44
39/** 45/**
40 * Move a container to the scratchpad. 46 * Move a container to the scratchpad.
@@ -56,23 +62,25 @@ void root_scratchpad_show(struct sway_container *con);
56 */ 62 */
57void root_scratchpad_hide(struct sway_container *con); 63void root_scratchpad_hide(struct sway_container *con);
58 64
59struct sway_container *root_workspace_for_pid(pid_t pid); 65struct sway_workspace *root_workspace_for_pid(pid_t pid);
60 66
61void root_record_workspace_pid(pid_t pid); 67void root_record_workspace_pid(pid_t pid);
62 68
63void root_for_each_workspace(void (*f)(struct sway_container *con, void *data), 69void root_for_each_workspace(void (*f)(struct sway_workspace *ws, void *data),
64 void *data); 70 void *data);
65 71
66void root_for_each_container(void (*f)(struct sway_container *con, void *data), 72void root_for_each_container(void (*f)(struct sway_container *con, void *data),
67 void *data); 73 void *data);
68 74
69struct sway_container *root_find_output( 75struct sway_output *root_find_output(
70 bool (*test)(struct sway_container *con, void *data), void *data); 76 bool (*test)(struct sway_output *output, void *data), void *data);
71 77
72struct sway_container *root_find_workspace( 78struct sway_workspace *root_find_workspace(
73 bool (*test)(struct sway_container *con, void *data), void *data); 79 bool (*test)(struct sway_workspace *ws, void *data), void *data);
74 80
75struct sway_container *root_find_container( 81struct sway_container *root_find_container(
76 bool (*test)(struct sway_container *con, void *data), void *data); 82 bool (*test)(struct sway_container *con, void *data), void *data);
77 83
84void root_get_box(struct sway_root *root, struct wlr_box *box);
85
78#endif 86#endif