From 9f11bf571e2644447b7b39aec8ee87ceab8015f0 Mon Sep 17 00:00:00 2001 From: emersion Date: Sat, 23 Feb 2019 14:18:32 +0100 Subject: rootston: add a view child interface --- include/rootston/view.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/rootston/view.h b/include/rootston/view.h index 64c49618..ce8f4268 100644 --- a/include/rootston/view.h +++ b/include/rootston/view.h @@ -94,6 +94,8 @@ enum roots_view_type { #endif }; +struct roots_view; + struct roots_view_interface { void (*activate)(struct roots_view *view, bool active); void (*move)(struct roots_view *view, double x, double y); @@ -168,15 +170,20 @@ struct roots_view { } events; }; +struct roots_view_child; + +struct roots_view_child_interface { + void (*destroy)(struct roots_view_child *child); +}; + struct roots_view_child { struct roots_view *view; + const struct roots_view_child_interface *impl; struct wlr_surface *wlr_surface; struct wl_list link; struct wl_listener commit; struct wl_listener new_subsurface; - - void (*destroy)(struct roots_view_child *child); }; struct roots_subsurface { @@ -267,9 +274,10 @@ enum roots_deco_part { enum roots_deco_part view_get_deco_part(struct roots_view *view, double sx, double sy); -void view_child_init(struct roots_view_child *child, struct roots_view *view, +void view_child_init(struct roots_view_child *child, + const struct roots_view_child_interface *impl, struct roots_view *view, struct wlr_surface *wlr_surface); -void view_child_finish(struct roots_view_child *child); +void view_child_destroy(struct roots_view_child *child); struct roots_subsurface *subsurface_create(struct roots_view *view, struct wlr_subsurface *wlr_subsurface); -- cgit v1.2.3