diff options
author | Povilas Kanapickas <povilas@radix.lt> | 2021-05-30 13:26:37 +0300 |
---|---|---|
committer | Povilas Kanapickas <povilas@radix.lt> | 2021-05-30 13:26:37 +0300 |
commit | 227f601de31aabf6aaa897477e42e6b7f8f7c963 (patch) | |
tree | 9a7c6241af09db5f0f48316fb2da99745682b604 /Xi | |
parent | f3462178caf09a8777b8671eb03949b75c8ee07a (diff) |
xi: Implement conversions from internal to Xi2 gesture event structs
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/extinit.c | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/Xi/extinit.c b/Xi/extinit.c index 8d9120866..4e5a13fc5 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -850,6 +850,74 @@ SBarrierEvent(xXIBarrierEvent * from, swapl(&to->eventid); } +static void +SGesturePinchEvent(xXIGesturePinchEvent* from, + xXIGesturePinchEvent* to) +{ + *to = *from; + + swaps(&to->sequenceNumber); + swapl(&to->length); + swaps(&to->evtype); + swaps(&to->deviceid); + swapl(&to->time); + swapl(&to->detail); + swapl(&to->root); + swapl(&to->event); + swapl(&to->child); + swapl(&to->root_x); + swapl(&to->root_y); + swapl(&to->event_x); + swapl(&to->event_y); + + swapl(&to->delta_x); + swapl(&to->delta_y); + swapl(&to->delta_unaccel_x); + swapl(&to->delta_unaccel_y); + swapl(&to->scale); + swapl(&to->delta_angle); + swaps(&to->sourceid); + + swapl(&to->mods.base_mods); + swapl(&to->mods.latched_mods); + swapl(&to->mods.locked_mods); + swapl(&to->mods.effective_mods); + swapl(&to->flags); +} + +static void +SGestureSwipeEvent(xXIGestureSwipeEvent* from, + xXIGestureSwipeEvent* to) +{ + *to = *from; + + swaps(&to->sequenceNumber); + swapl(&to->length); + swaps(&to->evtype); + swaps(&to->deviceid); + swapl(&to->time); + swapl(&to->detail); + swapl(&to->root); + swapl(&to->event); + swapl(&to->child); + swapl(&to->root_x); + swapl(&to->root_y); + swapl(&to->event_x); + swapl(&to->event_y); + + swapl(&to->delta_x); + swapl(&to->delta_y); + swapl(&to->delta_unaccel_x); + swapl(&to->delta_unaccel_y); + swaps(&to->sourceid); + + swapl(&to->mods.base_mods); + swapl(&to->mods.latched_mods); + swapl(&to->mods.locked_mods); + swapl(&to->mods.effective_mods); + swapl(&to->flags); +} + /** Event swapping function for XI2 events. */ void _X_COLD XI2EventSwap(xGenericEvent *from, xGenericEvent *to) @@ -901,6 +969,18 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to) SBarrierEvent((xXIBarrierEvent *) from, (xXIBarrierEvent *) to); break; + case XI_GesturePinchBegin: + case XI_GesturePinchUpdate: + case XI_GesturePinchEnd: + SGesturePinchEvent((xXIGesturePinchEvent*) from, + (xXIGesturePinchEvent*) to); + break; + case XI_GestureSwipeBegin: + case XI_GestureSwipeUpdate: + case XI_GestureSwipeEnd: + SGestureSwipeEvent((xXIGestureSwipeEvent*) from, + (xXIGestureSwipeEvent*) to); + break; default: ErrorF("[Xi] Unknown event type to swap. This is a bug.\n"); break; |