aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/include/input.h
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/include/input.h')
-rw-r--r--xorg-server/include/input.h225
1 files changed, 116 insertions, 109 deletions
diff --git a/xorg-server/include/input.h b/xorg-server/include/input.h
index 2ab815b80..7ab5e9d65 100644
--- a/xorg-server/include/input.h
+++ b/xorg-server/include/input.h
@@ -53,6 +53,8 @@ SOFTWARE.
#include <X11/Xmd.h>
#include <X11/Xproto.h>
#include "window.h" /* for WindowPtr */
+#include "xkbrules.h"
+#include "events.h"
#define DEVICE_INIT 0
#define DEVICE_ON 1
@@ -74,6 +76,7 @@ SOFTWARE.
/* Maximum number of valuators, divided by six, rounded up, to get number
* of events. */
#define MAX_VALUATOR_EVENTS 6
+#define MAX_BUTTONS 256 /* completely arbitrarily chosen */
#define NO_AXIS_LIMITS -1
@@ -94,34 +97,21 @@ SOFTWARE.
#define RevertToFollowKeyboard 3
#endif
-/* Used for enter/leave and focus in/out semaphores */
-#define SEMAPHORE_FIELD_SET(win, dev, field) \
- (win)->field[(dev)->id/8] |= (1 << ((dev)->id % 8)); \
-
-#define SEMAPHORE_FIELD_UNSET(win, dev, field) \
- (win)->field[(dev)->id/8] &= ~(1 << ((dev)->id % 8));
-
-#define FOCUS_SEMAPHORE_SET(win, dev) \
- SEMAPHORE_FIELD_SET(win, dev, focusinout);
-
-#define FOCUS_SEMAPHORE_UNSET(win, dev) \
- SEMAPHORE_FIELD_UNSET(win, dev, focusinout);
-
-#define FOCUS_SEMAPHORE_ISSET(win, dev) \
- (win)->focusinout[(dev)->id/8] & (1 << ((dev)->id % 8))
-
typedef unsigned long Leds;
typedef struct _OtherClients *OtherClientsPtr;
typedef struct _InputClients *InputClientsPtr;
typedef struct _DeviceIntRec *DeviceIntPtr;
typedef struct _ClassesRec *ClassesPtr;
+typedef union _GrabMask GrabMask;
typedef struct _EventList {
xEvent* event;
int evlen; /* length of allocated memory for event in bytes. This is not
the actual length of the event. The event's actual length is
32 for standard events or 32 +
- ((xGenericEvent*)event)->length * 4 for GenericEvents */
+ ((xGenericEvent*)event)->length * 4 for GenericEvents.
+ For events in the EQ, the length is
+ ((InternalEvent*)event)->u.any.length */
} EventList, *EventListPtr;
/* The DIX stores incoming input events in this list */
@@ -133,9 +123,8 @@ typedef int (*DeviceProc)(
int /*what*/);
typedef void (*ProcessInputProc)(
- xEventPtr /*events*/,
- DeviceIntPtr /*device*/,
- int /*count*/);
+ InternalEvent * /*event*/,
+ DeviceIntPtr /*device*/);
typedef Bool (*DeviceHandleProc)(
DeviceIntPtr /*device*/,
@@ -212,8 +201,8 @@ typedef struct {
unsigned char id;
} LedCtrl;
-extern KeybdCtrl defaultKeyboardControl;
-extern PtrCtrl defaultPointerControl;
+extern _X_EXPORT KeybdCtrl defaultKeyboardControl;
+extern _X_EXPORT PtrCtrl defaultPointerControl;
typedef struct _InputOption {
char *key;
@@ -221,21 +210,34 @@ typedef struct _InputOption {
struct _InputOption *next;
} InputOption;
+/* Key has been run through all input processing and events sent to clients. */
+#define KEY_PROCESSED 1
+/* Key has not been fully processed, no events have been sent. */
+#define KEY_POSTED 2
+
+extern void set_key_down(DeviceIntPtr pDev, int key_code, int type);
+extern void set_key_up(DeviceIntPtr pDev, int key_code, int type);
+extern int key_is_down(DeviceIntPtr pDev, int key_code, int type);
+
extern void InitCoreDevices(void);
+extern void InitXTestDevices(void);
-extern DeviceIntPtr AddInputDevice(
+extern _X_EXPORT DeviceIntPtr AddInputDevice(
ClientPtr /*client*/,
DeviceProc /*deviceProc*/,
Bool /*autoStart*/);
-extern Bool EnableDevice(
- DeviceIntPtr /*device*/);
+extern _X_EXPORT Bool EnableDevice(
+ DeviceIntPtr /*device*/,
+ BOOL /* sendevent */);
-extern Bool ActivateDevice(
- DeviceIntPtr /*device*/);
+extern _X_EXPORT Bool ActivateDevice(
+ DeviceIntPtr /*device*/,
+ BOOL /* sendevent */);
-extern Bool DisableDevice(
- DeviceIntPtr /*device*/);
+extern _X_EXPORT Bool DisableDevice(
+ DeviceIntPtr /*device*/,
+ BOOL /* sendevent */);
extern int InitAndStartDevices(void);
@@ -243,10 +245,11 @@ extern void CloseDownDevices(void);
extern void UndisplayDevices(void);
-extern int RemoveDevice(
- DeviceIntPtr /*dev*/);
+extern _X_EXPORT int RemoveDevice(
+ DeviceIntPtr /*dev*/,
+ BOOL /* sendevent */);
-extern int NumMotionEvents(void);
+extern _X_EXPORT int NumMotionEvents(void);
extern void RegisterPointerDevice(
DeviceIntPtr /*device*/);
@@ -254,44 +257,41 @@ extern void RegisterPointerDevice(
extern void RegisterKeyboardDevice(
DeviceIntPtr /*device*/);
-extern int dixLookupDevice(
+extern _X_EXPORT int dixLookupDevice(
DeviceIntPtr * /* dev */,
int /* id */,
ClientPtr /* client */,
Mask /* access_mode */);
-extern void QueryMinMaxKeyCodes(
+extern _X_EXPORT void QueryMinMaxKeyCodes(
KeyCode* /*minCode*/,
KeyCode* /*maxCode*/);
-extern Bool SetKeySymsMap(
+extern _X_EXPORT Bool SetKeySymsMap(
KeySymsPtr /*dst*/,
KeySymsPtr /*src*/);
-extern Bool InitKeyClassDeviceStruct(
- DeviceIntPtr /*device*/,
- KeySymsPtr /*pKeySyms*/,
- CARD8 /*pModifiers*/[]);
-
-extern Bool InitButtonClassDeviceStruct(
+extern _X_EXPORT Bool InitButtonClassDeviceStruct(
DeviceIntPtr /*device*/,
int /*numButtons*/,
+ Atom* /* labels */,
CARD8* /*map*/);
-extern Bool InitValuatorClassDeviceStruct(
+extern _X_EXPORT Bool InitValuatorClassDeviceStruct(
DeviceIntPtr /*device*/,
int /*numAxes*/,
+ Atom* /* labels */,
int /*numMotionEvents*/,
int /*mode*/);
-extern Bool InitPointerAccelerationScheme(
+extern _X_EXPORT Bool InitPointerAccelerationScheme(
DeviceIntPtr /*dev*/,
int /*scheme*/);
-extern Bool InitAbsoluteClassDeviceStruct(
+extern _X_EXPORT Bool InitAbsoluteClassDeviceStruct(
DeviceIntPtr /*device*/);
-extern Bool InitFocusClassDeviceStruct(
+extern _X_EXPORT Bool InitFocusClassDeviceStruct(
DeviceIntPtr /*device*/);
typedef void (*BellProcPtr)(
@@ -304,16 +304,11 @@ typedef void (*KbdCtrlProcPtr)(
DeviceIntPtr /*device*/,
KeybdCtrl * /*ctrl*/);
-extern Bool InitKbdFeedbackClassDeviceStruct(
- DeviceIntPtr /*device*/,
- BellProcPtr /*bellProc*/,
- KbdCtrlProcPtr /*controlProc*/);
-
typedef void (*PtrCtrlProcPtr)(
DeviceIntPtr /*device*/,
PtrCtrl * /*ctrl*/);
-extern Bool InitPtrFeedbackClassDeviceStruct(
+extern _X_EXPORT Bool InitPtrFeedbackClassDeviceStruct(
DeviceIntPtr /*device*/,
PtrCtrlProcPtr /*controlProc*/);
@@ -321,7 +316,7 @@ typedef void (*StringCtrlProcPtr)(
DeviceIntPtr /*device*/,
StringCtrl * /*ctrl*/);
-extern Bool InitStringFeedbackClassDeviceStruct(
+extern _X_EXPORT Bool InitStringFeedbackClassDeviceStruct(
DeviceIntPtr /*device*/,
StringCtrlProcPtr /*controlProc*/,
int /*max_symbols*/,
@@ -332,7 +327,7 @@ typedef void (*BellCtrlProcPtr)(
DeviceIntPtr /*device*/,
BellCtrl * /*ctrl*/);
-extern Bool InitBellFeedbackClassDeviceStruct(
+extern _X_EXPORT Bool InitBellFeedbackClassDeviceStruct(
DeviceIntPtr /*device*/,
BellProcPtr /*bellProc*/,
BellCtrlProcPtr /*controlProc*/);
@@ -341,7 +336,7 @@ typedef void (*LedCtrlProcPtr)(
DeviceIntPtr /*device*/,
LedCtrl * /*ctrl*/);
-extern Bool InitLedFeedbackClassDeviceStruct(
+extern _X_EXPORT Bool InitLedFeedbackClassDeviceStruct(
DeviceIntPtr /*device*/,
LedCtrlProcPtr /*controlProc*/);
@@ -350,30 +345,30 @@ typedef void (*IntegerCtrlProcPtr)(
IntegerCtrl * /*ctrl*/);
-extern Bool InitIntegerFeedbackClassDeviceStruct(
+extern _X_EXPORT Bool InitIntegerFeedbackClassDeviceStruct(
DeviceIntPtr /*device*/,
IntegerCtrlProcPtr /*controlProc*/);
-extern Bool InitPointerDeviceStruct(
+extern _X_EXPORT Bool InitPointerDeviceStruct(
DevicePtr /*device*/,
CARD8* /*map*/,
int /*numButtons*/,
+ Atom* /* btn_labels */,
PtrCtrlProcPtr /*controlProc*/,
int /*numMotionEvents*/,
- int /*numAxes*/);
+ int /*numAxes*/,
+ Atom* /* axes_labels */);
-extern Bool InitKeyboardDeviceStruct(
- DevicePtr /*device*/,
- KeySymsPtr /*pKeySyms*/,
- CARD8 /*pModifiers*/[],
+extern _X_EXPORT Bool InitKeyboardDeviceStruct(
+ DeviceIntPtr /*device*/,
+ XkbRMLVOSet * /*rmlvo*/,
BellProcPtr /*bellProc*/,
KbdCtrlProcPtr /*controlProc*/);
-extern void SendMappingNotify(
+extern int ApplyPointerMapping(
DeviceIntPtr /* pDev */,
- unsigned int /*request*/,
- unsigned int /*firstKeyCode*/,
- unsigned int /*count*/,
+ CARD8 * /* map */,
+ int /* len */,
ClientPtr /* client */);
extern Bool BadDeviceMap(
@@ -383,13 +378,6 @@ extern Bool BadDeviceMap(
unsigned /*high*/,
XID* /*errval*/);
-extern Bool AllModifierKeysAreUp(
- DeviceIntPtr /*device*/,
- CARD8* /*map1*/,
- int /*per1*/,
- CARD8* /*map2*/,
- int /*per2*/);
-
extern void NoteLedState(
DeviceIntPtr /*keybd*/,
int /*led*/,
@@ -400,49 +388,36 @@ extern void MaybeStopHint(
ClientPtr /*client*/);
extern void ProcessPointerEvent(
- xEventPtr /*xE*/,
- DeviceIntPtr /*mouse*/,
- int /*count*/);
+ InternalEvent* /* ev */,
+ DeviceIntPtr /*mouse*/);
extern void ProcessKeyboardEvent(
- xEventPtr /*xE*/,
- DeviceIntPtr /*keybd*/,
- int /*count*/);
-
-#ifdef XKB
-extern void CoreProcessPointerEvent(
- xEventPtr /*xE*/,
- DeviceIntPtr /*mouse*/,
- int /*count*/) _X_DEPRECATED;
-
-extern _X_DEPRECATED void CoreProcessKeyboardEvent(
- xEventPtr /*xE*/,
- DeviceIntPtr /*keybd*/,
- int /*count*/) _X_DEPRECATED;
-#endif
+ InternalEvent* /*ev*/,
+ DeviceIntPtr /*keybd*/);
extern Bool LegalModifier(
unsigned int /*key*/,
DeviceIntPtr /*pDev*/);
-extern void ProcessInputEvents(void);
+extern _X_EXPORT void ProcessInputEvents(void);
-extern void InitInput(
+extern _X_EXPORT void InitInput(
int /*argc*/,
char ** /*argv*/);
-extern int GetMaximumEventsNum(void);
+extern _X_EXPORT int GetMaximumEventsNum(void);
-extern int GetEventList(EventListPtr* list);
-extern EventListPtr InitEventList(int num_events);
-extern void SetMinimumEventSize(EventListPtr list,
+extern _X_EXPORT int GetEventList(EventListPtr* list);
+extern _X_EXPORT EventListPtr InitEventList(int num_events);
+extern _X_EXPORT void SetMinimumEventSize(EventListPtr list,
int num_events,
int min_size);
-extern void FreeEventList(EventListPtr list, int num_events);
+extern _X_EXPORT void FreeEventList(EventListPtr list, int num_events);
-extern void CreateClassesChangedEvent(EventListPtr event,
+extern void CreateClassesChangedEvent(EventListPtr event,
DeviceIntPtr master,
- DeviceIntPtr slave);
+ DeviceIntPtr slave,
+ int type);
extern int GetPointerEvents(
EventListPtr events,
DeviceIntPtr pDev,
@@ -483,13 +458,13 @@ extern void PostSyntheticMotion(
int screen,
unsigned long time);
-extern int GetMotionHistorySize(
+extern _X_EXPORT int GetMotionHistorySize(
void);
-extern void AllocateMotionHistory(
+extern _X_EXPORT void AllocateMotionHistory(
DeviceIntPtr pDev);
-extern int GetMotionHistory(
+extern _X_EXPORT int GetMotionHistory(
DeviceIntPtr pDev,
xTimecoord **buff,
unsigned long start,
@@ -501,25 +476,57 @@ extern int AttachDevice(ClientPtr client,
DeviceIntPtr slave,
DeviceIntPtr master);
-extern DeviceIntPtr GetPairedDevice(DeviceIntPtr kbd);
+extern _X_EXPORT DeviceIntPtr GetPairedDevice(DeviceIntPtr kbd);
+extern DeviceIntPtr GetMaster(DeviceIntPtr dev, int type);
-extern int AllocMasterDevice(ClientPtr client,
+extern int AllocDevicePair(ClientPtr client,
char* name,
DeviceIntPtr* ptr,
- DeviceIntPtr* keybd);
+ DeviceIntPtr* keybd,
+ DeviceProc ptr_proc,
+ DeviceProc keybd_proc,
+ Bool master);
extern void DeepCopyDeviceClasses(DeviceIntPtr from,
- DeviceIntPtr to);
+ DeviceIntPtr to,
+ DeviceChangedEvent *dce);
+
+/* Helper functions. */
+extern int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
+ KeyCode **modkeymap, int *max_keys_per_mod);
+extern int change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *map,
+ int max_keys_per_mod);
+extern int AllocXTestDevice(ClientPtr client,
+ char* name,
+ DeviceIntPtr* ptr,
+ DeviceIntPtr* keybd,
+ DeviceIntPtr master_ptr,
+ DeviceIntPtr master_keybd);
+extern BOOL IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master);
+extern DeviceIntPtr GetXTestDevice(DeviceIntPtr master);
+
+/* misc event helpers */
+extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event);
+extern Mask GetWindowXI2Mask(DeviceIntPtr dev, WindowPtr win, xEvent* ev);
+void FixUpEventFromWindow(DeviceIntPtr pDev,
+ xEvent *xE,
+ WindowPtr pWin,
+ Window child,
+ Bool calcChild);
/* Implemented by the DDX. */
-extern int NewInputDeviceRequest(
+extern _X_EXPORT int NewInputDeviceRequest(
InputOption *options,
DeviceIntPtr *dev);
-extern void DeleteInputDeviceRequest(
+extern _X_EXPORT void DeleteInputDeviceRequest(
DeviceIntPtr dev);
-extern void DDXRingBell(
+extern _X_EXPORT void DDXRingBell(
int volume,
int pitch,
int duration);
+/* Set to TRUE by default - os/utils.c sets it to FALSE on user request,
+ xfixes/cursor.c uses it to determine if the cursor is enabled */
+extern Bool EnableCursor;
+
#endif /* INPUT_H */