diff options
author | Drew DeVault <[email protected]> | 2017-11-11 18:06:50 -0500 |
---|---|---|
committer | Drew DeVault <[email protected]> | 2017-11-11 18:06:50 -0500 |
commit | 0c8491f7d0c735299a25f0ab929f5d1e0866b929 (patch) | |
tree | 69fc808ce6b8ceda33e8fadcf7cbbc10b892ca00 /include/sway/view.h | |
parent | 1efd5f819f9986bf27e390f4988359388606cea0 (diff) |
Initial (awful) pass on xdg shell support
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 @@ +#ifndef _SWAY_VIEW_H +#define _SWAY_VIEW_H +#include <wayland-server.h> +#include <wlr/types/wlr_xdg_shell_v6.h> + +struct sway_container; +struct sway_view; + +struct sway_xdg_surface_v6 { + struct sway_view *view; + + struct wl_listener commit; + struct wl_listener request_move; + struct wl_listener request_resize; + struct wl_listener request_maximize; +}; + +enum sway_view_type { + SWAY_WL_SHELL_VIEW, + SWAY_XDG_SHELL_V6_VIEW, + SWAY_XWAYLAND_VIEW, + // Keep last + SWAY_VIEW_TYPES, +}; + +enum sway_view_prop { + VIEW_PROP_TITLE, + VIEW_PROP_CLASS, + VIEW_PROP_INSTANCE, + VIEW_PROP_APP_ID, +}; + +/** + * sway_view is a state container for surfaces that are arranged in the sway + * tree (shell surfaces). + */ +struct sway_view { + struct wl_listener destroy; + enum sway_view_type type; + struct sway_container *swayc; + + union { + struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; + }; + + union { + struct sway_xdg_surface_v6 *sway_xdg_surface_v6; + }; + + struct { + const char *(*get_prop)(struct sway_view *view, + enum sway_view_prop prop); + } iface; +}; + +#endif |