diff options
author | Povilas Kanapickas <povilas@radix.lt> | 2021-05-30 13:26:30 +0300 |
---|---|---|
committer | Povilas Kanapickas <povilas@radix.lt> | 2021-05-30 13:26:30 +0300 |
commit | 22fa31ed561ed1e78bf3651f28e11882b1eac51f (patch) | |
tree | ba58017a7c84828bb733871bc3e521f30faba910 /Xi | |
parent | 8e504d8b36eb8f23bf8cfa46143d046cc6b8ea51 (diff) |
dix: Add new internal event enums for gesture events
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index dd3e90ae5..c8751ce18 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -95,6 +95,7 @@ SOFTWARE. #include "exevents.h" #include "extnsionst.h" #include "exglobals.h" +#include "eventstr.h" #include "dixevents.h" /* DeliverFocusedEvent */ #include "dixgrabs.h" /* CreateGrab() */ #include "scrnintstr.h" @@ -168,6 +169,49 @@ IsTouchEvent(InternalEvent *event) return FALSE; } +Bool +IsGestureEvent(InternalEvent *event) +{ + switch (event->any.type) { + case ET_GesturePinchBegin: + case ET_GesturePinchUpdate: + case ET_GesturePinchEnd: + case ET_GestureSwipeBegin: + case ET_GestureSwipeUpdate: + case ET_GestureSwipeEnd: + return TRUE; + default: + break; + } + return FALSE; +} + +Bool +IsGestureBeginEvent(InternalEvent *event) +{ + switch (event->any.type) { + case ET_GesturePinchBegin: + case ET_GestureSwipeBegin: + return TRUE; + default: + break; + } + return FALSE; +} + +Bool +IsGestureEndEvent(InternalEvent *event) +{ + switch (event->any.type) { + case ET_GesturePinchEnd: + case ET_GestureSwipeEnd: + return TRUE; + default: + break; + } + return FALSE; +} + /** * @return the device matching the deviceid of the device set in the event, or * NULL if the event is not an XInput event. |