From 08a6da05412961ddf629415a92749b02d875fa62 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Mon, 4 Oct 2021 17:25:48 -0700 Subject: feat(wm): layer shell --- sys/cmd/wm/wm.h | 49 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 9 deletions(-) (limited to 'sys/cmd/wm/wm.h') diff --git a/sys/cmd/wm/wm.h b/sys/cmd/wm/wm.h index bc898b1..d9124f4 100644 --- a/sys/cmd/wm/wm.h +++ b/sys/cmd/wm/wm.h @@ -17,10 +17,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -60,6 +62,7 @@ typedef union Arg Arg; typedef struct Button Button; typedef struct Key Key; typedef struct Keyboard Keyboard; +typedef struct Layer Layer; typedef struct Client Client; typedef struct Layout Layout; typedef struct Monitor Monitor; @@ -109,6 +112,22 @@ struct Keyboard } event; }; +struct Layer +{ + struct wl_list link; + struct wlr_layer_surface_v1 *surface; + enum zwlr_layer_shell_v1_layer type; + + struct wlr_box geometry; + + struct { + struct wl_listener map; + struct wl_listener unmap; + struct wl_listener commit; + struct wl_listener destroy; + } event; +}; + struct Client { struct wl_list link; @@ -159,6 +178,7 @@ struct Monitor struct wlr_box geometry; struct wlr_box window; + struct wl_list layer[4]; Layout *layout, *layouts[2]; struct { @@ -195,13 +215,15 @@ struct Rule struct Server { - struct wl_display *display; - struct wlr_backend *backend; - struct wlr_renderer *renderer; - struct wlr_presentation *present; + struct wl_display *display; + struct wlr_backend *backend; + struct wlr_renderer *renderer; + struct wlr_presentation *present; + struct wlr_xdg_activation_v1 *activate; struct { - struct wlr_xdg_shell *xdg; + struct wlr_xdg_shell *xdg; + struct wlr_layer_shell_v1 *layer; } shell; struct { @@ -255,6 +277,7 @@ struct Server struct wl_listener cursor_frame; struct wl_listener request_cursor; + struct wl_listener request_activate; struct wl_listener request_set_selection; } event; }; @@ -266,6 +289,7 @@ extern struct Server server; /* util.c */ void scale_box(struct wlr_box *, float); +void exclude(struct wlr_box *, uint32, int32, int32, int32, int32, int32 ); /* render.c */ void render_monitor(struct wl_listener *, void *); @@ -273,8 +297,12 @@ void render_monitor(struct wl_listener *, void *); /* xdg.c */ void make_xdg_surface(struct wl_listener *, void *); +/* layer.c */ +void make_layer_surface(struct wl_listener *, void *); + /* input.c */ void make_input(struct wl_listener *, void *); +void notify_move(uint32 time); void cursor_axis(struct wl_listener *, void *); void cursor_frame(struct wl_listener *, void *); @@ -292,18 +320,21 @@ void resize(Client *, int x, int y, int w, int h, int interact); void attach(Client *, Monitor *, uint tags); void floating(Client *, int); +void move_client(Arg *arg); +void float_client(Arg *arg); +void resize_client(Arg *arg); + +void request_activate(struct wl_listener *, void *); + Client *selected_client(void); Client *client_at(double x, double y); struct wlr_surface *client_surface_at(Client *, double cx, double cy, double *sx, double *sy); struct wlr_surface *top_surface(Client *); -void move_client(Arg *arg); -void float_client(Arg *arg); -void resize_client(Arg *arg); - /* monitor.c */ void tile(Monitor *); void arrange(Monitor *); +void stratify(Monitor *); Client *focused_client(Monitor *); Monitor *monitor_at(double x, double y); -- cgit v1.2.1