diff options
Diffstat (limited to 'backend/libinput')
-rw-r--r-- | backend/libinput/backend.c | 32 | ||||
-rw-r--r-- | backend/libinput/events.c | 16 | ||||
-rw-r--r-- | backend/libinput/keyboard.c | 10 | ||||
-rw-r--r-- | backend/libinput/pointer.c | 2 | ||||
-rw-r--r-- | backend/libinput/tablet_pad.c | 2 | ||||
-rw-r--r-- | backend/libinput/tablet_tool.c | 2 | ||||
-rw-r--r-- | backend/libinput/touch.c | 2 |
7 files changed, 33 insertions, 33 deletions
diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c index ef33df0a..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"); @@ -32,18 +32,18 @@ static int wlr_libinput_readable(int fd, uint32_t mask, void *_backend) { } struct libinput_event *event; while ((event = libinput_get_event(backend->libinput_context))) { - wlr_libinput_event(backend, event); + handle_libinput_event(backend, event); libinput_event_destroy(event); } 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 da7b2be4..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( @@ -86,7 +86,7 @@ static void handle_device_added(struct wlr_libinput_backend *backend, if (!wlr_dev) { goto fail; } - wlr_dev->keyboard = wlr_libinput_keyboard_create(libinput_dev); + wlr_dev->keyboard = create_libinput_keyboard(libinput_dev); if (!wlr_dev->keyboard) { free(wlr_dev); goto fail; @@ -99,7 +99,7 @@ static void handle_device_added(struct wlr_libinput_backend *backend, if (!wlr_dev) { goto fail; } - wlr_dev->pointer = wlr_libinput_pointer_create(libinput_dev); + wlr_dev->pointer = create_libinput_pointer(libinput_dev); if (!wlr_dev->pointer) { free(wlr_dev); goto fail; @@ -112,7 +112,7 @@ static void handle_device_added(struct wlr_libinput_backend *backend, if (!wlr_dev) { goto fail; } - wlr_dev->touch = wlr_libinput_touch_create(libinput_dev); + wlr_dev->touch = create_libinput_touch(libinput_dev); if (!wlr_dev->touch) { free(wlr_dev); goto fail; @@ -125,7 +125,7 @@ static void handle_device_added(struct wlr_libinput_backend *backend, if (!wlr_dev) { goto fail; } - wlr_dev->tablet_tool = wlr_libinput_tablet_tool_create(libinput_dev); + wlr_dev->tablet_tool = create_libinput_tablet_tool(libinput_dev); if (!wlr_dev->tablet_tool) { free(wlr_dev); goto fail; @@ -138,7 +138,7 @@ static void handle_device_added(struct wlr_libinput_backend *backend, if (!wlr_dev) { goto fail; } - wlr_dev->tablet_pad = wlr_libinput_tablet_pad_create(libinput_dev); + wlr_dev->tablet_pad = create_libinput_tablet_pad(libinput_dev); if (!wlr_dev->tablet_pad) { free(wlr_dev); goto fail; @@ -192,7 +192,7 @@ static void handle_device_removed(struct wlr_libinput_backend *backend, free(wlr_devices); } -void wlr_libinput_event(struct wlr_libinput_backend *backend, +void handle_libinput_event(struct wlr_libinput_backend *backend, struct libinput_event *event) { assert(backend && event); struct libinput_device *libinput_dev = libinput_event_get_device(event); diff --git a/backend/libinput/keyboard.c b/backend/libinput/keyboard.c index b44bc892..d8dd8878 100644 --- a/backend/libinput/keyboard.c +++ b/backend/libinput/keyboard.c @@ -12,23 +12,23 @@ 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 *wlr_libinput_keyboard_create( +struct wlr_keyboard *create_libinput_keyboard( struct libinput_device *libinput_dev) { assert(libinput_dev); struct wlr_libinput_keyboard *wlr_libinput_kb; diff --git a/backend/libinput/pointer.c b/backend/libinput/pointer.c index 9ccda634..9a39b66b 100644 --- a/backend/libinput/pointer.c +++ b/backend/libinput/pointer.c @@ -8,7 +8,7 @@ #include "backend/libinput.h" #include "util/signal.h" -struct wlr_pointer *wlr_libinput_pointer_create( +struct wlr_pointer *create_libinput_pointer( struct libinput_device *libinput_dev) { assert(libinput_dev); struct wlr_pointer *wlr_pointer = calloc(1, sizeof(struct wlr_pointer)); diff --git a/backend/libinput/tablet_pad.c b/backend/libinput/tablet_pad.c index f71e1efa..aa8b26d9 100644 --- a/backend/libinput/tablet_pad.c +++ b/backend/libinput/tablet_pad.c @@ -8,7 +8,7 @@ #include "backend/libinput.h" #include "util/signal.h" -struct wlr_tablet_pad *wlr_libinput_tablet_pad_create( +struct wlr_tablet_pad *create_libinput_tablet_pad( struct libinput_device *libinput_dev) { assert(libinput_dev); struct wlr_tablet_pad *wlr_tablet_pad = calloc(1, sizeof(struct wlr_tablet_pad)); diff --git a/backend/libinput/tablet_tool.c b/backend/libinput/tablet_tool.c index 815c4daf..b0bcfff5 100644 --- a/backend/libinput/tablet_tool.c +++ b/backend/libinput/tablet_tool.c @@ -8,7 +8,7 @@ #include "backend/libinput.h" #include "util/signal.h" -struct wlr_tablet_tool *wlr_libinput_tablet_tool_create( +struct wlr_tablet_tool *create_libinput_tablet_tool( struct libinput_device *libinput_dev) { assert(libinput_dev); struct wlr_tablet_tool *wlr_tablet_tool = calloc(1, sizeof(struct wlr_tablet_tool)); diff --git a/backend/libinput/touch.c b/backend/libinput/touch.c index 419c11ea..d79b2a97 100644 --- a/backend/libinput/touch.c +++ b/backend/libinput/touch.c @@ -8,7 +8,7 @@ #include "backend/libinput.h" #include "util/signal.h" -struct wlr_touch *wlr_libinput_touch_create( +struct wlr_touch *create_libinput_touch( struct libinput_device *libinput_dev) { assert(libinput_dev); struct wlr_touch *wlr_touch = calloc(1, sizeof(struct wlr_touch)); |