aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/output.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/output.h')
-rw-r--r--include/sway/output.h59
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
11struct sway_server; 12struct sway_server;
12struct sway_container; 13struct sway_container;
13 14
15struct sway_output_state {
16 list_t *workspaces;
17 struct sway_workspace *active_workspace;
18};
19
14struct sway_output { 20struct 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
42struct sway_container *output_create(struct sway_output *sway_output); 52struct sway_output *output_create(struct wlr_output *wlr_output);
53
54void output_destroy(struct sway_output *output);
55
56void output_begin_destroy(struct sway_output *output);
43 57
44void output_destroy(struct sway_container *output); 58struct sway_output *output_from_wlr_output(struct wlr_output *output);
45 59
46void output_begin_destroy(struct sway_container *output); 60struct sway_output *output_get_in_direction(struct sway_output *reference,
61 enum movement_direction direction);
47 62
48struct sway_container *output_from_wlr_output(struct wlr_output *output); 63void output_add_workspace(struct sway_output *output,
64 struct sway_workspace *workspace);
49 65
50typedef void (*sway_surface_iterator_func_t)(struct sway_output *output, 66typedef 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);
64void output_damage_whole_container(struct sway_output *output, 80void output_damage_whole_container(struct sway_output *output,
65 struct sway_container *con); 81 struct sway_container *con);
66 82
67struct sway_container *output_by_name(const char *name); 83struct sway_output *output_by_name(const char *name);
68 84
69void output_sort_workspaces(struct sway_container *output); 85void output_sort_workspaces(struct sway_output *output);
70 86
71void output_enable(struct sway_output *output); 87struct output_config *output_find_config(struct sway_output *output);
88
89void output_enable(struct sway_output *output, struct output_config *oc);
90
91void output_disable(struct sway_output *output);
72 92
73bool output_has_opaque_overlay_layer_surface(struct sway_output *output); 93bool output_has_opaque_overlay_layer_surface(struct sway_output *output);
74 94
75struct sway_container *output_get_active_workspace(struct sway_output *output); 95struct sway_workspace *output_get_active_workspace(struct sway_output *output);
76 96
77void output_render(struct sway_output *output, struct timespec *when, 97void 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
106void output_for_each_workspace(struct sway_container *output, 126void 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
109void output_for_each_container(struct sway_container *output, 129void 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
112struct sway_container *output_find_workspace(struct sway_container *output, 132struct 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
115struct sway_container *output_find_container(struct sway_container *output, 135struct 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
138void output_get_box(struct sway_output *output, struct wlr_box *box);
139
140enum sway_container_layout output_get_default_layout(
141 struct sway_output *output);
142
143void output_add_listeners(struct sway_output *output);
144
118#endif 145#endif