summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPovilas Kanapickas <povilas@radix.lt>2021-05-30 13:26:39 +0300
committerPovilas Kanapickas <povilas@radix.lt>2021-05-30 13:26:39 +0300
commit7656a9c8dddbc57adfd4fd05f8e26b1845ac8738 (patch)
tree830397f7586ff0f2a15c79fd7cbe158d5fca95ff /include
parent0bf4123fd3bc945d150884e6ea38bd2b81c0994b (diff)
dix: Implement internal gesture state handling
Diffstat (limited to 'include')
-rw-r--r--include/input.h12
-rw-r--r--include/inputstr.h28
2 files changed, 40 insertions, 0 deletions
diff --git a/include/input.h b/include/input.h
index 8252914a6..d607e6b97 100644
--- a/include/input.h
+++ b/include/input.h
@@ -153,7 +153,9 @@ typedef struct _ValuatorClassRec *ValuatorClassPtr;
typedef struct _ClassesRec *ClassesPtr;
typedef struct _SpriteRec *SpritePtr;
typedef struct _TouchClassRec *TouchClassPtr;
+typedef struct _GestureClassRec *GestureClassPtr;
typedef struct _TouchPointInfo *TouchPointInfoPtr;
+typedef struct _GestureInfo *GestureInfoPtr;
typedef struct _DDXTouchPointInfo *DDXTouchPointInfoPtr;
typedef union _GrabMask GrabMask;
@@ -340,6 +342,9 @@ extern _X_EXPORT Bool InitTouchClassDeviceStruct(DeviceIntPtr /*device */ ,
unsigned int /*mode */ ,
unsigned int /*numAxes */ );
+extern _X_EXPORT Bool InitGestureClassDeviceStruct(DeviceIntPtr device,
+ unsigned int max_touches);
+
typedef void (*BellProcPtr) (int percent,
DeviceIntPtr device,
void *ctrl,
@@ -576,6 +581,12 @@ enum TouchListenerType {
TOUCH_LISTENER_POINTER_REGULAR,
};
+enum GestureListenerType {
+ GESTURE_LISTENER_GRAB,
+ GESTURE_LISTENER_NONGESTURE_GRAB,
+ GESTURE_LISTENER_REGULAR
+};
+
extern void TouchInitDDXTouchPoint(DeviceIntPtr dev,
DDXTouchPointInfoPtr ddxtouch);
extern DDXTouchPointInfoPtr TouchBeginDDXTouch(DeviceIntPtr dev,
@@ -621,6 +632,7 @@ extern void TouchEndPhysicallyActiveTouches(DeviceIntPtr dev);
extern void TouchEmitTouchEnd(DeviceIntPtr dev, TouchPointInfoPtr ti, int flags, XID resource);
extern void TouchAcceptAndEnd(DeviceIntPtr dev, int touchid);
+extern Bool GestureInitGestureInfo(GestureInfoPtr gesture);
/* misc event helpers */
extern Mask GetEventMask(DeviceIntPtr dev, xEvent *ev, InputClientsPtr clients);
extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event);
diff --git a/include/inputstr.h b/include/inputstr.h
index 1cf871530..ec11b39bb 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -352,6 +352,32 @@ typedef struct _TouchClassRec {
Mask motionMask;
} TouchClassRec;
+typedef struct _GestureListener {
+ XID listener; /* grabs/event selection IDs receiving
+ * events for this gesture */
+ int resource_type; /* listener's resource type */
+ enum GestureListenerType type;
+ WindowPtr window;
+ GrabPtr grab;
+} GestureListener;
+
+typedef struct _GestureInfo {
+ int sourceid; /* Source device's ID for this gesture */
+ Bool active; /* whether or not the gesture is active */
+ uint8_t type; /* Gesture type: either ET_GesturePinchBegin or
+ ET_GestureSwipeBegin. Valid if active == TRUE */
+ int num_touches; /* The number of touches in the gesture */
+ SpriteRec sprite; /* window trace for delivery */
+ GestureListener listener; /* the listener that will receive events */
+ Bool has_listener; /* true if listener has been setup already */
+} GestureInfoRec;
+
+typedef struct _GestureClassRec {
+ int sourceid;
+ GestureInfoRec gesture;
+ unsigned short max_touches; /* maximum number of touches, may be 0 */
+} GestureClassRec;
+
typedef struct _ButtonClassRec {
int sourceid;
CARD8 numButtons;
@@ -435,6 +461,7 @@ typedef struct _ClassesRec {
KeyClassPtr key;
ValuatorClassPtr valuator;
TouchClassPtr touch;
+ GestureClassPtr gesture;
ButtonClassPtr button;
FocusClassPtr focus;
ProximityClassPtr proximity;
@@ -550,6 +577,7 @@ typedef struct _DeviceIntRec {
KeyClassPtr key;
ValuatorClassPtr valuator;
TouchClassPtr touch;
+ GestureClassPtr gesture;
ButtonClassPtr button;
FocusClassPtr focus;
ProximityClassPtr proximity;