aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-03-31 18:07:44 -0400
committeremersion <contact@emersion.fr>2018-03-31 18:07:44 -0400
commit1d68f9ecca8870f2f2a6823072c77657436b123a (patch)
treed66fbfa54f5c20f77c640bb695e43c02f2364bc3 /include
parentb2c2ee693b6f1cdaeb204a1469c0fa1b775a498c (diff)
Add sway_view_impl
Diffstat (limited to 'include')
-rw-r--r--include/sway/tree/view.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index 82a5541b..c68739d6 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -66,10 +66,23 @@ enum sway_view_prop {
VIEW_PROP_INSTANCE,
};
+struct sway_view_impl {
+ const char *(*get_prop)(struct sway_view *view,
+ enum sway_view_prop prop);
+ void (*set_size)(struct sway_view *view,
+ int width, int height);
+ void (*set_position)(struct sway_view *view,
+ double ox, double oy);
+ void (*set_activated)(struct sway_view *view, bool activated);
+ void (*close)(struct sway_view *view);
+};
+
struct sway_view {
enum sway_view_type type;
- struct sway_container *swayc;
- struct wlr_surface *surface;
+ const struct sway_view_impl *impl;
+
+ struct sway_container *swayc; // NULL for unmanaged views
+ struct wlr_surface *surface; // NULL for unmapped views
int width, height;
union {
@@ -84,22 +97,12 @@ struct sway_view {
struct sway_wl_shell_surface *sway_wl_shell_surface;
};
- struct {
- const char *(*get_prop)(struct sway_view *view,
- enum sway_view_prop prop);
- void (*set_size)(struct sway_view *view,
- int width, int height);
- void (*set_position)(struct sway_view *view,
- double ox, double oy);
- void (*set_activated)(struct sway_view *view, bool activated);
- void (*close)(struct sway_view *view);
- } iface;
-
// only used for unmanaged views (shell specific)
struct wl_list unmanaged_view_link; // sway_root::unmanaged_views
};
-struct sway_view *view_create(enum sway_view_type type);
+struct sway_view *view_create(enum sway_view_type type,
+ const struct sway_view_impl *impl);
void view_destroy(struct sway_view *view);