diff options
Diffstat (limited to 'xorg-server/include/input.h')
-rw-r--r-- | xorg-server/include/input.h | 115 |
1 files changed, 95 insertions, 20 deletions
diff --git a/xorg-server/include/input.h b/xorg-server/include/input.h index ca67cfac5..2ab815b80 100644 --- a/xorg-server/include/input.h +++ b/xorg-server/include/input.h @@ -62,6 +62,20 @@ SOFTWARE. #define POINTER_RELATIVE (1 << 1) #define POINTER_ABSOLUTE (1 << 2) #define POINTER_ACCELERATE (1 << 3) +#define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */ + +/*int constants for pointer acceleration schemes*/ +#define PtrAccelNoOp 0 +#define PtrAccelPredictable 1 +#define PtrAccelLightweight 2 +#define PtrAccelDefault PtrAccelPredictable + +#define MAX_VALUATORS 36 +/* Maximum number of valuators, divided by six, rounded up, to get number + * of events. */ +#define MAX_VALUATOR_EVENTS 6 + +#define NO_AXIS_LIMITS -1 #define MAP_LENGTH 256 #define DOWN_LENGTH 32 /* 256/8 => number of bytes to hold 256 bits */ @@ -80,10 +94,39 @@ 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 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 */ +} EventList, *EventListPtr; + +/* The DIX stores incoming input events in this list */ +extern EventListPtr InputEventList; +extern int InputEventListLen; typedef int (*DeviceProc)( DeviceIntPtr /*device*/, @@ -105,6 +148,17 @@ typedef void (*DeviceUnwrapProc)( void* /*data*/ ); +/* pointer acceleration handling */ +typedef void (*PointerAccelSchemeProc)( + DeviceIntPtr /*pDev*/, + int /*first_valuator*/, + int /*num_valuators*/, + int* /*valuators*/, + int /*evtime*/); + +typedef void (*DeviceCallbackProc)( + DeviceIntPtr /*pDev*/); + typedef struct _DeviceRec { pointer devicePrivate; ProcessInputProc processInputProc; /* current */ @@ -170,6 +224,7 @@ typedef struct _InputOption { extern void InitCoreDevices(void); extern DeviceIntPtr AddInputDevice( + ClientPtr /*client*/, DeviceProc /*deviceProc*/, Bool /*autoStart*/); @@ -186,6 +241,8 @@ extern int InitAndStartDevices(void); extern void CloseDownDevices(void); +extern void UndisplayDevices(void); + extern int RemoveDevice( DeviceIntPtr /*dev*/); @@ -221,20 +278,16 @@ extern Bool InitButtonClassDeviceStruct( int /*numButtons*/, CARD8* /*map*/); -typedef int (*ValuatorMotionProcPtr)( - DeviceIntPtr /*pdevice*/, - xTimecoord * /*coords*/, - unsigned long /*start*/, - unsigned long /*stop*/, - ScreenPtr /*pScreen*/); - extern Bool InitValuatorClassDeviceStruct( DeviceIntPtr /*device*/, int /*numAxes*/, - ValuatorMotionProcPtr /* motionProc */, int /*numMotionEvents*/, int /*mode*/); +extern Bool InitPointerAccelerationScheme( + DeviceIntPtr /*dev*/, + int /*scheme*/); + extern Bool InitAbsoluteClassDeviceStruct( DeviceIntPtr /*device*/); @@ -305,7 +358,6 @@ extern Bool InitPointerDeviceStruct( DevicePtr /*device*/, CARD8* /*map*/, int /*numButtons*/, - ValuatorMotionProcPtr /*motionProc*/, PtrCtrlProcPtr /*controlProc*/, int /*numMotionEvents*/, int /*numAxes*/); @@ -318,6 +370,7 @@ extern Bool InitKeyboardDeviceStruct( KbdCtrlProcPtr /*controlProc*/); extern void SendMappingNotify( + DeviceIntPtr /* pDev */, unsigned int /*request*/, unsigned int /*firstKeyCode*/, unsigned int /*count*/, @@ -360,12 +413,12 @@ extern void ProcessKeyboardEvent( extern void CoreProcessPointerEvent( xEventPtr /*xE*/, DeviceIntPtr /*mouse*/, - int /*count*/); + int /*count*/) _X_DEPRECATED; -extern void CoreProcessKeyboardEvent( +extern _X_DEPRECATED void CoreProcessKeyboardEvent( xEventPtr /*xE*/, DeviceIntPtr /*keybd*/, - int /*count*/); + int /*count*/) _X_DEPRECATED; #endif extern Bool LegalModifier( @@ -380,8 +433,18 @@ extern void InitInput( extern int GetMaximumEventsNum(void); +extern int GetEventList(EventListPtr* list); +extern EventListPtr InitEventList(int num_events); +extern void SetMinimumEventSize(EventListPtr list, + int num_events, + int min_size); +extern void FreeEventList(EventListPtr list, int num_events); + +extern void CreateClassesChangedEvent(EventListPtr event, + DeviceIntPtr master, + DeviceIntPtr slave); extern int GetPointerEvents( - xEvent *events, + EventListPtr events, DeviceIntPtr pDev, int type, int buttons, @@ -391,13 +454,13 @@ extern int GetPointerEvents( int *valuators); extern int GetKeyboardEvents( - xEvent *events, + EventListPtr events, DeviceIntPtr pDev, int type, int key_code); extern int GetKeyboardValuatorEvents( - xEvent *events, + EventListPtr events, DeviceIntPtr pDev, int type, int key_code, @@ -406,7 +469,7 @@ extern int GetKeyboardValuatorEvents( int *valuators); extern int GetProximityEvents( - xEvent *events, + EventListPtr events, DeviceIntPtr pDev, int type, int first_valuator, @@ -414,6 +477,7 @@ extern int GetProximityEvents( int *valuators); extern void PostSyntheticMotion( + DeviceIntPtr pDev, int x, int y, int screen, @@ -427,13 +491,24 @@ extern void AllocateMotionHistory( extern int GetMotionHistory( DeviceIntPtr pDev, - xTimecoord *buff, + xTimecoord **buff, unsigned long start, unsigned long stop, - ScreenPtr pScreen); + ScreenPtr pScreen, + BOOL core); + +extern int AttachDevice(ClientPtr client, + DeviceIntPtr slave, + DeviceIntPtr master); + +extern DeviceIntPtr GetPairedDevice(DeviceIntPtr kbd); -extern void SwitchCoreKeyboard(DeviceIntPtr pDev); -extern void SwitchCorePointer(DeviceIntPtr pDev); +extern int AllocMasterDevice(ClientPtr client, + char* name, + DeviceIntPtr* ptr, + DeviceIntPtr* keybd); +extern void DeepCopyDeviceClasses(DeviceIntPtr from, + DeviceIntPtr to); /* Implemented by the DDX. */ extern int NewInputDeviceRequest( |