From 9411749f76c31a8054ded62a6fb767c8135b4d4e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 26 Oct 2011 13:09:30 +1000 Subject: Replace open_slot/close_slot with a SlotState enum Signed-off-by: Peter Hutterer --- src/evdev.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/evdev.c') diff --git a/src/evdev.c b/src/evdev.c index 97da9c8..b55a0aa 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -709,9 +709,9 @@ EvdevProcessTouch(InputInfoPtr pInfo) if (pEvdev->cur_slot < 0 || !pEvdev->mt_mask) return; - if (pEvdev->close_slot) + if (pEvdev->slot_state == SLOTSTATE_CLOSE) type = XI_TouchEnd; - else if (pEvdev->open_slot) + else if (pEvdev->slot_state == SLOTSTATE_OPEN) type = XI_TouchBegin; else type = XI_TouchUpdate; @@ -719,8 +719,7 @@ EvdevProcessTouch(InputInfoPtr pInfo) EvdevQueueTouchEvent(pInfo, pEvdev->cur_slot, pEvdev->mt_mask, type); - pEvdev->close_slot = 0; - pEvdev->open_slot = 0; + pEvdev->slot_state = SLOTSTATE_EMPTY; valuator_mask_zero(pEvdev->mt_mask); } @@ -736,9 +735,9 @@ EvdevProcessTouchEvent(InputInfoPtr pInfo, struct input_event *ev) pEvdev->cur_slot = ev->value; } else if (ev->code == ABS_MT_TRACKING_ID) { if (ev->value >= 0) - pEvdev->open_slot = 1; + pEvdev->slot_state = SLOTSTATE_OPEN; else - pEvdev->close_slot = 1; + pEvdev->slot_state = SLOTSTATE_CLOSE; } else { map = pEvdev->axis_map[ev->code] - pEvdev->num_vals; valuator_mask_set(pEvdev->mt_mask, map, ev->value); -- cgit v1.2.3