diff options
Diffstat (limited to 'include/sway/view.h')
-rw-r--r-- | include/sway/view.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/include/sway/view.h b/include/sway/view.h new file mode 100644 index 00000000..979b20a8 --- /dev/null +++ b/include/sway/view.h | |||
@@ -0,0 +1,56 @@ | |||
1 | #ifndef _SWAY_VIEW_H | ||
2 | #define _SWAY_VIEW_H | ||
3 | #include <wayland-server.h> | ||
4 | #include <wlr/types/wlr_xdg_shell_v6.h> | ||
5 | |||
6 | struct sway_container; | ||
7 | struct sway_view; | ||
8 | |||
9 | struct sway_xdg_surface_v6 { | ||
10 | struct sway_view *view; | ||
11 | |||
12 | struct wl_listener commit; | ||
13 | struct wl_listener request_move; | ||
14 | struct wl_listener request_resize; | ||
15 | struct wl_listener request_maximize; | ||
16 | }; | ||
17 | |||
18 | enum sway_view_type { | ||
19 | SWAY_WL_SHELL_VIEW, | ||
20 | SWAY_XDG_SHELL_V6_VIEW, | ||
21 | SWAY_XWAYLAND_VIEW, | ||
22 | // Keep last | ||
23 | SWAY_VIEW_TYPES, | ||
24 | }; | ||
25 | |||
26 | enum sway_view_prop { | ||
27 | VIEW_PROP_TITLE, | ||
28 | VIEW_PROP_CLASS, | ||
29 | VIEW_PROP_INSTANCE, | ||
30 | VIEW_PROP_APP_ID, | ||
31 | }; | ||
32 | |||
33 | /** | ||
34 | * sway_view is a state container for surfaces that are arranged in the sway | ||
35 | * tree (shell surfaces). | ||
36 | */ | ||
37 | struct sway_view { | ||
38 | struct wl_listener destroy; | ||
39 | enum sway_view_type type; | ||
40 | struct sway_container *swayc; | ||
41 | |||
42 | union { | ||
43 | struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; | ||
44 | }; | ||
45 | |||
46 | union { | ||
47 | struct sway_xdg_surface_v6 *sway_xdg_surface_v6; | ||
48 | }; | ||
49 | |||
50 | struct { | ||
51 | const char *(*get_prop)(struct sway_view *view, | ||
52 | enum sway_view_prop prop); | ||
53 | } iface; | ||
54 | }; | ||
55 | |||
56 | #endif | ||