Don't use the wlr_ prefix for static functions

This commit is contained in:
emersion 2018-04-25 23:51:00 +01:00
parent 71ca45e2c0
commit 625a7a48dc
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
22 changed files with 306 additions and 302 deletions

View file

@ -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,

View file

@ -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(

View file

@ -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(