diff options
Diffstat (limited to 'include/sway/output.h')
-rw-r--r-- | include/sway/output.h | 59 |
1 files changed, 43 insertions, 16 deletions
diff --git a/include/sway/output.h b/include/sway/output.h index 651fdfe7..540ed8a0 100644 --- a/include/sway/output.h +++ b/include/sway/output.h | |||
@@ -6,14 +6,20 @@ | |||
6 | #include <wlr/types/wlr_box.h> | 6 | #include <wlr/types/wlr_box.h> |
7 | #include <wlr/types/wlr_output.h> | 7 | #include <wlr/types/wlr_output.h> |
8 | #include "config.h" | 8 | #include "config.h" |
9 | #include "sway/tree/node.h" | ||
9 | #include "sway/tree/view.h" | 10 | #include "sway/tree/view.h" |
10 | 11 | ||
11 | struct sway_server; | 12 | struct sway_server; |
12 | struct sway_container; | 13 | struct sway_container; |
13 | 14 | ||
15 | struct sway_output_state { | ||
16 | list_t *workspaces; | ||
17 | struct sway_workspace *active_workspace; | ||
18 | }; | ||
19 | |||
14 | struct sway_output { | 20 | struct sway_output { |
21 | struct sway_node node; | ||
15 | struct wlr_output *wlr_output; | 22 | struct wlr_output *wlr_output; |
16 | struct sway_container *swayc; | ||
17 | struct sway_server *server; | 23 | struct sway_server *server; |
18 | 24 | ||
19 | struct wl_list layers[4]; // sway_layer_surface::link | 25 | struct wl_list layers[4]; // sway_layer_surface::link |
@@ -22,11 +28,15 @@ struct sway_output { | |||
22 | struct timespec last_frame; | 28 | struct timespec last_frame; |
23 | struct wlr_output_damage *damage; | 29 | struct wlr_output_damage *damage; |
24 | 30 | ||
31 | bool enabled; | ||
32 | list_t *workspaces; | ||
33 | |||
34 | struct sway_output_state current; | ||
35 | |||
25 | struct wl_listener destroy; | 36 | struct wl_listener destroy; |
26 | struct wl_listener mode; | 37 | struct wl_listener mode; |
27 | struct wl_listener transform; | 38 | struct wl_listener transform; |
28 | struct wl_listener scale; | 39 | struct wl_listener scale; |
29 | |||
30 | struct wl_listener damage_destroy; | 40 | struct wl_listener damage_destroy; |
31 | struct wl_listener damage_frame; | 41 | struct wl_listener damage_frame; |
32 | 42 | ||
@@ -39,13 +49,19 @@ struct sway_output { | |||
39 | } events; | 49 | } events; |
40 | }; | 50 | }; |
41 | 51 | ||
42 | struct sway_container *output_create(struct sway_output *sway_output); | 52 | struct sway_output *output_create(struct wlr_output *wlr_output); |
53 | |||
54 | void output_destroy(struct sway_output *output); | ||
55 | |||
56 | void output_begin_destroy(struct sway_output *output); | ||
43 | 57 | ||
44 | void output_destroy(struct sway_container *output); | 58 | struct sway_output *output_from_wlr_output(struct wlr_output *output); |
45 | 59 | ||
46 | void output_begin_destroy(struct sway_container *output); | 60 | struct sway_output *output_get_in_direction(struct sway_output *reference, |
61 | enum movement_direction direction); | ||
47 | 62 | ||
48 | struct sway_container *output_from_wlr_output(struct wlr_output *output); | 63 | void output_add_workspace(struct sway_output *output, |
64 | struct sway_workspace *workspace); | ||
49 | 65 | ||
50 | typedef void (*sway_surface_iterator_func_t)(struct sway_output *output, | 66 | typedef void (*sway_surface_iterator_func_t)(struct sway_output *output, |
51 | struct wlr_surface *surface, struct wlr_box *box, float rotation, | 67 | struct wlr_surface *surface, struct wlr_box *box, float rotation, |
@@ -64,15 +80,19 @@ void output_damage_box(struct sway_output *output, struct wlr_box *box); | |||
64 | void output_damage_whole_container(struct sway_output *output, | 80 | void output_damage_whole_container(struct sway_output *output, |
65 | struct sway_container *con); | 81 | struct sway_container *con); |
66 | 82 | ||
67 | struct sway_container *output_by_name(const char *name); | 83 | struct sway_output *output_by_name(const char *name); |
68 | 84 | ||
69 | void output_sort_workspaces(struct sway_container *output); | 85 | void output_sort_workspaces(struct sway_output *output); |
70 | 86 | ||
71 | void output_enable(struct sway_output *output); | 87 | struct output_config *output_find_config(struct sway_output *output); |
88 | |||
89 | void output_enable(struct sway_output *output, struct output_config *oc); | ||
90 | |||
91 | void output_disable(struct sway_output *output); | ||
72 | 92 | ||
73 | bool output_has_opaque_overlay_layer_surface(struct sway_output *output); | 93 | bool output_has_opaque_overlay_layer_surface(struct sway_output *output); |
74 | 94 | ||
75 | struct sway_container *output_get_active_workspace(struct sway_output *output); | 95 | struct sway_workspace *output_get_active_workspace(struct sway_output *output); |
76 | 96 | ||
77 | void output_render(struct sway_output *output, struct timespec *when, | 97 | void output_render(struct sway_output *output, struct timespec *when, |
78 | pixman_region32_t *damage); | 98 | pixman_region32_t *damage); |
@@ -103,16 +123,23 @@ void output_drag_icons_for_each_surface(struct sway_output *output, | |||
103 | struct wl_list *drag_icons, sway_surface_iterator_func_t iterator, | 123 | struct wl_list *drag_icons, sway_surface_iterator_func_t iterator, |
104 | void *user_data); | 124 | void *user_data); |
105 | 125 | ||
106 | void output_for_each_workspace(struct sway_container *output, | 126 | void output_for_each_workspace(struct sway_output *output, |
107 | void (*f)(struct sway_container *con, void *data), void *data); | 127 | void (*f)(struct sway_workspace *ws, void *data), void *data); |
108 | 128 | ||
109 | void output_for_each_container(struct sway_container *output, | 129 | void output_for_each_container(struct sway_output *output, |
110 | void (*f)(struct sway_container *con, void *data), void *data); | 130 | void (*f)(struct sway_container *con, void *data), void *data); |
111 | 131 | ||
112 | struct sway_container *output_find_workspace(struct sway_container *output, | 132 | struct sway_workspace *output_find_workspace(struct sway_output *output, |
113 | bool (*test)(struct sway_container *con, void *data), void *data); | 133 | bool (*test)(struct sway_workspace *ws, void *data), void *data); |
114 | 134 | ||
115 | struct sway_container *output_find_container(struct sway_container *output, | 135 | struct sway_container *output_find_container(struct sway_output *output, |
116 | bool (*test)(struct sway_container *con, void *data), void *data); | 136 | bool (*test)(struct sway_container *con, void *data), void *data); |
117 | 137 | ||
138 | void output_get_box(struct sway_output *output, struct wlr_box *box); | ||
139 | |||
140 | enum sway_container_layout output_get_default_layout( | ||
141 | struct sway_output *output); | ||
142 | |||
143 | void output_add_listeners(struct sway_output *output); | ||
144 | |||
118 | #endif | 145 | #endif |