aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/view.h
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2017-11-11 18:06:50 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2017-11-11 18:06:50 -0500
commit0c8491f7d0c735299a25f0ab929f5d1e0866b929 (patch)
tree69fc808ce6b8ceda33e8fadcf7cbbc10b892ca00 /include/sway/view.h
parentWire up output frame loop (diff)
downloadsway-0c8491f7d0c735299a25f0ab929f5d1e0866b929.tar.gz
sway-0c8491f7d0c735299a25f0ab929f5d1e0866b929.tar.zst
sway-0c8491f7d0c735299a25f0ab929f5d1e0866b929.zip
Initial (awful) pass on xdg shell support
Diffstat (limited to 'include/sway/view.h')
-rw-r--r--include/sway/view.h56
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
6struct sway_container;
7struct sway_view;
8
9struct 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
18enum 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
26enum 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 */
37struct 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