4c221b0da1816acf2ca302b10092df059484468dvboxsync/************************************************************
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsyncCopyright 1987, 1998 The Open Group
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsyncPermission to use, copy, modify, distribute, and sell this software and its
4c221b0da1816acf2ca302b10092df059484468dvboxsyncdocumentation for any purpose is hereby granted without fee, provided that
4c221b0da1816acf2ca302b10092df059484468dvboxsyncthe above copyright notice appear in all copies and that both that
4c221b0da1816acf2ca302b10092df059484468dvboxsynccopyright notice and this permission notice appear in supporting
4c221b0da1816acf2ca302b10092df059484468dvboxsyncdocumentation.
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsyncThe above copyright notice and this permission notice shall be included in
4c221b0da1816acf2ca302b10092df059484468dvboxsyncall copies or substantial portions of the Software.
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
4c221b0da1816acf2ca302b10092df059484468dvboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
4c221b0da1816acf2ca302b10092df059484468dvboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
4c221b0da1816acf2ca302b10092df059484468dvboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
4c221b0da1816acf2ca302b10092df059484468dvboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
4c221b0da1816acf2ca302b10092df059484468dvboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsyncExcept as contained in this notice, the name of The Open Group shall not be
4c221b0da1816acf2ca302b10092df059484468dvboxsyncused in advertising or otherwise to promote the sale, use or other dealings
4c221b0da1816acf2ca302b10092df059484468dvboxsyncin this Software without prior written authorization from The Open Group.
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync All Rights Reserved
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsyncPermission to use, copy, modify, and distribute this software and its
4c221b0da1816acf2ca302b10092df059484468dvboxsyncdocumentation for any purpose and without fee is hereby granted,
4c221b0da1816acf2ca302b10092df059484468dvboxsyncprovided that the above copyright notice appear in all copies and that
4c221b0da1816acf2ca302b10092df059484468dvboxsyncboth that copyright notice and this permission notice appear in
4c221b0da1816acf2ca302b10092df059484468dvboxsyncsupporting documentation, and that the name of Digital not be
4c221b0da1816acf2ca302b10092df059484468dvboxsyncused in advertising or publicity pertaining to distribution of the
4c221b0da1816acf2ca302b10092df059484468dvboxsyncsoftware without specific, written prior permission.
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
4c221b0da1816acf2ca302b10092df059484468dvboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
4c221b0da1816acf2ca302b10092df059484468dvboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
4c221b0da1816acf2ca302b10092df059484468dvboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
4c221b0da1816acf2ca302b10092df059484468dvboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
4c221b0da1816acf2ca302b10092df059484468dvboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
4c221b0da1816acf2ca302b10092df059484468dvboxsyncSOFTWARE.
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync********************************************************/
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync#ifndef INPUTSTRUCT_H
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define INPUTSTRUCT_H
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync#include <pixman.h>
4c221b0da1816acf2ca302b10092df059484468dvboxsync#include "input.h"
4c221b0da1816acf2ca302b10092df059484468dvboxsync#include "window.h"
4c221b0da1816acf2ca302b10092df059484468dvboxsync#include "dixstruct.h"
4c221b0da1816acf2ca302b10092df059484468dvboxsync#include "cursorstr.h"
4c221b0da1816acf2ca302b10092df059484468dvboxsync#include "geext.h"
4c221b0da1816acf2ca302b10092df059484468dvboxsync#include "privates.h"
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define BitIsOn(ptr, bit) (!!(((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))))
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
4c221b0da1816acf2ca302b10092df059484468dvboxsyncextern _X_EXPORT int CountBits(const uint8_t *mask, int len);
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define SameClient(obj,client) \
4c221b0da1816acf2ca302b10092df059484468dvboxsync (CLIENT_BITS((obj)->resource) == (client)->clientAsMask)
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define EMASKSIZE MAXDEVICES + 2
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/* This is the last XI2 event supported by the server. If you add
4c221b0da1816acf2ca302b10092df059484468dvboxsync * events to the protocol, the server will not support these events until
4c221b0da1816acf2ca302b10092df059484468dvboxsync * this number here is bumped.
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define XI2LASTEVENT 17 /* XI_RawMotion */
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define XI2MASKSIZE ((XI2LASTEVENT + 7)/8) /* no of bits for masks */
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/**
4c221b0da1816acf2ca302b10092df059484468dvboxsync * This struct stores the core event mask for each client except the client
4c221b0da1816acf2ca302b10092df059484468dvboxsync * that created the window.
4c221b0da1816acf2ca302b10092df059484468dvboxsync *
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Each window that has events selected from other clients has at least one of
4c221b0da1816acf2ca302b10092df059484468dvboxsync * these masks. If multiple clients selected for events on the same window,
4c221b0da1816acf2ca302b10092df059484468dvboxsync * these masks are in a linked list.
4c221b0da1816acf2ca302b10092df059484468dvboxsync *
4c221b0da1816acf2ca302b10092df059484468dvboxsync * The event mask for the client that created the window is stored in
4c221b0da1816acf2ca302b10092df059484468dvboxsync * win->eventMask instead.
4c221b0da1816acf2ca302b10092df059484468dvboxsync *
4c221b0da1816acf2ca302b10092df059484468dvboxsync * The resource id is simply a fake client ID to associate this mask with a
4c221b0da1816acf2ca302b10092df059484468dvboxsync * client.
4c221b0da1816acf2ca302b10092df059484468dvboxsync *
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Kludge: OtherClients and InputClients must be compatible, see code.
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _OtherClients {
4c221b0da1816acf2ca302b10092df059484468dvboxsync OtherClientsPtr next; /**< Pointer to the next mask */
4c221b0da1816acf2ca302b10092df059484468dvboxsync XID resource; /**< id for putting into resource manager */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Mask mask; /**< Core event mask */
4c221b0da1816acf2ca302b10092df059484468dvboxsync} OtherClients;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/**
4c221b0da1816acf2ca302b10092df059484468dvboxsync * This struct stores the XI event mask for each client.
4c221b0da1816acf2ca302b10092df059484468dvboxsync *
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Each window that has events selected has at least one of these masks. If
4c221b0da1816acf2ca302b10092df059484468dvboxsync * multiple client selected for events on the same window, these masks are in
4c221b0da1816acf2ca302b10092df059484468dvboxsync * a linked list.
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _InputClients {
4c221b0da1816acf2ca302b10092df059484468dvboxsync InputClientsPtr next; /**< Pointer to the next mask */
4c221b0da1816acf2ca302b10092df059484468dvboxsync XID resource; /**< id for putting into resource manager */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Mask mask[EMASKSIZE]; /**< Actual XI event mask, deviceid is index */
4c221b0da1816acf2ca302b10092df059484468dvboxsync /** XI2 event masks. One per device, each bit is a mask of (1 << type) */
4c221b0da1816acf2ca302b10092df059484468dvboxsync unsigned char xi2mask[EMASKSIZE][XI2MASKSIZE];
4c221b0da1816acf2ca302b10092df059484468dvboxsync} InputClients;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/**
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Combined XI event masks from all devices.
4c221b0da1816acf2ca302b10092df059484468dvboxsync *
4c221b0da1816acf2ca302b10092df059484468dvboxsync * This is the XI equivalent of the deliverableEvents, eventMask and
4c221b0da1816acf2ca302b10092df059484468dvboxsync * dontPropagate mask of the WindowRec (or WindowOptRec).
4c221b0da1816acf2ca302b10092df059484468dvboxsync *
4c221b0da1816acf2ca302b10092df059484468dvboxsync * A window that has an XI client selecting for events has exactly one
4c221b0da1816acf2ca302b10092df059484468dvboxsync * OtherInputMasks struct and exactly one InputClients struct hanging off
4c221b0da1816acf2ca302b10092df059484468dvboxsync * inputClients. Each further client appends to the inputClients list.
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Each Mask field is per-device, with the device id as the index.
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Exception: for non-device events (Presence events), the MAXDEVICES
4c221b0da1816acf2ca302b10092df059484468dvboxsync * deviceid is used.
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _OtherInputMasks {
4c221b0da1816acf2ca302b10092df059484468dvboxsync /**
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Bitwise OR of all masks by all clients and the window's parent's masks.
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Mask deliverableEvents[EMASKSIZE];
4c221b0da1816acf2ca302b10092df059484468dvboxsync /**
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Bitwise OR of all masks by all clients on this window.
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Mask inputEvents[EMASKSIZE];
4c221b0da1816acf2ca302b10092df059484468dvboxsync /** The do-not-propagate masks for each device. */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Mask dontPropagateMask[EMASKSIZE];
4c221b0da1816acf2ca302b10092df059484468dvboxsync /** The clients that selected for events */
4c221b0da1816acf2ca302b10092df059484468dvboxsync InputClientsPtr inputClients;
4c221b0da1816acf2ca302b10092df059484468dvboxsync /* XI2 event masks. One per device, each bit is a mask of (1 << type) */
4c221b0da1816acf2ca302b10092df059484468dvboxsync unsigned char xi2mask[EMASKSIZE][XI2MASKSIZE];
4c221b0da1816acf2ca302b10092df059484468dvboxsync} OtherInputMasks;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/*
4c221b0da1816acf2ca302b10092df059484468dvboxsync * The following structure gets used for both active and passive grabs. For
4c221b0da1816acf2ca302b10092df059484468dvboxsync * active grabs some of the fields (e.g. modifiers) are not used. However,
4c221b0da1816acf2ca302b10092df059484468dvboxsync * that is not much waste since there aren't many active grabs (one per
4c221b0da1816acf2ca302b10092df059484468dvboxsync * keyboard/pointer device) going at once in the server.
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define MasksPerDetailMask 8 /* 256 keycodes and 256 possible
4c221b0da1816acf2ca302b10092df059484468dvboxsync modifier combinations, but only
4c221b0da1816acf2ca302b10092df059484468dvboxsync 3 buttons. */
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _DetailRec { /* Grab details may be bit masks */
4c221b0da1816acf2ca302b10092df059484468dvboxsync unsigned int exact;
4c221b0da1816acf2ca302b10092df059484468dvboxsync Mask *pMask;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} DetailRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef enum {
4c221b0da1816acf2ca302b10092df059484468dvboxsync GRABTYPE_CORE,
4c221b0da1816acf2ca302b10092df059484468dvboxsync GRABTYPE_XI,
4c221b0da1816acf2ca302b10092df059484468dvboxsync GRABTYPE_XI2
4c221b0da1816acf2ca302b10092df059484468dvboxsync} GrabType;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsyncunion _GrabMask {
4c221b0da1816acf2ca302b10092df059484468dvboxsync Mask core;
4c221b0da1816acf2ca302b10092df059484468dvboxsync Mask xi;
4c221b0da1816acf2ca302b10092df059484468dvboxsync char xi2mask[EMASKSIZE][XI2MASKSIZE];
4c221b0da1816acf2ca302b10092df059484468dvboxsync};
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/**
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Central struct for device grabs.
4c221b0da1816acf2ca302b10092df059484468dvboxsync * The same struct is used for both core grabs and device grabs, with
4c221b0da1816acf2ca302b10092df059484468dvboxsync * different fields being set.
4c221b0da1816acf2ca302b10092df059484468dvboxsync * If the grab is a core grab (GrabPointer/GrabKeyboard), then the eventMask
4c221b0da1816acf2ca302b10092df059484468dvboxsync * is a combination of standard event masks (i.e. PointerMotionMask |
4c221b0da1816acf2ca302b10092df059484468dvboxsync * ButtonPressMask).
4c221b0da1816acf2ca302b10092df059484468dvboxsync * If the grab is a device grab (GrabDevice), then the eventMask is a
4c221b0da1816acf2ca302b10092df059484468dvboxsync * combination of event masks for a given XI event type (see SetEventInfo).
4c221b0da1816acf2ca302b10092df059484468dvboxsync *
4c221b0da1816acf2ca302b10092df059484468dvboxsync * If the grab is a result of a ButtonPress, then eventMask is the core mask
4c221b0da1816acf2ca302b10092df059484468dvboxsync * and deviceMask is set to the XI event mask for the grab.
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _GrabRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync GrabPtr next; /* for chain of passive grabs */
4c221b0da1816acf2ca302b10092df059484468dvboxsync XID resource;
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr device;
4c221b0da1816acf2ca302b10092df059484468dvboxsync WindowPtr window;
4c221b0da1816acf2ca302b10092df059484468dvboxsync unsigned ownerEvents:1;
4c221b0da1816acf2ca302b10092df059484468dvboxsync unsigned keyboardMode:1;
4c221b0da1816acf2ca302b10092df059484468dvboxsync unsigned pointerMode:1;
4c221b0da1816acf2ca302b10092df059484468dvboxsync GrabType grabtype;
4c221b0da1816acf2ca302b10092df059484468dvboxsync CARD8 type; /* event type */
4c221b0da1816acf2ca302b10092df059484468dvboxsync DetailRec modifiersDetail;
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr modifierDevice;
4c221b0da1816acf2ca302b10092df059484468dvboxsync DetailRec detail; /* key or button */
4c221b0da1816acf2ca302b10092df059484468dvboxsync WindowPtr confineTo; /* always NULL for keyboards */
4c221b0da1816acf2ca302b10092df059484468dvboxsync CursorPtr cursor; /* always NULL for keyboards */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Mask eventMask;
4c221b0da1816acf2ca302b10092df059484468dvboxsync Mask deviceMask;
4c221b0da1816acf2ca302b10092df059484468dvboxsync /* XI2 event masks. One per device, each bit is a mask of (1 << type) */
4c221b0da1816acf2ca302b10092df059484468dvboxsync unsigned char xi2mask[EMASKSIZE][XI2MASKSIZE];
4c221b0da1816acf2ca302b10092df059484468dvboxsync} GrabRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/**
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Sprite information for a device.
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _SpriteRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync CursorPtr current;
4c221b0da1816acf2ca302b10092df059484468dvboxsync BoxRec hotLimits; /* logical constraints of hot spot */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Bool confined; /* confined to screen */
4c221b0da1816acf2ca302b10092df059484468dvboxsync RegionPtr hotShape; /* additional logical shape constraint */
4c221b0da1816acf2ca302b10092df059484468dvboxsync BoxRec physLimits; /* physical constraints of hot spot */
4c221b0da1816acf2ca302b10092df059484468dvboxsync WindowPtr win; /* window of logical position */
4c221b0da1816acf2ca302b10092df059484468dvboxsync HotSpot hot; /* logical pointer position */
4c221b0da1816acf2ca302b10092df059484468dvboxsync HotSpot hotPhys; /* physical pointer position */
4c221b0da1816acf2ca302b10092df059484468dvboxsync#ifdef PANORAMIX
4c221b0da1816acf2ca302b10092df059484468dvboxsync ScreenPtr screen; /* all others are in Screen 0 coordinates */
4c221b0da1816acf2ca302b10092df059484468dvboxsync RegionRec Reg1; /* Region 1 for confining motion */
4c221b0da1816acf2ca302b10092df059484468dvboxsync RegionRec Reg2; /* Region 2 for confining virtual motion */
4c221b0da1816acf2ca302b10092df059484468dvboxsync WindowPtr windows[MAXSCREENS];
4c221b0da1816acf2ca302b10092df059484468dvboxsync WindowPtr confineWin; /* confine window */
4c221b0da1816acf2ca302b10092df059484468dvboxsync#endif
4c221b0da1816acf2ca302b10092df059484468dvboxsync /* The window trace information is used at dix/events.c to avoid having
4c221b0da1816acf2ca302b10092df059484468dvboxsync * to compute all the windows between the root and the current pointer
4c221b0da1816acf2ca302b10092df059484468dvboxsync * window each time a button or key goes down. The grabs on each of those
4c221b0da1816acf2ca302b10092df059484468dvboxsync * windows must be checked.
4c221b0da1816acf2ca302b10092df059484468dvboxsync * spriteTraces should only be used at dix/events.c! */
4c221b0da1816acf2ca302b10092df059484468dvboxsync WindowPtr *spriteTrace;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int spriteTraceSize;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int spriteTraceGood;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync /* Due to delays between event generation and event processing, it is
4c221b0da1816acf2ca302b10092df059484468dvboxsync * possible that the pointer has crossed screen boundaries between the
4c221b0da1816acf2ca302b10092df059484468dvboxsync * time in which it begins generating events and the time when
4c221b0da1816acf2ca302b10092df059484468dvboxsync * those events are processed.
4c221b0da1816acf2ca302b10092df059484468dvboxsync *
4c221b0da1816acf2ca302b10092df059484468dvboxsync * pEnqueueScreen: screen the pointer was on when the event was generated
4c221b0da1816acf2ca302b10092df059484468dvboxsync * pDequeueScreen: screen the pointer was on when the event is processed
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsync ScreenPtr pEnqueueScreen;
4c221b0da1816acf2ca302b10092df059484468dvboxsync ScreenPtr pDequeueScreen;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync} SpriteRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _KeyClassRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync int sourceid;
4c221b0da1816acf2ca302b10092df059484468dvboxsync CARD8 down[DOWN_LENGTH];
4c221b0da1816acf2ca302b10092df059484468dvboxsync CARD8 postdown[DOWN_LENGTH];
4c221b0da1816acf2ca302b10092df059484468dvboxsync int modifierKeyCount[8];
4c221b0da1816acf2ca302b10092df059484468dvboxsync struct _XkbSrvInfo *xkbInfo;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} KeyClassRec, *KeyClassPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _AxisInfo {
4c221b0da1816acf2ca302b10092df059484468dvboxsync int resolution;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int min_resolution;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int max_resolution;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int min_value;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int max_value;
4c221b0da1816acf2ca302b10092df059484468dvboxsync Atom label;
4c221b0da1816acf2ca302b10092df059484468dvboxsync CARD8 mode;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} AxisInfo, *AxisInfoPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _ValuatorAccelerationRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync int number;
4c221b0da1816acf2ca302b10092df059484468dvboxsync PointerAccelSchemeProc AccelSchemeProc;
4c221b0da1816acf2ca302b10092df059484468dvboxsync void *accelData; /* at disposal of AccelScheme */
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceCallbackProc AccelCleanupProc;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} ValuatorAccelerationRec, *ValuatorAccelerationPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _ValuatorClassRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync int sourceid;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int numMotionEvents;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int first_motion;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int last_motion;
4c221b0da1816acf2ca302b10092df059484468dvboxsync void *motion; /* motion history buffer. Different layout
4c221b0da1816acf2ca302b10092df059484468dvboxsync for MDs and SDs!*/
4c221b0da1816acf2ca302b10092df059484468dvboxsync WindowPtr motionHintWindow;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync AxisInfoPtr axes;
4c221b0da1816acf2ca302b10092df059484468dvboxsync unsigned short numAxes;
4c221b0da1816acf2ca302b10092df059484468dvboxsync double *axisVal; /* always absolute, but device-coord system */
4c221b0da1816acf2ca302b10092df059484468dvboxsync ValuatorAccelerationRec accelScheme;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} ValuatorClassRec, *ValuatorClassPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _ButtonClassRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync int sourceid;
4c221b0da1816acf2ca302b10092df059484468dvboxsync CARD8 numButtons;
4c221b0da1816acf2ca302b10092df059484468dvboxsync CARD8 buttonsDown; /* number of buttons currently down
4c221b0da1816acf2ca302b10092df059484468dvboxsync This counts logical buttons, not
4c221b0da1816acf2ca302b10092df059484468dvboxsync physical ones, i.e if some buttons
4c221b0da1816acf2ca302b10092df059484468dvboxsync are mapped to 0, they're not counted
4c221b0da1816acf2ca302b10092df059484468dvboxsync here */
4c221b0da1816acf2ca302b10092df059484468dvboxsync unsigned short state;
4c221b0da1816acf2ca302b10092df059484468dvboxsync Mask motionMask;
4c221b0da1816acf2ca302b10092df059484468dvboxsync CARD8 down[DOWN_LENGTH];
4c221b0da1816acf2ca302b10092df059484468dvboxsync CARD8 postdown[DOWN_LENGTH];
4c221b0da1816acf2ca302b10092df059484468dvboxsync CARD8 map[MAP_LENGTH];
4c221b0da1816acf2ca302b10092df059484468dvboxsync union _XkbAction *xkb_acts;
4c221b0da1816acf2ca302b10092df059484468dvboxsync Atom labels[MAX_BUTTONS];
4c221b0da1816acf2ca302b10092df059484468dvboxsync} ButtonClassRec, *ButtonClassPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _FocusClassRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync int sourceid;
4c221b0da1816acf2ca302b10092df059484468dvboxsync WindowPtr win; /* May be set to a int constant (e.g. PointerRootWin)! */
4c221b0da1816acf2ca302b10092df059484468dvboxsync int revert;
4c221b0da1816acf2ca302b10092df059484468dvboxsync TimeStamp time;
4c221b0da1816acf2ca302b10092df059484468dvboxsync WindowPtr *trace;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int traceSize;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int traceGood;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} FocusClassRec, *FocusClassPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _ProximityClassRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync int sourceid;
4c221b0da1816acf2ca302b10092df059484468dvboxsync char in_proximity;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} ProximityClassRec, *ProximityClassPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _AbsoluteClassRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync int sourceid;
4c221b0da1816acf2ca302b10092df059484468dvboxsync /* Calibration. */
4c221b0da1816acf2ca302b10092df059484468dvboxsync int min_x;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int max_x;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int min_y;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int max_y;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int flip_x;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int flip_y;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int rotation;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int button_threshold;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync /* Area. */
4c221b0da1816acf2ca302b10092df059484468dvboxsync int offset_x;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int offset_y;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int width;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int height;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int screen;
4c221b0da1816acf2ca302b10092df059484468dvboxsync XID following;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} AbsoluteClassRec, *AbsoluteClassPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _KbdFeedbackClassRec *KbdFeedbackPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _PtrFeedbackClassRec *PtrFeedbackPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _IntegerFeedbackClassRec *IntegerFeedbackPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _StringFeedbackClassRec *StringFeedbackPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _BellFeedbackClassRec *BellFeedbackPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _LedFeedbackClassRec *LedFeedbackPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _KbdFeedbackClassRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync BellProcPtr BellProc;
4c221b0da1816acf2ca302b10092df059484468dvboxsync KbdCtrlProcPtr CtrlProc;
4c221b0da1816acf2ca302b10092df059484468dvboxsync KeybdCtrl ctrl;
4c221b0da1816acf2ca302b10092df059484468dvboxsync KbdFeedbackPtr next;
4c221b0da1816acf2ca302b10092df059484468dvboxsync struct _XkbSrvLedInfo *xkb_sli;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} KbdFeedbackClassRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _PtrFeedbackClassRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync PtrCtrlProcPtr CtrlProc;
4c221b0da1816acf2ca302b10092df059484468dvboxsync PtrCtrl ctrl;
4c221b0da1816acf2ca302b10092df059484468dvboxsync PtrFeedbackPtr next;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} PtrFeedbackClassRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _IntegerFeedbackClassRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync IntegerCtrlProcPtr CtrlProc;
4c221b0da1816acf2ca302b10092df059484468dvboxsync IntegerCtrl ctrl;
4c221b0da1816acf2ca302b10092df059484468dvboxsync IntegerFeedbackPtr next;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} IntegerFeedbackClassRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _StringFeedbackClassRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync StringCtrlProcPtr CtrlProc;
4c221b0da1816acf2ca302b10092df059484468dvboxsync StringCtrl ctrl;
4c221b0da1816acf2ca302b10092df059484468dvboxsync StringFeedbackPtr next;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} StringFeedbackClassRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _BellFeedbackClassRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync BellProcPtr BellProc;
4c221b0da1816acf2ca302b10092df059484468dvboxsync BellCtrlProcPtr CtrlProc;
4c221b0da1816acf2ca302b10092df059484468dvboxsync BellCtrl ctrl;
4c221b0da1816acf2ca302b10092df059484468dvboxsync BellFeedbackPtr next;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} BellFeedbackClassRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _LedFeedbackClassRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync LedCtrlProcPtr CtrlProc;
4c221b0da1816acf2ca302b10092df059484468dvboxsync LedCtrl ctrl;
4c221b0da1816acf2ca302b10092df059484468dvboxsync LedFeedbackPtr next;
4c221b0da1816acf2ca302b10092df059484468dvboxsync struct _XkbSrvLedInfo *xkb_sli;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} LedFeedbackClassRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _ClassesRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync KeyClassPtr key;
4c221b0da1816acf2ca302b10092df059484468dvboxsync ValuatorClassPtr valuator;
4c221b0da1816acf2ca302b10092df059484468dvboxsync ButtonClassPtr button;
4c221b0da1816acf2ca302b10092df059484468dvboxsync FocusClassPtr focus;
4c221b0da1816acf2ca302b10092df059484468dvboxsync ProximityClassPtr proximity;
4c221b0da1816acf2ca302b10092df059484468dvboxsync AbsoluteClassPtr absolute;
4c221b0da1816acf2ca302b10092df059484468dvboxsync KbdFeedbackPtr kbdfeed;
4c221b0da1816acf2ca302b10092df059484468dvboxsync PtrFeedbackPtr ptrfeed;
4c221b0da1816acf2ca302b10092df059484468dvboxsync IntegerFeedbackPtr intfeed;
4c221b0da1816acf2ca302b10092df059484468dvboxsync StringFeedbackPtr stringfeed;
4c221b0da1816acf2ca302b10092df059484468dvboxsync BellFeedbackPtr bell;
4c221b0da1816acf2ca302b10092df059484468dvboxsync LedFeedbackPtr leds;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} ClassesRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/* Device properties */
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _XIPropertyValue
4c221b0da1816acf2ca302b10092df059484468dvboxsync{
4c221b0da1816acf2ca302b10092df059484468dvboxsync Atom type; /* ignored by server */
4c221b0da1816acf2ca302b10092df059484468dvboxsync short format; /* format of data for swapping - 8,16,32 */
4c221b0da1816acf2ca302b10092df059484468dvboxsync long size; /* size of data in (format/8) bytes */
4c221b0da1816acf2ca302b10092df059484468dvboxsync pointer data; /* private to client */
4c221b0da1816acf2ca302b10092df059484468dvboxsync} XIPropertyValueRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _XIProperty
4c221b0da1816acf2ca302b10092df059484468dvboxsync{
4c221b0da1816acf2ca302b10092df059484468dvboxsync struct _XIProperty *next;
4c221b0da1816acf2ca302b10092df059484468dvboxsync Atom propertyName;
4c221b0da1816acf2ca302b10092df059484468dvboxsync BOOL deletable; /* clients can delete this prop? */
4c221b0da1816acf2ca302b10092df059484468dvboxsync XIPropertyValueRec value;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} XIPropertyRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef XIPropertyRec *XIPropertyPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef XIPropertyValueRec *XIPropertyValuePtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _XIPropertyHandler
4c221b0da1816acf2ca302b10092df059484468dvboxsync{
4c221b0da1816acf2ca302b10092df059484468dvboxsync struct _XIPropertyHandler* next;
4c221b0da1816acf2ca302b10092df059484468dvboxsync long id;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int (*SetProperty) (DeviceIntPtr dev,
4c221b0da1816acf2ca302b10092df059484468dvboxsync Atom property,
4c221b0da1816acf2ca302b10092df059484468dvboxsync XIPropertyValuePtr prop,
4c221b0da1816acf2ca302b10092df059484468dvboxsync BOOL checkonly);
4c221b0da1816acf2ca302b10092df059484468dvboxsync int (*GetProperty) (DeviceIntPtr dev,
4c221b0da1816acf2ca302b10092df059484468dvboxsync Atom property);
4c221b0da1816acf2ca302b10092df059484468dvboxsync int (*DeleteProperty) (DeviceIntPtr dev,
4c221b0da1816acf2ca302b10092df059484468dvboxsync Atom property);
4c221b0da1816acf2ca302b10092df059484468dvboxsync} XIPropertyHandler, *XIPropertyHandlerPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/* states for devices */
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define NOT_GRABBED 0
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define THAWED 1
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define THAWED_BOTH 2 /* not a real state */
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define FREEZE_NEXT_EVENT 3
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define FREEZE_BOTH_NEXT_EVENT 4
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define FROZEN 5 /* any state >= has device frozen */
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define FROZEN_NO_EVENT 5
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define FROZEN_WITH_EVENT 6
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define THAW_OTHERS 7
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _GrabInfoRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync TimeStamp grabTime;
4c221b0da1816acf2ca302b10092df059484468dvboxsync Bool fromPassiveGrab; /* true if from passive grab */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Bool implicitGrab; /* implicit from ButtonPress */
4c221b0da1816acf2ca302b10092df059484468dvboxsync GrabRec activeGrab;
4c221b0da1816acf2ca302b10092df059484468dvboxsync GrabPtr grab;
4c221b0da1816acf2ca302b10092df059484468dvboxsync CARD8 activatingKey;
4c221b0da1816acf2ca302b10092df059484468dvboxsync void (*ActivateGrab) (
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr /*device*/,
4c221b0da1816acf2ca302b10092df059484468dvboxsync GrabPtr /*grab*/,
4c221b0da1816acf2ca302b10092df059484468dvboxsync TimeStamp /*time*/,
4c221b0da1816acf2ca302b10092df059484468dvboxsync Bool /*autoGrab*/);
4c221b0da1816acf2ca302b10092df059484468dvboxsync void (*DeactivateGrab)(
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr /*device*/);
4c221b0da1816acf2ca302b10092df059484468dvboxsync struct {
4c221b0da1816acf2ca302b10092df059484468dvboxsync Bool frozen;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int state;
4c221b0da1816acf2ca302b10092df059484468dvboxsync GrabPtr other; /* if other grab has this frozen */
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceEvent *event; /* saved to be replayed */
4c221b0da1816acf2ca302b10092df059484468dvboxsync } sync;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} GrabInfoRec, *GrabInfoPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _SpriteInfoRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync /* sprite must always point to a valid sprite. For devices sharing the
4c221b0da1816acf2ca302b10092df059484468dvboxsync * sprite, let sprite point to a paired spriteOwner's sprite. */
4c221b0da1816acf2ca302b10092df059484468dvboxsync SpritePtr sprite; /* sprite information */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Bool spriteOwner; /* True if device owns the sprite */
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr paired; /* The paired device. Keyboard if
4c221b0da1816acf2ca302b10092df059484468dvboxsync spriteOwner is TRUE, otherwise the
4c221b0da1816acf2ca302b10092df059484468dvboxsync pointer that owns the sprite. */
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync /* keep states for animated cursor */
4c221b0da1816acf2ca302b10092df059484468dvboxsync struct {
4c221b0da1816acf2ca302b10092df059484468dvboxsync CursorPtr pCursor;
4c221b0da1816acf2ca302b10092df059484468dvboxsync ScreenPtr pScreen;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int elt;
4c221b0da1816acf2ca302b10092df059484468dvboxsync CARD32 time;
4c221b0da1816acf2ca302b10092df059484468dvboxsync } anim;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} SpriteInfoRec, *SpriteInfoPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/* device types */
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define MASTER_POINTER 1
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define MASTER_KEYBOARD 2
4c221b0da1816acf2ca302b10092df059484468dvboxsync#define SLAVE 3
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _DeviceIntRec {
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceRec public;
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr next;
4c221b0da1816acf2ca302b10092df059484468dvboxsync Bool startup; /* true if needs to be turned on at
4c221b0da1816acf2ca302b10092df059484468dvboxsync server intialization time */
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceProc deviceProc; /* proc(DevicePtr, DEVICE_xx). It is
4c221b0da1816acf2ca302b10092df059484468dvboxsync used to initialize, turn on, or
4c221b0da1816acf2ca302b10092df059484468dvboxsync turn off the device */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Bool inited; /* TRUE if INIT returns Success */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Bool enabled; /* TRUE if ON returns Success */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Bool coreEvents; /* TRUE if device also sends core */
4c221b0da1816acf2ca302b10092df059484468dvboxsync GrabInfoRec deviceGrab; /* grab on the device */
4c221b0da1816acf2ca302b10092df059484468dvboxsync int type; /* MASTER_POINTER, MASTER_KEYBOARD, SLAVE */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Atom xinput_type;
4c221b0da1816acf2ca302b10092df059484468dvboxsync char *name;
4c221b0da1816acf2ca302b10092df059484468dvboxsync int id;
4c221b0da1816acf2ca302b10092df059484468dvboxsync KeyClassPtr key;
4c221b0da1816acf2ca302b10092df059484468dvboxsync ValuatorClassPtr valuator;
4c221b0da1816acf2ca302b10092df059484468dvboxsync ButtonClassPtr button;
4c221b0da1816acf2ca302b10092df059484468dvboxsync FocusClassPtr focus;
4c221b0da1816acf2ca302b10092df059484468dvboxsync ProximityClassPtr proximity;
4c221b0da1816acf2ca302b10092df059484468dvboxsync AbsoluteClassPtr absolute;
4c221b0da1816acf2ca302b10092df059484468dvboxsync KbdFeedbackPtr kbdfeed;
4c221b0da1816acf2ca302b10092df059484468dvboxsync PtrFeedbackPtr ptrfeed;
4c221b0da1816acf2ca302b10092df059484468dvboxsync IntegerFeedbackPtr intfeed;
4c221b0da1816acf2ca302b10092df059484468dvboxsync StringFeedbackPtr stringfeed;
4c221b0da1816acf2ca302b10092df059484468dvboxsync BellFeedbackPtr bell;
4c221b0da1816acf2ca302b10092df059484468dvboxsync LedFeedbackPtr leds;
4c221b0da1816acf2ca302b10092df059484468dvboxsync struct _XkbInterest *xkb_interest;
4c221b0da1816acf2ca302b10092df059484468dvboxsync char *config_info; /* used by the hotplug layer */
4c221b0da1816acf2ca302b10092df059484468dvboxsync ClassesPtr unused_classes; /* for master devices */
4c221b0da1816acf2ca302b10092df059484468dvboxsync int saved_master_id; /* for slaves while grabbed */
4c221b0da1816acf2ca302b10092df059484468dvboxsync PrivateRec *devPrivates;
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceUnwrapProc unwrapProc;
4c221b0da1816acf2ca302b10092df059484468dvboxsync SpriteInfoPtr spriteInfo;
4c221b0da1816acf2ca302b10092df059484468dvboxsync union {
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr master; /* master device */
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr lastSlave; /* last slave device used */
4c221b0da1816acf2ca302b10092df059484468dvboxsync } u;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync /* last valuator values recorded, not posted to client;
4c221b0da1816acf2ca302b10092df059484468dvboxsync * for slave devices, valuators is in device coordinates
4c221b0da1816acf2ca302b10092df059484468dvboxsync * for master devices, valuators is in screen coordinates
4c221b0da1816acf2ca302b10092df059484468dvboxsync * see dix/getevents.c
4c221b0da1816acf2ca302b10092df059484468dvboxsync * remainder supports acceleration
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsync struct {
4c221b0da1816acf2ca302b10092df059484468dvboxsync int valuators[MAX_VALUATORS];
4c221b0da1816acf2ca302b10092df059484468dvboxsync float remainder[MAX_VALUATORS];
4c221b0da1816acf2ca302b10092df059484468dvboxsync int numValuators;
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr slave;
4c221b0da1816acf2ca302b10092df059484468dvboxsync } last;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync /* Input device property handling. */
4c221b0da1816acf2ca302b10092df059484468dvboxsync struct {
4c221b0da1816acf2ca302b10092df059484468dvboxsync XIPropertyPtr properties;
4c221b0da1816acf2ca302b10092df059484468dvboxsync XIPropertyHandlerPtr handlers; /* NULL-terminated */
4c221b0da1816acf2ca302b10092df059484468dvboxsync } properties;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync /* coordinate transformation matrix for absolute input devices */
4c221b0da1816acf2ca302b10092df059484468dvboxsync struct pixman_f_transform transform;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync /* XTest related master device id */
4c221b0da1816acf2ca302b10092df059484468dvboxsync int xtest_master_id;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} DeviceIntRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct {
4c221b0da1816acf2ca302b10092df059484468dvboxsync int numDevices; /* total number of devices */
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr devices; /* all devices turned on */
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr off_devices; /* all devices turned off */
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr keyboard; /* the main one for the server */
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr pointer;
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr all_devices;
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr all_master_devices;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} InputInfo;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsyncextern _X_EXPORT InputInfo inputInfo;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/* for keeping the events for devices grabbed synchronously */
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _QdEvent *QdEventPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _QdEvent {
4c221b0da1816acf2ca302b10092df059484468dvboxsync QdEventPtr next;
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr device;
4c221b0da1816acf2ca302b10092df059484468dvboxsync ScreenPtr pScreen; /* what screen the pointer was on */
4c221b0da1816acf2ca302b10092df059484468dvboxsync unsigned long months; /* milliseconds is in the event */
4c221b0da1816acf2ca302b10092df059484468dvboxsync InternalEvent *event;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} QdEventRec;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync/**
4c221b0da1816acf2ca302b10092df059484468dvboxsync * syncEvents is the global structure for queued events.
4c221b0da1816acf2ca302b10092df059484468dvboxsync *
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Devices can be frozen through GrabModeSync pointer grabs. If this is the
4c221b0da1816acf2ca302b10092df059484468dvboxsync * case, events from these devices are added to "pending" instead of being
4c221b0da1816acf2ca302b10092df059484468dvboxsync * processed normally. When the device is unfrozen, events in "pending" are
4c221b0da1816acf2ca302b10092df059484468dvboxsync * replayed and processed as if they would come from the device directly.
4c221b0da1816acf2ca302b10092df059484468dvboxsync */
4c221b0da1816acf2ca302b10092df059484468dvboxsynctypedef struct _EventSyncInfo {
4c221b0da1816acf2ca302b10092df059484468dvboxsync QdEventPtr pending, /**< list of queued events */
4c221b0da1816acf2ca302b10092df059484468dvboxsync *pendtail; /**< last event in list */
4c221b0da1816acf2ca302b10092df059484468dvboxsync /** The device to replay events for. Only set in AllowEvents(), in which
4c221b0da1816acf2ca302b10092df059484468dvboxsync * case it is set to the device specified in the request. */
4c221b0da1816acf2ca302b10092df059484468dvboxsync DeviceIntPtr replayDev; /* kludgy rock to put flag for */
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync /**
4c221b0da1816acf2ca302b10092df059484468dvboxsync * The window the events are supposed to be replayed on.
4c221b0da1816acf2ca302b10092df059484468dvboxsync * This window may be set to the grab's window (but only when
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Replay{Pointer|Keyboard} is given in the XAllowEvents()
4c221b0da1816acf2ca302b10092df059484468dvboxsync * request. */
4c221b0da1816acf2ca302b10092df059484468dvboxsync WindowPtr replayWin; /* ComputeFreezes */
4c221b0da1816acf2ca302b10092df059484468dvboxsync /**
4c221b0da1816acf2ca302b10092df059484468dvboxsync * Flag to indicate whether we're in the process of
4c221b0da1816acf2ca302b10092df059484468dvboxsync * replaying events. Only set in ComputeFreezes(). */
4c221b0da1816acf2ca302b10092df059484468dvboxsync Bool playingEvents;
4c221b0da1816acf2ca302b10092df059484468dvboxsync TimeStamp time;
4c221b0da1816acf2ca302b10092df059484468dvboxsync} EventSyncInfoRec, *EventSyncInfoPtr;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsyncextern EventSyncInfoRec syncEvents;
4c221b0da1816acf2ca302b10092df059484468dvboxsync
4c221b0da1816acf2ca302b10092df059484468dvboxsync#endif /* INPUTSTRUCT_H */