deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* $XFree86$ */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Copyright 2002 Red Hat Inc., Durham, North Carolina.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * All Rights Reserved.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Permission is hereby granted, free of charge, to any person obtaining
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * a copy of this software and associated documentation files (the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * "Software"), to deal in the Software without restriction, including
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * without limitation on the rights to use, copy, modify, merge,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * publish, distribute, sublicense, and/or sell copies of the Software,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * and to permit persons to whom the Software is furnished to do so,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * subject to the following conditions:
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * The above copyright notice and this permission notice (including the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * next paragraph) shall be included in all copies or substantial
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * portions of the Software.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * SOFTWARE.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Rickard E. (Rik) Faith <faith@redhat.com>
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Interface for low-level input support. \see dmxinputinit.c */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DMX_MAP_ENTRIES 16 /* Must be a power of 2 */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef enum {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef enum {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef enum {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef enum {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/** Stores information from low-level device that is used to initialize
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * the device at the dix level. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int keyboard; /**< Non-zero if the device is a keyboard */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync XkbComponentNamesRec names; /**< XKB component names */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int freenames; /**< Non-zero if names should be free'd */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int force; /**< Do not allow command line override */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int buttonClass; /**< Non-zero if buttons are present */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned char map[DMX_MAX_BUTTONS]; /**< Button map */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * present */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int minres[DMX_MAX_AXES]; /**< Minimum resolutions */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int maxres[DMX_MAX_AXES]; /**< Maximum resolutions */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * cause focus */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * causes proximity events */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * keyboard feedback */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * pointer feedback */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * LED indicators */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int belFeedbackClass; /**< Non-zero if device has a
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * integer feedback */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * string feedback */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int maxSymbolsSupported; /**< Maximum symbols supported */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef pointer (*dmxCreatePrivateProcPtr)(DeviceIntPtr);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*dmxGetInfoProcPtr)(DevicePtr, DMXLocalInitInfoPtr);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*dmxUpdatePositionProcPtr)(pointer, int x, int y);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*dmxVTPreSwitchProcPtr)(pointer); /* Turn I/O Off */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*dmxVTPostSwitchProcPtr)(pointer); /* Turn I/O On */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*dmxEnqueueProcPtr)(DevicePtr, int type, int detail,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef int (*dmxCheckSpecialProcPtr)(DevicePtr, KeySym keySym);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*dmxUpdateInfoProcPtr)(pointer, DMXUpdateType, WindowPtr);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef int (*dmxFunctionsProcPtr)(pointer, DMXFunctionType);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*dmxKBCtrlProcPtr)(DevicePtr, KeybdCtrl *ctrl);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*dmxMCtrlProcPtr)(DevicePtr, PtrCtrl *ctrl);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef void (*dmxKBBellProcPtr)(DevicePtr, int percent,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/** Stores a mapping between the device id on the remote X server and
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * the id on the DMX server */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int remote; /**< Event number on remote X server */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int server; /**< Event number (unbiased) on DMX server */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/** This is the device-independent structure used by the low-level input
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * routines. The contents are not exposed to top-level .c files (except
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * dmxextensions.c). \see dmxinput.h \see dmxextensions.c */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DMXLocalInputExtType extType; /**< Extended device type */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * structs are bound to the same
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * device */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync /* Low-level (e.g., keyboard/mouse drivers) */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync dmxCreatePrivateProcPtr create_private; /**< Create
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * device-dependent
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * private */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync dmxDestroyPrivateProcPtr destroy_private; /**< Destroy
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * device-dependent
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * private */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * (during a
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * reconfiguration) */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync dmxLateReInitProcPtr latereinit; /**< Reinitialize a device
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * (called very late
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * reconfiguration) */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync dmxGetInfoProcPtr get_info; /**< Get device information */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync dmxUpdatePositionProcPtr update_position; /**< Called when another
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * device updates the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * cursor position */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync dmxVTPreSwitchProcPtr vt_pre_switch; /**< Called before a VT switch */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync dmxVTPostSwitchProcPtr vt_post_switch; /**< Called after a VT switch */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync dmxVTSwitchProcPtr vt_switch; /**< Causes a VT switch */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync dmxCollectEventsProcPtr collect_events; /**< Collect and enqueue
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * events from the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync dmxProcessInputProcPtr process_input; /**< Process event (from
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * queue) */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync dmxUpdateInfoProcPtr update_info; /**< Update window layout
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * information */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * for XInput in
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned long *history; /**< XInput motion history */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync /* for XInput ChangePointerDevice */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned long,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned long,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DMXEventMap map[DMX_MAP_ENTRIES]; /**< XInput device id map */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * optimization */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * if any */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * side, if any */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern DMXLocalInputInfoPtr dmxLocalCorePointer, dmxLocalCoreKeyboard;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxLocalInitInput(DMXInputInfo *dmxInput);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern DMXLocalInputInfoPtr dmxInputCopyLocal(DMXInputInfo *dmxInput,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxChangePointerControl(DeviceIntPtr pDevice, PtrCtrl *ctrl);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxKeyboardKbdCtrlProc(DeviceIntPtr pDevice, KeybdCtrl *ctrl);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int dmxInputExtensionErrorHandler(Display *dsp, char *name,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void dmxInputDetachAll(DMXScreenInfo *dmxScreen);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int dmxInputAttachConsole(const char *name, int isCore,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int dmxInputAttachBackend(int physicalScreen, int isCore,