summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <RedSoxFan@users.noreply.github.com>2018-05-14 00:28:21 -0400
committerLibravatar GitHub <noreply@github.com>2018-05-14 00:28:21 -0400
commit34b864fb1752fde2528db6aa86d53c23412a8f43 (patch)
treeb387f1e1eb8f8fc16faeb4bf24a0ab6e8ba5787c /include
parentFix titles and detect edges for hide_edge_borders (diff)
parentActually fix swayidle (diff)
downloadsway-34b864fb1752fde2528db6aa86d53c23412a8f43.tar.gz
sway-34b864fb1752fde2528db6aa86d53c23412a8f43.tar.zst
sway-34b864fb1752fde2528db6aa86d53c23412a8f43.zip
Merge branch 'master' into fix-1975
Diffstat (limited to 'include')
-rw-r--r--include/pango.h11
-rw-r--r--include/sway/config.h7
-rw-r--r--include/sway/server.h6
-rw-r--r--include/sway/tree/view.h27
4 files changed, 51 insertions, 0 deletions
diff --git a/include/pango.h b/include/pango.h
index f6325f28..d8263f9e 100644
--- a/include/pango.h
+++ b/include/pango.h
@@ -6,6 +6,17 @@
6#include <cairo/cairo.h> 6#include <cairo/cairo.h>
7#include <pango/pangocairo.h> 7#include <pango/pangocairo.h>
8 8
9/* Utility function which escape characters a & < > ' ".
10 *
11 * If the dest parameter is NULL, then the function returns the length of
12 * of the escaped src string. The dest_length doesn't matter.
13 *
14 * If the dest parameter is not NULL then the fuction escapes the src string
15 * an puts the escaped string in dest and returns the lenght of the escaped string.
16 * The dest_length parameter is the size of dest array. If the size of dest is not
17 * enough, then the function returns -1.
18 */
19int escape_markup_text(const char *src, char *dest, int dest_length);
9PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, 20PangoLayout *get_pango_layout(cairo_t *cairo, const char *font,
10 const char *text, int32_t scale, bool markup); 21 const char *text, int32_t scale, bool markup);
11void get_text_size(cairo_t *cairo, const char *font, int *width, int *height, 22void get_text_size(cairo_t *cairo, const char *font, int *width, int *height,
diff --git a/include/sway/config.h b/include/sway/config.h
index b20458cb..f77c3b50 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -107,6 +107,12 @@ struct seat_config {
107 list_t *attachments; // list of seat_attachment configs 107 list_t *attachments; // list of seat_attachment configs
108}; 108};
109 109
110enum config_dpms {
111 DPMS_IGNORE,
112 DPMS_ON,
113 DPMS_OFF
114};
115
110/** 116/**
111 * Size and position configuration for a particular output. 117 * Size and position configuration for a particular output.
112 * 118 *
@@ -123,6 +129,7 @@ struct output_config {
123 129
124 char *background; 130 char *background;
125 char *background_option; 131 char *background_option;
132 enum config_dpms dpms_state;
126}; 133};
127 134
128/** 135/**
diff --git a/include/sway/server.h b/include/sway/server.h
index 296fbf22..d04ea896 100644
--- a/include/sway/server.h
+++ b/include/sway/server.h
@@ -8,6 +8,7 @@
8#include <wlr/types/wlr_data_device.h> 8#include <wlr/types/wlr_data_device.h>
9#include <wlr/types/wlr_layer_shell.h> 9#include <wlr/types/wlr_layer_shell.h>
10#include <wlr/types/wlr_xdg_shell_v6.h> 10#include <wlr/types/wlr_xdg_shell_v6.h>
11#include <wlr/types/wlr_xdg_shell.h>
11#include <wlr/render/wlr_renderer.h> 12#include <wlr/render/wlr_renderer.h>
12// TODO WLR: make Xwayland optional 13// TODO WLR: make Xwayland optional
13#include <wlr/xwayland.h> 14#include <wlr/xwayland.h>
@@ -21,6 +22,7 @@ struct sway_server {
21 22
22 struct wlr_compositor *compositor; 23 struct wlr_compositor *compositor;
23 struct wlr_data_device_manager *data_device_manager; 24 struct wlr_data_device_manager *data_device_manager;
25 struct wlr_idle *idle;
24 26
25 struct sway_input_manager *input; 27 struct sway_input_manager *input;
26 28
@@ -32,6 +34,9 @@ struct sway_server {
32 struct wlr_xdg_shell_v6 *xdg_shell_v6; 34 struct wlr_xdg_shell_v6 *xdg_shell_v6;
33 struct wl_listener xdg_shell_v6_surface; 35 struct wl_listener xdg_shell_v6_surface;
34 36
37 struct wlr_xdg_shell *xdg_shell;
38 struct wl_listener xdg_shell_surface;
39
35 struct wlr_xwayland *xwayland; 40 struct wlr_xwayland *xwayland;
36 struct wlr_xcursor_manager *xcursor_manager; 41 struct wlr_xcursor_manager *xcursor_manager;
37 struct wl_listener xwayland_surface; 42 struct wl_listener xwayland_surface;
@@ -51,6 +56,7 @@ void handle_new_output(struct wl_listener *listener, void *data);
51 56
52void handle_layer_shell_surface(struct wl_listener *listener, void *data); 57void handle_layer_shell_surface(struct wl_listener *listener, void *data);
53void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data); 58void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data);
59void handle_xdg_shell_surface(struct wl_listener *listener, void *data);
54void handle_xwayland_surface(struct wl_listener *listener, void *data); 60void handle_xwayland_surface(struct wl_listener *listener, void *data);
55void handle_wl_shell_surface(struct wl_listener *listener, void *data); 61void handle_wl_shell_surface(struct wl_listener *listener, void *data);
56 62
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index de431c89..e163e3fe 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -12,6 +12,7 @@ struct sway_container;
12enum sway_view_type { 12enum sway_view_type {
13 SWAY_VIEW_WL_SHELL, 13 SWAY_VIEW_WL_SHELL,
14 SWAY_VIEW_XDG_SHELL_V6, 14 SWAY_VIEW_XDG_SHELL_V6,
15 SWAY_VIEW_XDG_SHELL,
15 SWAY_VIEW_XWAYLAND, 16 SWAY_VIEW_XWAYLAND,
16}; 17};
17 18
@@ -58,6 +59,7 @@ struct sway_view {
58 59
59 union { 60 union {
60 struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; 61 struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6;
62 struct wlr_xdg_surface *wlr_xdg_surface;
61 struct wlr_xwayland_surface *wlr_xwayland_surface; 63 struct wlr_xwayland_surface *wlr_xwayland_surface;
62 struct wlr_wl_shell_surface *wlr_wl_shell_surface; 64 struct wlr_wl_shell_surface *wlr_wl_shell_surface;
63 }; 65 };
@@ -86,6 +88,22 @@ struct sway_xdg_shell_v6_view {
86 int pending_width, pending_height; 88 int pending_width, pending_height;
87}; 89};
88 90
91struct sway_xdg_shell_view {
92 struct sway_view view;
93
94 struct wl_listener commit;
95 struct wl_listener request_move;
96 struct wl_listener request_resize;
97 struct wl_listener request_maximize;
98 struct wl_listener request_fullscreen;
99 struct wl_listener new_popup;
100 struct wl_listener map;
101 struct wl_listener unmap;
102 struct wl_listener destroy;
103
104 int pending_width, pending_height;
105};
106
89struct sway_xwayland_view { 107struct sway_xwayland_view {
90 struct sway_view view; 108 struct sway_view view;
91 109
@@ -160,6 +178,15 @@ struct sway_xdg_popup_v6 {
160 struct wl_listener destroy; 178 struct wl_listener destroy;
161}; 179};
162 180
181struct sway_xdg_popup {
182 struct sway_view_child child;
183
184 struct wlr_xdg_surface *wlr_xdg_surface;
185
186 struct wl_listener new_popup;
187 struct wl_listener destroy;
188};
189
163const char *view_get_title(struct sway_view *view); 190const char *view_get_title(struct sway_view *view);
164 191
165const char *view_get_app_id(struct sway_view *view); 192const char *view_get_app_id(struct sway_view *view);