summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-05-30 16:31:46 +0100
committerKristian Høgsberg <krh@bitplanet.net>2012-05-31 15:40:47 -0400
commita62e804c7e2058af9e3b73796dba45b473c2718b (patch)
treefac732c858951440165cd84aee27176616f85055
parent8c8164faeb68e4c460a1d45085128ffce8cd5a57 (diff)
evdev: Convert device type to an enum
Rather than using #defines. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
-rw-r--r--src/evdev-private.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/evdev-private.h b/src/evdev-private.h
index c11c9b6..43143f2 100644
--- a/src/evdev-private.h
+++ b/src/evdev-private.h
@@ -36,6 +36,14 @@ struct evdev_seat {
#define MAX_SLOTS 16
+enum evdev_event_type {
+ EVDEV_ABSOLUTE_MOTION = (1 << 0),
+ EVDEV_ABSOLUTE_MT_DOWN = (1 << 1),
+ EVDEV_ABSOLUTE_MT_MOTION = (1 << 2),
+ EVDEV_ABSOLUTE_MT_UP = (1 << 3),
+ EVDEV_RELATIVE_MOTION = (1 << 4),
+};
+
struct evdev_input_device {
struct evdev_seat *master;
struct wl_list link;
@@ -60,18 +68,11 @@ struct evdev_input_device {
wl_fixed_t dx, dy;
} rel;
- int type; /* event type flags */
+ enum evdev_event_type type;
int is_mt;
};
-/* event type flags */
-#define EVDEV_ABSOLUTE_MOTION (1 << 0)
-#define EVDEV_ABSOLUTE_MT_DOWN (1 << 1)
-#define EVDEV_ABSOLUTE_MT_MOTION (1 << 2)
-#define EVDEV_ABSOLUTE_MT_UP (1 << 3)
-#define EVDEV_RELATIVE_MOTION (1 << 4)
-
/* copied from udev/extras/input_id/input_id.c */
/* we must use this kernel-compatible implementation */
#define BITS_PER_LONG (sizeof(unsigned long) * 8)