]> git.mdlowis.com Git - proto/labwc.git/commitdiff
config: prefix enums with LAB_LIBINPUT_DEVICE_
authorJohan Malm <jgm323@gmail.com>
Mon, 1 Jan 2024 19:14:08 +0000 (19:14 +0000)
committerJohan Malm <johanmalm@users.noreply.github.com>
Mon, 1 Jan 2024 22:04:21 +0000 (22:04 +0000)
include/config/libinput.h
src/config/libinput.c
src/seat.c

index d05b84890dfb3431f582a092e0b144a3521d0e33..ae362ab4be07538c306b28a6cca6728c38fe384f 100644 (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 {
index 4b61d54660a0202756ecd8d946c8e84006d86a84..b2a1970ea06c9e618804fb2018079ef41d2faa65 100644 (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;
                }
        }
index 4696f589287ab11123ac775c3af1315727a02421..f5564416bc925151f994889df12e27da80e92425 100644 (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;
 }
 
 /*