mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-26 06:20:12 +01:00
evdev: Convert device type to an enum
Rather than using #defines. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
bb25b2ad29
commit
4594e9904b
1 changed files with 9 additions and 8 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue