45e9809aff7304721fddb95654901b32195c9c7avboxsync/************************************************************
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncCopyright 1987, 1998 The Open Group
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncPermission to use, copy, modify, distribute, and sell this software and its
45e9809aff7304721fddb95654901b32195c9c7avboxsyncdocumentation for any purpose is hereby granted without fee, provided that
45e9809aff7304721fddb95654901b32195c9c7avboxsyncthe above copyright notice appear in all copies and that both that
45e9809aff7304721fddb95654901b32195c9c7avboxsynccopyright notice and this permission notice appear in supporting
45e9809aff7304721fddb95654901b32195c9c7avboxsyncdocumentation.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncThe above copyright notice and this permission notice shall be included in
45e9809aff7304721fddb95654901b32195c9c7avboxsyncall copies or substantial portions of the Software.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45e9809aff7304721fddb95654901b32195c9c7avboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45e9809aff7304721fddb95654901b32195c9c7avboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
45e9809aff7304721fddb95654901b32195c9c7avboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
45e9809aff7304721fddb95654901b32195c9c7avboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncExcept as contained in this notice, the name of The Open Group shall not be
45e9809aff7304721fddb95654901b32195c9c7avboxsyncused in advertising or otherwise to promote the sale, use or other dealings
45e9809aff7304721fddb95654901b32195c9c7avboxsyncin this Software without prior written authorization from The Open Group.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync All Rights Reserved
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncPermission to use, copy, modify, and distribute this software and its
45e9809aff7304721fddb95654901b32195c9c7avboxsyncdocumentation for any purpose and without fee is hereby granted,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncprovided that the above copyright notice appear in all copies and that
45e9809aff7304721fddb95654901b32195c9c7avboxsyncboth that copyright notice and this permission notice appear in
45e9809aff7304721fddb95654901b32195c9c7avboxsyncsupporting documentation, and that the name of Digital not be
45e9809aff7304721fddb95654901b32195c9c7avboxsyncused in advertising or publicity pertaining to distribution of the
45e9809aff7304721fddb95654901b32195c9c7avboxsyncsoftware without specific, written prior permission.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
45e9809aff7304721fddb95654901b32195c9c7avboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
45e9809aff7304721fddb95654901b32195c9c7avboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
45e9809aff7304721fddb95654901b32195c9c7avboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
45e9809aff7304721fddb95654901b32195c9c7avboxsyncSOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync********************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef INPUTSTRUCT_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define INPUTSTRUCT_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "input.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "window.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "dixstruct.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SameClient(obj,client) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (CLIENT_BITS((obj)->resource) == (client)->clientAsMask)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define MAX_DEVICES 20
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define EMASKSIZE MAX_DEVICES
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int CoreDevicePrivatesIndex;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Kludge: OtherClients and InputClients must be compatible, see code */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _OtherClients {
45e9809aff7304721fddb95654901b32195c9c7avboxsync OtherClientsPtr next;
45e9809aff7304721fddb95654901b32195c9c7avboxsync XID resource; /* id for putting into resource manager */
45e9809aff7304721fddb95654901b32195c9c7avboxsync Mask mask;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} OtherClients;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _InputClients {
45e9809aff7304721fddb95654901b32195c9c7avboxsync InputClientsPtr next;
45e9809aff7304721fddb95654901b32195c9c7avboxsync XID resource; /* id for putting into resource manager */
45e9809aff7304721fddb95654901b32195c9c7avboxsync Mask mask[EMASKSIZE];
45e9809aff7304721fddb95654901b32195c9c7avboxsync} InputClients;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _OtherInputMasks {
45e9809aff7304721fddb95654901b32195c9c7avboxsync Mask deliverableEvents[EMASKSIZE];
45e9809aff7304721fddb95654901b32195c9c7avboxsync Mask inputEvents[EMASKSIZE];
45e9809aff7304721fddb95654901b32195c9c7avboxsync Mask dontPropagateMask[EMASKSIZE];
45e9809aff7304721fddb95654901b32195c9c7avboxsync InputClientsPtr inputClients;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} OtherInputMasks;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * The following structure gets used for both active and passive grabs. For
45e9809aff7304721fddb95654901b32195c9c7avboxsync * active grabs some of the fields (e.g. modifiers) are not used. However,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * that is not much waste since there aren't many active grabs (one per
45e9809aff7304721fddb95654901b32195c9c7avboxsync * keyboard/pointer device) going at once in the server.
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define MasksPerDetailMask 8 /* 256 keycodes and 256 possible
45e9809aff7304721fddb95654901b32195c9c7avboxsync modifier combinations, but only
45e9809aff7304721fddb95654901b32195c9c7avboxsync 3 buttons. */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _DetailRec { /* Grab details may be bit masks */
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned short exact;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Mask *pMask;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} DetailRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _GrabRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync GrabPtr next; /* for chain of passive grabs */
45e9809aff7304721fddb95654901b32195c9c7avboxsync XID resource;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr device;
45e9809aff7304721fddb95654901b32195c9c7avboxsync WindowPtr window;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned ownerEvents:1;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned keyboardMode:1;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned pointerMode:1;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned coreGrab:1; /* grab is on core device */
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned coreMods:1; /* modifiers are on core keyboard */
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 type; /* event type */
45e9809aff7304721fddb95654901b32195c9c7avboxsync DetailRec modifiersDetail;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr modifierDevice;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DetailRec detail; /* key or button */
45e9809aff7304721fddb95654901b32195c9c7avboxsync WindowPtr confineTo; /* always NULL for keyboards */
45e9809aff7304721fddb95654901b32195c9c7avboxsync CursorPtr cursor; /* always NULL for keyboards */
45e9809aff7304721fddb95654901b32195c9c7avboxsync Mask eventMask;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} GrabRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _KeyClassRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 down[DOWN_LENGTH];
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 postdown[DOWN_LENGTH];
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeyCode *modifierKeyMap;
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeySymsRec curKeySyms;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int modifierKeyCount[8];
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 modifierMap[MAP_LENGTH];
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 maxKeysPerModifier;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned short state;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned short prev_state;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef XKB
45e9809aff7304721fddb95654901b32195c9c7avboxsync struct _XkbSrvInfo *xkbInfo;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#else
45e9809aff7304721fddb95654901b32195c9c7avboxsync void *pad0;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync} KeyClassRec, *KeyClassPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _AxisInfo {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int resolution;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int min_resolution;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int max_resolution;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int min_value;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int max_value;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} AxisInfo, *AxisInfoPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _ValuatorClassRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync ValuatorMotionProcPtr GetMotionProc;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int numMotionEvents;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int first_motion;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int last_motion;
45e9809aff7304721fddb95654901b32195c9c7avboxsync void *motion;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync WindowPtr motionHintWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync AxisInfoPtr axes;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned short numAxes;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int *axisVal;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int lastx, lasty; /* last event recorded, not posted to
45e9809aff7304721fddb95654901b32195c9c7avboxsync * client; see dix/devices.c */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int dxremaind, dyremaind; /* for acceleration */
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 mode;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} ValuatorClassRec, *ValuatorClassPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _ButtonClassRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 numButtons;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 buttonsDown; /* number of buttons currently down */
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned short state;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Mask motionMask;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 down[DOWN_LENGTH];
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 map[MAP_LENGTH];
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef XKB
45e9809aff7304721fddb95654901b32195c9c7avboxsync union _XkbAction *xkb_acts;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#else
45e9809aff7304721fddb95654901b32195c9c7avboxsync void *pad0;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync} ButtonClassRec, *ButtonClassPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _FocusClassRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync WindowPtr win;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int revert;
45e9809aff7304721fddb95654901b32195c9c7avboxsync TimeStamp time;
45e9809aff7304721fddb95654901b32195c9c7avboxsync WindowPtr *trace;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int traceSize;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int traceGood;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} FocusClassRec, *FocusClassPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _ProximityClassRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync char pad;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} ProximityClassRec, *ProximityClassPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _AbsoluteClassRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* Calibration. */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int min_x;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int max_x;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int min_y;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int max_y;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int flip_x;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int flip_y;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int rotation;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int button_threshold;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* Area. */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int offset_x;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int offset_y;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int width;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int height;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int screen;
45e9809aff7304721fddb95654901b32195c9c7avboxsync XID following;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} AbsoluteClassRec, *AbsoluteClassPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _KbdFeedbackClassRec *KbdFeedbackPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _PtrFeedbackClassRec *PtrFeedbackPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _IntegerFeedbackClassRec *IntegerFeedbackPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _StringFeedbackClassRec *StringFeedbackPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _BellFeedbackClassRec *BellFeedbackPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _LedFeedbackClassRec *LedFeedbackPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _KbdFeedbackClassRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync BellProcPtr BellProc;
45e9809aff7304721fddb95654901b32195c9c7avboxsync KbdCtrlProcPtr CtrlProc;
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeybdCtrl ctrl;
45e9809aff7304721fddb95654901b32195c9c7avboxsync KbdFeedbackPtr next;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef XKB
45e9809aff7304721fddb95654901b32195c9c7avboxsync struct _XkbSrvLedInfo *xkb_sli;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#else
45e9809aff7304721fddb95654901b32195c9c7avboxsync void *pad0;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync} KbdFeedbackClassRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _PtrFeedbackClassRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync PtrCtrlProcPtr CtrlProc;
45e9809aff7304721fddb95654901b32195c9c7avboxsync PtrCtrl ctrl;
45e9809aff7304721fddb95654901b32195c9c7avboxsync PtrFeedbackPtr next;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} PtrFeedbackClassRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _IntegerFeedbackClassRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync IntegerCtrlProcPtr CtrlProc;
45e9809aff7304721fddb95654901b32195c9c7avboxsync IntegerCtrl ctrl;
45e9809aff7304721fddb95654901b32195c9c7avboxsync IntegerFeedbackPtr next;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} IntegerFeedbackClassRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _StringFeedbackClassRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync StringCtrlProcPtr CtrlProc;
45e9809aff7304721fddb95654901b32195c9c7avboxsync StringCtrl ctrl;
45e9809aff7304721fddb95654901b32195c9c7avboxsync StringFeedbackPtr next;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} StringFeedbackClassRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _BellFeedbackClassRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync BellProcPtr BellProc;
45e9809aff7304721fddb95654901b32195c9c7avboxsync BellCtrlProcPtr CtrlProc;
45e9809aff7304721fddb95654901b32195c9c7avboxsync BellCtrl ctrl;
45e9809aff7304721fddb95654901b32195c9c7avboxsync BellFeedbackPtr next;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} BellFeedbackClassRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _LedFeedbackClassRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync LedCtrlProcPtr CtrlProc;
45e9809aff7304721fddb95654901b32195c9c7avboxsync LedCtrl ctrl;
45e9809aff7304721fddb95654901b32195c9c7avboxsync LedFeedbackPtr next;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef XKB
45e9809aff7304721fddb95654901b32195c9c7avboxsync struct _XkbSrvLedInfo *xkb_sli;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#else
45e9809aff7304721fddb95654901b32195c9c7avboxsync void *pad0;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync} LedFeedbackClassRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* states for devices */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define NOT_GRABBED 0
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define THAWED 1
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define THAWED_BOTH 2 /* not a real state */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FREEZE_NEXT_EVENT 3
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FREEZE_BOTH_NEXT_EVENT 4
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FROZEN 5 /* any state >= has device frozen */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FROZEN_NO_EVENT 5
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FROZEN_WITH_EVENT 6
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define THAW_OTHERS 7
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _DeviceIntRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceRec public;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr next;
45e9809aff7304721fddb95654901b32195c9c7avboxsync TimeStamp grabTime;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool startup; /* true if needs to be turned on at
45e9809aff7304721fddb95654901b32195c9c7avboxsync server intialization time */
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceProc deviceProc; /* proc(DevicePtr, DEVICE_xx). It is
45e9809aff7304721fddb95654901b32195c9c7avboxsync used to initialize, turn on, or
45e9809aff7304721fddb95654901b32195c9c7avboxsync turn off the device */
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool inited; /* TRUE if INIT returns Success */
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool enabled; /* TRUE if ON returns Success */
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool coreEvents; /* TRUE if device also sends core */
45e9809aff7304721fddb95654901b32195c9c7avboxsync GrabPtr grab; /* the grabber - used by DIX */
45e9809aff7304721fddb95654901b32195c9c7avboxsync struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool frozen;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int state;
45e9809aff7304721fddb95654901b32195c9c7avboxsync GrabPtr other; /* if other grab has this frozen */
45e9809aff7304721fddb95654901b32195c9c7avboxsync xEvent *event; /* saved to be replayed */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int evcount;
45e9809aff7304721fddb95654901b32195c9c7avboxsync } sync;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Atom type;
45e9809aff7304721fddb95654901b32195c9c7avboxsync char *name;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 id;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 activatingKey;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool fromPassiveGrab;
45e9809aff7304721fddb95654901b32195c9c7avboxsync GrabRec activeGrab;
45e9809aff7304721fddb95654901b32195c9c7avboxsync void (*ActivateGrab) (
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync GrabPtr /*grab*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync TimeStamp /*time*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool /*autoGrab*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync void (*DeactivateGrab)(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeyClassPtr key;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ValuatorClassPtr valuator;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ButtonClassPtr button;
45e9809aff7304721fddb95654901b32195c9c7avboxsync FocusClassPtr focus;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ProximityClassPtr proximity;
45e9809aff7304721fddb95654901b32195c9c7avboxsync AbsoluteClassPtr absolute;
45e9809aff7304721fddb95654901b32195c9c7avboxsync KbdFeedbackPtr kbdfeed;
45e9809aff7304721fddb95654901b32195c9c7avboxsync PtrFeedbackPtr ptrfeed;
45e9809aff7304721fddb95654901b32195c9c7avboxsync IntegerFeedbackPtr intfeed;
45e9809aff7304721fddb95654901b32195c9c7avboxsync StringFeedbackPtr stringfeed;
45e9809aff7304721fddb95654901b32195c9c7avboxsync BellFeedbackPtr bell;
45e9809aff7304721fddb95654901b32195c9c7avboxsync LedFeedbackPtr leds;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef XKB
45e9809aff7304721fddb95654901b32195c9c7avboxsync struct _XkbInterest *xkb_interest;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#else
45e9809aff7304721fddb95654901b32195c9c7avboxsync void *pad0;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync char *config_info; /* used by the hotplug layer */
45e9809aff7304721fddb95654901b32195c9c7avboxsync DevUnion *devPrivates;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int nPrivates;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceUnwrapProc unwrapProc;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} DeviceIntRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int numDevices; /* total number of devices */
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr devices; /* all devices turned on */
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr off_devices; /* all devices turned off */
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr keyboard; /* the main one for the server */
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr pointer;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} InputInfo;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern InputInfo inputInfo;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* for keeping the events for devices grabbed synchronously */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _QdEvent *QdEventPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _QdEvent {
45e9809aff7304721fddb95654901b32195c9c7avboxsync QdEventPtr next;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr device;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ScreenPtr pScreen; /* what screen the pointer was on */
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long months; /* milliseconds is in the event */
45e9809aff7304721fddb95654901b32195c9c7avboxsync xEvent *event;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int evcount;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} QdEventRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* INPUTSTRUCT_H */