summaryrefslogtreecommitdiff
path: root/src/evdev.h
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-12-23 08:16:54 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-12-23 08:16:54 +1000
commit5fb48757477b2effd69c8fe8722ad95b21dbf7f5 (patch)
tree6795e62f0f41714c64965c4d588cd394af7a4ed1 /src/evdev.h
parent7909975b0b965fbf0935bf012987a5368ea0e67a (diff)
parente99ab2314f712df8dd705b16008755f8b3095707 (diff)
Merge branch 'multitouch'
Diffstat (limited to 'src/evdev.h')
-rw-r--r--src/evdev.h43
1 files changed, 40 insertions, 3 deletions
diff --git a/src/evdev.h b/src/evdev.h
index b2e2f42..5fd99ff 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -39,6 +39,10 @@
#include <xf86_OSproc.h>
#include <xkbstr.h>
+#ifdef MULTITOUCH
+#include <mtdev.h>
+#endif
+
#ifndef EV_CNT /* linux 2.6.23 kernels and earlier lack _CNT defines */
#define EV_CNT (EV_MAX+1)
#endif
@@ -96,6 +100,18 @@ enum fkeymode {
FKEYMODE_MMKEYS, /* function keys send multimedia keys */
};
+enum SlotState {
+ SLOTSTATE_OPEN = 8,
+ SLOTSTATE_CLOSE,
+ SLOTSTATE_UPDATE,
+ SLOTSTATE_EMPTY,
+};
+
+enum ButtonAction {
+ BUTTON_RELEASE = 0,
+ BUTTON_PRESS = 1
+};
+
/* axis specific data for wheel emulation */
typedef struct {
int up_button;
@@ -109,9 +125,20 @@ typedef struct {
EV_QUEUE_KEY, /* xf86PostKeyboardEvent() */
EV_QUEUE_BTN, /* xf86PostButtonEvent() */
EV_QUEUE_PROXIMITY, /* xf86PostProximityEvent() */
+#ifdef MULTITOUCH
+ EV_QUEUE_TOUCH, /*xf86PostTouchEvent() */
+#endif
} type;
- int key; /* May be either a key code or button number. */
- int val; /* State of the key/button; pressed or released. */
+ union {
+ int key; /* May be either a key code or button number. */
+#ifdef MULTITOUCH
+ unsigned int touch; /* Touch ID */
+#endif
+ } detail;
+ int val; /* State of the key/button/touch; pressed or released. */
+#ifdef MULTITOUCH
+ ValuatorMask *touchMask;
+#endif
} EventQueueRec, *EventQueuePtr;
typedef struct {
@@ -126,6 +153,12 @@ typedef struct {
ValuatorMask *vals; /* new values coming in */
ValuatorMask *old_vals; /* old values for calculating relative motion */
ValuatorMask *prox; /* last values set while not in proximity */
+#ifdef MULTITOUCH
+ ValuatorMask *mt_mask;
+ int cur_slot;
+ enum SlotState slot_state;
+ struct mtdev *mtdev;
+#endif
int flags;
int in_proximity; /* device in proximity */
@@ -216,7 +249,11 @@ typedef struct {
void EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value);
void EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value);
void EvdevQueueProximityEvent(InputInfoPtr pInfo, int value);
-void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, int value);
+#ifdef MULTITOUCH
+void EvdevQueueTouchEvent(InputInfoPtr pInfo, unsigned int touch,
+ ValuatorMask *mask, uint16_t type);
+#endif
+void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, enum ButtonAction act);
void EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count);
void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
int v[MAX_VALUATORS]);