diff --git a/include/inputstr.h b/include/inputstr.h
index 00f72c260f38a4bab7fb15674b29adc0801bd29c..c3297db64bf4223bbb359b014a7b9f1a5f95e82d 100644 (file)
--- a/include/inputstr.h
+++ b/include/inputstr.h
#ifndef INPUTSTRUCT_H
#define INPUTSTRUCT_H
+#include <X11/extensions/XI2proto.h>
+
#include <pixman.h>
#include "input.h"
#include "window.h"
#include "geext.h"
#include "privates.h"
-#define BitIsOn(ptr, bit) (!!(((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))))
+#define BitIsOn(ptr, bit) (!!(((const BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))))
#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
extern _X_EXPORT int CountBits(const uint8_t *mask, int len);
* events to the protocol, the server will not support these events until
* this number here is bumped.
*/
-#define XI2LASTEVENT 17 /* XI_RawMotion */
-#define XI2MASKSIZE ((XI2LASTEVENT + 7)/8) /* no of bits for masks */
+#define XI2LASTEVENT XI_RawTouchEnd
+#define XI2MASKSIZE ((XI2LASTEVENT >> 3) + 1) /* no of bytes for masks */
+
+/**
+ * Scroll types for ::SetScrollValuator and the scroll type in the
+ * ::ScrollInfoPtr.
+ */
+enum ScrollType {
+ SCROLL_TYPE_NONE = 0, /**< Not a scrolling valuator */
+ SCROLL_TYPE_VERTICAL = 8,
+ SCROLL_TYPE_HORIZONTAL = 9,
+};
/**
* This struct stores the core event mask for each client except the client
XID resource; /**< id for putting into resource manager */
Mask mask[EMASKSIZE]; /**< Actual XI event mask, deviceid is index */
/** XI2 event masks. One per device, each bit is a mask of (1 << type) */
- unsigned char xi2mask[EMASKSIZE][XI2MASKSIZE];
+ struct _XI2Mask *xi2mask;
} InputClients;
/**
/** The clients that selected for events */
InputClientsPtr inputClients;
/* XI2 event masks. One per device, each bit is a mask of (1 << type) */
- unsigned char xi2mask[EMASKSIZE][XI2MASKSIZE];
+ struct _XI2Mask *xi2mask;
} OtherInputMasks;
/*
Mask *pMask;
} DetailRec;
-typedef enum {
- GRABTYPE_CORE,
- GRABTYPE_XI,
- GRABTYPE_XI2
-} GrabType;
-
union _GrabMask {
Mask core;
Mask xi;
- char xi2mask[EMASKSIZE][XI2MASKSIZE];
+ struct _XI2Mask *xi2mask;
};
/**
unsigned ownerEvents:1;
unsigned keyboardMode:1;
unsigned pointerMode:1;
- GrabType grabtype;
+ enum InputLevel grabtype;
CARD8 type; /* event type */
DetailRec modifiersDetail;
DeviceIntPtr modifierDevice;
Mask eventMask;
Mask deviceMask;
/* XI2 event masks. One per device, each bit is a mask of (1 << type) */
- unsigned char xi2mask[EMASKSIZE][XI2MASKSIZE];
+ struct _XI2Mask *xi2mask;
} GrabRec;
/**
struct _XkbSrvInfo *xkbInfo;
} KeyClassRec, *KeyClassPtr;
+typedef struct _ScrollInfo {
+ enum ScrollType type;
+ double increment;
+ int flags;
+} ScrollInfo, *ScrollInfoPtr;
+
typedef struct _AxisInfo {
int resolution;
int min_resolution;
int max_value;
Atom label;
CARD8 mode;
+ ScrollInfo scroll;
} AxisInfo, *AxisInfoPtr;
typedef struct _ValuatorAccelerationRec {
unsigned short numAxes;
double *axisVal; /* always absolute, but device-coord system */
ValuatorAccelerationRec accelScheme;
+ int h_scroll_axis; /* horiz smooth-scrolling axis */
+ int v_scroll_axis; /* vert smooth-scrolling axis */
} ValuatorClassRec;
+typedef struct _TouchPointInfo {
+ uint32_t client_id; /* touch ID as seen in client events */
+ int sourceid; /* Source device's ID for this touchpoint */
+ Bool active; /* whether or not the touch is active */
+ Bool pending_finish; /* true if the touch is physically inactive
+ * but still owned by a grab */
+ SpriteRec sprite; /* window trace for delivery */
+ ValuatorMask *valuators; /* last recorded axis values */
+ struct _TouchListener {
+ XID listener; /* grabs/event selection IDs receiving
+ * events for this touch */
+ enum TouchListenerType type;
+ enum TouchListenerState state;
+ enum InputLevel level; /* matters only for emulating touches */
+ } *listeners;
+ int num_listeners;
+ int num_grabs; /* number of open grabs on this touch
+ * which have not accepted or rejected */
+ Bool emulate_pointer;
+ DeviceEvent *history; /* History of events on this touchpoint */
+ size_t history_elements; /* Number of current elements in history */
+ size_t history_size; /* Size of history in elements */
+} TouchPointInfoRec;
+
+typedef struct _TouchListener TouchListener;
+
+typedef struct _DDXTouchPointInfo {
+ uint32_t client_id; /* touch ID as seen in client events */
+ Bool active; /* whether or not the touch is active */
+ uint32_t ddx_id; /* touch ID given by the DDX */
+ Bool emulate_pointer;
+
+ ValuatorMask* valuators; /* last recorded axis values */
+} DDXTouchPointInfoRec;
+
+typedef struct _TouchClassRec {
+ int sourceid;
+ TouchPointInfoPtr touches;
+ unsigned short num_touches; /* number of allocated touches */
+ unsigned short max_touches; /* maximum number of touches, may be 0 */
+ CARD8 mode; /* ::XIDirectTouch, XIDependentTouch */
+ /* for pointer-emulation */
+ CARD8 buttonsDown; /* number of buttons down */
+ unsigned short state; /* logical button state */
+ Mask motionMask;
+} TouchClassRec;
+
typedef struct _ButtonClassRec {
int sourceid;
CARD8 numButtons;
typedef struct _ClassesRec {
KeyClassPtr key;
ValuatorClassPtr valuator;
+ TouchClassPtr touch;
ButtonClassPtr button;
FocusClassPtr focus;
ProximityClassPtr proximity;
TimeStamp grabTime;
Bool fromPassiveGrab; /* true if from passive grab */
Bool implicitGrab; /* implicit from ButtonPress */
- GrabRec activeGrab;
+ GrabPtr activeGrab;
GrabPtr grab;
CARD8 activatingKey;
void (*ActivateGrab) (
#define MASTER_POINTER 1
#define MASTER_KEYBOARD 2
#define SLAVE 3
-#define MASTER_ATTACHED 4 /* special type for GetMaster */
+/* special types for GetMaster */
+#define MASTER_ATTACHED 4 /* Master for this device */
+#define KEYBOARD_OR_FLOAT 5 /* Keyboard master for this device or this device if floating */
+#define POINTER_OR_FLOAT 6 /* Pointer master for this device or this device if floating */
typedef struct _DeviceIntRec {
DeviceRec public;
DeviceIntPtr next;
Bool startup; /* true if needs to be turned on at
- server intialization time */
+ server initialization time */
DeviceProc deviceProc; /* proc(DevicePtr, DEVICE_xx). It is
used to initialize, turn on, or
turn off the device */
int id;
KeyClassPtr key;
ValuatorClassPtr valuator;
+ TouchClassPtr touch;
ButtonClassPtr button;
FocusClassPtr focus;
ProximityClassPtr proximity;
DeviceIntPtr lastSlave; /* last slave device used */
/* last valuator values recorded, not posted to client;
- * for slave devices, valuators is in device coordinates
- * for master devices, valuators is in screen coordinates
+ * for slave devices, valuators is in device coordinates, mapped to the
+ * desktop
+ * for master devices, valuators is in desktop coordinates.
* see dix/getevents.c
* remainder supports acceleration
*/
struct {
- int valuators[MAX_VALUATORS];
- float remainder[MAX_VALUATORS];
+ double valuators[MAX_VALUATORS];
int numValuators;
DeviceIntPtr slave;
+ ValuatorMask *scroll;
+ int num_touches; /* size of the touches array */
+ DDXTouchPointInfoPtr touches;
} last;
/* Input device property handling. */
/* for keeping the events for devices grabbed synchronously */
typedef struct _QdEvent *QdEventPtr;
typedef struct _QdEvent {
- QdEventPtr next;
+ struct list next;
DeviceIntPtr device;
ScreenPtr pScreen; /* what screen the pointer was on */
unsigned long months; /* milliseconds is in the event */
* replayed and processed as if they would come from the device directly.
*/
typedef struct _EventSyncInfo {
- QdEventPtr pending, /**< list of queued events */
- *pendtail; /**< last event in list */
+ struct list pending;
+
/** The device to replay events for. Only set in AllowEvents(), in which
* case it is set to the device specified in the request. */
DeviceIntPtr replayDev; /* kludgy rock to put flag for */
return sprite->spriteTrace[sprite->spriteTraceGood - 1];
}
+struct _XI2Mask {
+ unsigned char **masks; /* event mask in masks[deviceid][event type byte] */
+ size_t nmasks; /* number of masks */
+ size_t mask_size; /* size of each mask in bytes */
+};
+
#endif /* INPUTSTRUCT_H */