config: prefix enums with LAB_LIBINPUT_DEVICE_

This commit is contained in:
Johan Malm 2024-01-01 19:14:08 +00:00 committed by Johan Malm
parent a7f8eef163
commit 673c745cff
3 changed files with 13 additions and 15 deletions

View file

@ -8,12 +8,10 @@
enum device_type {
LAB_LIBINPUT_DEVICE_NONE = 0,
// FIXME: Rename the entries below with a LAB_LIBINPUT_ prefix
DEFAULT_DEVICE,
TOUCH_DEVICE,
TOUCHPAD_DEVICE,
NON_TOUCH_DEVICE,
LAB_LIBINPUT_DEVICE_DEFAULT,
LAB_LIBINPUT_DEVICE_TOUCH,
LAB_LIBINPUT_DEVICE_TOUCHPAD,
LAB_LIBINPUT_DEVICE_NON_TOUCH,
};
struct libinput_category {

View file

@ -10,7 +10,7 @@
static void
libinput_category_init(struct libinput_category *l)
{
l->type = DEFAULT_DEVICE;
l->type = LAB_LIBINPUT_DEVICE_DEFAULT;
l->name = NULL;
l->pointer_speed = -2;
l->natural_scroll = -1;
@ -31,16 +31,16 @@ get_device_type(const char *s)
return LAB_LIBINPUT_DEVICE_NONE;
}
if (!strcasecmp(s, "default")) {
return DEFAULT_DEVICE;
return LAB_LIBINPUT_DEVICE_DEFAULT;
}
if (!strcasecmp(s, "touch")) {
return TOUCH_DEVICE;
return LAB_LIBINPUT_DEVICE_TOUCH;
}
if (!strcasecmp(s, "touchpad")) {
return TOUCHPAD_DEVICE;
return LAB_LIBINPUT_DEVICE_TOUCHPAD;
}
if (!strcasecmp(s, "non-touch")) {
return NON_TOUCH_DEVICE;
return LAB_LIBINPUT_DEVICE_NON_TOUCH;
}
return LAB_LIBINPUT_DEVICE_NONE;
}
@ -64,7 +64,7 @@ libinput_category_get_default(void)
* 'default' profiles were created.
*/
wl_list_for_each_reverse(l, &rc.libinput_categories, link) {
if (l->type == DEFAULT_DEVICE) {
if (l->type == LAB_LIBINPUT_DEVICE_DEFAULT) {
return l;
}
}

View file

@ -39,7 +39,7 @@ device_type_from_wlr_device(struct wlr_input_device *wlr_input_device)
switch (wlr_input_device->type) {
case WLR_INPUT_DEVICE_TOUCH:
case WLR_INPUT_DEVICE_TABLET_TOOL:
return TOUCH_DEVICE;
return LAB_LIBINPUT_DEVICE_TOUCH;
default:
break;
}
@ -50,11 +50,11 @@ device_type_from_wlr_device(struct wlr_input_device *wlr_input_device)
wlr_libinput_get_device_handle(wlr_input_device);
if (libinput_device_config_tap_get_finger_count(libinput_device) > 0) {
return TOUCHPAD_DEVICE;
return LAB_LIBINPUT_DEVICE_TOUCHPAD;
}
}
return NON_TOUCH_DEVICE;
return LAB_LIBINPUT_DEVICE_NON_TOUCH;
}
/*