diff options
author | Joel Bosveld <joel.bosveld@gmail.com> | 2009-09-08 23:06:00 +0800 |
---|---|---|
committer | Joel Bosveld <joel.bosveld@gmail.com> | 2009-09-08 23:55:13 +0800 |
commit | 1ba17340a98a34b40f78442963aa4132e6cfae5c (patch) | |
tree | d11d814844e4ad037d146133250b73f28cdb3e31 /include | |
parent | 5e38708c3466129c3e5af40a915c044bb26e083f (diff) | |
parent | 1bdc9ec617d357b076c9e69296018bc212d91c7d (diff) |
Conflicts:
test/Makefile.am
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.am | 6 | ||||
-rw-r--r-- | include/dix-config.h.in | 6 | ||||
-rw-r--r-- | include/dix.h | 11 | ||||
-rw-r--r-- | include/dixaccess.h | 1 | ||||
-rw-r--r-- | include/events.h | 205 | ||||
-rw-r--r-- | include/eventstr.h | 232 | ||||
-rw-r--r-- | include/exevents.h | 246 | ||||
-rw-r--r-- | include/extinit.h | 2 | ||||
-rw-r--r-- | include/input.h | 16 | ||||
-rw-r--r-- | include/inputstr.h | 4 | ||||
-rw-r--r-- | include/misc.h | 30 | ||||
-rw-r--r-- | include/ptrveloc.h | 44 | ||||
-rw-r--r-- | include/resource.h | 8 | ||||
-rw-r--r-- | include/xkbsrv.h | 10 | ||||
-rw-r--r-- | include/xkbstr.h | 53 | ||||
-rw-r--r-- | include/xorg-config.h.in | 12 | ||||
-rw-r--r-- | include/xorg-server.h.in | 6 | ||||
-rw-r--r-- | include/xserver-properties.h | 2 |
18 files changed, 535 insertions, 359 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index fda4b70ac..f8eef53e1 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -17,6 +17,7 @@ sdk_HEADERS = \ dixfontstr.h \ dixgrabs.h \ dixstruct.h \ + events.h \ exevents.h \ extension.h \ extinit.h \ @@ -57,10 +58,11 @@ sdk_HEADERS = \ xkbrules.h \ xserver-properties.h -nodist_sdk_HEADERS = xorg-server.h events.h eventconvert.h +nodist_sdk_HEADERS = xorg-server.h endif AM_CFLAGS = $(DIX_CFLAGS) EXTRA_DIST = \ - dix-config-apple-verbatim.h + dix-config-apple-verbatim.h \ + eventconvert.h eventstr.h diff --git a/include/dix-config.h.in b/include/dix-config.h.in index 26ac22388..798d9e73c 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -124,6 +124,12 @@ /* Have Quartz */ #undef XQUARTZ +/* Support application updating through sparkle. */ +#undef XQUARTZ_SPARKLE + +/* Prefix to use for launchd identifiers */ +#undef LAUNCHD_ID_PREFIX + /* Build a standalone xpbproxy */ #undef STANDALONE_XPBPROXY diff --git a/include/dix.h b/include/dix.h index c4a639467..49dfe3774 100644 --- a/include/dix.h +++ b/include/dix.h @@ -229,6 +229,12 @@ extern _X_EXPORT void WakeupHandler( int /*result*/, pointer /*pReadmask*/); +void +EnableLimitedSchedulingLatency(void); + +void +DisableLimitedSchedulingLatency(void); + typedef void (* WakeupHandlerProcPtr)( pointer /* blockData */, int /* result */, @@ -485,7 +491,7 @@ extern _X_EXPORT int TryClientEvents( extern _X_EXPORT void WindowsRestructured(void); -extern Bool SetClientPointer( +extern int SetClientPointer( ClientPtr /* client */, DeviceIntPtr /* device */); @@ -586,6 +592,9 @@ extern Bool IsKeyboardDevice(DeviceIntPtr dev); extern Bool IsPointerEvent(InternalEvent *event); extern Bool IsMaster(DeviceIntPtr dev); +extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what); +extern _X_HIDDEN int CoreKeyboardProc(DeviceIntPtr dev, int what); + /* * These are deprecated compatibility functions and will be removed soon! diff --git a/include/dixaccess.h b/include/dixaccess.h index 3c62ee354..7180acd71 100644 --- a/include/dixaccess.h +++ b/include/dixaccess.h @@ -49,5 +49,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define DixManageAccess (1<<25) /* manage object */ #define DixDebugAccess (1<<26) /* debug object */ #define DixBellAccess (1<<27) /* audible sound */ +#define DixPostAccess (1<<28) /* post or follow-up call */ #endif /* DIX_ACCESS_H */ diff --git a/include/events.h b/include/events.h index f6405c5c2..9f6a94c5b 100644 --- a/include/events.h +++ b/include/events.h @@ -24,207 +24,12 @@ #ifndef EVENTS_H #define EVENTS_H - -/** - * @file events.h - * This file describes the event structures used internally by the X - * server during event generation and event processing. - * - * When are internal events used? - * Events from input devices are stored as internal events in the EQ and - * processed as internal events until late in the processing cycle. Only then - * do they switch to their respective wire events. - */ - -/** - * Event types. Used exclusively internal to the server, not visible on the - * protocol. - * - * Note: Keep KeyPress to Motion aligned with the core events. - */ -enum { - ET_KeyPress = 2, - ET_KeyRelease, - ET_ButtonPress, - ET_ButtonRelease, - ET_Motion, - ET_Enter, - ET_Leave, - ET_FocusIn, - ET_FocusOut, - ET_ProximityIn, - ET_ProximityOut, - ET_DeviceChanged, - ET_Hierarchy, -#if XFreeXDGA - ET_DGAEvent, -#endif - ET_Raw, - ET_Internal = 0xFF /* First byte */ -} EventType; - -#define CHECKEVENT(ev) if (ev && ((InternalEvent*)(ev))->any.header != 0xFF) \ - FatalError("Wrong event type %d.\n", \ - ((InternalEvent*)(ev))->any.header); - -/** - * Used for ALL input device events internal in the server until - * copied into the matching protocol event. - * - * Note: We only use the device id because the DeviceIntPtr may become invalid while - * the event is in the EQ. - */ -typedef struct -{ - unsigned char header; /**< Always ET_Internal */ - int type; /**< One of EventType */ - int length; /**< Length in bytes */ - Time time; /**< Time in ms */ - int deviceid; /**< Device to post this event for */ - int sourceid; /**< The physical source device */ - union { - uint32_t button; /**< Button number */ - uint32_t key; /**< Key code */ - } detail; - uint16_t root_x; /**< Pos relative to root window in integral data */ - float root_x_frac; /**< Pos relative to root window in frac part */ - uint16_t root_y; /**< Pos relative to root window in integral part */ - float root_y_frac; /**< Pos relative to root window in frac part */ - uint8_t buttons[(MAX_BUTTONS + 7)/8]; /**< Button mask */ - struct { - uint8_t mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */ - uint8_t mode[(MAX_VALUATORS + 7)/8]; /**< Valuator mode (Abs or Rel)*/ - uint32_t data[MAX_VALUATORS]; /**< Valuator data */ - int32_t data_frac[MAX_VALUATORS]; /**< Fractional part for data */ - } valuators; - struct { - uint32_t base; /**< XKB base modifiers */ - uint32_t latched; /**< XKB latched modifiers */ - uint32_t locked; /**< XKB locked modifiers */ - } mods; - struct { - uint8_t base; /**< XKB base group */ - uint8_t latched; /**< XKB latched group */ - uint8_t locked; /**< XKB locked group */ - } group; - Window root; /**< Root window of the event */ - int corestate; /**< Core key/button state BEFORE the event */ -} DeviceEvent; - - -/* Flags used in DeviceChangedEvent to signal if new/old slave is present. */ -#define DEVCHANGE_HAS_OLD_SLAVE 0x1 -#define DEVCHANGE_HAS_NEW_SLAVE 0x2 -/* Flags used in DeviceChangedEvent to signal whether the event was a - * pointer event or a keyboard event */ -#define DEVCHANGE_POINTER_EVENT 0x4 -#define DEVCHANGE_KEYBOARD_EVENT 0x8 -/* device capabilities changed */ -#define DEVCHANGE_DEVICE_CHANGE 0x10 - -/** - * Sent whenever a device's capabilities have changed. - */ -typedef struct -{ - unsigned char header; /**< Always ET_Internal */ - int type; /**< ET_DeviceChanged */ - int length; /**< Length in bytes */ - Time time; /**< Time in ms */ - int deviceid; /**< Device whose capabilities have changed */ - int flags; /**< Mask of ::HAS_OLD_SLAVE, ::HAS_NEW_SLAVE, - ::POINTER_EVENT, ::KEYBOARD_EVENT */ - /** If flags & HAS_OLD_SLAVE is set, old_slaveid specifies SD previously - * attached to this device. */ - int old_slaveid; - /** If flags & HAS_OLD_SLAVE is set, old_slaveid specifies device now - * attached to this device. */ - int new_slaveid; - - struct { - int num_buttons; /**< Number of buttons */ - Atom names[MAX_BUTTONS];/**< Button names */ - } buttons; - - int num_valuators; /**< Number of axes */ - struct { - uint32_t min; /**< Minimum value */ - uint32_t max; /**< Maximum value */ - /* FIXME: frac parts of min/max */ - uint32_t resolution; /**< Resolution counts/m */ - uint8_t mode; /**< Relative or Absolute */ - Atom name; /**< Axis name */ - } valuators[MAX_VALUATORS]; - - struct { - int min_keycode; - int max_keycode; - } keys; -} DeviceChangedEvent; - -#if XFreeXDGA -/** - * DGAEvent, used by DGA to intercept and emulate input events. - */ -typedef struct -{ - unsigned char header; /**< Always ET_Internal */ - int type; /**< ET_DGAEvent */ - int length; /**< Length in bytes */ - Time time; /**< Time in ms */ - int subtype; /**< KeyPress, KeyRelease, ButtonPress, - ButtonRelease, MotionNotify */ - int detail; /**< Relative x coordinate */ - int dx; /**< Relative x coordinate */ - int dy; /**< Relative y coordinate */ - int screen; /**< Screen number this event applies to */ - uint16_t state; /**< Core modifier/button state */ -} DGAEvent; -#endif - -/** - * Raw event, contains the data as posted by the device. - */ -typedef struct -{ - unsigned char header; /**< Always ET_Internal */ - int type; /**< ET_Raw */ - int length; /**< Length in bytes */ - Time time; /**< Time in ms */ - int subtype; /**< KeyPress, KeyRelease, ButtonPress, - ButtonRelease, MotionNotify */ - int deviceid; /**< Device to post this event for */ - int sourceid; /**< The physical source device */ - union { - uint32_t button; /**< Button number */ - uint32_t key; /**< Key code */ - } detail; - struct { - uint8_t mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */ - int32_t data[MAX_VALUATORS]; /**< Valuator data */ - int32_t data_frac[MAX_VALUATORS]; /**< Fractional part for data */ - int32_t data_raw[MAX_VALUATORS]; /**< Valuator data as posted */ - int32_t data_raw_frac[MAX_VALUATORS];/**< Fractional part for data_raw */ - } valuators; -} RawDeviceEvent; - -/** - * Event type used inside the X server for input event - * processing. - */ -typedef union { - struct { - unsigned char header; /**< Always ET_Internal */ - int type; /**< One of ET_* */ - int length; /**< Length in bytes */ - Time time; /**< Time in ms. */ - } any; - DeviceEvent device; - DeviceChangedEvent changed; +typedef struct _DeviceEvent DeviceEvent; +typedef struct _DeviceChangedEvent DeviceChangedEvent; #if XFreeXDGA - DGAEvent dga; +typedef struct _DGAEvent DGAEvent; #endif - RawDeviceEvent raw; -} InternalEvent; +typedef struct _RawDeviceEvent RawDeviceEvent; +typedef union _InternalEvent InternalEvent; #endif diff --git a/include/eventstr.h b/include/eventstr.h new file mode 100644 index 000000000..f082db34a --- /dev/null +++ b/include/eventstr.h @@ -0,0 +1,232 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef EVENTSTR_H +#define EVENTSTR_H + +#include <events.h> +/** + * @file events.h + * This file describes the event structures used internally by the X + * server during event generation and event processing. + * + * When are internal events used? + * Events from input devices are stored as internal events in the EQ and + * processed as internal events until late in the processing cycle. Only then + * do they switch to their respective wire events. + */ + +/** + * Event types. Used exclusively internal to the server, not visible on the + * protocol. + * + * Note: Keep KeyPress to Motion aligned with the core events. + * Keep ET_Raw* in the same order as KeyPress - Motion + */ +enum EventType { + ET_KeyPress = 2, + ET_KeyRelease, + ET_ButtonPress, + ET_ButtonRelease, + ET_Motion, + ET_Enter, + ET_Leave, + ET_FocusIn, + ET_FocusOut, + ET_ProximityIn, + ET_ProximityOut, + ET_DeviceChanged, + ET_Hierarchy, +#if XFreeXDGA + ET_DGAEvent, +#endif + ET_RawKeyPress, + ET_RawKeyRelease, + ET_RawButtonPress, + ET_RawButtonRelease, + ET_RawMotion, + ET_Internal = 0xFF /* First byte */ +}; + +#define CHECKEVENT(ev) if (ev && ((InternalEvent*)(ev))->any.header != 0xFF) \ + FatalError("Wrong event type %d.\n", \ + ((InternalEvent*)(ev))->any.header); + +/** + * Used for ALL input device events internal in the server until + * copied into the matching protocol event. + * + * Note: We only use the device id because the DeviceIntPtr may become invalid while + * the event is in the EQ. + */ +struct _DeviceEvent +{ + unsigned char header; /**< Always ET_Internal */ + enum EventType type; /**< One of EventType */ + int length; /**< Length in bytes */ + Time time; /**< Time in ms */ + int deviceid; /**< Device to post this event for */ + int sourceid; /**< The physical source device */ + union { + uint32_t button; /**< Button number */ + uint32_t key; /**< Key code */ + } detail; + uint16_t root_x; /**< Pos relative to root window in integral data */ + float root_x_frac; /**< Pos relative to root window in frac part */ + uint16_t root_y; /**< Pos relative to root window in integral part */ + float root_y_frac; /**< Pos relative to root window in frac part */ + uint8_t buttons[(MAX_BUTTONS + 7)/8]; /**< Button mask */ + struct { + uint8_t mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */ + uint8_t mode[(MAX_VALUATORS + 7)/8]; /**< Valuator mode (Abs or Rel)*/ + uint32_t data[MAX_VALUATORS]; /**< Valuator data */ + int32_t data_frac[MAX_VALUATORS]; /**< Fractional part for data */ + } valuators; + struct { + uint32_t base; /**< XKB base modifiers */ + uint32_t latched; /**< XKB latched modifiers */ + uint32_t locked; /**< XKB locked modifiers */ + uint32_t effective;/**< XKB effective modifiers */ + } mods; + struct { + uint8_t base; /**< XKB base group */ + uint8_t latched; /**< XKB latched group */ + uint8_t locked; /**< XKB locked group */ + uint8_t effective;/**< XKB effective group */ + } group; + Window root; /**< Root window of the event */ + int corestate; /**< Core key/button state BEFORE the event */ + int key_repeat; /**< Internally-generated key repeat event */ +}; + + +/* Flags used in DeviceChangedEvent to signal if the slave has changed */ +#define DEVCHANGE_SLAVE_SWITCH 0x2 +/* Flags used in DeviceChangedEvent to signal whether the event was a + * pointer event or a keyboard event */ +#define DEVCHANGE_POINTER_EVENT 0x4 +#define DEVCHANGE_KEYBOARD_EVENT 0x8 +/* device capabilities changed */ +#define DEVCHANGE_DEVICE_CHANGE 0x10 + +/** + * Sent whenever a device's capabilities have changed. + */ +struct _DeviceChangedEvent +{ + unsigned char header; /**< Always ET_Internal */ + enum EventType type; /**< ET_DeviceChanged */ + int length; /**< Length in bytes */ + Time time; /**< Time in ms */ + int deviceid; /**< Device whose capabilities have changed */ + int flags; /**< Mask of ::HAS_NEW_SLAVE, + ::POINTER_EVENT, ::KEYBOARD_EVENT */ + int masterid; /**< MD when event was generated */ + int sourceid; /**< The device that caused the change */ + + struct { + int num_buttons; /**< Number of buttons */ + Atom names[MAX_BUTTONS];/**< Button names */ + } buttons; + + int num_valuators; /**< Number of axes */ + struct { + uint32_t min; /**< Minimum value */ + uint32_t max; /**< Maximum value */ + /* FIXME: frac parts of min/max */ + uint32_t resolution; /**< Resolution counts/m */ + uint8_t mode; /**< Relative or Absolute */ + Atom name; /**< Axis name */ + } valuators[MAX_VALUATORS]; + + struct { + int min_keycode; + int max_keycode; + } keys; +}; + +#if XFreeXDGA +/** + * DGAEvent, used by DGA to intercept and emulate input events. + */ +struct _DGAEvent +{ + unsigned char header; /**< Always ET_Internal */ + enum EventType type; /**< ET_DGAEvent */ + int length; /**< Length in bytes */ + Time time; /**< Time in ms */ + int subtype; /**< KeyPress, KeyRelease, ButtonPress, + ButtonRelease, MotionNotify */ + int detail; /**< Relative x coordinate */ + int dx; /**< Relative x coordinate */ + int dy; /**< Relative y coordinate */ + int screen; /**< Screen number this event applies to */ + uint16_t state; /**< Core modifier/button state */ +}; +#endif + +/** + * Raw event, contains the data as posted by the device. + */ +struct _RawDeviceEvent +{ + unsigned char header; /**< Always ET_Internal */ + enum EventType type; /**< ET_Raw */ + int length; /**< Length in bytes */ + Time time; /**< Time in ms */ + int deviceid; /**< Device to post this event for */ + int sourceid; /**< The physical source device */ + union { + uint32_t button; /**< Button number */ + uint32_t key; /**< Key code */ + } detail; + struct { + uint8_t mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */ + int32_t data[MAX_VALUATORS]; /**< Valuator data */ + int32_t data_frac[MAX_VALUATORS]; /**< Fractional part for data */ + int32_t data_raw[MAX_VALUATORS]; /**< Valuator data as posted */ + int32_t data_raw_frac[MAX_VALUATORS];/**< Fractional part for data_raw */ + } valuators; +}; + +/** + * Event type used inside the X server for input event + * processing. + */ +union _InternalEvent { + struct { + unsigned char header; /**< Always ET_Internal */ + enum EventType type; /**< One of ET_* */ + int length; /**< Length in bytes */ + Time time; /**< Time in ms. */ + } any; + DeviceEvent device; + DeviceChangedEvent changed; +#if XFreeXDGA + DGAEvent dga; +#endif + RawDeviceEvent raw; +}; + +#endif diff --git a/include/exevents.h b/include/exevents.h index 861d0ddb1..39e1c70fe 100644 --- a/include/exevents.h +++ b/include/exevents.h @@ -33,6 +33,97 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <X11/extensions/XIproto.h> #include "inputstr.h" +/*************************************************************** + * Interface available to drivers * + ***************************************************************/ + +extern _X_EXPORT int InitProximityClassDeviceStruct( + DeviceIntPtr /* dev */); + +extern _X_EXPORT void InitValuatorAxisStruct( + DeviceIntPtr /* dev */, + int /* axnum */, + Atom /* label */, + int /* minval */, + int /* maxval */, + int /* resolution */, + int /* min_res */, + int /* max_res */); + +/* Input device properties */ +extern _X_EXPORT void XIDeleteAllDeviceProperties( + DeviceIntPtr /* device */ +); + +extern _X_EXPORT int XIDeleteDeviceProperty( + DeviceIntPtr /* device */, + Atom /* property */, + Bool /* fromClient */ +); + +extern _X_EXPORT int XIChangeDeviceProperty( + DeviceIntPtr /* dev */, + Atom /* property */, + Atom /* type */, + int /* format*/, + int /* mode*/, + unsigned long /* len*/, + pointer /* value*/, + Bool /* sendevent*/ + ); + +extern _X_EXPORT int XIGetDeviceProperty( + DeviceIntPtr /* dev */, + Atom /* property */, + XIPropertyValuePtr* /* value */ +); + +extern _X_EXPORT int XISetDevicePropertyDeletable( + DeviceIntPtr /* dev */, + Atom /* property */, + Bool /* deletable */ +); + +extern _X_EXPORT long XIRegisterPropertyHandler( + DeviceIntPtr dev, + int (*SetProperty) (DeviceIntPtr dev, + Atom property, + XIPropertyValuePtr prop, + BOOL checkonly), + int (*GetProperty) (DeviceIntPtr dev, + Atom property), + int (*DeleteProperty) (DeviceIntPtr dev, + Atom property) +); + +extern _X_EXPORT void XIUnregisterPropertyHandler( + DeviceIntPtr dev, + long id +); + +extern _X_EXPORT Atom XIGetKnownProperty( + char* name +); + +extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev); + +extern _X_EXPORT int XIPropToInt( + XIPropertyValuePtr val, + int *nelem_return, + int **buf_return +); + +extern _X_EXPORT int XIPropToFloat( + XIPropertyValuePtr val, + int *nelem_return, + float **buf_return +); + +/**************************************************************************** + * End of driver interface * + ****************************************************************************/ + + /** * Attached to the devPrivates of each client. Specifies the version number as * supported by the client. @@ -55,43 +146,35 @@ typedef struct _GrabParameters { } GrabParameters; -extern _X_EXPORT void RegisterOtherDevice ( +extern void +RegisterOtherDevice ( DeviceIntPtr /* device */); -extern _X_EXPORT int +extern int UpdateDeviceState ( DeviceIntPtr /* device */, DeviceEvent* /* xE */); -extern _X_EXPORT void ProcessOtherEvent ( +extern void +ProcessOtherEvent ( InternalEvent* /* ev */, DeviceIntPtr /* other */); -extern _X_EXPORT int InitProximityClassDeviceStruct( - DeviceIntPtr /* dev */); - -extern _X_EXPORT void InitValuatorAxisStruct( - DeviceIntPtr /* dev */, - int /* axnum */, - Atom /* label */, - int /* minval */, - int /* maxval */, - int /* resolution */, - int /* min_res */, - int /* max_res */); - -extern _X_EXPORT void DeviceFocusEvent( +extern void +DeviceFocusEvent( DeviceIntPtr /* dev */, int /* type */, int /* mode */, int /* detail */, WindowPtr /* pWin */); -extern int CheckGrabValues( +extern int +CheckGrabValues( ClientPtr /* client */, GrabParameters* /* param */); -extern int GrabButton( +extern int +GrabButton( ClientPtr /* client */, DeviceIntPtr /* dev */, DeviceIntPtr /* modifier_device */, @@ -100,7 +183,8 @@ extern int GrabButton( GrabType /* grabtype */, GrabMask* /* eventMask */); -extern int GrabKey( +extern int +GrabKey( ClientPtr /* client */, DeviceIntPtr /* dev */, DeviceIntPtr /* modifier_device */, @@ -109,34 +193,40 @@ extern int GrabKey( GrabType /* grabtype */, GrabMask* /* eventMask */); -extern int GrabWindow( +extern int +GrabWindow( ClientPtr /* client */, DeviceIntPtr /* dev */, int /* type */, GrabParameters* /* param */, GrabMask* /* eventMask */); -extern int SelectForWindow( +extern int +SelectForWindow( DeviceIntPtr /* dev */, WindowPtr /* pWin */, ClientPtr /* client */, Mask /* mask */, Mask /* exclusivemasks */); -extern _X_EXPORT int AddExtensionClient ( +extern int +AddExtensionClient ( WindowPtr /* pWin */, ClientPtr /* client */, Mask /* mask */, int /* mskidx */); -extern _X_EXPORT void RecalculateDeviceDeliverableEvents( +extern void +RecalculateDeviceDeliverableEvents( WindowPtr /* pWin */); -extern _X_EXPORT int InputClientGone( +extern int +InputClientGone( WindowPtr /* pWin */, XID /* id */); -extern _X_EXPORT int SendEvent ( +extern int +SendEvent ( ClientPtr /* client */, DeviceIntPtr /* d */, Window /* dest */, @@ -145,13 +235,15 @@ extern _X_EXPORT int SendEvent ( Mask /* mask */, int /* count */); -extern _X_EXPORT int SetButtonMapping ( +extern int +SetButtonMapping ( ClientPtr /* client */, DeviceIntPtr /* dev */, int /* nElts */, BYTE * /* map */); -extern _X_EXPORT int ChangeKeyMapping( +extern int +ChangeKeyMapping( ClientPtr /* client */, DeviceIntPtr /* dev */, unsigned /* len */, @@ -161,15 +253,18 @@ extern _X_EXPORT int ChangeKeyMapping( CARD8 /* keySymsPerKeyCode */, KeySym * /* map */); -extern _X_EXPORT void DeleteWindowFromAnyExtEvents( +extern void +DeleteWindowFromAnyExtEvents( WindowPtr /* pWin */, Bool /* freeResources */); -extern _X_EXPORT int MaybeSendDeviceMotionNotifyHint ( +extern int +MaybeSendDeviceMotionNotifyHint ( deviceKeyButtonPointer * /* pEvents */, Mask /* mask */); -extern _X_EXPORT void CheckDeviceGrabAndHintWindow ( +extern void +CheckDeviceGrabAndHintWindow ( WindowPtr /* pWin */, int /* type */, deviceKeyButtonPointer * /* xE */, @@ -177,101 +272,44 @@ extern _X_EXPORT void CheckDeviceGrabAndHintWindow ( ClientPtr /* client */, Mask /* deliveryMask */); -extern _X_EXPORT void MaybeStopDeviceHint( +extern void +MaybeStopDeviceHint( DeviceIntPtr /* dev */, ClientPtr /* client */); -extern _X_EXPORT int DeviceEventSuppressForWindow( +extern int +DeviceEventSuppressForWindow( WindowPtr /* pWin */, ClientPtr /* client */, Mask /* mask */, int /* maskndx */); -extern _X_EXPORT void SendEventToAllWindows( +extern void +SendEventToAllWindows( DeviceIntPtr /* dev */, Mask /* mask */, xEvent * /* ev */, int /* count */); -/* Input device properties */ -extern _X_EXPORT void XIDeleteAllDeviceProperties( - DeviceIntPtr /* device */ -); - -extern _X_EXPORT int XIDeleteDeviceProperty( - DeviceIntPtr /* device */, - Atom /* property */, - Bool /* fromClient */ -); - -extern _X_EXPORT int XIChangeDeviceProperty( - DeviceIntPtr /* dev */, - Atom /* property */, - Atom /* type */, - int /* format*/, - int /* mode*/, - unsigned long /* len*/, - pointer /* value*/, - Bool /* sendevent*/ - ); - -extern _X_EXPORT int XIGetDeviceProperty( - DeviceIntPtr /* dev */, - Atom /* property */, - XIPropertyValuePtr* /* value */ -); - -extern _X_EXPORT int XISetDevicePropertyDeletable( - DeviceIntPtr /* dev */, - Atom /* property */, - Bool /* deletable */ -); - -extern _X_EXPORT long XIRegisterPropertyHandler( - DeviceIntPtr dev, - int (*SetProperty) (DeviceIntPtr dev, - Atom property, - XIPropertyValuePtr prop, - BOOL checkonly), - int (*GetProperty) (DeviceIntPtr dev, - Atom property), - int (*DeleteProperty) (DeviceIntPtr dev, - Atom property) -); - -extern _X_EXPORT void XIUnregisterPropertyHandler( - DeviceIntPtr dev, - long id -); - -extern _X_EXPORT Atom XIGetKnownProperty( - char* name -); - -extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev); - -extern _X_EXPORT int XIPropToInt( - XIPropertyValuePtr val, - int *nelem_return, - int **buf_return -); - -extern _X_EXPORT int XIPropToFloat( - XIPropertyValuePtr val, - int *nelem_return, - float **buf_return -); +extern _X_HIDDEN void XI2EventSwap( + xGenericEvent * /* from */, + xGenericEvent * /* to */); /* For an event such as MappingNotify which affects client interpretation * of input events sent by device dev, should we notify the client, or * would it merely be irrelevant and confusing? */ -extern _X_EXPORT int XIShouldNotify(ClientPtr client, DeviceIntPtr dev); +extern int +XIShouldNotify(ClientPtr client, DeviceIntPtr dev); extern void XISendDeviceChangedEvent(DeviceIntPtr device, DeviceIntPtr master, DeviceChangedEvent *dce); -extern void XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client, +extern int +XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client, unsigned int len, unsigned char* mask); +extern int +XICheckInvalidMaskBits(unsigned char *mask, int len); + #endif /* EXEVENTS_H */ diff --git a/include/extinit.h b/include/extinit.h index 0b36d3bcd..c3aa7b681 100644 --- a/include/extinit.h +++ b/include/extinit.h @@ -32,7 +32,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "extnsionst.h" -extern _X_EXPORT void +extern void XInputExtensionInit( void ); diff --git a/include/input.h b/include/input.h index 9711fa87d..7ab5e9d65 100644 --- a/include/input.h +++ b/include/input.h @@ -54,6 +54,7 @@ SOFTWARE. #include <X11/Xproto.h> #include "window.h" /* for WindowPtr */ #include "xkbrules.h" +#include "events.h" #define DEVICE_INIT 0 #define DEVICE_ON 1 @@ -96,8 +97,6 @@ SOFTWARE. #define RevertToFollowKeyboard 3 #endif -#include "events.h" - typedef unsigned long Leds; typedef struct _OtherClients *OtherClientsPtr; typedef struct _InputClients *InputClientsPtr; @@ -221,6 +220,7 @@ 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 _X_EXPORT DeviceIntPtr AddInputDevice( ClientPtr /*client*/, @@ -365,7 +365,7 @@ extern _X_EXPORT Bool InitKeyboardDeviceStruct( BellProcPtr /*bellProc*/, KbdCtrlProcPtr /*controlProc*/); -extern _X_EXPORT int ApplyPointerMapping( +extern int ApplyPointerMapping( DeviceIntPtr /* pDev */, CARD8 * /* map */, int /* len */, @@ -483,6 +483,8 @@ extern int AllocDevicePair(ClientPtr client, char* name, DeviceIntPtr* ptr, DeviceIntPtr* keybd, + DeviceProc ptr_proc, + DeviceProc keybd_proc, Bool master); extern void DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to, @@ -493,10 +495,14 @@ 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 AllocXtstDevice(ClientPtr client, +extern int AllocXTestDevice(ClientPtr client, char* name, DeviceIntPtr* ptr, - DeviceIntPtr* keybd); + 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); diff --git a/include/inputstr.h b/include/inputstr.h index 623b3c0e5..aeb01c0b7 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -69,7 +69,7 @@ SOFTWARE. * events to the protocol, the server will not support these events until * this number here is bumped. */ -#define XI2LASTEVENT 13 /* XI_PropertyEvent */ +#define XI2LASTEVENT 17 /* XI_RawMotion */ #define XI2MASKSIZE ((XI2LASTEVENT + 7)/8) /* no of bits for masks */ /** @@ -119,7 +119,7 @@ typedef struct _InputClients { * OtherInputMasks struct and exactly one InputClients struct hanging off * inputClients. Each further client appends to the inputClients list. * Each Mask field is per-device, with the device id as the index. - * Exception: for non-device events (Presence events), the MAX_DEVICES + * Exception: for non-device events (Presence events), the MAXDEVICES * deviceid is used. */ typedef struct _OtherInputMasks { diff --git a/include/misc.h b/include/misc.h index 61dd9474c..877c682d4 100644 --- a/include/misc.h +++ b/include/misc.h @@ -180,6 +180,36 @@ typedef struct _xReq *xReqPtr; #endif +/** + * Calculate the number of bytes needed to hold bits. + * @param bits The minimum number of bits needed. + * @return The number of bytes needed to hold bits. + */ +static inline int +bits_to_bytes(const int bits) { + return ((bits + 7) >> 3); +} +/** + * Calculate the number of 4-byte units needed to hold the given number of + * bytes. + * @param bytes The minimum number of bytes needed. + * @return The number of 4-byte units needed to hold bytes. + */ +static inline int +bytes_to_int32(const int bytes) { + return (((bytes) + 3) >> 2); +} + +/** + * Calculate the number of bytes (in multiples of 4) needed to hold bytes. + * @param bytes The minimum number of bytes needed. + * @return The closest multiple of 4 that is equal or higher than bytes. + */ +static inline int +pad_to_int32(const int bytes) { + return (((bytes) + 3) & ~3); +} + /* some macros to help swap requests, replies, and events */ #define LengthRestB(stuff) \ diff --git a/include/ptrveloc.h b/include/ptrveloc.h index 83d188c54..fa2156b0d 100644 --- a/include/ptrveloc.h +++ b/include/ptrveloc.h @@ -1,6 +1,6 @@ /* * - * Copyright © 2006-2008 Simon Thum simon dot thum at gmx dot de + * Copyright © 2006-2009 Simon Thum simon dot thum at gmx dot de * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -47,8 +47,8 @@ struct _DeviceVelocityRec; * returns actual acceleration depending on velocity, acceleration control,... */ typedef float (*PointerAccelerationProfileFunc) - (struct _DeviceVelocityRec* /*pVel*/, - float /*velocity*/, float /*threshold*/, float /*acc*/); + (DeviceIntPtr dev, struct _DeviceVelocityRec* vel, + float velocity, float threshold, float accelCoeff); /** * a motion history, with just enough information to @@ -91,33 +91,43 @@ typedef struct _DeviceVelocityRec { extern _X_EXPORT void -InitVelocityData(DeviceVelocityPtr s); +InitVelocityData(DeviceVelocityPtr vel); extern _X_EXPORT void -InitTrackers(DeviceVelocityPtr s, int ntracker); +InitTrackers(DeviceVelocityPtr vel, int ntracker); -extern _X_EXPORT BOOL -InitializePredictableAccelerationProperties(DeviceIntPtr pDev); +extern _X_EXPORT short +ProcessVelocityData2D(DeviceVelocityPtr vel, int dx, int dy, int time); + +extern _X_EXPORT float +BasicComputeAcceleration(DeviceIntPtr dev, DeviceVelocityPtr vel, + float velocity, float threshold, float acc); + +extern _X_EXPORT void +FreeVelocityData(DeviceVelocityPtr vel); + +extern _X_INTERNAL BOOL +InitializePredictableAccelerationProperties(DeviceIntPtr dev); extern _X_EXPORT int -SetAccelerationProfile(DeviceVelocityPtr s, int profile_num); +SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num); extern _X_EXPORT DeviceVelocityPtr -GetDevicePredictableAccelData(DeviceIntPtr pDev); +GetDevicePredictableAccelData(DeviceIntPtr dev); extern _X_EXPORT void -SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr s, +SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel, PointerAccelerationProfileFunc profile); -extern _X_EXPORT void -AccelerationDefaultCleanup(DeviceIntPtr pDev); +extern _X_INTERNAL void +AccelerationDefaultCleanup(DeviceIntPtr dev); -extern _X_EXPORT void -acceleratePointerPredictable(DeviceIntPtr pDev, int first_valuator, +extern _X_INTERNAL void +acceleratePointerPredictable(DeviceIntPtr dev, int first_valuator, int num_valuators, int *valuators, int evtime); -extern _X_EXPORT void -acceleratePointerLightweight(DeviceIntPtr pDev, int first_valuator, - int num_valuators, int *valuators, int ignore); +extern _X_INTERNAL void +acceleratePointerLightweight(DeviceIntPtr dev, int first_valuator, + int num_valuators, int *valuators, int ignored); #endif /* POINTERVELOCITY_H */ diff --git a/include/resource.h b/include/resource.h index 774f81b56..8ed4e569e 100644 --- a/include/resource.h +++ b/include/resource.h @@ -257,14 +257,6 @@ extern _X_EXPORT RESTYPE TypeMask; #define X_DEPRECATED #endif -/* replaced by dixLookupResourceByType or dixLookupResourceByClass */ -extern int dixLookupResource( - pointer *result, - XID id, - RESTYPE rtype, - ClientPtr client, - Mask access_mode) X_DEPRECATED; - /* replaced by dixLookupResourceByType */ extern _X_EXPORT pointer SecurityLookupIDByType( ClientPtr client, diff --git a/include/xkbsrv.h b/include/xkbsrv.h index 48891fd99..2c7d86aaa 100644 --- a/include/xkbsrv.h +++ b/include/xkbsrv.h @@ -297,8 +297,6 @@ extern _X_EXPORT int XkbKeyboardErrorCode; extern _X_EXPORT char * XkbBaseDirectory; extern _X_EXPORT char * XkbBinDirectory; -extern _X_EXPORT pointer XkbLastRepeatEvent; - extern _X_EXPORT CARD32 xkbDebugFlags; #define _XkbTypedAlloc(t) ((t *)xalloc(sizeof(t))) @@ -942,12 +940,12 @@ extern Bool XkbCopyDeviceKeymap( DeviceIntPtr /* dst */, DeviceIntPtr /* src */); -extern int XkbGetKeysym( - DeviceIntPtr /* dev */, - DeviceEvent* /* event*/); +extern void XkbFilterEvents( + ClientPtr /* pClient */, + int /* nEvents */, + xEvent* /* xE */); #include "xkbfile.h" -#include <X11/extensions/XKMformat.h> #include "xkbrules.h" #define _XkbListKeycodes 0 diff --git a/include/xkbstr.h b/include/xkbstr.h index ec19b30c2..4afe010d2 100644 --- a/include/xkbstr.h +++ b/include/xkbstr.h @@ -123,8 +123,14 @@ typedef struct _XkbModAction { unsigned char flags; unsigned char mask; unsigned char real_mods; - unsigned int vmods; + /* FIXME: Make this an int. */ + unsigned char vmods1; + unsigned char vmods2; } XkbModAction; +#define XkbModActionVMods(a) ((short) (((a)->vmods1 << 8) | (a)->vmods2)) +#define XkbSetModActionVMods(a,v) \ + ((a)->vmods1 = (((v) >> 8) & 0xff), \ + (a)->vmods2 = (v) & 0xff) typedef struct _XkbGroupAction { unsigned char type; @@ -143,15 +149,23 @@ typedef struct _XkbISOAction { /* FIXME: Make this an int. */ char group_XXX; unsigned char affect; - unsigned int vmods; + unsigned char vmods1; + unsigned char vmods2; } XkbISOAction; typedef struct _XkbPtrAction { unsigned char type; unsigned char flags; - int x; - int y; + /* FIXME: Make this an int. */ + unsigned char high_XXX; + unsigned char low_XXX; + unsigned char high_YYY; + unsigned char low_YYY; } XkbPtrAction; +#define XkbPtrActionX(a) (Xkb2CharsToInt((a)->high_XXX,(a)->low_XXX)) +#define XkbPtrActionY(a) (Xkb2CharsToInt((a)->high_YYY,(a)->low_YYY)) +#define XkbSetPtrActionX(a,x) (XkbIntTo2Chars(x,(a)->high_XXX,(a)->low_XXX)) +#define XkbSetPtrActionY(a,y) (XkbIntTo2Chars(y,(a)->high_YYY,(a)->low_YYY)) typedef struct _XkbPtrBtnAction { unsigned char type; @@ -180,8 +194,20 @@ typedef struct _XkbSwitchScreenAction { typedef struct _XkbCtrlsAction { unsigned char type; unsigned char flags; - unsigned long ctrls; + /* FIXME: Make this an int. */ + unsigned char ctrls3; + unsigned char ctrls2; + unsigned char ctrls1; + unsigned char ctrls0; } XkbCtrlsAction; +#define XkbActionSetCtrls(a, c) ((a)->ctrls3 = ((c) >> 24) & 0xff, \ + (a)->ctrls2 = ((c) >> 16) & 0xff, \ + (a)->ctrls1 = ((c) >> 8) & 0xff, \ + (a)->ctrls0 = (c) & 0xff) +#define XkbActionCtrls(a) ((((unsigned int)(a)->ctrls3)<<24)|\ + (((unsigned int)(a)->ctrls2)<<16)|\ + (((unsigned int)(a)->ctrls1)<<8)|\ + ((unsigned int) (a)->ctrls0)) typedef struct _XkbMessageAction { unsigned char type; @@ -194,10 +220,23 @@ typedef struct _XkbRedirectKeyAction { unsigned char new_key; unsigned char mods_mask; unsigned char mods; - unsigned int vmods_mask; - unsigned int vmods; + /* FIXME: Make this an int. */ + unsigned char vmods_mask0; + unsigned char vmods_mask1; + unsigned char vmods0; + unsigned char vmods1; } XkbRedirectKeyAction; +#define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods1)<<8)|\ + ((unsigned int)(a)->vmods0)) +/* FIXME: This is blatantly not setting vmods. Yeesh. */ +#define XkbSARedirectSetVMods(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\ + ((a)->vmods_mask0=((m)&0xff))) +#define XkbSARedirectVModsMask(a) ((((unsigned int)(a)->vmods_mask1)<<8)|\ + ((unsigned int)(a)->vmods_mask0)) +#define XkbSARedirectSetVModsMask(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\ + ((a)->vmods_mask0=((m)&0xff))) + typedef struct _XkbDeviceBtnAction { unsigned char type; unsigned char flags; diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in index ebeb44a37..d1594202e 100644 --- a/include/xorg-config.h.in +++ b/include/xorg-config.h.in @@ -51,15 +51,15 @@ /* Build DRI2 extension */ #undef DRI2 -/* Solaris 8 or later? */ -#undef __SOL8__ - /* Define to 1 if you have the <stropts.h> header file. */ #undef HAVE_STROPTS_H /* Define to 1 if you have the <sys/kd.h> header file. */ #undef HAVE_SYS_KD_H +/* Define to 1 if you have the <sys/vt.h> header file. */ +#undef HAVE_SYS_VT_H + /* Define to 1 if you have the `walkcontext' function (used on Solaris for xorg_backtrace in hw/xfree86/common/xf86Events.c */ #undef HAVE_WALKCONTEXT @@ -118,9 +118,15 @@ /* Have pci_system_init_dev_mem() */ #undef HAVE_PCI_SYSTEM_INIT_DEV_MEM +/* Define to 1 if you have the `pci_device_is_boot_vga' function. */ +#undef HAVE_PCI_DEVICE_IS_BOOT_VGA + /* Have pci_enable_device */ #undef HAVE_PCI_DEVICE_ENABLE +/* Define to 1 if you have the `pci_device_vgaarb_init' function. */ +#undef HAVE_PCI_DEVICE_VGAARB_INIT + /* Path to text files containing PCI IDs */ #undef PCI_TXT_IDS_PATH diff --git a/include/xorg-server.h.in b/include/xorg-server.h.in index 3189ff3c8..76cab16b6 100644 --- a/include/xorg-server.h.in +++ b/include/xorg-server.h.in @@ -166,9 +166,6 @@ /* System is BSD-like */ #undef CSRG_BASED -/* Solaris 8 or later? */ -#undef __SOL8__ - /* System has PC console */ #undef PCCONS_SUPPORT @@ -187,4 +184,7 @@ /* Use libpciaccess */ #undef XSERVER_LIBPCIACCESS +/* X Access Control Extension */ +#undef XACE + #endif /* _XORG_SERVER_H_ */ diff --git a/include/xserver-properties.h b/include/xserver-properties.h index 9b3b7bf8d..626d0ad27 100644 --- a/include/xserver-properties.h +++ b/include/xserver-properties.h @@ -32,6 +32,8 @@ /* BOOL. 0 - device disabled, 1 - device enabled */ #define XI_PROP_ENABLED "Device Enabled" +/* BOOL. If present, device is a virtual XTEST device */ +#define XI_PROP_XTEST_DEVICE "XTEST Device" /* Pointer acceleration properties */ /* INTEGER of any format */ |