spkp

Stacking wayland compositor
git clone git://git.z3bra.org/spkp.git
Log | Files | Refs

commit 63ec1886aacfecf9c2698e306cff14b2b699d235
parent 225253e393ebc7586d665967d1e09e84b91ec524
Author: Willy Goiffon <dev@z3bra.org>
Date:   Mon, 16 Nov 2020 14:23:31 +0100

Rename internal state struct to "spkp"

Diffstat:
Msp:kp.c | 88++++++++++++++++++++++++++++++++++++++++----------------------------------------
1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/sp:kp.c b/sp:kp.c @@ -48,7 +48,7 @@ enum { }; /* Internal compositor state */ -struct state { +struct spkp { struct wl_display *dpy; struct wlr_backend *backend; struct wlr_renderer *renderer; @@ -89,7 +89,7 @@ struct state { /* Display output (usually a monitor) */ struct output { - struct state *server; + struct spkp *server; struct wlr_output *wlr_output; struct wl_listener destroy; @@ -102,7 +102,7 @@ struct output { /* Client surface window */ struct window { - struct state *server; + struct spkp *server; struct wlr_surface *surface; struct wlr_xdg_surface *xdg; struct wlr_xdg_toplevel_decoration_v1 decoration; @@ -122,7 +122,7 @@ struct window { }; struct keyboard { - struct state *server; + struct spkp *server; struct wlr_input_device *device; struct wl_listener destroy; @@ -134,7 +134,7 @@ struct keyboard { }; struct chrome { - struct state *server; + struct spkp *server; struct wlr_xdg_toplevel_decoration_v1 *decoration; struct wl_listener destroy; @@ -152,7 +152,7 @@ union keyarg { struct key { uint32_t mod; uint32_t key; - void (*func)(struct state *, union keyarg *); + void (*func)(struct spkp *, union keyarg *); union keyarg arg; }; @@ -185,30 +185,30 @@ static void cb_destroy_chrome(struct wl_listener *, void *); static void cb_kb_mod(struct wl_listener *, void *); static void cb_kb_key(struct wl_listener *, void *); -static void cb_motion(struct state *, uint32_t); +static void cb_motion(struct spkp *, uint32_t); static void cb_motion_relative(struct wl_listener *, void *); static void cb_motion_absolute(struct wl_listener *, void *); static void cb_click(struct wl_listener *, void *); -static void cb_click_press(struct state *, struct wlr_event_pointer_button *); -static void cb_click_release(struct state *, struct wlr_event_pointer_button *); +static void cb_click_press(struct spkp *, struct wlr_event_pointer_button *); +static void cb_click_release(struct spkp *, struct wlr_event_pointer_button *); static void cb_scroll(struct wl_listener *, void *); static void cb_paint_cursor(struct wl_listener *, void *); /* helper functions, used inside callbacks */ -static void add_keyboard(struct state *, struct wlr_input_device *); -static void add_pointer(struct state *, struct wlr_input_device *); +static void add_keyboard(struct spkp *, struct wlr_input_device *); +static void add_pointer(struct spkp *, struct wlr_input_device *); static void render(struct wlr_surface *, int, int, void *); static void render_border(struct wlr_box *, struct rdata *, float *); static void focus(struct window *); static int dropprivilege(); -static int keybinding(struct state *, uint32_t, uint32_t, enum wlr_key_state); -static struct window *underneath(struct state *, double, double); +static int keybinding(struct spkp *, uint32_t, uint32_t, enum wlr_key_state); +static struct window *underneath(struct spkp *, double, double); /* keybinding functions, see config.h */ -static void kb_terminate(struct state *, union keyarg *); -static void kb_alttab(struct state *, union keyarg *); -static void kb_exec(struct state *, union keyarg *); -static void kb_desktop(struct state *, union keyarg *); +static void kb_terminate(struct spkp *, union keyarg *); +static void kb_alttab(struct spkp *, union keyarg *); +static void kb_exec(struct spkp *, union keyarg *); +static void kb_desktop(struct spkp *, union keyarg *); #include "config.h" @@ -226,7 +226,7 @@ void cb_new_input(struct wl_listener *listener, void *data) { uint32_t cap = 0; - struct state *server; + struct spkp *server; struct wlr_input_device *device; server = wl_container_of(listener, server, new_input); @@ -260,7 +260,7 @@ cb_new_input(struct wl_listener *listener, void *data) void cb_new_output(struct wl_listener *listener, void *data) { - struct state *server; + struct spkp *server; struct output *output; struct wlr_output *wlr_output; struct wlr_output_mode *mode; @@ -364,7 +364,7 @@ cb_frame_output(struct wl_listener *listener, void *data) wlr_xdg_surface_for_each_surface(window->xdg, render, &rdata); } - struct state *server = output->server; + struct spkp *server = output->server; if (server->grabmode != NORMAL) render_border(&server->grabbox, &rdata, drawcolor); @@ -386,7 +386,7 @@ cb_frame_output(struct wl_listener *listener, void *data) void cb_new_window(struct wl_listener *listener, void *data) { - struct state *server; + struct spkp *server; struct wlr_xdg_surface *surface; struct window *window; @@ -427,7 +427,7 @@ cb_new_window(struct wl_listener *listener, void *data) void cb_new_decoration(struct wl_listener *listener, void *data) { - struct state *server; + struct spkp *server; struct chrome *chrome; struct wlr_xdg_toplevel_decoration_v1 *decoration; @@ -455,7 +455,7 @@ cb_new_decoration(struct wl_listener *listener, void *data) void cb_copy(struct wl_listener *listener, void *data) { - struct state *server; + struct spkp *server; struct wlr_seat_request_set_selection_event *ev; server = wl_container_of(listener, server, copy); @@ -473,7 +473,7 @@ cb_map_window(struct wl_listener *listener, void *data) int ow, oh; struct window *w; struct wlr_output *output; - struct state *server; + struct spkp *server; struct wlr_output_layout_output *layer; struct wlr_box geom; @@ -587,7 +587,7 @@ cb_kb_mod(struct wl_listener *listener, void *data) void cb_kb_key(struct wl_listener *listener, void *data) { - struct state *server; + struct spkp *server; struct keyboard *kb; struct wlr_event_keyboard_key *ev; struct wlr_seat *seat; @@ -629,7 +629,7 @@ cb_kb_key(struct wl_listener *listener, void *data) void cb_req_cursor(struct wl_listener *listener, void *data) { - struct state *server; + struct spkp *server; struct wlr_seat_pointer_request_set_cursor_event *ev; struct wlr_seat_client *focus; @@ -648,7 +648,7 @@ cb_req_cursor(struct wl_listener *listener, void *data) * the client underneath the pointer. */ void -cb_motion(struct state *server, uint32_t time) +cb_motion(struct spkp *server, uint32_t time) { struct window *w; struct wlr_seat *seat; @@ -698,7 +698,7 @@ cb_motion(struct state *server, uint32_t time) void cb_motion_relative(struct wl_listener *listener, void *data) { - struct state *server; + struct spkp *server; struct wlr_event_pointer_motion *ev; server = wl_container_of(listener, server, motion_relative); @@ -715,7 +715,7 @@ cb_motion_relative(struct wl_listener *listener, void *data) void cb_motion_absolute(struct wl_listener *listener, void *data) { - struct state *server; + struct spkp *server; struct wlr_event_pointer_motion_absolute *ev; server = wl_container_of(listener, server, motion_absolute); @@ -736,7 +736,7 @@ cb_motion_absolute(struct wl_listener *listener, void *data) void cb_click(struct wl_listener *listener, void *data) { - struct state *server; + struct spkp *server; struct wlr_event_pointer_button *ev; server = wl_container_of(listener, server, click); @@ -760,7 +760,7 @@ cb_click(struct wl_listener *listener, void *data) * When it's not, the event is simply passed down to the focused window. */ void -cb_click_release(struct state *server, struct wlr_event_pointer_button *ev) +cb_click_release(struct spkp *server, struct wlr_event_pointer_button *ev) { struct wlr_box geom; @@ -792,7 +792,7 @@ cb_click_release(struct state *server, struct wlr_event_pointer_button *ev) * window, and will terminate when the button is released. */ void -cb_click_press(struct state *server, struct wlr_event_pointer_button *ev) +cb_click_press(struct spkp *server, struct wlr_event_pointer_button *ev) { struct window *w; struct wlr_keyboard *kb; @@ -860,7 +860,7 @@ cb_click_press(struct state *server, struct wlr_event_pointer_button *ev) void cb_scroll(struct wl_listener *listener, void *data) { - struct state *server; + struct spkp *server; struct wlr_event_pointer_axis *ev; server = wl_container_of(listener, server, scroll); @@ -877,7 +877,7 @@ void cb_paint_cursor(struct wl_listener *listener, void *data) { (void)data; - struct state *server; + struct spkp *server; server = wl_container_of(listener, server, paint_cursor); @@ -888,7 +888,7 @@ cb_paint_cursor(struct wl_listener *listener, void *data) * Configure a newly added keyboard. */ void -add_keyboard(struct state *server, struct wlr_input_device *device) +add_keyboard(struct spkp *server, struct wlr_input_device *device) { struct keyboard *kb; struct xkb_context *context; @@ -929,7 +929,7 @@ add_keyboard(struct state *server, struct wlr_input_device *device) * Configure a newly added pointer device. */ void -add_pointer(struct state *server, struct wlr_input_device *device) +add_pointer(struct spkp *server, struct wlr_input_device *device) { /* no special configuration required (eg, accel, …) */ wlr_cursor_attach_input_device(server->cursor, device); @@ -1014,7 +1014,7 @@ render_border(struct wlr_box *content, struct rdata *rdata, float *color) void focus(struct window *window) { - struct state *server; + struct spkp *server; struct wlr_seat *seat; struct wlr_keyboard *kb; struct wlr_surface *focus; @@ -1062,7 +1062,7 @@ dropprivilege() * Execute specific functions when an modifier/key combination is pressed. */ int -keybinding(struct state *server, uint32_t mod, uint32_t key, enum wlr_key_state state) +keybinding(struct spkp *server, uint32_t mod, uint32_t key, enum wlr_key_state state) { ssize_t i, nkey; @@ -1088,7 +1088,7 @@ keybinding(struct state *server, uint32_t mod, uint32_t key, enum wlr_key_state * These informations are needed to relay pointer events to the window. */ struct window * -underneath(struct state *server, double x, double y) +underneath(struct spkp *server, double x, double y) { struct window *w; @@ -1127,7 +1127,7 @@ underneath(struct state *server, double x, double y) * Keybind: Terminate the wayland compositor */ void -kb_terminate(struct state *server, union keyarg *arg) +kb_terminate(struct spkp *server, union keyarg *arg) { (void)arg; wl_display_terminate(server->dpy); @@ -1137,7 +1137,7 @@ kb_terminate(struct state *server, union keyarg *arg) * Cycle windows. */ void -kb_alttab(struct state *server, union keyarg *arg) +kb_alttab(struct spkp *server, union keyarg *arg) { int reverse; struct window *w; @@ -1168,7 +1168,7 @@ kb_alttab(struct state *server, union keyarg *arg) * Run the given command */ void -kb_exec(struct state *server, union keyarg *arg) +kb_exec(struct spkp *server, union keyarg *arg) { (void)server; if (!fork()) { @@ -1187,7 +1187,7 @@ kb_exec(struct state *server, union keyarg *arg) * Hide/show all windows on the desktop */ void -kb_desktop(struct state *server, union keyarg *arg) +kb_desktop(struct spkp *server, union keyarg *arg) { (void)arg; struct window *w; @@ -1203,7 +1203,7 @@ main(int argc, char *argv[]) { char *argv0; const char *socket; - struct state server; + struct spkp server; struct wlr_server_decoration_manager *decorations; ARGBEGIN {