summaryrefslogtreecommitdiffstats
path: root/include/sway/tree/view.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/tree/view.h')
-rw-r--r--include/sway/tree/view.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index d4dace4a..03d27ceb 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -45,6 +45,12 @@ struct sway_view {
45 struct wlr_xwayland_surface *wlr_xwayland_surface; 45 struct wlr_xwayland_surface *wlr_xwayland_surface;
46 struct wlr_wl_shell_surface *wlr_wl_shell_surface; 46 struct wlr_wl_shell_surface *wlr_wl_shell_surface;
47 }; 47 };
48
49 struct {
50 struct wl_signal unmap;
51 } events;
52
53 struct wl_listener surface_new_subsurface;
48}; 54};
49 55
50struct sway_xdg_shell_v6_view { 56struct sway_xdg_shell_v6_view {
@@ -54,6 +60,7 @@ struct sway_xdg_shell_v6_view {
54 struct wl_listener request_move; 60 struct wl_listener request_move;
55 struct wl_listener request_resize; 61 struct wl_listener request_resize;
56 struct wl_listener request_maximize; 62 struct wl_listener request_maximize;
63 struct wl_listener new_popup;
57 struct wl_listener map; 64 struct wl_listener map;
58 struct wl_listener unmap; 65 struct wl_listener unmap;
59 struct wl_listener destroy; 66 struct wl_listener destroy;
@@ -80,6 +87,12 @@ struct sway_xwayland_unmanaged {
80 struct wlr_xwayland_surface *wlr_xwayland_surface; 87 struct wlr_xwayland_surface *wlr_xwayland_surface;
81 struct wl_list link; 88 struct wl_list link;
82 89
90 int lx, ly;
91
92 struct wl_listener request_configure;
93 struct wl_listener commit;
94 struct wl_listener map;
95 struct wl_listener unmap;
83 struct wl_listener destroy; 96 struct wl_listener destroy;
84}; 97};
85 98
@@ -95,6 +108,37 @@ struct sway_wl_shell_view {
95 int pending_width, pending_height; 108 int pending_width, pending_height;
96}; 109};
97 110
111struct sway_view_child;
112
113struct sway_view_child_impl {
114 void (*destroy)(struct sway_view_child *child);
115};
116
117/**
118 * A view child is a surface in the view tree, such as a subsurface or a popup.
119 */
120struct sway_view_child {
121 const struct sway_view_child_impl *impl;
122
123 struct sway_view *view;
124 struct wlr_surface *surface;
125
126 struct wl_listener surface_commit;
127 struct wl_listener surface_new_subsurface;
128 struct wl_listener surface_destroy;
129 struct wl_listener view_unmap;
130};
131
132struct sway_xdg_popup_v6 {
133 struct sway_view_child child;
134
135 struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6;
136
137 struct wl_listener new_popup;
138 struct wl_listener unmap;
139 struct wl_listener destroy;
140};
141
98const char *view_get_title(struct sway_view *view); 142const char *view_get_title(struct sway_view *view);
99 143
100const char *view_get_app_id(struct sway_view *view); 144const char *view_get_app_id(struct sway_view *view);
@@ -129,4 +173,10 @@ void view_update_position(struct sway_view *view, double ox, double oy);
129 173
130void view_update_size(struct sway_view *view, int width, int height); 174void view_update_size(struct sway_view *view, int width, int height);
131 175
176void view_child_init(struct sway_view_child *child,
177 const struct sway_view_child_impl *impl, struct sway_view *view,
178 struct wlr_surface *surface);
179
180void view_child_destroy(struct sway_view_child *child);
181
132#endif 182#endif