From 71ca45e2c0cbecf8fb24f0cab019646d92cce14b Mon Sep 17 00:00:00 2001 From: emersion Date: Wed, 25 Apr 2018 23:24:58 +0100 Subject: Make sure we don't use others' prefixes --- backend/x11/backend.c | 14 +++++++------- backend/x11/input_device.c | 8 ++++---- backend/x11/output.c | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'backend/x11') diff --git a/backend/x11/backend.c b/backend/x11/backend.c index b4b0f154..8b5fc195 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -22,7 +22,7 @@ #include "backend/x11.h" #include "util/signal.h" -struct wlr_x11_output *x11_output_from_window_id(struct wlr_x11_backend *x11, +struct wlr_x11_output *get_x11_output_from_window_id(struct wlr_x11_backend *x11, xcb_window_t window) { struct wlr_x11_output *output; wl_list_for_each(output, &x11->outputs, link) { @@ -33,7 +33,7 @@ struct wlr_x11_output *x11_output_from_window_id(struct wlr_x11_backend *x11, return NULL; } -void x11_output_layout_get_box(struct wlr_x11_backend *backend, +void get_x11_output_layout_box(struct wlr_x11_backend *backend, struct wlr_box *box) { int min_x = INT_MAX, min_y = INT_MAX; int max_x = INT_MIN, max_y = INT_MIN; @@ -67,13 +67,13 @@ void x11_output_layout_get_box(struct wlr_x11_backend *backend, static void handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *event) { - x11_handle_input_event(x11, event); + handle_x11_input_event(x11, event); switch (event->response_type & XCB_EVENT_RESPONSE_TYPE_MASK) { case XCB_EXPOSE: { xcb_expose_event_t *ev = (xcb_expose_event_t *)event; struct wlr_x11_output *output = - x11_output_from_window_id(x11, ev->window); + get_x11_output_from_window_id(x11, ev->window); if (output != NULL) { wlr_output_update_needs_swap(&output->wlr_output); } @@ -83,9 +83,9 @@ static void handle_x11_event(struct wlr_x11_backend *x11, xcb_configure_notify_event_t *ev = (xcb_configure_notify_event_t *)event; struct wlr_x11_output *output = - x11_output_from_window_id(x11, ev->window); + get_x11_output_from_window_id(x11, ev->window); if (output != NULL) { - x11_output_handle_configure_notify(output, ev); + handle_x11_configure_notify(output, ev); } break; } @@ -93,7 +93,7 @@ static void handle_x11_event(struct wlr_x11_backend *x11, xcb_client_message_event_t *ev = (xcb_client_message_event_t *)event; if (ev->data.data32[0] == x11->atoms.wm_delete_window) { struct wlr_x11_output *output = - x11_output_from_window_id(x11, ev->window); + get_x11_output_from_window_id(x11, ev->window); if (output != NULL) { wlr_output_destroy(&output->wlr_output); } diff --git a/backend/x11/input_device.c b/backend/x11/input_device.c index 4433568d..5de5b4c2 100644 --- a/backend/x11/input_device.c +++ b/backend/x11/input_device.c @@ -40,7 +40,7 @@ static void x11_handle_pointer_position(struct wlr_x11_output *output, box.y /= wlr_output->scale; struct wlr_box layout_box; - x11_output_layout_get_box(x11, &layout_box); + get_x11_output_layout_box(x11, &layout_box); double ox = wlr_output->lx / (double)layout_box.width; double oy = wlr_output->ly / (double)layout_box.height; @@ -56,7 +56,7 @@ static void x11_handle_pointer_position(struct wlr_x11_output *output, x11->time = time; } -void x11_handle_input_event(struct wlr_x11_backend *x11, +void handle_x11_input_event(struct wlr_x11_backend *x11, xcb_generic_event_t *event) { switch (event->response_type & XCB_EVENT_RESPONSE_TYPE_MASK) { case XCB_KEY_PRESS: @@ -116,7 +116,7 @@ void x11_handle_input_event(struct wlr_x11_backend *x11, xcb_motion_notify_event_t *ev = (xcb_motion_notify_event_t *)event; struct wlr_x11_output *output = - x11_output_from_window_id(x11, ev->event); + get_x11_output_from_window_id(x11, ev->event); if (output != NULL) { x11_handle_pointer_position(output, ev->event_x, ev->event_y, ev->time); } @@ -138,7 +138,7 @@ void x11_handle_input_event(struct wlr_x11_backend *x11, const struct wlr_input_device_impl input_device_impl = { 0 }; -void x11_update_pointer_position(struct wlr_x11_output *output, +void update_x11_pointer_position(struct wlr_x11_output *output, xcb_timestamp_t time) { struct wlr_x11_backend *x11 = output->x11; diff --git a/backend/x11/output.c b/backend/x11/output.c index 77b4fb07..1f61c5e9 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -164,13 +164,13 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) { return wlr_output; } -void x11_output_handle_configure_notify(struct wlr_x11_output *output, +void handle_x11_configure_notify(struct wlr_x11_output *output, xcb_configure_notify_event_t *ev) { wlr_output_update_custom_mode(&output->wlr_output, ev->width, ev->height, output->wlr_output.refresh); // Move the pointer to its new location - x11_update_pointer_position(output, output->x11->time); + update_x11_pointer_position(output, output->x11->time); } bool wlr_output_is_x11(struct wlr_output *wlr_output) { -- cgit v1.2.3 From 625a7a48dc9f348a7556b03dd3c10a6a7d9c6037 Mon Sep 17 00:00:00 2001 From: emersion Date: Wed, 25 Apr 2018 23:51:00 +0100 Subject: Don't use the wlr_ prefix for static functions --- backend/drm/backend.c | 14 +++---- backend/libinput/backend.c | 30 +++++++-------- backend/libinput/events.c | 4 +- backend/libinput/keyboard.c | 8 ++-- backend/wayland/backend.c | 14 +++---- backend/wayland/output.c | 30 +++++++-------- backend/wayland/wl_seat.c | 4 +- backend/x11/backend.c | 14 +++---- types/wlr_cursor.c | 30 +++++++-------- types/wlr_data_device.c | 40 ++++++++++---------- types/wlr_idle_inhibit_v1.c | 16 ++++---- types/wlr_layer_shell.c | 8 ++-- types/wlr_output.c | 10 ++--- types/wlr_output_layout.c | 54 +++++++++++++------------- types/wlr_seat.c | 4 +- types/wlr_surface.c | 92 ++++++++++++++++++++++----------------------- types/wlr_wl_shell.c | 9 +++-- types/wlr_xdg_shell.c | 87 +++++++++++++++++++++--------------------- types/wlr_xdg_shell_v6.c | 88 ++++++++++++++++++++++--------------------- xcursor/wlr_xcursor.c | 16 ++++---- xwayland/xwayland.c | 28 +++++++------- xwayland/xwm.c | 8 ++-- 22 files changed, 306 insertions(+), 302 deletions(-) (limited to 'backend/x11') diff --git a/backend/drm/backend.c b/backend/drm/backend.c index 80402f61..c14b99e3 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -15,13 +15,13 @@ #include "backend/drm/drm.h" #include "util/signal.h" -static bool wlr_drm_backend_start(struct wlr_backend *backend) { +static bool backend_start(struct wlr_backend *backend) { struct wlr_drm_backend *drm = (struct wlr_drm_backend *)backend; scan_drm_connectors(drm); return true; } -static void wlr_drm_backend_destroy(struct wlr_backend *backend) { +static void backend_destroy(struct wlr_backend *backend) { if (!backend) { return; } @@ -48,16 +48,16 @@ static void wlr_drm_backend_destroy(struct wlr_backend *backend) { free(drm); } -static struct wlr_renderer *wlr_drm_backend_get_renderer( +static struct wlr_renderer *backend_get_renderer( struct wlr_backend *backend) { struct wlr_drm_backend *drm = (struct wlr_drm_backend *)backend; return drm->renderer.wlr_rend; } static struct wlr_backend_impl backend_impl = { - .start = wlr_drm_backend_start, - .destroy = wlr_drm_backend_destroy, - .get_renderer = wlr_drm_backend_get_renderer, + .start = backend_start, + .destroy = backend_destroy, + .get_renderer = backend_get_renderer, }; bool wlr_backend_is_drm(struct wlr_backend *b) { @@ -110,7 +110,7 @@ static void drm_invalidated(struct wl_listener *listener, void *data) { static void handle_display_destroy(struct wl_listener *listener, void *data) { struct wlr_drm_backend *drm = wl_container_of(listener, drm, display_destroy); - wlr_drm_backend_destroy(&drm->backend); + backend_destroy(&drm->backend); } struct wlr_backend *wlr_drm_backend_create(struct wl_display *display, diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c index 625cabb8..4fcd2fe4 100644 --- a/backend/libinput/backend.c +++ b/backend/libinput/backend.c @@ -7,23 +7,23 @@ #include "backend/libinput.h" #include "util/signal.h" -static int wlr_libinput_open_restricted(const char *path, +static int libinput_open_restricted(const char *path, int flags, void *_backend) { struct wlr_libinput_backend *backend = _backend; return wlr_session_open_file(backend->session, path); } -static void wlr_libinput_close_restricted(int fd, void *_backend) { +static void libinput_close_restricted(int fd, void *_backend) { struct wlr_libinput_backend *backend = _backend; wlr_session_close_file(backend->session, fd); } static const struct libinput_interface libinput_impl = { - .open_restricted = wlr_libinput_open_restricted, - .close_restricted = wlr_libinput_close_restricted + .open_restricted = libinput_open_restricted, + .close_restricted = libinput_close_restricted }; -static int wlr_libinput_readable(int fd, uint32_t mask, void *_backend) { +static int handle_libinput_readable(int fd, uint32_t mask, void *_backend) { struct wlr_libinput_backend *backend = _backend; if (libinput_dispatch(backend->libinput_context) != 0) { wlr_log(L_ERROR, "Failed to dispatch libinput"); @@ -38,12 +38,12 @@ static int wlr_libinput_readable(int fd, uint32_t mask, void *_backend) { return 0; } -static void wlr_libinput_log(struct libinput *libinput_context, +static void log_libinput(struct libinput *libinput_context, enum libinput_log_priority priority, const char *fmt, va_list args) { _wlr_vlog(L_ERROR, fmt, args); } -static bool wlr_libinput_backend_start(struct wlr_backend *_backend) { +static bool backend_start(struct wlr_backend *_backend) { struct wlr_libinput_backend *backend = (struct wlr_libinput_backend *)_backend; wlr_log(L_DEBUG, "Initializing libinput"); @@ -62,7 +62,7 @@ static bool wlr_libinput_backend_start(struct wlr_backend *_backend) { } // TODO: More sophisticated logging - libinput_log_set_handler(backend->libinput_context, wlr_libinput_log); + libinput_log_set_handler(backend->libinput_context, log_libinput); libinput_log_set_priority(backend->libinput_context, LIBINPUT_LOG_PRIORITY_ERROR); int libinput_fd = libinput_get_fd(backend->libinput_context); @@ -73,7 +73,7 @@ static bool wlr_libinput_backend_start(struct wlr_backend *_backend) { } } if (!no_devs && backend->wlr_device_lists.length == 0) { - wlr_libinput_readable(libinput_fd, WL_EVENT_READABLE, backend); + handle_libinput_readable(libinput_fd, WL_EVENT_READABLE, backend); if (backend->wlr_device_lists.length == 0) { wlr_log(L_ERROR, "libinput initialization failed, no input devices"); wlr_log(L_ERROR, "Set WLR_LIBINPUT_NO_DEVICES=1 to suppress this check"); @@ -87,7 +87,7 @@ static bool wlr_libinput_backend_start(struct wlr_backend *_backend) { wl_event_source_remove(backend->input_event); } backend->input_event = wl_event_loop_add_fd(event_loop, libinput_fd, - WL_EVENT_READABLE, wlr_libinput_readable, backend); + WL_EVENT_READABLE, handle_libinput_readable, backend); if (!backend->input_event) { wlr_log(L_ERROR, "Failed to create input event on event loop"); return false; @@ -96,7 +96,7 @@ static bool wlr_libinput_backend_start(struct wlr_backend *_backend) { return true; } -static void wlr_libinput_backend_destroy(struct wlr_backend *wlr_backend) { +static void backend_destroy(struct wlr_backend *wlr_backend) { if (!wlr_backend) { return; } @@ -125,9 +125,9 @@ static void wlr_libinput_backend_destroy(struct wlr_backend *wlr_backend) { free(backend); } -static struct wlr_backend_impl backend_impl = { - .start = wlr_libinput_backend_start, - .destroy = wlr_libinput_backend_destroy +static const struct wlr_backend_impl backend_impl = { + .start = backend_start, + .destroy = backend_destroy, }; bool wlr_backend_is_libinput(struct wlr_backend *b) { @@ -153,7 +153,7 @@ static void session_signal(struct wl_listener *listener, void *data) { static void handle_display_destroy(struct wl_listener *listener, void *data) { struct wlr_libinput_backend *backend = wl_container_of(listener, backend, display_destroy); - wlr_libinput_backend_destroy(&backend->backend); + backend_destroy(&backend->backend); } struct wlr_backend *wlr_libinput_backend_create(struct wl_display *display, diff --git a/backend/libinput/events.c b/backend/libinput/events.c index f0accdd8..ace21a89 100644 --- a/backend/libinput/events.c +++ b/backend/libinput/events.c @@ -24,7 +24,7 @@ struct wlr_input_device *get_appropriate_device( return NULL; } -static void wlr_libinput_device_destroy(struct wlr_input_device *_dev) { +static void input_device_destroy(struct wlr_input_device *_dev) { struct wlr_libinput_input_device *dev = (struct wlr_libinput_input_device *)_dev; libinput_device_unref(dev->handle); wl_list_remove(&dev->wlr_input_device.link); @@ -32,7 +32,7 @@ static void wlr_libinput_device_destroy(struct wlr_input_device *_dev) { } static const struct wlr_input_device_impl input_device_impl = { - .destroy = wlr_libinput_device_destroy + .destroy = input_device_destroy, }; static struct wlr_input_device *allocate_device( diff --git a/backend/libinput/keyboard.c b/backend/libinput/keyboard.c index ae2f0f23..d8dd8878 100644 --- a/backend/libinput/keyboard.c +++ b/backend/libinput/keyboard.c @@ -12,20 +12,20 @@ struct wlr_libinput_keyboard { struct libinput_device *libinput_dev; }; -static void wlr_libinput_keyboard_set_leds(struct wlr_keyboard *wlr_kb, uint32_t leds) { +static void keyboard_set_leds(struct wlr_keyboard *wlr_kb, uint32_t leds) { struct wlr_libinput_keyboard *wlr_libinput_kb = (struct wlr_libinput_keyboard *)wlr_kb; libinput_device_led_update(wlr_libinput_kb->libinput_dev, leds); } -static void wlr_libinput_keyboard_destroy(struct wlr_keyboard *wlr_kb) { +static void keyboard_destroy(struct wlr_keyboard *wlr_kb) { struct wlr_libinput_keyboard *wlr_libinput_kb = (struct wlr_libinput_keyboard *)wlr_kb; libinput_device_unref(wlr_libinput_kb->libinput_dev); } struct wlr_keyboard_impl impl = { - .destroy = wlr_libinput_keyboard_destroy, - .led_update = wlr_libinput_keyboard_set_leds + .destroy = keyboard_destroy, + .led_update = keyboard_set_leds }; struct wlr_keyboard *create_libinput_keyboard( diff --git a/backend/wayland/backend.c b/backend/wayland/backend.c index 8796b784..03e56e22 100644 --- a/backend/wayland/backend.c +++ b/backend/wayland/backend.c @@ -39,7 +39,7 @@ static int dispatch_events(int fd, uint32_t mask, void *data) { * compositor and creates surfaces for each output, then registers globals on * the specified display. */ -static bool wlr_wl_backend_start(struct wlr_backend *_backend) { +static bool backend_start(struct wlr_backend *_backend) { struct wlr_wl_backend *backend = (struct wlr_wl_backend *)_backend; wlr_log(L_INFO, "Initializating wayland backend"); @@ -65,7 +65,7 @@ static bool wlr_wl_backend_start(struct wlr_backend *_backend) { return true; } -static void wlr_wl_backend_destroy(struct wlr_backend *wlr_backend) { +static void backend_destroy(struct wlr_backend *wlr_backend) { struct wlr_wl_backend *backend = (struct wlr_wl_backend *)wlr_backend; if (backend == NULL) { return; @@ -110,16 +110,16 @@ static void wlr_wl_backend_destroy(struct wlr_backend *wlr_backend) { free(backend); } -static struct wlr_renderer *wlr_wl_backend_get_renderer( +static struct wlr_renderer *backend_get_renderer( struct wlr_backend *wlr_backend) { struct wlr_wl_backend *backend = (struct wlr_wl_backend *)wlr_backend; return backend->renderer; } static struct wlr_backend_impl backend_impl = { - .start = wlr_wl_backend_start, - .destroy = wlr_wl_backend_destroy, - .get_renderer = wlr_wl_backend_get_renderer, + .start = backend_start, + .destroy = backend_destroy, + .get_renderer = backend_get_renderer, }; bool wlr_backend_is_wl(struct wlr_backend *b) { @@ -172,7 +172,7 @@ void get_wl_output_layout_box(struct wlr_wl_backend *backend, static void handle_display_destroy(struct wl_listener *listener, void *data) { struct wlr_wl_backend *backend = wl_container_of(listener, backend, local_display_destroy); - wlr_wl_backend_destroy(&backend->backend); + backend_destroy(&backend->backend); } struct wlr_backend *wlr_wl_backend_create(struct wl_display *display, const char *remote) { diff --git a/backend/wayland/output.c b/backend/wayland/output.c index f9e77a67..a49070e8 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -32,7 +32,7 @@ static struct wl_callback_listener frame_listener = { .done = surface_frame_callback }; -static bool wlr_wl_output_set_custom_mode(struct wlr_output *_output, +static bool output_set_custom_mode(struct wlr_output *_output, int32_t width, int32_t height, int32_t refresh) { struct wlr_wl_backend_output *output = (struct wlr_wl_backend_output *)_output; wl_egl_window_resize(output->egl_window, width, height, 0, 0); @@ -40,7 +40,7 @@ static bool wlr_wl_output_set_custom_mode(struct wlr_output *_output, return true; } -static bool wlr_wl_output_make_current(struct wlr_output *wlr_output, +static bool output_make_current(struct wlr_output *wlr_output, int *buffer_age) { struct wlr_wl_backend_output *output = (struct wlr_wl_backend_output *)wlr_output; @@ -48,7 +48,7 @@ static bool wlr_wl_output_make_current(struct wlr_output *wlr_output, buffer_age); } -static bool wlr_wl_output_swap_buffers(struct wlr_output *wlr_output, +static bool output_swap_buffers(struct wlr_output *wlr_output, pixman_region32_t *damage) { struct wlr_wl_backend_output *output = (struct wlr_wl_backend_output *)wlr_output; @@ -65,13 +65,13 @@ static bool wlr_wl_output_swap_buffers(struct wlr_output *wlr_output, damage); } -static void wlr_wl_output_transform(struct wlr_output *_output, +static void output_transform(struct wlr_output *_output, enum wl_output_transform transform) { struct wlr_wl_backend_output *output = (struct wlr_wl_backend_output *)_output; output->wlr_output.transform = transform; } -static bool wlr_wl_output_set_cursor(struct wlr_output *_output, +static bool output_set_cursor(struct wlr_output *_output, const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height, int32_t hotspot_x, int32_t hotspot_y, bool update_pixels) { struct wlr_wl_backend_output *output = @@ -157,7 +157,7 @@ static bool wlr_wl_output_set_cursor(struct wlr_output *_output, return true; } -static void wlr_wl_output_destroy(struct wlr_output *wlr_output) { +static void output_destroy(struct wlr_output *wlr_output) { struct wlr_wl_backend_output *output = (struct wlr_wl_backend_output *)wlr_output; if (output == NULL) { @@ -200,19 +200,19 @@ void update_wl_output_cursor(struct wlr_wl_backend_output *output) { } } -bool wl_output_move_cursor(struct wlr_output *_output, int x, int y) { +bool output_move_cursor(struct wlr_output *_output, int x, int y) { // TODO: only return true if x == current x and y == current y return true; } -static struct wlr_output_impl output_impl = { - .set_custom_mode = wlr_wl_output_set_custom_mode, - .transform = wlr_wl_output_transform, - .destroy = wlr_wl_output_destroy, - .make_current = wlr_wl_output_make_current, - .swap_buffers = wlr_wl_output_swap_buffers, - .set_cursor = wlr_wl_output_set_cursor, - .move_cursor = wl_output_move_cursor, +static const struct wlr_output_impl output_impl = { + .set_custom_mode = output_set_custom_mode, + .transform = output_transform, + .destroy = output_destroy, + .make_current = output_make_current, + .swap_buffers = output_swap_buffers, + .set_cursor = output_set_cursor, + .move_cursor = output_move_cursor, }; bool wlr_output_is_wl(struct wlr_output *wlr_output) { diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c index e580afd3..03f1c727 100644 --- a/backend/wayland/wl_seat.c +++ b/backend/wayland/wl_seat.c @@ -235,7 +235,7 @@ static struct wlr_input_device *allocate_device(struct wlr_wl_backend *backend, return wlr_device; } -static void wlr_wl_pointer_handle_output_destroy(struct wl_listener *listener, +static void pointer_handle_output_destroy(struct wl_listener *listener, void *data) { struct wlr_wl_pointer *wlr_wl_pointer = wl_container_of(listener, wlr_wl_pointer, output_destroy_listener); @@ -256,7 +256,7 @@ static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, return; } wlr_wl_pointer->output_destroy_listener.notify = - wlr_wl_pointer_handle_output_destroy; + pointer_handle_output_destroy; struct wlr_input_device *wlr_device; if (!(wlr_device = allocate_device(backend, WLR_INPUT_DEVICE_POINTER))) { diff --git a/backend/x11/backend.c b/backend/x11/backend.c index 8b5fc195..4a615e67 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -120,7 +120,7 @@ static int x11_event(int fd, uint32_t mask, void *data) { return 0; } -static bool wlr_x11_backend_start(struct wlr_backend *backend) { +static bool backend_start(struct wlr_backend *backend) { struct wlr_x11_backend *x11 = (struct wlr_x11_backend *)backend; x11->started = true; @@ -209,7 +209,7 @@ static bool wlr_x11_backend_start(struct wlr_backend *backend) { return true; } -static void wlr_x11_backend_destroy(struct wlr_backend *backend) { +static void backend_destroy(struct wlr_backend *backend) { if (!backend) { return; } @@ -250,16 +250,16 @@ static void wlr_x11_backend_destroy(struct wlr_backend *backend) { free(x11); } -static struct wlr_renderer *wlr_x11_backend_get_renderer( +static struct wlr_renderer *backend_get_renderer( struct wlr_backend *backend) { struct wlr_x11_backend *x11 = (struct wlr_x11_backend *)backend; return x11->renderer; } static const struct wlr_backend_impl backend_impl = { - .start = wlr_x11_backend_start, - .destroy = wlr_x11_backend_destroy, - .get_renderer = wlr_x11_backend_get_renderer, + .start = backend_start, + .destroy = backend_destroy, + .get_renderer = backend_get_renderer, }; bool wlr_backend_is_x11(struct wlr_backend *backend) { @@ -269,7 +269,7 @@ bool wlr_backend_is_x11(struct wlr_backend *backend) { static void handle_display_destroy(struct wl_listener *listener, void *data) { struct wlr_x11_backend *x11 = wl_container_of(listener, x11, display_destroy); - wlr_x11_backend_destroy(&x11->backend); + backend_destroy(&x11->backend); } struct wlr_backend *wlr_x11_backend_create(struct wl_display *display, diff --git a/types/wlr_cursor.c b/types/wlr_cursor.c index c24601d6..7f0e6c62 100644 --- a/types/wlr_cursor.c +++ b/types/wlr_cursor.c @@ -107,7 +107,7 @@ static void output_cursor_destroy( free(output_cursor); } -static void wlr_cursor_detach_output_layout(struct wlr_cursor *cur) { +static void cursor_detach_output_layout(struct wlr_cursor *cur) { if (!cur->state->layout) { return; } @@ -125,7 +125,7 @@ static void wlr_cursor_detach_output_layout(struct wlr_cursor *cur) { cur->state->layout = NULL; } -static void wlr_cursor_device_destroy(struct wlr_cursor_device *c_device) { +static void cursor_device_destroy(struct wlr_cursor_device *c_device) { struct wlr_input_device *dev = c_device->device; if (dev->type == WLR_INPUT_DEVICE_POINTER) { wl_list_remove(&c_device->motion.link); @@ -150,11 +150,11 @@ static void wlr_cursor_device_destroy(struct wlr_cursor_device *c_device) { } void wlr_cursor_destroy(struct wlr_cursor *cur) { - wlr_cursor_detach_output_layout(cur); + cursor_detach_output_layout(cur); struct wlr_cursor_device *device, *device_tmp = NULL; wl_list_for_each_safe(device, device_tmp, &cur->state->devices, link) { - wlr_cursor_device_destroy(device); + cursor_device_destroy(device); } free(cur->state); @@ -174,7 +174,7 @@ static struct wlr_cursor_device *get_cursor_device(struct wlr_cursor *cur, return ret; } -static void wlr_cursor_warp_unchecked(struct wlr_cursor *cur, +static void cursor_warp_unchecked(struct wlr_cursor *cur, double x, double y) { assert(cur->state->layout); @@ -241,12 +241,12 @@ bool wlr_cursor_warp(struct wlr_cursor *cur, struct wlr_input_device *dev, if (mapping) { if (wlr_box_contains_point(mapping, x, y)) { - wlr_cursor_warp_unchecked(cur, x, y); + cursor_warp_unchecked(cur, x, y); result = true; } } else if (wlr_output_layout_contains_point(cur->state->layout, NULL, x, y)) { - wlr_cursor_warp_unchecked(cur, x, y); + cursor_warp_unchecked(cur, x, y); result = true; } @@ -265,7 +265,7 @@ void wlr_cursor_warp_absolute(struct wlr_cursor *cur, x = x >= 0 ? mapping->width * x + mapping->x : cur->x; y = y >= 0 ? mapping->height * y + mapping->y : cur->y; - wlr_cursor_warp_unchecked(cur, x, y); + cursor_warp_unchecked(cur, x, y); } void wlr_cursor_move(struct wlr_cursor *cur, struct wlr_input_device *dev, @@ -295,7 +295,7 @@ void wlr_cursor_move(struct wlr_cursor *cur, struct wlr_input_device *dev, } } - wlr_cursor_warp_unchecked(cur, x, y); + cursor_warp_unchecked(cur, x, y); } void wlr_cursor_set_image(struct wlr_cursor *cur, const uint8_t *pixels, @@ -414,7 +414,7 @@ static void handle_device_destroy(struct wl_listener *listener, void *data) { wlr_cursor_detach_input_device(c_device->cursor, c_device->device); } -static struct wlr_cursor_device *wlr_cursor_device_create( +static struct wlr_cursor_device *cursor_device_create( struct wlr_cursor *cursor, struct wlr_input_device *device) { struct wlr_cursor_device *c_device = calloc(1, sizeof(struct wlr_cursor_device)); @@ -496,7 +496,7 @@ void wlr_cursor_attach_input_device(struct wlr_cursor *cur, } } - wlr_cursor_device_create(cur, dev); + cursor_device_create(cur, dev); } void wlr_cursor_detach_input_device(struct wlr_cursor *cur, @@ -504,7 +504,7 @@ void wlr_cursor_detach_input_device(struct wlr_cursor *cur, struct wlr_cursor_device *c_device, *tmp = NULL; wl_list_for_each_safe(c_device, tmp, &cur->state->devices, link) { if (c_device->device == dev) { - wlr_cursor_device_destroy(c_device); + cursor_device_destroy(c_device); } } } @@ -512,7 +512,7 @@ void wlr_cursor_detach_input_device(struct wlr_cursor *cur, static void handle_layout_destroy(struct wl_listener *listener, void *data) { struct wlr_cursor_state *state = wl_container_of(listener, state, layout_destroy); - wlr_cursor_detach_output_layout(state->cursor); + cursor_detach_output_layout(state->cursor); } static void handle_layout_output_destroy(struct wl_listener *listener, @@ -567,13 +567,13 @@ static void handle_layout_change(struct wl_listener *listener, void *data) { wlr_output_layout_closest_point(layout, NULL, state->cursor->x, state->cursor->y, &x, &y); - wlr_cursor_warp_unchecked(state->cursor, x, y); + cursor_warp_unchecked(state->cursor, x, y); } } void wlr_cursor_attach_output_layout(struct wlr_cursor *cur, struct wlr_output_layout *l) { - wlr_cursor_detach_output_layout(cur); + cursor_detach_output_layout(cur); if (l == NULL) { return; diff --git a/types/wlr_data_device.c b/types/wlr_data_device.c index 13b1d08a..23e54809 100644 --- a/types/wlr_data_device.c +++ b/types/wlr_data_device.c @@ -219,7 +219,7 @@ static void handle_offer_source_destroyed(struct wl_listener *listener, offer->source = NULL; } -static struct wlr_data_offer *wlr_data_source_send_offer( +static struct wlr_data_offer *data_source_send_offer( struct wlr_data_source *source, struct wlr_seat_client *target) { if (wl_list_empty(&target->data_devices)) { @@ -268,7 +268,7 @@ void wlr_seat_client_send_selection(struct wlr_seat_client *seat_client) { } if (seat_client->seat->selection_source) { - struct wlr_data_offer *offer = wlr_data_source_send_offer( + struct wlr_data_offer *offer = data_source_send_offer( seat_client->seat->selection_source, seat_client); if (offer == NULL) { return; @@ -375,7 +375,7 @@ static void handle_drag_seat_client_destroy(struct wl_listener *listener, wl_list_remove(&drag->seat_client_destroy.link); } -static void wlr_drag_set_focus(struct wlr_drag *drag, +static void drag_set_focus(struct wlr_drag *drag, struct wlr_surface *surface, double sx, double sy) { if (drag->focus == surface) { return; @@ -420,7 +420,7 @@ static void wlr_drag_set_focus(struct wlr_drag *drag, struct wl_resource *offer_resource = NULL; if (drag->source) { drag->source->accepted = false; - struct wlr_data_offer *offer = wlr_data_source_send_offer(drag->source, + struct wlr_data_offer *offer = data_source_send_offer(drag->source, focus_client); if (offer != NULL) { data_offer_update_action(offer); @@ -454,7 +454,7 @@ static void wlr_drag_set_focus(struct wlr_drag *drag, wlr_signal_emit_safe(&drag->events.focus, drag); } -static void wlr_drag_end(struct wlr_drag *drag) { +static void drag_end(struct wlr_drag *drag) { if (!drag->cancelling) { drag->cancelling = true; if (drag->is_pointer_grab) { @@ -468,7 +468,7 @@ static void wlr_drag_end(struct wlr_drag *drag) { wl_list_remove(&drag->source_destroy.link); } - wlr_drag_set_focus(drag, NULL, 0, 0); + drag_set_focus(drag, NULL, 0, 0); if (drag->icon) { drag->icon->mapped = false; @@ -484,7 +484,7 @@ static void wlr_drag_end(struct wlr_drag *drag) { static void pointer_drag_enter(struct wlr_seat_pointer_grab *grab, struct wlr_surface *surface, double sx, double sy) { struct wlr_drag *drag = grab->data; - wlr_drag_set_focus(drag, surface, sx, sy); + drag_set_focus(drag, surface, sx, sy); } static void pointer_drag_motion(struct wlr_seat_pointer_grab *grab, @@ -540,7 +540,7 @@ static uint32_t pointer_drag_button(struct wlr_seat_pointer_grab *grab, if (grab->seat->pointer_state.button_count == 0 && state == WL_POINTER_BUTTON_STATE_RELEASED) { - wlr_drag_end(drag); + drag_end(drag); } return 0; @@ -553,7 +553,7 @@ static void pointer_drag_axis(struct wlr_seat_pointer_grab *grab, uint32_t time, static void pointer_drag_cancel(struct wlr_seat_pointer_grab *grab) { struct wlr_drag *drag = grab->data; - wlr_drag_end(drag); + drag_end(drag); } static const struct wlr_pointer_grab_interface @@ -585,7 +585,7 @@ static void touch_drag_up(struct wlr_seat_touch_grab *grab, uint32_t time, } } - wlr_drag_end(drag); + drag_end(drag); } static void touch_drag_motion(struct wlr_seat_touch_grab *grab, uint32_t time, @@ -604,12 +604,12 @@ static void touch_drag_motion(struct wlr_seat_touch_grab *grab, uint32_t time, static void touch_drag_enter(struct wlr_seat_touch_grab *grab, uint32_t time, struct wlr_touch_point *point) { struct wlr_drag *drag = grab->data; - wlr_drag_set_focus(drag, point->focus_surface, point->sx, point->sy); + drag_set_focus(drag, point->focus_surface, point->sx, point->sy); } static void touch_drag_cancel(struct wlr_seat_touch_grab *grab) { struct wlr_drag *drag = grab->data; - wlr_drag_end(drag); + drag_end(drag); } static const struct wlr_touch_grab_interface @@ -641,7 +641,7 @@ static void keyboard_drag_modifiers(struct wlr_seat_keyboard_grab *grab, static void keyboard_drag_cancel(struct wlr_seat_keyboard_grab *grab) { struct wlr_drag *drag = grab->data; - wlr_drag_end(drag); + drag_end(drag); } static const struct wlr_keyboard_grab_interface @@ -660,10 +660,10 @@ static void drag_handle_icon_destroy(struct wl_listener *listener, void *data) { static void drag_handle_drag_source_destroy(struct wl_listener *listener, void *data) { struct wlr_drag *drag = wl_container_of(listener, drag, source_destroy); - wlr_drag_end(drag); + drag_end(drag); } -static void wlr_drag_icon_destroy(struct wlr_drag_icon *icon) { +static void drag_icon_destroy(struct wlr_drag_icon *icon) { if (!icon) { return; } @@ -679,7 +679,7 @@ static void handle_drag_icon_surface_destroy(struct wl_listener *listener, void *data) { struct wlr_drag_icon *icon = wl_container_of(listener, icon, surface_destroy); - wlr_drag_icon_destroy(icon); + drag_icon_destroy(icon); } static void handle_drag_icon_surface_commit(struct wlr_surface *surface, @@ -694,10 +694,10 @@ static void handle_drag_icon_seat_client_destroy(struct wl_listener *listener, struct wlr_drag_icon *icon = wl_container_of(listener, icon, seat_client_destroy); - wlr_drag_icon_destroy(icon); + drag_icon_destroy(icon); } -static struct wlr_drag_icon *wlr_drag_icon_create( +static struct wlr_drag_icon *drag_icon_create( struct wlr_surface *icon_surface, struct wlr_seat_client *client, bool is_pointer, int32_t touch_id) { struct wlr_drag_icon *icon = calloc(1, sizeof(struct wlr_drag_icon)); @@ -780,7 +780,7 @@ static bool seat_client_start_drag(struct wlr_seat_client *client, if (icon_surface) { int32_t touch_id = (point ? point->touch_id : 0); struct wlr_drag_icon *icon = - wlr_drag_icon_create(icon_surface, client, drag->is_pointer_grab, + drag_icon_create(icon_surface, client, drag->is_pointer_grab, touch_id); if (!icon) { free(drag); @@ -817,7 +817,7 @@ static bool seat_client_start_drag(struct wlr_seat_client *client, } else { assert(point); wlr_seat_touch_start_grab(seat, &drag->touch_grab); - wlr_drag_set_focus(drag, point->surface, point->sx, point->sy); + drag_set_focus(drag, point->surface, point->sx, point->sy); } seat->drag = drag; // TODO: unset this thing somewhere diff --git a/types/wlr_idle_inhibit_v1.c b/types/wlr_idle_inhibit_v1.c index 3a5fc810..a36992d5 100644 --- a/types/wlr_idle_inhibit_v1.c +++ b/types/wlr_idle_inhibit_v1.c @@ -8,9 +8,9 @@ #include "wayland-server.h" #include "idle-inhibit-unstable-v1-protocol.h" -static struct zwp_idle_inhibit_manager_v1_interface idle_inhibit_impl; +static const struct zwp_idle_inhibit_manager_v1_interface idle_inhibit_impl; -static struct zwp_idle_inhibitor_v1_interface idle_inhibitor_impl; +static const struct zwp_idle_inhibitor_v1_interface idle_inhibitor_impl; static struct wlr_idle_inhibit_manager_v1 * wlr_idle_inhibit_manager_v1_from_resource(struct wl_resource *resource) { @@ -50,11 +50,11 @@ static void idle_inhibitor_v1_handle_destroy(struct wl_client *client, wl_resource_destroy(manager_resource); } -static struct zwp_idle_inhibitor_v1_interface idle_inhibitor_impl = { +static const struct zwp_idle_inhibitor_v1_interface idle_inhibitor_impl = { .destroy = idle_inhibitor_v1_handle_destroy, }; -static void wlr_create_inhibitor(struct wl_client *client, +static void manager_create_inhibitor(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource) { struct wlr_surface *surface = wlr_surface_from_resource(surface_resource); @@ -96,14 +96,14 @@ static void idle_inhibit_manager_v1_destroy(struct wl_resource *resource) { wl_list_remove(wl_resource_get_link(resource)); } -static void idle_inhibit_manager_v1_handle_destroy(struct wl_client *client, +static void manager_destroy(struct wl_client *client, struct wl_resource *manager_resource) { wl_resource_destroy(manager_resource); } -static struct zwp_idle_inhibit_manager_v1_interface idle_inhibit_impl = { - .destroy = idle_inhibit_manager_v1_handle_destroy, - .create_inhibitor = wlr_create_inhibitor, +static const struct zwp_idle_inhibit_manager_v1_interface idle_inhibit_impl = { + .destroy = manager_destroy, + .create_inhibitor = manager_create_inhibitor, }; static void handle_display_destroy(struct wl_listener *listener, void *data) { diff --git a/types/wlr_layer_shell.c b/types/wlr_layer_shell.c index ec73bc61..1fd0977b 100644 --- a/types/wlr_layer_shell.c +++ b/types/wlr_layer_shell.c @@ -195,7 +195,7 @@ static void layer_surface_resource_destroy(struct wl_resource *resource) { } } -static bool wlr_layer_surface_state_changed(struct wlr_layer_surface *surface) { +static bool layer_surface_state_changed(struct wlr_layer_surface *surface) { struct wlr_layer_surface_state *state; if (wl_list_empty(&surface->configure_list)) { if (surface->acked_configure) { @@ -220,7 +220,7 @@ void wlr_layer_surface_configure(struct wlr_layer_surface *surface, uint32_t width, uint32_t height) { surface->server_pending.actual_width = width; surface->server_pending.actual_height = height; - if (wlr_layer_surface_state_changed(surface)) { + if (layer_surface_state_changed(surface)) { struct wl_display *display = wl_client_get_display(wl_resource_get_client(surface->resource)); struct wlr_layer_surface_configure *configure = @@ -249,7 +249,7 @@ void wlr_layer_surface_close(struct wlr_layer_surface *surface) { zwlr_layer_surface_v1_send_closed(surface->resource); } -static void handle_wlr_surface_committed(struct wlr_surface *wlr_surface, +static void handle_surface_committed(struct wlr_surface *wlr_surface, void *role_data) { struct wlr_layer_surface *surface = role_data; @@ -372,7 +372,7 @@ static void layer_shell_handle_get_layer_surface(struct wl_client *wl_client, wl_signal_init(&surface->events.new_popup); wlr_surface_set_role_committed(surface->surface, - handle_wlr_surface_committed, surface); + handle_surface_committed, surface); wlr_log(L_DEBUG, "new layer_surface %p (res %p)", surface, surface->resource); diff --git a/types/wlr_output.c b/types/wlr_output.c index 9cb3b6de..a8361ead 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -48,7 +48,7 @@ static void wl_output_send_to_resource(struct wl_resource *resource) { } } -static void wlr_output_send_current_mode_to_resource( +static void output_send_current_mode_to_resource( struct wl_resource *resource) { struct wlr_output *output = wlr_output_from_resource(resource); const uint32_t version = wl_resource_get_version(resource); @@ -138,7 +138,7 @@ void wlr_output_update_enabled(struct wlr_output *output, bool enabled) { wlr_signal_emit_safe(&output->events.enable, output); } -static void wlr_output_update_matrix(struct wlr_output *output) { +static void output_update_matrix(struct wlr_output *output) { wlr_matrix_projection(output->transform_matrix, output->width, output->height, output->transform); } @@ -185,13 +185,13 @@ void wlr_output_update_custom_mode(struct wlr_output *output, int32_t width, output->width = width; output->height = height; - wlr_output_update_matrix(output); + output_update_matrix(output); output->refresh = refresh; struct wl_resource *resource; wl_resource_for_each(resource, &output->wl_resources) { - wlr_output_send_current_mode_to_resource(resource); + output_send_current_mode_to_resource(resource); } wlr_signal_emit_safe(&output->events.mode, output); @@ -200,7 +200,7 @@ void wlr_output_update_custom_mode(struct wlr_output *output, int32_t width, void wlr_output_set_transform(struct wlr_output *output, enum wl_output_transform transform) { output->impl->transform(output, transform); - wlr_output_update_matrix(output); + output_update_matrix(output); // TODO: only send geometry and done struct wl_resource *resource; diff --git a/types/wlr_output_layout.c b/types/wlr_output_layout.c index 1a06f71e..38329a48 100644 --- a/types/wlr_output_layout.c +++ b/types/wlr_output_layout.c @@ -45,7 +45,7 @@ struct wlr_output_layout *wlr_output_layout_create() { return layout; } -static void wlr_output_layout_output_destroy( +static void output_layout_output_destroy( struct wlr_output_layout_output *l_output) { wlr_signal_emit_safe(&l_output->events.destroy, l_output); wlr_output_destroy_global(l_output->output); @@ -67,14 +67,14 @@ void wlr_output_layout_destroy(struct wlr_output_layout *layout) { struct wlr_output_layout_output *l_output, *temp; wl_list_for_each_safe(l_output, temp, &layout->outputs, link) { - wlr_output_layout_output_destroy(l_output); + output_layout_output_destroy(l_output); } free(layout->state); free(layout); } -static struct wlr_box *wlr_output_layout_output_get_box( +static struct wlr_box *output_layout_output_get_box( struct wlr_output_layout_output *l_output) { l_output->state->_box.x = l_output->x; l_output->state->_box.y = l_output->y; @@ -92,7 +92,7 @@ static struct wlr_box *wlr_output_layout_output_get_box( * Auto configured outputs are placed to the right of the north east corner of * the rightmost output in the layout in a horizontal line. */ -static void wlr_output_layout_reconfigure(struct wlr_output_layout *layout) { +static void output_layout_reconfigure(struct wlr_output_layout *layout) { int max_x = INT_MIN; int max_x_y = INT_MIN; // y value for the max_x output @@ -104,7 +104,7 @@ static void wlr_output_layout_reconfigure(struct wlr_output_layout *layout) { continue; } - struct wlr_box *box = wlr_output_layout_output_get_box(l_output); + struct wlr_box *box = output_layout_output_get_box(l_output); if (box->x + box->width > max_x) { max_x = box->x + box->width; max_x_y = box->y; @@ -121,7 +121,7 @@ static void wlr_output_layout_reconfigure(struct wlr_output_layout *layout) { if (!l_output->state->auto_configured) { continue; } - struct wlr_box *box = wlr_output_layout_output_get_box(l_output); + struct wlr_box *box = output_layout_output_get_box(l_output); l_output->x = max_x; l_output->y = max_x_y; max_x += box->width; @@ -137,30 +137,30 @@ static void wlr_output_layout_reconfigure(struct wlr_output_layout *layout) { static void handle_output_mode(struct wl_listener *listener, void *data) { struct wlr_output_layout_output_state *state = wl_container_of(listener, state, mode); - wlr_output_layout_reconfigure(state->layout); + output_layout_reconfigure(state->layout); } static void handle_output_scale(struct wl_listener *listener, void *data) { struct wlr_output_layout_output_state *state = wl_container_of(listener, state, scale); - wlr_output_layout_reconfigure(state->layout); + output_layout_reconfigure(state->layout); } static void handle_output_transform(struct wl_listener *listener, void *data) { struct wlr_output_layout_output_state *state = wl_container_of(listener, state, transform); - wlr_output_layout_reconfigure(state->layout); + output_layout_reconfigure(state->layout); } static void handle_output_destroy(struct wl_listener *listener, void *data) { struct wlr_output_layout_output_state *state = wl_container_of(listener, state, output_destroy); struct wlr_output_layout *layout = state->layout; - wlr_output_layout_output_destroy(state->l_output); - wlr_output_layout_reconfigure(layout); + output_layout_output_destroy(state->l_output); + output_layout_reconfigure(layout); } -static struct wlr_output_layout_output *wlr_output_layout_output_create( +static struct wlr_output_layout_output *output_layout_output_create( struct wlr_output_layout *layout, struct wlr_output *output) { struct wlr_output_layout_output *l_output = calloc(1, sizeof(struct wlr_output_layout_output)); @@ -195,7 +195,7 @@ void wlr_output_layout_add(struct wlr_output_layout *layout, struct wlr_output_layout_output *l_output = wlr_output_layout_get(layout, output); if (!l_output) { - l_output = wlr_output_layout_output_create(layout, output); + l_output = output_layout_output_create(layout, output); if (!l_output) { wlr_log(L_ERROR, "Failed to create wlr_output_layout_output"); return; @@ -204,7 +204,7 @@ void wlr_output_layout_add(struct wlr_output_layout *layout, l_output->x = lx; l_output->y = ly; l_output->state->auto_configured = false; - wlr_output_layout_reconfigure(layout); + output_layout_reconfigure(layout); wlr_output_create_global(output); wlr_signal_emit_safe(&layout->events.add, l_output); } @@ -225,7 +225,7 @@ bool wlr_output_layout_contains_point(struct wlr_output_layout *layout, if (reference) { struct wlr_output_layout_output *l_output = wlr_output_layout_get(layout, reference); - struct wlr_box *box = wlr_output_layout_output_get_box(l_output); + struct wlr_box *box = output_layout_output_get_box(l_output); return wlr_box_contains_point(box, lx, ly); } else { return !!wlr_output_layout_output_at(layout, lx, ly); @@ -240,7 +240,7 @@ bool wlr_output_layout_intersects(struct wlr_output_layout *layout, struct wlr_output_layout_output *l_output; wl_list_for_each(l_output, &layout->outputs, link) { struct wlr_box *output_box = - wlr_output_layout_output_get_box(l_output); + output_layout_output_get_box(l_output); if (wlr_box_intersection(output_box, target_lbox, &out_box)) { return true; } @@ -253,7 +253,7 @@ bool wlr_output_layout_intersects(struct wlr_output_layout *layout, return false; } - struct wlr_box *output_box = wlr_output_layout_output_get_box(l_output); + struct wlr_box *output_box = output_layout_output_get_box(l_output); return wlr_box_intersection(output_box, target_lbox, &out_box); } } @@ -262,7 +262,7 @@ struct wlr_output *wlr_output_layout_output_at(struct wlr_output_layout *layout, double lx, double ly) { struct wlr_output_layout_output *l_output; wl_list_for_each(l_output, &layout->outputs, link) { - struct wlr_box *box = wlr_output_layout_output_get_box(l_output); + struct wlr_box *box = output_layout_output_get_box(l_output); if (wlr_box_contains_point(box, lx, ly)) { return l_output->output; } @@ -278,7 +278,7 @@ void wlr_output_layout_move(struct wlr_output_layout *layout, l_output->x = lx; l_output->y = ly; l_output->state->auto_configured = false; - wlr_output_layout_reconfigure(layout); + output_layout_reconfigure(layout); } else { wlr_log(L_ERROR, "output not found in this layout: %s", output->name); } @@ -289,8 +289,8 @@ void wlr_output_layout_remove(struct wlr_output_layout *layout, struct wlr_output_layout_output *l_output = wlr_output_layout_get(layout, output); if (l_output) { - wlr_output_layout_output_destroy(l_output); - wlr_output_layout_reconfigure(layout); + output_layout_output_destroy(l_output); + output_layout_reconfigure(layout); } } @@ -325,7 +325,7 @@ void wlr_output_layout_closest_point(struct wlr_output_layout *layout, } double output_x, output_y, output_distance; - struct wlr_box *box = wlr_output_layout_output_get_box(l_output); + struct wlr_box *box = output_layout_output_get_box(l_output); wlr_box_closest_point(box, lx, ly, &output_x, &output_y); // calculate squared distance suitable for comparison @@ -359,7 +359,7 @@ struct wlr_box *wlr_output_layout_get_box( l_output = wlr_output_layout_get(layout, reference); if (l_output) { - return wlr_output_layout_output_get_box(l_output); + return output_layout_output_get_box(l_output); } else { return NULL; } @@ -368,7 +368,7 @@ struct wlr_box *wlr_output_layout_get_box( int min_x = INT_MAX, min_y = INT_MAX; int max_x = INT_MIN, max_y = INT_MIN; wl_list_for_each(l_output, &layout->outputs, link) { - struct wlr_box *box = wlr_output_layout_output_get_box(l_output); + struct wlr_box *box = output_layout_output_get_box(l_output); if (box->x < min_x) { min_x = box->x; @@ -400,7 +400,7 @@ void wlr_output_layout_add_auto(struct wlr_output_layout *layout, struct wlr_output_layout_output *l_output = wlr_output_layout_get(layout, output); if (!l_output) { - l_output = wlr_output_layout_output_create(layout, output); + l_output = output_layout_output_create(layout, output); if (!l_output) { wlr_log(L_ERROR, "Failed to create wlr_output_layout_output"); return; @@ -408,7 +408,7 @@ void wlr_output_layout_add_auto(struct wlr_output_layout *layout, } l_output->state->auto_configured = true; - wlr_output_layout_reconfigure(layout); + output_layout_reconfigure(layout); wlr_output_create_global(output); wlr_signal_emit_safe(&layout->events.add, l_output); } @@ -445,7 +445,7 @@ struct wlr_output *wlr_output_layout_adjacent_output( if (reference != NULL && reference == l_output->output) { continue; } - struct wlr_box *box = wlr_output_layout_output_get_box(l_output); + struct wlr_box *box = output_layout_output_get_box(l_output); bool match = false; // test to make sure this output is in the given direction diff --git a/types/wlr_seat.c b/types/wlr_seat.c index 5e5de235..f77a492d 100644 --- a/types/wlr_seat.c +++ b/types/wlr_seat.c @@ -185,7 +185,7 @@ static void wl_seat_get_touch(struct wl_client *client, wl_list_insert(&seat_client->touches, wl_resource_get_link(resource)); } -static void wlr_seat_client_resource_destroy(struct wl_resource *seat_resource) { +static void seat_client_resource_destroy(struct wl_resource *seat_resource) { struct wlr_seat_client *client = wlr_seat_client_from_resource(seat_resource); wlr_signal_emit_safe(&client->events.destroy, client); @@ -251,7 +251,7 @@ static void wl_seat_bind(struct wl_client *client, void *_wlr_seat, wl_list_init(&seat_client->data_devices); wl_list_init(&seat_client->primary_selection_devices); wl_resource_set_implementation(seat_client->wl_resource, &wl_seat_impl, - seat_client, wlr_seat_client_resource_destroy); + seat_client, seat_client_resource_destroy); wl_list_insert(&wlr_seat->clients, &seat_client->link); if (version >= WL_SEAT_NAME_SINCE_VERSION) { wl_seat_send_name(seat_client->wl_resource, wlr_seat->name); diff --git a/types/wlr_surface.c b/types/wlr_surface.c index e1807498..1304f8b9 100644 --- a/types/wlr_surface.c +++ b/types/wlr_surface.c @@ -11,7 +11,7 @@ #include #include "util/signal.h" -static void wlr_surface_state_reset_buffer(struct wlr_surface_state *state) { +static void surface_state_reset_buffer(struct wlr_surface_state *state) { if (state->buffer) { wl_list_remove(&state->buffer_destroy_listener.link); state->buffer = NULL; @@ -26,7 +26,7 @@ static void buffer_destroy(struct wl_listener *listener, void *data) { state->buffer = NULL; } -static void wlr_surface_state_release_buffer(struct wlr_surface_state *state) { +static void surface_state_release_buffer(struct wlr_surface_state *state) { if (state->buffer) { wl_resource_post_event(state->buffer, WL_BUFFER_RELEASE); wl_list_remove(&state->buffer_destroy_listener.link); @@ -34,7 +34,7 @@ static void wlr_surface_state_release_buffer(struct wlr_surface_state *state) { } } -static void wlr_surface_state_set_buffer(struct wlr_surface_state *state, +static void surface_state_set_buffer(struct wlr_surface_state *state, struct wl_resource *buffer) { state->buffer = buffer; if (buffer) { @@ -57,8 +57,8 @@ static void surface_attach(struct wl_client *client, surface->pending->invalid |= WLR_SURFACE_INVALID_BUFFER; surface->pending->sx = sx; surface->pending->sy = sy; - wlr_surface_state_reset_buffer(surface->pending); - wlr_surface_state_set_buffer(surface->pending, buffer); + surface_state_reset_buffer(surface->pending); + surface_state_set_buffer(surface->pending, buffer); } static void surface_damage(struct wl_client *client, @@ -143,7 +143,7 @@ static void surface_set_input_region(struct wl_client *client, } } -static bool wlr_surface_update_size(struct wlr_surface *surface, +static bool surface_update_size(struct wlr_surface *surface, struct wlr_surface_state *state) { if (!state->buffer) { pixman_region32_union_rect(&state->surface_damage, @@ -207,7 +207,7 @@ static bool wlr_surface_update_size(struct wlr_surface *surface, /** * Append pending state to current state and clear pending state. */ -static void wlr_surface_move_state(struct wlr_surface *surface, +static void surface_move_state(struct wlr_surface *surface, struct wlr_surface_state *next, struct wlr_surface_state *state) { bool update_damage = false; bool update_size = false; @@ -224,15 +224,15 @@ static void wlr_surface_move_state(struct wlr_surface *surface, update_size = true; } if ((next->invalid & WLR_SURFACE_INVALID_BUFFER)) { - wlr_surface_state_release_buffer(state); - wlr_surface_state_set_buffer(state, next->buffer); - wlr_surface_state_reset_buffer(next); + surface_state_release_buffer(state); + surface_state_set_buffer(state, next->buffer); + surface_state_reset_buffer(next); state->sx = next->sx; state->sy = next->sy; update_size = true; } if (update_size) { - update_damage = wlr_surface_update_size(surface, state); + update_damage = surface_update_size(surface, state); } if ((next->invalid & WLR_SURFACE_INVALID_SURFACE_DAMAGE)) { pixman_region32_intersect_rect(&next->surface_damage, @@ -312,7 +312,7 @@ static void wlr_surface_move_state(struct wlr_surface *surface, next->invalid = 0; } -static void wlr_surface_damage_subsurfaces(struct wlr_subsurface *subsurface) { +static void surface_damage_subsurfaces(struct wlr_subsurface *subsurface) { // XXX: This is probably the wrong way to do it, because this damage should // come from the client, but weston doesn't do it correctly either and it // seems to work ok. See the comment on weston_surface_damage for more info @@ -327,11 +327,11 @@ static void wlr_surface_damage_subsurfaces(struct wlr_subsurface *subsurface) { struct wlr_subsurface *child; wl_list_for_each(child, &subsurface->surface->subsurfaces, parent_link) { - wlr_surface_damage_subsurfaces(child); + surface_damage_subsurfaces(child); } } -static void wlr_surface_apply_damage(struct wlr_surface *surface, +static void surface_apply_damage(struct wlr_surface *surface, bool invalid_buffer, bool reupload_buffer) { struct wl_resource *resource = surface->current->buffer; if (resource == NULL) { @@ -392,17 +392,17 @@ static void wlr_surface_apply_damage(struct wlr_surface *surface, } } - wlr_surface_state_release_buffer(surface->current); + surface_state_release_buffer(surface->current); } -static void wlr_surface_commit_pending(struct wlr_surface *surface) { +static void surface_commit_pending(struct wlr_surface *surface) { int32_t oldw = surface->current->buffer_width; int32_t oldh = surface->current->buffer_height; bool invalid_buffer = surface->pending->invalid & WLR_SURFACE_INVALID_BUFFER; bool null_buffer_commit = invalid_buffer && surface->pending->buffer == NULL; - wlr_surface_move_state(surface, surface->pending, surface->current); + surface_move_state(surface, surface->pending, surface->current); if (null_buffer_commit) { wlr_texture_destroy(surface->texture); @@ -411,7 +411,7 @@ static void wlr_surface_commit_pending(struct wlr_surface *surface) { bool reupload_buffer = oldw != surface->current->buffer_width || oldh != surface->current->buffer_height; - wlr_surface_apply_damage(surface, invalid_buffer, reupload_buffer); + surface_apply_damage(surface, invalid_buffer, reupload_buffer); // commit subsurface order struct wlr_subsurface *subsurface; @@ -422,7 +422,7 @@ static void wlr_surface_commit_pending(struct wlr_surface *surface) { if (subsurface->reordered) { // TODO: damage all the subsurfaces - wlr_surface_damage_subsurfaces(subsurface); + surface_damage_subsurfaces(subsurface); } } @@ -437,7 +437,7 @@ static void wlr_surface_commit_pending(struct wlr_surface *surface) { pixman_region32_clear(&surface->current->buffer_damage); } -static bool wlr_subsurface_is_synchronized(struct wlr_subsurface *subsurface) { +static bool subsurface_is_synchronized(struct wlr_subsurface *subsurface) { while (1) { if (subsurface->synchronized) { return true; @@ -459,43 +459,43 @@ static bool wlr_subsurface_is_synchronized(struct wlr_subsurface *subsurface) { /** * Recursive function to commit the effectively synchronized children. */ -static void wlr_subsurface_parent_commit(struct wlr_subsurface *subsurface, +static void subsurface_parent_commit(struct wlr_subsurface *subsurface, bool synchronized) { struct wlr_surface *surface = subsurface->surface; if (synchronized || subsurface->synchronized) { if (subsurface->has_cache) { - wlr_surface_move_state(surface, subsurface->cached, surface->pending); - wlr_surface_commit_pending(surface); + surface_move_state(surface, subsurface->cached, surface->pending); + surface_commit_pending(surface); subsurface->has_cache = false; subsurface->cached->invalid = 0; } struct wlr_subsurface *tmp; wl_list_for_each(tmp, &surface->subsurfaces, parent_link) { - wlr_subsurface_parent_commit(tmp, true); + subsurface_parent_commit(tmp, true); } } } -static void wlr_subsurface_commit(struct wlr_subsurface *subsurface) { +static void subsurface_commit(struct wlr_subsurface *subsurface) { struct wlr_surface *surface = subsurface->surface; - if (wlr_subsurface_is_synchronized(subsurface)) { - wlr_surface_move_state(surface, surface->pending, subsurface->cached); + if (subsurface_is_synchronized(subsurface)) { + surface_move_state(surface, surface->pending, subsurface->cached); subsurface->has_cache = true; } else { if (subsurface->has_cache) { - wlr_surface_move_state(surface, subsurface->cached, surface->pending); - wlr_surface_commit_pending(surface); + surface_move_state(surface, subsurface->cached, surface->pending); + surface_commit_pending(surface); subsurface->has_cache = false; } else { - wlr_surface_commit_pending(surface); + surface_commit_pending(surface); } struct wlr_subsurface *tmp; wl_list_for_each(tmp, &surface->subsurfaces, parent_link) { - wlr_subsurface_parent_commit(tmp, false); + subsurface_parent_commit(tmp, false); } } } @@ -507,15 +507,15 @@ static void surface_commit(struct wl_client *client, if (wlr_surface_is_subsurface(surface)) { struct wlr_subsurface *subsurface = wlr_subsurface_from_surface(surface); - wlr_subsurface_commit(subsurface); + subsurface_commit(subsurface); return; } - wlr_surface_commit_pending(surface); + surface_commit_pending(surface); struct wlr_subsurface *tmp; wl_list_for_each(tmp, &surface->subsurfaces, parent_link) { - wlr_subsurface_parent_commit(tmp, false); + subsurface_parent_commit(tmp, false); } } @@ -567,7 +567,7 @@ struct wlr_surface *wlr_surface_from_resource(struct wl_resource *resource) { return wl_resource_get_user_data(resource); } -static struct wlr_surface_state *wlr_surface_state_create() { +static struct wlr_surface_state *surface_state_create() { struct wlr_surface_state *state = calloc(1, sizeof(struct wlr_surface_state)); if (state == NULL) { @@ -588,8 +588,8 @@ static struct wlr_surface_state *wlr_surface_state_create() { return state; } -static void wlr_surface_state_destroy(struct wlr_surface_state *state) { - wlr_surface_state_reset_buffer(state); +static void surface_state_destroy(struct wlr_surface_state *state) { + surface_state_reset_buffer(state); struct wlr_frame_callback *cb, *tmp; wl_list_for_each_safe(cb, tmp, &state->frame_callback_list, link) { wl_resource_destroy(cb->resource); @@ -607,7 +607,7 @@ static void subsurface_destroy(struct wlr_subsurface *subsurface) { wlr_signal_emit_safe(&subsurface->events.destroy, subsurface); wl_list_remove(&subsurface->surface_destroy.link); - wlr_surface_state_destroy(subsurface->cached); + surface_state_destroy(subsurface->cached); if (subsurface->parent) { wl_list_remove(&subsurface->parent_link); @@ -628,8 +628,8 @@ static void destroy_surface(struct wl_resource *resource) { wlr_signal_emit_safe(&surface->events.destroy, surface); wlr_texture_destroy(surface->texture); - wlr_surface_state_destroy(surface->pending); - wlr_surface_state_destroy(surface->current); + surface_state_destroy(surface->pending); + surface_state_destroy(surface->current); free(surface); } @@ -645,8 +645,8 @@ struct wlr_surface *wlr_surface_create(struct wl_resource *res, surface->renderer = renderer; surface->resource = res; - surface->current = wlr_surface_state_create(); - surface->pending = wlr_surface_state_create(); + surface->current = surface_state_create(); + surface->pending = surface_state_create(); wl_signal_init(&surface->events.commit); wl_signal_init(&surface->events.destroy); @@ -794,9 +794,9 @@ static void subsurface_set_desync(struct wl_client *client, if (subsurface && subsurface->synchronized) { subsurface->synchronized = false; - if (!wlr_subsurface_is_synchronized(subsurface)) { + if (!subsurface_is_synchronized(subsurface)) { // TODO: do a synchronized commit to flush the cache - wlr_subsurface_parent_commit(subsurface, true); + subsurface_parent_commit(subsurface, true); } } } @@ -837,7 +837,7 @@ void wlr_surface_make_subsurface(struct wlr_surface *surface, wl_client_post_no_memory(client); return; } - subsurface->cached = wlr_surface_state_create(); + subsurface->cached = surface_state_create(); if (subsurface->cached == NULL) { free(subsurface); wl_client_post_no_memory(client); @@ -860,7 +860,7 @@ void wlr_surface_make_subsurface(struct wlr_surface *surface, subsurface->resource = wl_resource_create(client, &wl_subsurface_interface, 1, id); if (subsurface->resource == NULL) { - wlr_surface_state_destroy(subsurface->cached); + surface_state_destroy(subsurface->cached); free(subsurface); wl_client_post_no_memory(client); return; diff --git a/types/wlr_wl_shell.c b/types/wlr_wl_shell.c index 5e4c24e7..6010869e 100644 --- a/types/wlr_wl_shell.c +++ b/types/wlr_wl_shell.c @@ -461,13 +461,13 @@ static void shell_surface_resource_destroy(struct wl_resource *resource) { } } -static void handle_wlr_surface_destroyed(struct wl_listener *listener, +static void shell_surface_handle_surface_destroy(struct wl_listener *listener, void *data) { struct wlr_wl_shell_surface *surface = wl_container_of(listener, surface, surface_destroy_listener); shell_surface_destroy(surface); } -static void handle_wlr_surface_committed(struct wlr_surface *wlr_surface, +static void handle_surface_committed(struct wlr_surface *wlr_surface, void *role_data) { struct wlr_wl_shell_surface *surface = role_data; if (!surface->configured && @@ -556,9 +556,10 @@ static void shell_protocol_get_shell_surface(struct wl_client *client, wl_signal_add(&wl_surface->surface->events.destroy, &wl_surface->surface_destroy_listener); - wl_surface->surface_destroy_listener.notify = handle_wlr_surface_destroyed; + wl_surface->surface_destroy_listener.notify = + shell_surface_handle_surface_destroy; - wlr_surface_set_role_committed(surface, handle_wlr_surface_committed, + wlr_surface_set_role_committed(surface, handle_surface_committed, wl_surface); struct wl_display *display = wl_client_get_display(client); diff --git a/types/wlr_xdg_shell.c b/types/wlr_xdg_shell.c index 4c8c9983..fce2a1bb 100644 --- a/types/wlr_xdg_shell.c +++ b/types/wlr_xdg_shell.c @@ -122,7 +122,7 @@ static const struct wlr_keyboard_grab_interface xdg_keyboard_grab_impl = { static void xdg_surface_destroy(struct wlr_xdg_surface *surface); -static void wlr_xdg_popup_grab_handle_seat_destroy( +static void xdg_popup_grab_handle_seat_destroy( struct wl_listener *listener, void *data) { struct wlr_xdg_popup_grab *xdg_grab = wl_container_of(listener, xdg_grab, seat_destroy); @@ -162,7 +162,7 @@ static struct wlr_xdg_popup_grab *xdg_shell_popup_grab_from_seat( wl_list_insert(&shell->popup_grabs, &xdg_grab->link); xdg_grab->seat = seat; - xdg_grab->seat_destroy.notify = wlr_xdg_popup_grab_handle_seat_destroy; + xdg_grab->seat_destroy.notify = xdg_popup_grab_handle_seat_destroy; wl_signal_add(&seat->events.destroy, &xdg_grab->seat_destroy); return xdg_grab; @@ -910,7 +910,7 @@ static void xdg_surface_handle_get_toplevel(struct wl_client *client, xdg_toplevel_resource_destroy); } -static void wlr_xdg_toplevel_ack_configure( +static void xdg_toplevel_ack_configure( struct wlr_xdg_surface *surface, struct wlr_xdg_surface_configure *configure) { assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL); @@ -961,7 +961,7 @@ static void xdg_surface_handle_ack_configure(struct wl_client *client, assert(0 && "not reached"); break; case WLR_XDG_SURFACE_ROLE_TOPLEVEL: - wlr_xdg_toplevel_ack_configure(surface, configure); + xdg_toplevel_ack_configure(surface, configure); break; case WLR_XDG_SURFACE_ROLE_POPUP: break; @@ -1013,7 +1013,7 @@ static const struct xdg_surface_interface xdg_surface_implementation = { .set_window_geometry = xdg_surface_handle_set_window_geometry, }; -static bool wlr_xdg_surface_toplevel_state_compare( +static bool xdg_surface_toplevel_state_compare( struct wlr_xdg_toplevel *state) { struct { struct wlr_xdg_toplevel_state state; @@ -1063,7 +1063,7 @@ static bool wlr_xdg_surface_toplevel_state_compare( return false; } -static void wlr_xdg_toplevel_send_configure( +static void toplevel_send_configure( struct wlr_xdg_surface *surface, struct wlr_xdg_surface_configure *configure) { assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL); @@ -1125,7 +1125,7 @@ error_out: wl_resource_post_no_memory(surface->toplevel->resource); } -static void wlr_xdg_surface_send_configure(void *user_data) { +static void surface_send_configure(void *user_data) { struct wlr_xdg_surface *surface = user_data; surface->configure_idle = NULL; @@ -1145,7 +1145,7 @@ static void wlr_xdg_surface_send_configure(void *user_data) { assert(0 && "not reached"); break; case WLR_XDG_SURFACE_ROLE_TOPLEVEL: - wlr_xdg_toplevel_send_configure(surface, configure); + toplevel_send_configure(surface, configure); break; case WLR_XDG_SURFACE_ROLE_POPUP: xdg_popup_send_configure(surface->popup->resource, @@ -1159,7 +1159,7 @@ static void wlr_xdg_surface_send_configure(void *user_data) { xdg_surface_send_configure(surface->resource, configure->serial); } -static uint32_t wlr_xdg_surface_schedule_configure( +static uint32_t xdg_surface_schedule_configure( struct wlr_xdg_surface *surface) { struct wl_display *display = wl_client_get_display(surface->client->client); struct wl_event_loop *loop = wl_display_get_event_loop(display); @@ -1171,7 +1171,7 @@ static uint32_t wlr_xdg_surface_schedule_configure( break; case WLR_XDG_SURFACE_ROLE_TOPLEVEL: pending_same = - wlr_xdg_surface_toplevel_state_compare(surface->toplevel); + xdg_surface_toplevel_state_compare(surface->toplevel); break; case WLR_XDG_SURFACE_ROLE_POPUP: break; @@ -1195,26 +1195,26 @@ static uint32_t wlr_xdg_surface_schedule_configure( surface->configure_next_serial = wl_display_next_serial(display); surface->configure_idle = wl_event_loop_add_idle(loop, - wlr_xdg_surface_send_configure, surface); + surface_send_configure, surface); return surface->configure_next_serial; } } -static void handle_wlr_surface_destroyed(struct wl_listener *listener, +static void xdg_surface_handle_surface_destroy(struct wl_listener *listener, void *data) { struct wlr_xdg_surface *xdg_surface = wl_container_of(listener, xdg_surface, surface_destroy_listener); xdg_surface_destroy(xdg_surface); } -static void wlr_xdg_surface_toplevel_committed( +static void xdg_surface_toplevel_committed( struct wlr_xdg_surface *surface) { assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL); if (!surface->toplevel->added) { // on the first commit, send a configure request to tell the client it // is added - wlr_xdg_surface_schedule_configure(surface); + xdg_surface_schedule_configure(surface); surface->toplevel->added = true; return; } @@ -1230,7 +1230,7 @@ static void wlr_xdg_surface_toplevel_committed( surface->toplevel->client_pending.min_height; } -static void wlr_xdg_surface_popup_committed( +static void xdg_surface_popup_committed( struct wlr_xdg_surface *surface) { assert(surface->role == WLR_XDG_SURFACE_ROLE_POPUP); @@ -1242,12 +1242,12 @@ static void wlr_xdg_surface_popup_committed( } if (!surface->popup->committed) { - wlr_xdg_surface_schedule_configure(surface); + xdg_surface_schedule_configure(surface); surface->popup->committed = true; } } -static void handle_wlr_surface_committed(struct wlr_surface *wlr_surface, +static void handle_surface_committed(struct wlr_surface *wlr_surface, void *role_data) { struct wlr_xdg_surface *surface = role_data; @@ -1273,10 +1273,10 @@ static void handle_wlr_surface_committed(struct wlr_surface *wlr_surface, "xdg_surface must have a role"); break; case WLR_XDG_SURFACE_ROLE_TOPLEVEL: - wlr_xdg_surface_toplevel_committed(surface); + xdg_surface_toplevel_committed(surface); break; case WLR_XDG_SURFACE_ROLE_POPUP: - wlr_xdg_surface_popup_committed(surface); + xdg_surface_popup_committed(surface); break; } @@ -1350,10 +1350,11 @@ static void xdg_shell_handle_get_xdg_surface(struct wl_client *wl_client, wl_signal_add(&surface->surface->events.destroy, &surface->surface_destroy_listener); - surface->surface_destroy_listener.notify = handle_wlr_surface_destroyed; + surface->surface_destroy_listener.notify = + xdg_surface_handle_surface_destroy; wlr_surface_set_role_committed(surface->surface, - handle_wlr_surface_committed, surface); + handle_surface_committed, surface); wlr_log(L_DEBUG, "new xdg_surface %p (res %p)", surface, surface->resource); wl_resource_set_implementation(surface->resource, @@ -1394,7 +1395,7 @@ static const struct xdg_wm_base_interface xdg_shell_impl = { .pong = xdg_shell_handle_pong, }; -static void wlr_xdg_client_destroy(struct wl_resource *resource) { +static void xdg_client_handle_resource_destroy(struct wl_resource *resource) { struct wlr_xdg_client *client = xdg_client_from_resource(resource); struct wlr_xdg_surface *surface, *tmp = NULL; @@ -1410,7 +1411,7 @@ static void wlr_xdg_client_destroy(struct wl_resource *resource) { free(client); } -static int wlr_xdg_client_ping_timeout(void *user_data) { +static int xdg_client_ping_timeout(void *user_data) { struct wlr_xdg_client *client = user_data; struct wlr_xdg_surface *surface; @@ -1447,13 +1448,13 @@ static void xdg_shell_bind(struct wl_client *wl_client, void *data, client->shell = xdg_shell; wl_resource_set_implementation(client->resource, &xdg_shell_impl, client, - wlr_xdg_client_destroy); + xdg_client_handle_resource_destroy); wl_list_insert(&xdg_shell->clients, &client->link); struct wl_display *display = wl_client_get_display(client->client); struct wl_event_loop *loop = wl_display_get_event_loop(display); client->ping_timer = wl_event_loop_add_timer(loop, - wlr_xdg_client_ping_timeout, client); + xdg_client_ping_timeout, client); if (client->ping_timer == NULL) { wl_client_post_no_memory(client->client); } @@ -1522,7 +1523,7 @@ uint32_t wlr_xdg_toplevel_set_size(struct wlr_xdg_surface *surface, surface->toplevel->server_pending.width = width; surface->toplevel->server_pending.height = height; - return wlr_xdg_surface_schedule_configure(surface); + return xdg_surface_schedule_configure(surface); } uint32_t wlr_xdg_toplevel_set_activated(struct wlr_xdg_surface *surface, @@ -1530,7 +1531,7 @@ uint32_t wlr_xdg_toplevel_set_activated(struct wlr_xdg_surface *surface, assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL); surface->toplevel->server_pending.activated = activated; - return wlr_xdg_surface_schedule_configure(surface); + return xdg_surface_schedule_configure(surface); } uint32_t wlr_xdg_toplevel_set_maximized(struct wlr_xdg_surface *surface, @@ -1538,7 +1539,7 @@ uint32_t wlr_xdg_toplevel_set_maximized(struct wlr_xdg_surface *surface, assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL); surface->toplevel->server_pending.maximized = maximized; - return wlr_xdg_surface_schedule_configure(surface); + return xdg_surface_schedule_configure(surface); } uint32_t wlr_xdg_toplevel_set_fullscreen(struct wlr_xdg_surface *surface, @@ -1546,7 +1547,7 @@ uint32_t wlr_xdg_toplevel_set_fullscreen(struct wlr_xdg_surface *surface, assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL); surface->toplevel->server_pending.fullscreen = fullscreen; - return wlr_xdg_surface_schedule_configure(surface); + return xdg_surface_schedule_configure(surface); } uint32_t wlr_xdg_toplevel_set_resizing(struct wlr_xdg_surface *surface, @@ -1554,7 +1555,7 @@ uint32_t wlr_xdg_toplevel_set_resizing(struct wlr_xdg_surface *surface, assert(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL); surface->toplevel->server_pending.resizing = resizing; - return wlr_xdg_surface_schedule_configure(surface); + return xdg_surface_schedule_configure(surface); } void wlr_xdg_surface_send_close(struct wlr_xdg_surface *surface) { @@ -1669,7 +1670,7 @@ void wlr_xdg_popup_get_toplevel_coords(struct wlr_xdg_popup *popup, } -static void wlr_xdg_popup_box_constraints(struct wlr_xdg_popup *popup, +static void xdg_popup_box_constraints(struct wlr_xdg_popup *popup, struct wlr_box *toplevel_sx_box, int *offset_x, int *offset_y) { int popup_width = popup->geometry.width; int popup_height = popup->geometry.height; @@ -1697,10 +1698,10 @@ static void wlr_xdg_popup_box_constraints(struct wlr_xdg_popup *popup, } } -static bool wlr_xdg_popup_unconstrain_flip(struct wlr_xdg_popup *popup, +static bool xdg_popup_unconstrain_flip(struct wlr_xdg_popup *popup, struct wlr_box *toplevel_sx_box) { int offset_x = 0, offset_y = 0; - wlr_xdg_popup_box_constraints(popup, toplevel_sx_box, + xdg_popup_box_constraints(popup, toplevel_sx_box, &offset_x, &offset_y); if (!offset_x && !offset_y) { @@ -1725,7 +1726,7 @@ static bool wlr_xdg_popup_unconstrain_flip(struct wlr_xdg_popup *popup, popup->geometry = wlr_xdg_positioner_get_geometry(&popup->positioner); - wlr_xdg_popup_box_constraints(popup, toplevel_sx_box, + xdg_popup_box_constraints(popup, toplevel_sx_box, &offset_x, &offset_y); if (!offset_x && !offset_y) { @@ -1747,10 +1748,10 @@ static bool wlr_xdg_popup_unconstrain_flip(struct wlr_xdg_popup *popup, return false; } -static bool wlr_xdg_popup_unconstrain_slide(struct wlr_xdg_popup *popup, +static bool xdg_popup_unconstrain_slide(struct wlr_xdg_popup *popup, struct wlr_box *toplevel_sx_box) { int offset_x = 0, offset_y = 0; - wlr_xdg_popup_box_constraints(popup, toplevel_sx_box, + xdg_popup_box_constraints(popup, toplevel_sx_box, &offset_x, &offset_y); if (!offset_x && !offset_y) { @@ -1784,16 +1785,16 @@ static bool wlr_xdg_popup_unconstrain_slide(struct wlr_xdg_popup *popup, popup->geometry.y += toplevel_sx_box->y - toplevel_y; } - wlr_xdg_popup_box_constraints(popup, toplevel_sx_box, + xdg_popup_box_constraints(popup, toplevel_sx_box, &offset_x, &offset_y); return !offset_x && !offset_y; } -static bool wlr_xdg_popup_unconstrain_resize(struct wlr_xdg_popup *popup, +static bool xdg_popup_unconstrain_resize(struct wlr_xdg_popup *popup, struct wlr_box *toplevel_sx_box) { int offset_x, offset_y; - wlr_xdg_popup_box_constraints(popup, toplevel_sx_box, + xdg_popup_box_constraints(popup, toplevel_sx_box, &offset_x, &offset_y); if (!offset_x && !offset_y) { @@ -1815,7 +1816,7 @@ static bool wlr_xdg_popup_unconstrain_resize(struct wlr_xdg_popup *popup, popup->geometry.height -= offset_y; } - wlr_xdg_popup_box_constraints(popup, toplevel_sx_box, + xdg_popup_box_constraints(popup, toplevel_sx_box, &offset_y, &offset_y); return !offset_x && !offset_y; @@ -1823,13 +1824,13 @@ static bool wlr_xdg_popup_unconstrain_resize(struct wlr_xdg_popup *popup, void wlr_xdg_popup_unconstrain_from_box(struct wlr_xdg_popup *popup, struct wlr_box *toplevel_sx_box) { - if (wlr_xdg_popup_unconstrain_flip(popup, toplevel_sx_box)) { + if (xdg_popup_unconstrain_flip(popup, toplevel_sx_box)) { return; } - if (wlr_xdg_popup_unconstrain_slide(popup, toplevel_sx_box)) { + if (xdg_popup_unconstrain_slide(popup, toplevel_sx_box)) { return; } - if (wlr_xdg_popup_unconstrain_resize(popup, toplevel_sx_box)) { + if (xdg_popup_unconstrain_resize(popup, toplevel_sx_box)) { return; } } diff --git a/types/wlr_xdg_shell_v6.c b/types/wlr_xdg_shell_v6.c index 2d0fbe29..8af6204f 100644 --- a/types/wlr_xdg_shell_v6.c +++ b/types/wlr_xdg_shell_v6.c @@ -132,7 +132,7 @@ static const struct wlr_keyboard_grab_interface xdg_keyboard_grab_impl = { static void xdg_surface_destroy(struct wlr_xdg_surface_v6 *surface); -static void wlr_xdg_popup_grab_handle_seat_destroy( +static void xdg_popup_grab_handle_seat_destroy( struct wl_listener *listener, void *data) { struct wlr_xdg_popup_grab_v6 *xdg_grab = wl_container_of(listener, xdg_grab, seat_destroy); @@ -172,7 +172,7 @@ static struct wlr_xdg_popup_grab_v6 *xdg_shell_popup_grab_from_seat( wl_list_insert(&shell->popup_grabs, &xdg_grab->link); xdg_grab->seat = seat; - xdg_grab->seat_destroy.notify = wlr_xdg_popup_grab_handle_seat_destroy; + xdg_grab->seat_destroy.notify = xdg_popup_grab_handle_seat_destroy; wl_signal_add(&seat->events.destroy, &xdg_grab->seat_destroy); return xdg_grab; @@ -924,7 +924,7 @@ static void xdg_surface_handle_get_toplevel(struct wl_client *client, xdg_toplevel_resource_destroy); } -static void wlr_xdg_toplevel_v6_ack_configure( +static void xdg_toplevel_v6_ack_configure( struct wlr_xdg_surface_v6 *surface, struct wlr_xdg_surface_v6_configure *configure) { assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL); @@ -975,7 +975,7 @@ static void xdg_surface_handle_ack_configure(struct wl_client *client, assert(0 && "not reached"); break; case WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL: - wlr_xdg_toplevel_v6_ack_configure(surface, configure); + xdg_toplevel_v6_ack_configure(surface, configure); break; case WLR_XDG_SURFACE_V6_ROLE_POPUP: break; @@ -1027,7 +1027,7 @@ static const struct zxdg_surface_v6_interface zxdg_surface_v6_implementation = { .set_window_geometry = xdg_surface_handle_set_window_geometry, }; -static bool wlr_xdg_surface_v6_toplevel_state_compare( +static bool xdg_surface_v6_toplevel_state_compare( struct wlr_xdg_toplevel_v6 *state) { struct { struct wlr_xdg_toplevel_v6_state state; @@ -1077,7 +1077,7 @@ static bool wlr_xdg_surface_v6_toplevel_state_compare( return false; } -static void wlr_xdg_toplevel_v6_send_configure( +static void xdg_toplevel_v6_send_configure( struct wlr_xdg_surface_v6 *surface, struct wlr_xdg_surface_v6_configure *configure) { assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL); @@ -1143,7 +1143,7 @@ error_out: wl_resource_post_no_memory(surface->toplevel->resource); } -static void wlr_xdg_surface_send_configure(void *user_data) { +static void xdg_surface_send_configure(void *user_data) { struct wlr_xdg_surface_v6 *surface = user_data; surface->configure_idle = NULL; @@ -1163,7 +1163,7 @@ static void wlr_xdg_surface_send_configure(void *user_data) { assert(0 && "not reached"); break; case WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL: - wlr_xdg_toplevel_v6_send_configure(surface, configure); + xdg_toplevel_v6_send_configure(surface, configure); break; case WLR_XDG_SURFACE_V6_ROLE_POPUP: zxdg_popup_v6_send_configure(surface->popup->resource, @@ -1177,7 +1177,7 @@ static void wlr_xdg_surface_send_configure(void *user_data) { zxdg_surface_v6_send_configure(surface->resource, configure->serial); } -static uint32_t wlr_xdg_surface_v6_schedule_configure( +static uint32_t xdg_surface_v6_schedule_configure( struct wlr_xdg_surface_v6 *surface) { struct wl_display *display = wl_client_get_display(surface->client->client); struct wl_event_loop *loop = wl_display_get_event_loop(display); @@ -1189,7 +1189,7 @@ static uint32_t wlr_xdg_surface_v6_schedule_configure( break; case WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL: pending_same = - wlr_xdg_surface_v6_toplevel_state_compare(surface->toplevel); + xdg_surface_v6_toplevel_state_compare(surface->toplevel); break; case WLR_XDG_SURFACE_V6_ROLE_POPUP: break; @@ -1213,26 +1213,26 @@ static uint32_t wlr_xdg_surface_v6_schedule_configure( surface->configure_next_serial = wl_display_next_serial(display); surface->configure_idle = wl_event_loop_add_idle(loop, - wlr_xdg_surface_send_configure, surface); + xdg_surface_send_configure, surface); return surface->configure_next_serial; } } -static void handle_wlr_surface_destroyed(struct wl_listener *listener, +static void xdg_surface_handle_surface_destroy(struct wl_listener *listener, void *data) { struct wlr_xdg_surface_v6 *xdg_surface = wl_container_of(listener, xdg_surface, surface_destroy_listener); xdg_surface_destroy(xdg_surface); } -static void wlr_xdg_surface_v6_toplevel_committed( +static void xdg_surface_v6_toplevel_committed( struct wlr_xdg_surface_v6 *surface) { assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL); if (!surface->toplevel->added) { // on the first commit, send a configure request to tell the client it // is added - wlr_xdg_surface_v6_schedule_configure(surface); + xdg_surface_v6_schedule_configure(surface); surface->toplevel->added = true; return; } @@ -1248,17 +1248,17 @@ static void wlr_xdg_surface_v6_toplevel_committed( surface->toplevel->client_pending.min_height; } -static void wlr_xdg_surface_v6_popup_committed( +static void xdg_surface_v6_popup_committed( struct wlr_xdg_surface_v6 *surface) { assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_POPUP); if (!surface->popup->committed) { - wlr_xdg_surface_v6_schedule_configure(surface); + xdg_surface_v6_schedule_configure(surface); surface->popup->committed = true; } } -static void handle_wlr_surface_committed(struct wlr_surface *wlr_surface, +static void handle_surface_committed(struct wlr_surface *wlr_surface, void *role_data) { struct wlr_xdg_surface_v6 *surface = role_data; @@ -1284,10 +1284,10 @@ static void handle_wlr_surface_committed(struct wlr_surface *wlr_surface, "xdg_surface must have a role"); break; case WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL: - wlr_xdg_surface_v6_toplevel_committed(surface); + xdg_surface_v6_toplevel_committed(surface); break; case WLR_XDG_SURFACE_V6_ROLE_POPUP: - wlr_xdg_surface_v6_popup_committed(surface); + xdg_surface_v6_popup_committed(surface); break; } @@ -1361,10 +1361,11 @@ static void xdg_shell_handle_get_xdg_surface(struct wl_client *wl_client, wl_signal_add(&surface->surface->events.destroy, &surface->surface_destroy_listener); - surface->surface_destroy_listener.notify = handle_wlr_surface_destroyed; + surface->surface_destroy_listener.notify = + xdg_surface_handle_surface_destroy; wlr_surface_set_role_committed(surface->surface, - handle_wlr_surface_committed, surface); + handle_surface_committed, surface); wlr_log(L_DEBUG, "new xdg_surface %p (res %p)", surface, surface->resource); wl_resource_set_implementation(surface->resource, @@ -1405,7 +1406,8 @@ static const struct zxdg_shell_v6_interface xdg_shell_impl = { .pong = xdg_shell_handle_pong, }; -static void wlr_xdg_client_v6_destroy(struct wl_resource *resource) { +static void xdg_client_v6_handle_resource_destroy( + struct wl_resource *resource) { struct wlr_xdg_client_v6 *client = xdg_client_from_resource(resource); struct wlr_xdg_surface_v6 *surface, *tmp = NULL; @@ -1421,7 +1423,7 @@ static void wlr_xdg_client_v6_destroy(struct wl_resource *resource) { free(client); } -static int wlr_xdg_client_v6_ping_timeout(void *user_data) { +static int xdg_client_v6_ping_timeout(void *user_data) { struct wlr_xdg_client_v6 *client = user_data; struct wlr_xdg_surface_v6 *surface; @@ -1458,13 +1460,13 @@ static void xdg_shell_bind(struct wl_client *wl_client, void *data, client->shell = xdg_shell; wl_resource_set_implementation(client->resource, &xdg_shell_impl, client, - wlr_xdg_client_v6_destroy); + xdg_client_v6_handle_resource_destroy); wl_list_insert(&xdg_shell->clients, &client->link); struct wl_display *display = wl_client_get_display(client->client); struct wl_event_loop *loop = wl_display_get_event_loop(display); client->ping_timer = wl_event_loop_add_timer(loop, - wlr_xdg_client_v6_ping_timeout, client); + xdg_client_v6_ping_timeout, client); if (client->ping_timer == NULL) { wl_client_post_no_memory(client->client); } @@ -1533,7 +1535,7 @@ uint32_t wlr_xdg_toplevel_v6_set_size(struct wlr_xdg_surface_v6 *surface, surface->toplevel->server_pending.width = width; surface->toplevel->server_pending.height = height; - return wlr_xdg_surface_v6_schedule_configure(surface); + return xdg_surface_v6_schedule_configure(surface); } uint32_t wlr_xdg_toplevel_v6_set_activated(struct wlr_xdg_surface_v6 *surface, @@ -1541,7 +1543,7 @@ uint32_t wlr_xdg_toplevel_v6_set_activated(struct wlr_xdg_surface_v6 *surface, assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL); surface->toplevel->server_pending.activated = activated; - return wlr_xdg_surface_v6_schedule_configure(surface); + return xdg_surface_v6_schedule_configure(surface); } uint32_t wlr_xdg_toplevel_v6_set_maximized(struct wlr_xdg_surface_v6 *surface, @@ -1549,7 +1551,7 @@ uint32_t wlr_xdg_toplevel_v6_set_maximized(struct wlr_xdg_surface_v6 *surface, assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL); surface->toplevel->server_pending.maximized = maximized; - return wlr_xdg_surface_v6_schedule_configure(surface); + return xdg_surface_v6_schedule_configure(surface); } uint32_t wlr_xdg_toplevel_v6_set_fullscreen(struct wlr_xdg_surface_v6 *surface, @@ -1557,7 +1559,7 @@ uint32_t wlr_xdg_toplevel_v6_set_fullscreen(struct wlr_xdg_surface_v6 *surface, assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL); surface->toplevel->server_pending.fullscreen = fullscreen; - return wlr_xdg_surface_v6_schedule_configure(surface); + return xdg_surface_v6_schedule_configure(surface); } uint32_t wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface, @@ -1565,7 +1567,7 @@ uint32_t wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface, assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL); surface->toplevel->server_pending.resizing = resizing; - return wlr_xdg_surface_v6_schedule_configure(surface); + return xdg_surface_v6_schedule_configure(surface); } void wlr_xdg_surface_v6_send_close(struct wlr_xdg_surface_v6 *surface) { @@ -1677,7 +1679,7 @@ void wlr_xdg_popup_v6_get_toplevel_coords(struct wlr_xdg_popup_v6 *popup, } -static void wlr_xdg_popup_v6_box_constraints(struct wlr_xdg_popup_v6 *popup, +static void xdg_popup_v6_box_constraints(struct wlr_xdg_popup_v6 *popup, struct wlr_box *toplevel_sx_box, int *offset_x, int *offset_y) { int popup_width = popup->geometry.width; int popup_height = popup->geometry.height; @@ -1705,10 +1707,10 @@ static void wlr_xdg_popup_v6_box_constraints(struct wlr_xdg_popup_v6 *popup, } } -static bool wlr_xdg_popup_v6_unconstrain_flip(struct wlr_xdg_popup_v6 *popup, +static bool xdg_popup_v6_unconstrain_flip(struct wlr_xdg_popup_v6 *popup, struct wlr_box *toplevel_sx_box) { int offset_x = 0, offset_y = 0; - wlr_xdg_popup_v6_box_constraints(popup, toplevel_sx_box, + xdg_popup_v6_box_constraints(popup, toplevel_sx_box, &offset_x, &offset_y); if (!offset_x && !offset_y) { @@ -1733,7 +1735,7 @@ static bool wlr_xdg_popup_v6_unconstrain_flip(struct wlr_xdg_popup_v6 *popup, popup->geometry = wlr_xdg_positioner_v6_get_geometry(&popup->positioner); - wlr_xdg_popup_v6_box_constraints(popup, toplevel_sx_box, + xdg_popup_v6_box_constraints(popup, toplevel_sx_box, &offset_x, &offset_y); if (!offset_x && !offset_y) { @@ -1755,10 +1757,10 @@ static bool wlr_xdg_popup_v6_unconstrain_flip(struct wlr_xdg_popup_v6 *popup, return false; } -static bool wlr_xdg_popup_v6_unconstrain_slide(struct wlr_xdg_popup_v6 *popup, +static bool xdg_popup_v6_unconstrain_slide(struct wlr_xdg_popup_v6 *popup, struct wlr_box *toplevel_sx_box) { int offset_x = 0, offset_y = 0; - wlr_xdg_popup_v6_box_constraints(popup, toplevel_sx_box, + xdg_popup_v6_box_constraints(popup, toplevel_sx_box, &offset_x, &offset_y); if (!offset_x && !offset_y) { @@ -1792,16 +1794,16 @@ static bool wlr_xdg_popup_v6_unconstrain_slide(struct wlr_xdg_popup_v6 *popup, popup->geometry.y += toplevel_sx_box->y - toplevel_y; } - wlr_xdg_popup_v6_box_constraints(popup, toplevel_sx_box, + xdg_popup_v6_box_constraints(popup, toplevel_sx_box, &offset_x, &offset_y); return !offset_x && !offset_y; } -static bool wlr_xdg_popup_v6_unconstrain_resize(struct wlr_xdg_popup_v6 *popup, +static bool xdg_popup_v6_unconstrain_resize(struct wlr_xdg_popup_v6 *popup, struct wlr_box *toplevel_sx_box) { int offset_x, offset_y; - wlr_xdg_popup_v6_box_constraints(popup, toplevel_sx_box, + xdg_popup_v6_box_constraints(popup, toplevel_sx_box, &offset_x, &offset_y); if (!offset_x && !offset_y) { @@ -1823,7 +1825,7 @@ static bool wlr_xdg_popup_v6_unconstrain_resize(struct wlr_xdg_popup_v6 *popup, popup->geometry.height -= offset_y; } - wlr_xdg_popup_v6_box_constraints(popup, toplevel_sx_box, + xdg_popup_v6_box_constraints(popup, toplevel_sx_box, &offset_y, &offset_y); return !offset_x && !offset_y; @@ -1831,13 +1833,13 @@ static bool wlr_xdg_popup_v6_unconstrain_resize(struct wlr_xdg_popup_v6 *popup, void wlr_xdg_popup_v6_unconstrain_from_box(struct wlr_xdg_popup_v6 *popup, struct wlr_box *toplevel_sx_box) { - if (wlr_xdg_popup_v6_unconstrain_flip(popup, toplevel_sx_box)) { + if (xdg_popup_v6_unconstrain_flip(popup, toplevel_sx_box)) { return; } - if (wlr_xdg_popup_v6_unconstrain_slide(popup, toplevel_sx_box)) { + if (xdg_popup_v6_unconstrain_slide(popup, toplevel_sx_box)) { return; } - if (wlr_xdg_popup_v6_unconstrain_resize(popup, toplevel_sx_box)) { + if (xdg_popup_v6_unconstrain_resize(popup, toplevel_sx_box)) { return; } } diff --git a/xcursor/wlr_xcursor.c b/xcursor/wlr_xcursor.c index 7fcdbb6f..38c01efe 100644 --- a/xcursor/wlr_xcursor.c +++ b/xcursor/wlr_xcursor.c @@ -32,7 +32,7 @@ #include #include "xcursor/xcursor.h" -static void wlr_xcursor_destroy(struct wlr_xcursor *cursor) { +static void xcursor_destroy(struct wlr_xcursor *cursor) { for (size_t i = 0; i < cursor->image_count; i++) { free(cursor->images[i]->buffer); free(cursor->images[i]); @@ -45,7 +45,7 @@ static void wlr_xcursor_destroy(struct wlr_xcursor *cursor) { #include "xcursor/cursor_data.h" -static struct wlr_xcursor *wlr_xcursor_create_from_data( +static struct wlr_xcursor *xcursor_create_from_data( struct cursor_metadata *metadata, struct wlr_xcursor_theme *theme) { struct wlr_xcursor *cursor; struct wlr_xcursor_image *image; @@ -117,7 +117,7 @@ static void load_default_theme(struct wlr_xcursor_theme *theme) { for (i = 0; i < theme->cursor_count; ++i) { theme->cursors[i] = - wlr_xcursor_create_from_data(&cursor_metadata[i], theme); + xcursor_create_from_data(&cursor_metadata[i], theme); if (theme->cursors[i] == NULL) { break; @@ -126,7 +126,7 @@ static void load_default_theme(struct wlr_xcursor_theme *theme) { theme->cursor_count = i; } -static struct wlr_xcursor *wlr_xcursor_create_from_xcursor_images( +static struct wlr_xcursor *xcursor_create_from_xcursor_images( XcursorImages *images, struct wlr_xcursor_theme *theme) { struct wlr_xcursor *cursor; struct wlr_xcursor_image *image; @@ -193,7 +193,7 @@ static void load_callback(XcursorImages *images, void *data) { return; } - cursor = wlr_xcursor_create_from_xcursor_images(images, theme); + cursor = xcursor_create_from_xcursor_images(images, theme); if (cursor) { theme->cursor_count++; @@ -259,7 +259,7 @@ void wlr_xcursor_theme_destroy(struct wlr_xcursor_theme *theme) { unsigned int i; for (i = 0; i < theme->cursor_count; i++) { - wlr_xcursor_destroy(theme->cursors[i]); + xcursor_destroy(theme->cursors[i]); } free(theme->name); @@ -280,7 +280,7 @@ struct wlr_xcursor *wlr_xcursor_theme_get_cursor(struct wlr_xcursor_theme *theme return NULL; } -static int wlr_xcursor_frame_and_duration(struct wlr_xcursor *cursor, +static int xcursor_frame_and_duration(struct wlr_xcursor *cursor, uint32_t time, uint32_t *duration) { uint32_t t; int i; @@ -323,7 +323,7 @@ static int wlr_xcursor_frame_and_duration(struct wlr_xcursor *cursor, } int wlr_xcursor_frame(struct wlr_xcursor *_cursor, uint32_t time) { - return wlr_xcursor_frame_and_duration(_cursor, time, NULL); + return xcursor_frame_and_duration(_cursor, time, NULL); } const char *wlr_xcursor_get_resize_name(enum wlr_edges edges) { diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c index 04f4f6f9..f27de679 100644 --- a/xwayland/xwayland.c +++ b/xwayland/xwayland.c @@ -128,7 +128,7 @@ static void exec_xwayland(struct wlr_xwayland *wlr_xwayland) { execvp("Xwayland", argv); } -static void wlr_xwayland_finish(struct wlr_xwayland *wlr_xwayland) { +static void xwayland_finish(struct wlr_xwayland *wlr_xwayland) { if (!wlr_xwayland || wlr_xwayland->display == -1) { return; } @@ -165,7 +165,7 @@ static void wlr_xwayland_finish(struct wlr_xwayland *wlr_xwayland) { */ } -static bool wlr_xwayland_start(struct wlr_xwayland *wlr_xwayland, +static bool xwayland_start(struct wlr_xwayland *wlr_xwayland, struct wl_display *wl_display, struct wlr_compositor *compositor); static void handle_client_destroy(struct wl_listener *listener, void *data) { @@ -176,11 +176,11 @@ static void handle_client_destroy(struct wl_listener *listener, void *data) { wlr_xwayland->client = NULL; wl_list_remove(&wlr_xwayland->client_destroy.link); - wlr_xwayland_finish(wlr_xwayland); + xwayland_finish(wlr_xwayland); if (time(NULL) - wlr_xwayland->server_start > 5) { wlr_log(L_INFO, "Restarting Xwayland"); - wlr_xwayland_start(wlr_xwayland, wlr_xwayland->wl_display, + xwayland_start(wlr_xwayland, wlr_xwayland->wl_display, wlr_xwayland->compositor); } } @@ -217,7 +217,7 @@ static int xserver_handle_ready(int signal_number, void *data) { wlr_xwayland->xwm = xwm_create(wlr_xwayland); if (!wlr_xwayland->xwm) { - wlr_xwayland_finish(wlr_xwayland); + xwayland_finish(wlr_xwayland); return 1; } @@ -247,7 +247,7 @@ static int xserver_handle_ready(int signal_number, void *data) { return 1; /* wayland event loop dispatcher's count */ } -static bool wlr_xwayland_start(struct wlr_xwayland *wlr_xwayland, +static bool xwayland_start(struct wlr_xwayland *wlr_xwayland, struct wl_display *wl_display, struct wlr_compositor *compositor) { memset(wlr_xwayland, 0, offsetof(struct wlr_xwayland, seat)); wlr_xwayland->wl_display = wl_display; @@ -261,13 +261,13 @@ static bool wlr_xwayland_start(struct wlr_xwayland *wlr_xwayland, wlr_xwayland->display = open_display_sockets(wlr_xwayland->x_fd); if (wlr_xwayland->display < 0) { - wlr_xwayland_finish(wlr_xwayland); + xwayland_finish(wlr_xwayland); return false; } if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, wlr_xwayland->wl_fd) != 0 || socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, wlr_xwayland->wm_fd) != 0) { wlr_log_errno(L_ERROR, "failed to create socketpair"); - wlr_xwayland_finish(wlr_xwayland); + xwayland_finish(wlr_xwayland); return false; } @@ -275,7 +275,7 @@ static bool wlr_xwayland_start(struct wlr_xwayland *wlr_xwayland, if (!(wlr_xwayland->client = wl_client_create(wl_display, wlr_xwayland->wl_fd[0]))) { wlr_log_errno(L_ERROR, "wl_client_create failed"); - wlr_xwayland_finish(wlr_xwayland); + xwayland_finish(wlr_xwayland); return false; } @@ -323,7 +323,7 @@ static bool wlr_xwayland_start(struct wlr_xwayland *wlr_xwayland, } if (wlr_xwayland->pid < 0) { wlr_log_errno(L_ERROR, "fork failed"); - wlr_xwayland_finish(wlr_xwayland); + xwayland_finish(wlr_xwayland); return false; } @@ -340,7 +340,7 @@ static bool wlr_xwayland_start(struct wlr_xwayland *wlr_xwayland, void wlr_xwayland_destroy(struct wlr_xwayland *wlr_xwayland) { wlr_xwayland_set_seat(wlr_xwayland, NULL); - wlr_xwayland_finish(wlr_xwayland); + xwayland_finish(wlr_xwayland); free(wlr_xwayland); } @@ -350,7 +350,7 @@ struct wlr_xwayland *wlr_xwayland_create(struct wl_display *wl_display, wl_signal_init(&wlr_xwayland->events.new_surface); wl_signal_init(&wlr_xwayland->events.ready); - if (wlr_xwayland_start(wlr_xwayland, wl_display, compositor)) { + if (xwayland_start(wlr_xwayland, wl_display, compositor)) { return wlr_xwayland; } free(wlr_xwayland); @@ -380,7 +380,7 @@ void wlr_xwayland_set_cursor(struct wlr_xwayland *wlr_xwayland, wlr_xwayland->cursor->hotspot_y = hotspot_y; } -static void wlr_xwayland_handle_seat_destroy(struct wl_listener *listener, +static void xwayland_handle_seat_destroy(struct wl_listener *listener, void *data) { struct wlr_xwayland *xwayland = wl_container_of(listener, xwayland, seat_destroy); @@ -404,6 +404,6 @@ void wlr_xwayland_set_seat(struct wlr_xwayland *xwayland, return; } - xwayland->seat_destroy.notify = wlr_xwayland_handle_seat_destroy; + xwayland->seat_destroy.notify = xwayland_handle_seat_destroy; wl_signal_add(&seat->events.destroy, &xwayland->seat_destroy); } diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 599006ae..2e01da6f 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -278,7 +278,7 @@ static void xsurface_set_net_wm_state(struct wlr_xwayland_surface *xsurface) { static void xsurface_unmap(struct wlr_xwayland_surface *surface); -static void wlr_xwayland_surface_destroy( +static void xwayland_surface_destroy( struct wlr_xwayland_surface *xsurface) { xsurface_unmap(xsurface); @@ -708,7 +708,7 @@ static void xwm_handle_destroy_notify(struct wlr_xwm *xwm, if (xsurface == NULL) { return; } - wlr_xwayland_surface_destroy(xsurface); + xwayland_surface_destroy(xsurface); } static void xwm_handle_configure_request(struct wlr_xwm *xwm, @@ -1304,10 +1304,10 @@ void xwm_destroy(struct wlr_xwm *xwm) { #endif struct wlr_xwayland_surface *xsurface, *tmp; wl_list_for_each_safe(xsurface, tmp, &xwm->surfaces, link) { - wlr_xwayland_surface_destroy(xsurface); + xwayland_surface_destroy(xsurface); } wl_list_for_each_safe(xsurface, tmp, &xwm->unpaired_surfaces, link) { - wlr_xwayland_surface_destroy(xsurface); + xwayland_surface_destroy(xsurface); } wl_list_remove(&xwm->compositor_new_surface.link); wl_list_remove(&xwm->compositor_destroy.link); -- cgit v1.2.3