test/xi2: Update tests for gesture event types

This commit is contained in:
Povilas Kanapickas 2021-05-30 13:26:35 +03:00
parent f83f7dbb1c
commit 407a2234b3
2 changed files with 21 additions and 1 deletions

View File

@ -194,7 +194,7 @@ test_XIPassiveGrabDevice(void)
request->deviceid = XIAllMasterDevices;
printf("Testing invalid grab types\n");
for (i = XIGrabtypeTouchBegin + 1; i < 0xFF; i++) {
for (i = XIGrabtypeGestureSwipeBegin + 1; i < 0xFF; i++) {
request->grab_type = i;
request_XIPassiveGrabDevice(&client_request, request, BadValue,
request->grab_type);

View File

@ -124,6 +124,16 @@ _set_bit(unsigned char *bits, int bit)
SetBit(bits, XI_TouchUpdate);
SetBit(bits, XI_TouchEnd);
}
if (bit >= XI_GesturePinchBegin && bit <= XI_GesturePinchEnd) {
SetBit(bits, XI_GesturePinchBegin);
SetBit(bits, XI_GesturePinchUpdate);
SetBit(bits, XI_GesturePinchEnd);
}
if (bit >= XI_GestureSwipeBegin && bit <= XI_GestureSwipeEnd) {
SetBit(bits, XI_GestureSwipeBegin);
SetBit(bits, XI_GestureSwipeUpdate);
SetBit(bits, XI_GestureSwipeEnd);
}
}
static void
@ -135,6 +145,16 @@ _clear_bit(unsigned char *bits, int bit)
ClearBit(bits, XI_TouchUpdate);
ClearBit(bits, XI_TouchEnd);
}
if (bit >= XI_GesturePinchBegin && bit <= XI_GesturePinchEnd) {
ClearBit(bits, XI_GesturePinchBegin);
ClearBit(bits, XI_GesturePinchUpdate);
ClearBit(bits, XI_GesturePinchEnd);
}
if (bit >= XI_GestureSwipeBegin && bit <= XI_GestureSwipeEnd) {
ClearBit(bits, XI_GestureSwipeBegin);
ClearBit(bits, XI_GestureSwipeUpdate);
ClearBit(bits, XI_GestureSwipeEnd);
}
}
static void