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#ifndef INPUT_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define INPUT_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "misc.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "screenint.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <X11/Xmd.h>
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <X11/Xproto.h>
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "window.h" /* for WindowPtr */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define DEVICE_INIT 0
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define DEVICE_ON 1
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define DEVICE_OFF 2
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define DEVICE_CLOSE 3
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define POINTER_RELATIVE (1 << 1)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define POINTER_ABSOLUTE (1 << 2)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define POINTER_ACCELERATE (1 << 3)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define MAP_LENGTH 256
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define DOWN_LENGTH 32 /* 256/8 => number of bytes to hold 256 bits */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define NullGrab ((GrabPtr)NULL)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define PointerRootWin ((WindowPtr)PointerRoot)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define NoneWin ((WindowPtr)None)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define NullDevice ((DevicePtr)NULL)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef FollowKeyboard
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FollowKeyboard 3
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef FollowKeyboardWin
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FollowKeyboardWin ((WindowPtr) FollowKeyboard)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef RevertToFollowKeyboard
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define RevertToFollowKeyboard 3
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef unsigned long Leds;
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _OtherClients *OtherClientsPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _InputClients *InputClientsPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _DeviceIntRec *DeviceIntPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef int (*DeviceProc)(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*what*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*ProcessInputProc)(
45e9809aff7304721fddb95654901b32195c9c7avboxsync xEventPtr /*events*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*count*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef Bool (*DeviceHandleProc)(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync void* /*data*/
45e9809aff7304721fddb95654901b32195c9c7avboxsync );
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*DeviceUnwrapProc)(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceHandleProc /*proc*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync void* /*data*/
45e9809aff7304721fddb95654901b32195c9c7avboxsync );
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _DeviceRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync pointer devicePrivate;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ProcessInputProc processInputProc; /* current */
45e9809aff7304721fddb95654901b32195c9c7avboxsync ProcessInputProc realInputProc; /* deliver */
45e9809aff7304721fddb95654901b32195c9c7avboxsync ProcessInputProc enqueueInputProc; /* enqueue */
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool on; /* used by DDX to keep state */
45e9809aff7304721fddb95654901b32195c9c7avboxsync} DeviceRec, *DevicePtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int click, bell, bell_pitch, bell_duration;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool autoRepeat;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned char autoRepeats[32];
45e9809aff7304721fddb95654901b32195c9c7avboxsync Leds leds;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned char id;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} KeybdCtrl;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeySym *map;
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeyCode minKeyCode,
45e9809aff7304721fddb95654901b32195c9c7avboxsync maxKeyCode;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int mapWidth;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} KeySymsRec, *KeySymsPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int num, den, threshold;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned char id;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} PtrCtrl;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int resolution, min_value, max_value;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int integer_displayed;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned char id;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} IntegerCtrl;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int max_symbols, num_symbols_supported;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int num_symbols_displayed;
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeySym *symbols_supported;
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeySym *symbols_displayed;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned char id;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} StringCtrl;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int percent, pitch, duration;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned char id;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} BellCtrl;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync Leds led_values;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Mask led_mask;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned char id;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} LedCtrl;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int AllocateDevicePrivateIndex(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool AllocateDevicePrivate(DeviceIntPtr device, int index);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void ResetDevicePrivateIndex(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern KeybdCtrl defaultKeyboardControl;
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern PtrCtrl defaultPointerControl;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _InputOption {
45e9809aff7304721fddb95654901b32195c9c7avboxsync char *key;
45e9809aff7304721fddb95654901b32195c9c7avboxsync char *value;
45e9809aff7304721fddb95654901b32195c9c7avboxsync struct _InputOption *next;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} InputOption;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void InitCoreDevices(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern DeviceIntPtr AddInputDevice(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceProc /*deviceProc*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool /*autoStart*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool EnableDevice(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool ActivateDevice(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool DisableDevice(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int InitAndStartDevices(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void CloseDownDevices(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int RemoveDevice(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*dev*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int NumMotionEvents(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void RegisterPointerDevice(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void RegisterKeyboardDevice(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern DevicePtr LookupKeyboardDevice(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern DevicePtr LookupPointerDevice(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern DevicePtr LookupDevice(
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /* id */);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void QueryMinMaxKeyCodes(
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeyCode* /*minCode*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeyCode* /*maxCode*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool SetKeySymsMap(
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeySymsPtr /*dst*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeySymsPtr /*src*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool InitKeyClassDeviceStruct(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeySymsPtr /*pKeySyms*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 /*pModifiers*/[]);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool InitButtonClassDeviceStruct(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*numButtons*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8* /*map*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef int (*ValuatorMotionProcPtr)(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*pdevice*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xTimecoord * /*coords*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long /*start*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long /*stop*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ScreenPtr /*pScreen*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool InitValuatorClassDeviceStruct(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*numAxes*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ValuatorMotionProcPtr /* motionProc */,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*numMotionEvents*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*mode*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool InitAbsoluteClassDeviceStruct(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool InitFocusClassDeviceStruct(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*BellProcPtr)(
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*percent*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync pointer /*ctrl*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*KbdCtrlProcPtr)(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeybdCtrl * /*ctrl*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool InitKbdFeedbackClassDeviceStruct(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync BellProcPtr /*bellProc*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync KbdCtrlProcPtr /*controlProc*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*PtrCtrlProcPtr)(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PtrCtrl * /*ctrl*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool InitPtrFeedbackClassDeviceStruct(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PtrCtrlProcPtr /*controlProc*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*StringCtrlProcPtr)(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync StringCtrl * /*ctrl*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool InitStringFeedbackClassDeviceStruct(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync StringCtrlProcPtr /*controlProc*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*max_symbols*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*num_symbols_supported*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeySym* /*symbols*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*BellCtrlProcPtr)(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync BellCtrl * /*ctrl*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool InitBellFeedbackClassDeviceStruct(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync BellProcPtr /*bellProc*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync BellCtrlProcPtr /*controlProc*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*LedCtrlProcPtr)(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync LedCtrl * /*ctrl*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool InitLedFeedbackClassDeviceStruct(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync LedCtrlProcPtr /*controlProc*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*IntegerCtrlProcPtr)(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync IntegerCtrl * /*ctrl*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool InitIntegerFeedbackClassDeviceStruct(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync IntegerCtrlProcPtr /*controlProc*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool InitPointerDeviceStruct(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DevicePtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8* /*map*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*numButtons*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ValuatorMotionProcPtr /*motionProc*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync PtrCtrlProcPtr /*controlProc*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*numMotionEvents*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*numAxes*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool InitKeyboardDeviceStruct(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DevicePtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync KeySymsPtr /*pKeySyms*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 /*pModifiers*/[],
45e9809aff7304721fddb95654901b32195c9c7avboxsync BellProcPtr /*bellProc*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync KbdCtrlProcPtr /*controlProc*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void SendMappingNotify(
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int /*request*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int /*firstKeyCode*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int /*count*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientPtr /* client */);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool BadDeviceMap(
45e9809aff7304721fddb95654901b32195c9c7avboxsync BYTE* /*buff*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*length*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned /*low*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned /*high*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync XID* /*errval*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool AllModifierKeysAreUp(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8* /*map1*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*per1*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8* /*map2*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*per2*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void NoteLedState(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*keybd*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*led*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool /*on*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void MaybeStopHint(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*device*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ClientPtr /*client*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void ProcessPointerEvent(
45e9809aff7304721fddb95654901b32195c9c7avboxsync xEventPtr /*xE*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*mouse*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*count*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void ProcessKeyboardEvent(
45e9809aff7304721fddb95654901b32195c9c7avboxsync xEventPtr /*xE*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*keybd*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*count*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef XKB
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void CoreProcessPointerEvent(
45e9809aff7304721fddb95654901b32195c9c7avboxsync xEventPtr /*xE*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*mouse*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*count*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void CoreProcessKeyboardEvent(
45e9809aff7304721fddb95654901b32195c9c7avboxsync xEventPtr /*xE*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*keybd*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*count*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern Bool LegalModifier(
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int /*key*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr /*pDev*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void ProcessInputEvents(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void InitInput(
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*argc*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync char ** /*argv*/);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int GetMaximumEventsNum(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int GetPointerEvents(
45e9809aff7304721fddb95654901b32195c9c7avboxsync xEvent *events,
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr pDev,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int type,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int buttons,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int flags,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int first_valuator,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int num_valuators,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int *valuators);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int GetKeyboardEvents(
45e9809aff7304721fddb95654901b32195c9c7avboxsync xEvent *events,
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr pDev,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int type,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int key_code);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int GetKeyboardValuatorEvents(
45e9809aff7304721fddb95654901b32195c9c7avboxsync xEvent *events,
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr pDev,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int type,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int key_code,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int first_valuator,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int num_valuator,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int *valuators);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int GetProximityEvents(
45e9809aff7304721fddb95654901b32195c9c7avboxsync xEvent *events,
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr pDev,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int type,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int first_valuator,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int num_valuators,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int *valuators);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void PostSyntheticMotion(
45e9809aff7304721fddb95654901b32195c9c7avboxsync int x,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int y,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int screen,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long time);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int GetMotionHistorySize(
45e9809aff7304721fddb95654901b32195c9c7avboxsync void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void AllocateMotionHistory(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr pDev);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int GetMotionHistory(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr pDev,
45e9809aff7304721fddb95654901b32195c9c7avboxsync xTimecoord *buff,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long start,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long stop,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ScreenPtr pScreen);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void SwitchCoreKeyboard(DeviceIntPtr pDev);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void SwitchCorePointer(DeviceIntPtr pDev);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern DeviceIntPtr LookupDeviceIntRec(
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 deviceid);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Implemented by the DDX. */
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int NewInputDeviceRequest(
45e9809aff7304721fddb95654901b32195c9c7avboxsync InputOption *options,
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr *dev);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void DeleteInputDeviceRequest(
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr dev);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void DDXRingBell(
45e9809aff7304721fddb95654901b32195c9c7avboxsync int volume,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int pitch,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int duration);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* INPUT_H */