aboutsummaryrefslogtreecommitdiff
path: root/include/rootston/view.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/rootston/view.h')
-rw-r--r--include/rootston/view.h56
1 files changed, 50 insertions, 6 deletions
diff --git a/include/rootston/view.h b/include/rootston/view.h
index e1172bca..f6968c7a 100644
--- a/include/rootston/view.h
+++ b/include/rootston/view.h
@@ -11,6 +11,7 @@ struct roots_wl_shell_surface {
struct roots_view *view;
struct wl_listener destroy;
+ struct wl_listener new_popup;
struct wl_listener request_move;
struct wl_listener request_resize;
struct wl_listener request_maximize;
@@ -23,13 +24,15 @@ struct roots_wl_shell_surface {
struct roots_xdg_surface_v6 {
struct roots_view *view;
- struct wl_listener commit;
struct wl_listener destroy;
+ struct wl_listener new_popup;
struct wl_listener request_move;
struct wl_listener request_resize;
struct wl_listener request_maximize;
struct wl_listener request_fullscreen;
+ struct wl_listener surface_commit;
+
uint32_t pending_move_resize_configure_serial;
};
@@ -61,6 +64,7 @@ struct roots_view {
struct wl_list link; // roots_desktop::views
double x, y;
+ uint32_t width, height;
float rotation;
bool decorated;
@@ -97,17 +101,17 @@ struct roots_view {
struct roots_xwayland_surface *roots_xwayland_surface;
#endif
};
+
struct wlr_surface *wlr_surface;
+ struct wl_list children; // roots_view_child::link
+
+ struct wl_listener new_subsurface;
struct {
struct wl_signal destroy;
} events;
- // TODO: This would probably be better as a field that's updated on a
- // configure event from the xdg_shell
- // If not then this should follow the typical type/impl pattern we use
- // elsewhere
- void (*get_size)(const struct roots_view *view, struct wlr_box *box);
+ // TODO: this should follow the typical type/impl pattern we use elsewhere
void (*activate)(struct roots_view *view, bool active);
void (*move)(struct roots_view *view, double x, double y);
void (*resize)(struct roots_view *view, uint32_t width, uint32_t height);
@@ -118,6 +122,38 @@ struct roots_view {
void (*close)(struct roots_view *view);
};
+struct roots_view_child {
+ struct roots_view *view;
+ 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 {
+ struct roots_view_child view_child;
+ struct wlr_subsurface *wlr_subsurface;
+ struct wl_listener destroy;
+};
+
+struct roots_wl_shell_popup {
+ struct roots_view_child view_child;
+ struct wlr_wl_shell_surface *wlr_wl_shell_surface;
+ struct wl_listener destroy;
+ struct wl_listener set_state;
+ struct wl_listener new_popup;
+};
+
+struct roots_xdg_popup_v6 {
+ struct roots_view_child view_child;
+ struct wlr_xdg_popup_v6 *wlr_popup;
+ struct wl_listener destroy;
+ struct wl_listener new_popup;
+};
+
void view_get_box(const struct roots_view *view, struct wlr_box *box);
void view_activate(struct roots_view *view, bool active);
void view_move(struct roots_view *view, double x, double y);
@@ -127,6 +163,7 @@ void view_move_resize(struct roots_view *view, double x, double y,
void view_maximize(struct roots_view *view, bool maximized);
void view_set_fullscreen(struct roots_view *view, bool fullscreen,
struct wlr_output *output);
+void view_rotate(struct roots_view *view, float rotation);
void view_close(struct roots_view *view);
bool view_center(struct roots_view *view);
void view_setup(struct roots_view *view);
@@ -145,4 +182,11 @@ 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,
+ struct wlr_surface *wlr_surface);
+void view_child_finish(struct roots_view_child *child);
+
+struct roots_subsurface *subsurface_create(struct roots_view *view,
+ struct wlr_subsurface *wlr_subsurface);
+
#endif