summaryrefslogtreecommitdiff
path: root/include/input.h
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2010-09-20 15:03:06 +1000
committerChase Douglas <chase.douglas@ubuntu.com>2010-10-13 21:42:27 +0200
commita6cdd84853df31b8d2beffcbf7fbc5e51dbd74b5 (patch)
tree4147c8c3b56826ca841aa3f780bdf31e80ae3838 /include/input.h
parentf7d671b89a6c4e00f1333960b56d18f69548628e (diff)
Input: Add initial multitouch support from Xi 2.1
Xi 2.1 adds TouchClasses to devices, as well as TouchBegin, TouchMotion and TouchEnd events, to allow support for multiple touchpoints on a single device. This is a full implementation of the Xi 2.1 additions. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'include/input.h')
-rw-r--r--include/input.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/input.h b/include/input.h
index dbdc863c4..fa9b7c38c 100644
--- a/include/input.h
+++ b/include/input.h
@@ -105,6 +105,9 @@ typedef struct _DeviceIntRec *DeviceIntPtr;
typedef struct _ClassesRec *ClassesPtr;
typedef struct _SpriteRec *SpritePtr;
typedef union _GrabMask GrabMask;
+typedef struct _TouchInfoRec *TouchInfoPtr;
+
+#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
typedef struct _EventList {
xEvent* event;
@@ -323,6 +326,18 @@ extern _X_EXPORT Bool InitAbsoluteClassDeviceStruct(
extern _X_EXPORT Bool InitFocusClassDeviceStruct(
DeviceIntPtr /*device*/);
+extern _X_EXPORT Bool InitTouchClassDeviceStruct(
+ DeviceIntPtr /*device*/,
+ unsigned int /*max_touches*/,
+ unsigned int /*xy_mode*/,
+ unsigned int /*focus_mode*/,
+ double /*min_x*/,
+ double /*max_x*/,
+ double /*min_y*/,
+ double /*max_y*/,
+ double /*min_touch_width*/,
+ double /*max_touch_width*/);
+
typedef void (*BellProcPtr)(
int /*percent*/,
DeviceIntPtr /*device*/,
@@ -474,6 +489,25 @@ extern int GetKeyboardValuatorEvents(
ValuatorMask *mask,
int *valuators);
+extern int GetTouchEvents(
+ EventListPtr events,
+ DeviceIntPtr pDev,
+ uint32_t touchid,
+ uint32_t tool,
+ uint16_t mask,
+ double x,
+ double y,
+ double touch_width_major,
+ double touch_width_minor,
+ double tool_width_major,
+ double tool_width_minor,
+ unsigned int orientation);
+
+extern int GetTouchFinishEvents(
+ EventListPtr events,
+ DeviceIntPtr pDev,
+ uint32_t touchid);
+
extern int GetProximityEvents(
EventListPtr events,
DeviceIntPtr pDev,
@@ -536,8 +570,13 @@ extern DeviceIntPtr GetXTestDevice(DeviceIntPtr master);
extern void SendDevicePresenceEvent(int deviceid, int type);
extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *attrs);
extern _X_EXPORT void FreeInputAttributes(InputAttributes *attrs);
+extern TouchInfoPtr CreateTouchPoint(DeviceIntPtr dev, uint32_t touchid,
+ uint32_t tool);
+extern TouchInfoPtr FindTouchPoint(DeviceIntPtr dev, uint32_t touchid);
+extern void FinishTouchPoint(DeviceIntPtr dev, uint32_t touchid);
/* misc event helpers */
+extern Mask GetEventMask(DeviceIntPtr dev, xEvent* ev, InputClientsPtr clients);
extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event);
extern Mask GetWindowXI2Mask(DeviceIntPtr dev, WindowPtr win, xEvent* ev);
void FixUpEventFromWindow(SpritePtr pSprite,
@@ -545,6 +584,7 @@ void FixUpEventFromWindow(SpritePtr pSprite,
WindowPtr pWin,
Window child,
Bool calcChild);
+extern WindowPtr XYToWindow(SpritePtr pSprite, int x, int y);
/* Implemented by the DDX. */
extern _X_EXPORT int NewInputDeviceRequest(