From b2c2ee693b6f1cdaeb204a1469c0fa1b775a498c Mon Sep 17 00:00:00 2001 From: emersion Date: Sat, 31 Mar 2018 17:49:40 -0400 Subject: Introduce common functions to create, map, unmap, destroy views --- include/sway/tree/container.h | 3 +-- include/sway/tree/view.h | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'include/sway/tree') diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 6aa66da0..d707df17 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -70,9 +70,8 @@ struct sway_container { enum sway_container_layout prev_layout; enum sway_container_layout workspace_layout; - // TODO convert to layout coordinates + // in output-local coordinates double x, y; - // does not include borders or gaps. double width, height; diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 3965d2b7..82a5541b 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -4,6 +4,8 @@ #include #include #include +#include "sway/input/input-manager.h" +#include "sway/input/seat.h" struct sway_container; struct sway_view; @@ -94,9 +96,13 @@ struct sway_view { } iface; // only used for unmanaged views (shell specific) - struct wl_list unmanaged_view_link; // sway_root::unmanaged views + struct wl_list unmanaged_view_link; // sway_root::unmanaged_views }; +struct sway_view *view_create(enum sway_view_type type); + +void view_destroy(struct sway_view *view); + const char *view_get_title(struct sway_view *view); const char *view_get_app_id(struct sway_view *view); @@ -113,7 +119,12 @@ void view_set_activated(struct sway_view *view, bool activated); void view_close(struct sway_view *view); -void view_update_outputs(struct sway_view *view, const struct wlr_box *before); +void view_map(struct sway_view *view, struct wlr_surface *wlr_surface); + +void view_map_unmanaged(struct sway_view *view, + struct wlr_surface *wlr_surface); + +void view_unmap(struct sway_view *view); void view_damage_whole(struct sway_view *view); -- cgit v1.2.3-54-g00ecf