diff options
author | emersion <contact@emersion.fr> | 2018-03-31 17:49:40 -0400 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-03-31 17:49:40 -0400 |
commit | b2c2ee693b6f1cdaeb204a1469c0fa1b775a498c (patch) | |
tree | 1fd4a806d0ab7ba780d5fb93acb741b9b1dc3f85 /include/sway | |
parent | Merge pull request #1684 from swaywm/follow-warp (diff) | |
download | sway-b2c2ee693b6f1cdaeb204a1469c0fa1b775a498c.tar.gz sway-b2c2ee693b6f1cdaeb204a1469c0fa1b775a498c.tar.zst sway-b2c2ee693b6f1cdaeb204a1469c0fa1b775a498c.zip |
Introduce common functions to create, map, unmap, destroy views
Diffstat (limited to 'include/sway')
-rw-r--r-- | include/sway/output.h | 1 | ||||
-rw-r--r-- | include/sway/tree/container.h | 3 | ||||
-rw-r--r-- | include/sway/tree/view.h | 15 |
3 files changed, 15 insertions, 4 deletions
diff --git a/include/sway/output.h b/include/sway/output.h index b4980cd8..cfe7502b 100644 --- a/include/sway/output.h +++ b/include/sway/output.h | |||
@@ -24,6 +24,7 @@ struct sway_output { | |||
24 | struct wl_listener destroy; | 24 | struct wl_listener destroy; |
25 | struct wl_listener mode; | 25 | struct wl_listener mode; |
26 | struct wl_listener transform; | 26 | struct wl_listener transform; |
27 | struct wl_listener scale; | ||
27 | 28 | ||
28 | struct wl_listener damage_destroy; | 29 | struct wl_listener damage_destroy; |
29 | struct wl_listener damage_frame; | 30 | struct wl_listener damage_frame; |
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 { | |||
70 | enum sway_container_layout prev_layout; | 70 | enum sway_container_layout prev_layout; |
71 | enum sway_container_layout workspace_layout; | 71 | enum sway_container_layout workspace_layout; |
72 | 72 | ||
73 | // TODO convert to layout coordinates | 73 | // in output-local coordinates |
74 | double x, y; | 74 | double x, y; |
75 | |||
76 | // does not include borders or gaps. | 75 | // does not include borders or gaps. |
77 | double width, height; | 76 | double width, height; |
78 | 77 | ||
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 @@ | |||
4 | #include <wlr/types/wlr_surface.h> | 4 | #include <wlr/types/wlr_surface.h> |
5 | #include <wlr/types/wlr_xdg_shell_v6.h> | 5 | #include <wlr/types/wlr_xdg_shell_v6.h> |
6 | #include <wlr/xwayland.h> | 6 | #include <wlr/xwayland.h> |
7 | #include "sway/input/input-manager.h" | ||
8 | #include "sway/input/seat.h" | ||
7 | 9 | ||
8 | struct sway_container; | 10 | struct sway_container; |
9 | struct sway_view; | 11 | struct sway_view; |
@@ -94,9 +96,13 @@ struct sway_view { | |||
94 | } iface; | 96 | } iface; |
95 | 97 | ||
96 | // only used for unmanaged views (shell specific) | 98 | // only used for unmanaged views (shell specific) |
97 | struct wl_list unmanaged_view_link; // sway_root::unmanaged views | 99 | struct wl_list unmanaged_view_link; // sway_root::unmanaged_views |
98 | }; | 100 | }; |
99 | 101 | ||
102 | struct sway_view *view_create(enum sway_view_type type); | ||
103 | |||
104 | void view_destroy(struct sway_view *view); | ||
105 | |||
100 | const char *view_get_title(struct sway_view *view); | 106 | const char *view_get_title(struct sway_view *view); |
101 | 107 | ||
102 | const char *view_get_app_id(struct sway_view *view); | 108 | const char *view_get_app_id(struct sway_view *view); |
@@ -113,7 +119,12 @@ void view_set_activated(struct sway_view *view, bool activated); | |||
113 | 119 | ||
114 | void view_close(struct sway_view *view); | 120 | void view_close(struct sway_view *view); |
115 | 121 | ||
116 | void view_update_outputs(struct sway_view *view, const struct wlr_box *before); | 122 | void view_map(struct sway_view *view, struct wlr_surface *wlr_surface); |
123 | |||
124 | void view_map_unmanaged(struct sway_view *view, | ||
125 | struct wlr_surface *wlr_surface); | ||
126 | |||
127 | void view_unmap(struct sway_view *view); | ||
117 | 128 | ||
118 | void view_damage_whole(struct sway_view *view); | 129 | void view_damage_whole(struct sway_view *view); |
119 | 130 | ||