summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-05-30 16:31:47 +0100
committerKristian Høgsberg <krh@bitplanet.net>2012-05-31 15:41:11 -0400
commit1d637772c821b8becd5f1ddfa97199955b199993 (patch)
tree73ee9ad76d5b82e05ce3af7fe3ea036f004ae2b8
parenta62e804c7e2058af9e3b73796dba45b473c2718b (diff)
Rename evdev_input_device::type to pending_events
Since that's what it actually is, rather than a description of the device as such. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
-rw-r--r--src/evdev-private.h2
-rw-r--r--src/evdev-touchpad.c2
-rw-r--r--src/evdev.c44
3 files changed, 24 insertions, 24 deletions
diff --git a/src/evdev-private.h b/src/evdev-private.h
index 43143f2..e4bcf13 100644
--- a/src/evdev-private.h
+++ b/src/evdev-private.h
@@ -68,7 +68,7 @@ struct evdev_input_device {
wl_fixed_t dx, dy;
} rel;
- enum evdev_event_type type;
+ enum evdev_event_type pending_events;
int is_mt;
};
diff --git a/src/evdev-touchpad.c b/src/evdev-touchpad.c
index dd7ab1c..f658081 100644
--- a/src/evdev-touchpad.c
+++ b/src/evdev-touchpad.c
@@ -375,7 +375,7 @@ touchpad_update_state(struct touchpad_dispatch *touchpad, uint32_t time)
touchpad->device->rel.dx = wl_fixed_from_double(dx);
touchpad->device->rel.dy = wl_fixed_from_double(dy);
- touchpad->device->type |= EVDEV_RELATIVE_MOTION;
+ touchpad->device->pending_events |= EVDEV_RELATIVE_MOTION;
}
}
diff --git a/src/evdev.c b/src/evdev.c
index 73b012b..6adf10a 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -73,23 +73,23 @@ evdev_process_touch(struct evdev_input_device *device,
break;
case ABS_MT_TRACKING_ID:
if (e->value >= 0)
- device->type |= EVDEV_ABSOLUTE_MT_DOWN;
+ device->pending_events |= EVDEV_ABSOLUTE_MT_DOWN;
else
- device->type |= EVDEV_ABSOLUTE_MT_UP;
+ device->pending_events |= EVDEV_ABSOLUTE_MT_UP;
break;
case ABS_MT_POSITION_X:
device->mt.x[device->mt.slot] =
(e->value - device->abs.min_x) * screen_width /
(device->abs.max_x - device->abs.min_x) +
device->output->x;
- device->type |= EVDEV_ABSOLUTE_MT_MOTION;
+ device->pending_events |= EVDEV_ABSOLUTE_MT_MOTION;
break;
case ABS_MT_POSITION_Y:
device->mt.y[device->mt.slot] =
(e->value - device->abs.min_y) * screen_height /
(device->abs.max_y - device->abs.min_y) +
device->output->y;
- device->type |= EVDEV_ABSOLUTE_MT_MOTION;
+ device->pending_events |= EVDEV_ABSOLUTE_MT_MOTION;
break;
}
}
@@ -107,14 +107,14 @@ evdev_process_absolute_motion(struct evdev_input_device *device,
(e->value - device->abs.min_x) * screen_width /
(device->abs.max_x - device->abs.min_x) +
device->output->x;
- device->type |= EVDEV_ABSOLUTE_MOTION;
+ device->pending_events |= EVDEV_ABSOLUTE_MOTION;
break;
case ABS_Y:
device->abs.y =
(e->value - device->abs.min_y) * screen_height /
(device->abs.max_y - device->abs.min_y) +
device->output->y;
- device->type |= EVDEV_ABSOLUTE_MOTION;
+ device->pending_events |= EVDEV_ABSOLUTE_MOTION;
break;
}
}
@@ -126,11 +126,11 @@ evdev_process_relative(struct evdev_input_device *device,
switch (e->code) {
case REL_X:
device->rel.dx += wl_fixed_from_int(e->value);
- device->type |= EVDEV_RELATIVE_MOTION;
+ device->pending_events |= EVDEV_RELATIVE_MOTION;
break;
case REL_Y:
device->rel.dy += wl_fixed_from_int(e->value);
- device->type |= EVDEV_RELATIVE_MOTION;
+ device->pending_events |= EVDEV_RELATIVE_MOTION;
break;
case REL_WHEEL:
notify_axis(&device->master->base.seat,
@@ -184,45 +184,45 @@ evdev_flush_motion(struct evdev_input_device *device, uint32_t time)
{
struct weston_seat *master = &device->master->base;
- if (!device->type)
+ if (!device->pending_events)
return;
- if (device->type & EVDEV_RELATIVE_MOTION) {
+ if (device->pending_events & EVDEV_RELATIVE_MOTION) {
notify_motion(&master->seat, time,
master->seat.pointer->x + device->rel.dx,
master->seat.pointer->y + device->rel.dy);
- device->type &= ~EVDEV_RELATIVE_MOTION;
+ device->pending_events &= ~EVDEV_RELATIVE_MOTION;
device->rel.dx = 0;
device->rel.dy = 0;
}
- if (device->type & EVDEV_ABSOLUTE_MT_DOWN) {
+ if (device->pending_events & EVDEV_ABSOLUTE_MT_DOWN) {
notify_touch(&master->seat, time,
device->mt.slot,
wl_fixed_from_int(device->mt.x[device->mt.slot]),
wl_fixed_from_int(device->mt.y[device->mt.slot]),
WL_TOUCH_DOWN);
- device->type &= ~EVDEV_ABSOLUTE_MT_DOWN;
- device->type &= ~EVDEV_ABSOLUTE_MT_MOTION;
+ device->pending_events &= ~EVDEV_ABSOLUTE_MT_DOWN;
+ device->pending_events &= ~EVDEV_ABSOLUTE_MT_MOTION;
}
- if (device->type & EVDEV_ABSOLUTE_MT_MOTION) {
+ if (device->pending_events & EVDEV_ABSOLUTE_MT_MOTION) {
notify_touch(&master->seat, time,
device->mt.slot,
wl_fixed_from_int(device->mt.x[device->mt.slot]),
wl_fixed_from_int(device->mt.y[device->mt.slot]),
WL_TOUCH_MOTION);
- device->type &= ~EVDEV_ABSOLUTE_MT_DOWN;
- device->type &= ~EVDEV_ABSOLUTE_MT_MOTION;
+ device->pending_events &= ~EVDEV_ABSOLUTE_MT_DOWN;
+ device->pending_events &= ~EVDEV_ABSOLUTE_MT_MOTION;
}
- if (device->type & EVDEV_ABSOLUTE_MT_UP) {
+ if (device->pending_events & EVDEV_ABSOLUTE_MT_UP) {
notify_touch(&master->seat, time, device->mt.slot, 0, 0,
WL_TOUCH_UP);
- device->type &= ~EVDEV_ABSOLUTE_MT_UP;
+ device->pending_events &= ~EVDEV_ABSOLUTE_MT_UP;
}
- if (device->type & EVDEV_ABSOLUTE_MOTION) {
+ if (device->pending_events & EVDEV_ABSOLUTE_MOTION) {
notify_motion(&master->seat, time,
wl_fixed_from_int(device->abs.x),
wl_fixed_from_int(device->abs.y));
- device->type &= ~EVDEV_ABSOLUTE_MOTION;
+ device->pending_events &= ~EVDEV_ABSOLUTE_MOTION;
}
}
@@ -276,7 +276,7 @@ evdev_process_events(struct evdev_input_device *device,
struct input_event *e, *end;
uint32_t time = 0;
- device->type = 0;
+ device->pending_events = 0;
e = ev;
end = e + count;