rootston: add a view child interface

This commit is contained in:
emersion 2019-02-23 14:18:32 +01:00
parent e86c7a3dd6
commit 9f11bf571e
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
5 changed files with 59 additions and 40 deletions

View file

@ -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);