summaryrefslogtreecommitdiff
path: root/include/input.h
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2011-12-14 12:46:40 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-12-19 09:08:36 +1000
commit3fb258ca28850c998097b55884774cb95f476f69 (patch)
tree8e620ad39a18467800e599694c9258411632988c /include/input.h
parent098b837440e40bbc485368ec9658e12efd6ef581 (diff)
input: add a TouchClassRec to the devices
These structs will be used to store touch-related data, events and information. Drivers must call InitTouchClassDeviceStruct to set up a multi-touch capable device. Touchpoints for the DDX and the DIX are handled separately - touchpoints submitted by the driver/DDX will be stored in the DDXTouchPointInfoRec. Once the touchpoints are processed by the DIX, new TouchPointInfoRecs are created and stored. This process is already used for pointer events with the last.valuators field. Note that this patch does not actually add the generation of touch events, only the required structs. TouchListeners are (future) recipients of touch or emulated pointer events. Each listener is in a state, depending which event they have already received. The type of listener defines how the listener got to be one. Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'include/input.h')
-rw-r--r--include/input.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/input.h b/include/input.h
index a94ff942d..0d31edf75 100644
--- a/include/input.h
+++ b/include/input.h
@@ -124,6 +124,9 @@ typedef struct _DeviceIntRec *DeviceIntPtr;
typedef struct _ValuatorClassRec *ValuatorClassPtr;
typedef struct _ClassesRec *ClassesPtr;
typedef struct _SpriteRec *SpritePtr;
+typedef struct _TouchClassRec *TouchClassPtr;
+typedef struct _TouchPointInfo *TouchPointInfoPtr;
+typedef struct _DDXTouchPointInfo *DDXTouchPointInfoPtr;
typedef union _GrabMask GrabMask;
typedef struct _ValuatorMask ValuatorMask;
@@ -324,6 +327,12 @@ extern _X_EXPORT Bool InitPointerAccelerationScheme(
extern _X_EXPORT Bool InitFocusClassDeviceStruct(
DeviceIntPtr /*device*/);
+extern _X_EXPORT Bool InitTouchClassDeviceStruct(
+ DeviceIntPtr /*device*/,
+ unsigned int /*max_touches*/,
+ unsigned int /*mode*/,
+ unsigned int /*numAxes*/);
+
typedef void (*BellProcPtr)(
int /*percent*/,
DeviceIntPtr /*device*/,
@@ -563,6 +572,24 @@ extern void SendDevicePresenceEvent(int deviceid, int type);
extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *attrs);
extern _X_EXPORT void FreeInputAttributes(InputAttributes *attrs);
+enum TouchListenerState{
+ LISTENER_AWAITING_BEGIN = 0, /**< Waiting for a TouchBegin event */
+ LISTENER_AWAITING_OWNER, /**< Waiting for a TouchOwnership event */
+ LISTENER_IS_OWNER, /**< Is the current owner */
+ LISTENER_HAS_END, /**< Has already received the end event */
+};
+
+enum TouchListenerType {
+ LISTENER_GRAB,
+ LISTENER_POINTER_GRAB,
+ LISTENER_REGULAR,
+ LISTENER_POINTER_REGULAR,
+};
+
+extern void TouchInitDDXTouchPoint(DeviceIntPtr dev, DDXTouchPointInfoPtr ddxtouch);
+extern Bool TouchInitTouchPoint(TouchClassPtr touch, ValuatorClassPtr v, int index);
+extern void TouchFreeTouchPoint(DeviceIntPtr dev, int index);
+
/* misc event helpers */
extern Mask GetEventMask(DeviceIntPtr dev, xEvent* ev, InputClientsPtr clients);
extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event);