diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/pango.h | 11 | ||||
-rw-r--r-- | include/sway/config.h | 7 | ||||
-rw-r--r-- | include/sway/server.h | 6 | ||||
-rw-r--r-- | include/sway/tree/view.h | 27 |
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 @@ #include <cairo/cairo.h> #include <pango/pangocairo.h> +/* Utility function which escape characters a & < > ' ". + * + * If the dest parameter is NULL, then the function returns the length of + * of the escaped src string. The dest_length doesn't matter. + * + * If the dest parameter is not NULL then the fuction escapes the src string + * an puts the escaped string in dest and returns the lenght of the escaped string. + * The dest_length parameter is the size of dest array. If the size of dest is not + * enough, then the function returns -1. + */ +int escape_markup_text(const char *src, char *dest, int dest_length); PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, const char *text, int32_t scale, bool markup); void 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 { list_t *attachments; // list of seat_attachment configs }; +enum config_dpms { + DPMS_IGNORE, + DPMS_ON, + DPMS_OFF +}; + /** * Size and position configuration for a particular output. * @@ -123,6 +129,7 @@ struct output_config { char *background; char *background_option; + enum config_dpms dpms_state; }; /** 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 @@ #include <wlr/types/wlr_data_device.h> #include <wlr/types/wlr_layer_shell.h> #include <wlr/types/wlr_xdg_shell_v6.h> +#include <wlr/types/wlr_xdg_shell.h> #include <wlr/render/wlr_renderer.h> // TODO WLR: make Xwayland optional #include <wlr/xwayland.h> @@ -21,6 +22,7 @@ struct sway_server { struct wlr_compositor *compositor; struct wlr_data_device_manager *data_device_manager; + struct wlr_idle *idle; struct sway_input_manager *input; @@ -32,6 +34,9 @@ struct sway_server { struct wlr_xdg_shell_v6 *xdg_shell_v6; struct wl_listener xdg_shell_v6_surface; + struct wlr_xdg_shell *xdg_shell; + struct wl_listener xdg_shell_surface; + struct wlr_xwayland *xwayland; struct wlr_xcursor_manager *xcursor_manager; struct wl_listener xwayland_surface; @@ -51,6 +56,7 @@ void handle_new_output(struct wl_listener *listener, void *data); void handle_layer_shell_surface(struct wl_listener *listener, void *data); void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data); +void handle_xdg_shell_surface(struct wl_listener *listener, void *data); void handle_xwayland_surface(struct wl_listener *listener, void *data); void handle_wl_shell_surface(struct wl_listener *listener, void *data); 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; enum sway_view_type { SWAY_VIEW_WL_SHELL, SWAY_VIEW_XDG_SHELL_V6, + SWAY_VIEW_XDG_SHELL, SWAY_VIEW_XWAYLAND, }; @@ -58,6 +59,7 @@ struct sway_view { union { struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; + struct wlr_xdg_surface *wlr_xdg_surface; struct wlr_xwayland_surface *wlr_xwayland_surface; struct wlr_wl_shell_surface *wlr_wl_shell_surface; }; @@ -86,6 +88,22 @@ struct sway_xdg_shell_v6_view { int pending_width, pending_height; }; +struct sway_xdg_shell_view { + struct sway_view view; + + struct wl_listener commit; + struct wl_listener request_move; + struct wl_listener request_resize; + struct wl_listener request_maximize; + struct wl_listener request_fullscreen; + struct wl_listener new_popup; + struct wl_listener map; + struct wl_listener unmap; + struct wl_listener destroy; + + int pending_width, pending_height; +}; + struct sway_xwayland_view { struct sway_view view; @@ -160,6 +178,15 @@ struct sway_xdg_popup_v6 { struct wl_listener destroy; }; +struct sway_xdg_popup { + struct sway_view_child child; + + struct wlr_xdg_surface *wlr_xdg_surface; + + struct wl_listener new_popup; + struct wl_listener destroy; +}; + const char *view_get_title(struct sway_view *view); const char *view_get_app_id(struct sway_view *view); |