b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* $XFree86$ */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Copyright 2002 Red Hat Inc., Durham, North Carolina.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * All Rights Reserved.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Permission is hereby granted, free of charge, to any person obtaining
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * a copy of this software and associated documentation files (the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * "Software"), to deal in the Software without restriction, including
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * without limitation on the rights to use, copy, modify, merge,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * publish, distribute, sublicense, and/or sell copies of the Software,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * and to permit persons to whom the Software is furnished to do so,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * subject to the following conditions:
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * The above copyright notice and this permission notice (including the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * next paragraph) shall be included in all copies or substantial
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * portions of the Software.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * SOFTWARE.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Authors:
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Rickard E. (Rik) Faith <faith@redhat.com>
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/** \file
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Interface for low-level input support. \see dmxinputinit.c */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#ifndef _DMXINPUTINIT_H_
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define _DMXINPUTINIT_H_
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#include "dmx.h"
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#include "dmxinput.h"
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#include "dmxlog.h"
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DMX_LOCAL_DEFAULT_KEYBOARD "kbd"
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DMX_LOCAL_DEFAULT_POINTER "ps2"
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DMX_MAX_BUTTONS 256
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DMX_MOTION_SIZE 256
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DMX_MAX_VALUATORS 32
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DMX_MAX_AXES 32
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DMX_MAX_XINPUT_EVENT_TYPES 100
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DMX_MAP_ENTRIES 16 /* Must be a power of 2 */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DMX_MAP_MASK (DMX_MAP_ENTRIES - 1)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef enum {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_FUNCTION_GRAB,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_FUNCTION_TERMINATE,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_FUNCTION_FINE
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} DMXFunctionType;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef enum {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_LOCAL_HIGHLEVEL,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_LOCAL_KEYBOARD,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_LOCAL_MOUSE,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_LOCAL_OTHER
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} DMXLocalInputType;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef enum {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_LOCAL_TYPE_LOCAL,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_LOCAL_TYPE_CONSOLE,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_LOCAL_TYPE_BACKEND,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_LOCAL_TYPE_COMMON
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} DMXLocalInputExtType;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef enum {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_RELATIVE,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_ABSOLUTE,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMX_ABSOLUTE_CONFINED
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} DMXMotionType;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/** Stores information from low-level device that is used to initialize
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * the device at the dix level. */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _DMXLocalInitInfo {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int keyboard; /**< Non-zero if the device is a keyboard */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int keyClass; /**< Non-zero if keys are present */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync KeySymsRec keySyms; /**< Key symbols */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int freemap; /**< If non-zero, free keySyms.map */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync CARD8 modMap[MAP_LENGTH]; /**< Modifier map */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#ifdef XKB
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync XkbDescPtr xkb; /**< XKB description */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync XkbComponentNamesRec names; /**< XKB component names */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int freenames; /**< Non-zero if names should be free'd */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int force; /**< Do not allow command line override */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#endif
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int buttonClass; /**< Non-zero if buttons are present */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int numButtons; /**< Number of buttons */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned char map[DMX_MAX_BUTTONS]; /**< Button map */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int valuatorClass; /**< Non-zero if valuators are
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * present */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int numRelAxes; /**< Number of relative axes */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int numAbsAxes; /**< Number of absolute axes */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int minval[DMX_MAX_AXES]; /**< Minimum values */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int maxval[DMX_MAX_AXES]; /**< Maximum values */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int res[DMX_MAX_AXES]; /**< Resolution */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int minres[DMX_MAX_AXES]; /**< Minimum resolutions */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int maxres[DMX_MAX_AXES]; /**< Maximum resolutions */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int focusClass; /**< Non-zero if device can
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * cause focus */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int proximityClass; /**< Non-zero if device
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * causes proximity events */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int kbdFeedbackClass; /**< Non-zero if device has
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * keyboard feedback */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int ptrFeedbackClass; /**< Non-zero if device has
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * pointer feedback */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int ledFeedbackClass; /**< Non-zero if device has
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * LED indicators */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int belFeedbackClass; /**< Non-zero if device has a
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * bell */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int intFeedbackClass; /**< Non-zero if device has
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * integer feedback */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int strFeedbackClass; /**< Non-zero if device has
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * string feedback */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int maxSymbols; /**< Maximum symbols */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int maxSymbolsSupported; /**< Maximum symbols supported */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync KeySym *symbols; /**< Key symbols */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} DMXLocalInitInfo, *DMXLocalInitInfoPtr;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef pointer (*dmxCreatePrivateProcPtr)(DeviceIntPtr);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxDestroyPrivateProcPtr)(pointer);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxInitProcPtr)(DevicePtr);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxReInitProcPtr)(DevicePtr);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxLateReInitProcPtr)(DevicePtr);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxGetInfoProcPtr)(DevicePtr, DMXLocalInitInfoPtr);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef int (*dmxOnProcPtr)(DevicePtr);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxOffProcPtr)(DevicePtr);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxUpdatePositionProcPtr)(pointer, int x, int y);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxVTPreSwitchProcPtr)(pointer); /* Turn I/O Off */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxVTPostSwitchProcPtr)(pointer); /* Turn I/O On */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxVTSwitchReturnProcPtr)(pointer);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef int (*dmxVTSwitchProcPtr)(pointer, int vt,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxVTSwitchReturnProcPtr, pointer);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxMotionProcPtr)(DevicePtr,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int *valuators,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int firstAxis,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int axesCount,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMXMotionType type,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMXBlockType block);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxEnqueueProcPtr)(DevicePtr, int type, int detail,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync KeySym keySym, XEvent *e,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMXBlockType block);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef int (*dmxCheckSpecialProcPtr)(DevicePtr, KeySym keySym);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxCollectEventsProcPtr)(DevicePtr,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxMotionProcPtr,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxEnqueueProcPtr,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxCheckSpecialProcPtr,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMXBlockType);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxProcessInputProcPtr)(pointer);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxUpdateInfoProcPtr)(pointer, DMXUpdateType, WindowPtr);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef int (*dmxFunctionsProcPtr)(pointer, DMXFunctionType);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxKBCtrlProcPtr)(DevicePtr, KeybdCtrl *ctrl);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxMCtrlProcPtr)(DevicePtr, PtrCtrl *ctrl);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*dmxKBBellProcPtr)(DevicePtr, int percent,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int volume, int pitch, int duration);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/** Stores a mapping between the device id on the remote X server and
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * the id on the DMX server */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _DMXEventMap {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int remote; /**< Event number on remote X server */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int server; /**< Event number (unbiased) on DMX server */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} DMXEventMap;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/** This is the device-independent structure used by the low-level input
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * routines. The contents are not exposed to top-level .c files (except
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * dmxextensions.c). \see dmxinput.h \see dmxextensions.c */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _DMXLocalInputInfo {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync const char *name; /**< Device name */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMXLocalInputType type; /**< Device type */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMXLocalInputExtType extType; /**< Extended device type */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int binding; /**< Count of how many consecutive
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * structs are bound to the same
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * device */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /* Low-level (e.g., keyboard/mouse drivers) */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxCreatePrivateProcPtr create_private; /**< Create
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * device-dependent
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * private */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxDestroyPrivateProcPtr destroy_private; /**< Destroy
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * device-dependent
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * private */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxInitProcPtr init; /**< Initialize device */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxReInitProcPtr reinit; /**< Reinitialize device
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * (during a
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * reconfiguration) */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxLateReInitProcPtr latereinit; /**< Reinitialize a device
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * (called very late
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * during a
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * reconfiguration) */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxGetInfoProcPtr get_info; /**< Get device information */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxOnProcPtr on; /**< Turn device on */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxOffProcPtr off; /**< Turn device off */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxUpdatePositionProcPtr update_position; /**< Called when another
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * device updates the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * cursor position */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxVTPreSwitchProcPtr vt_pre_switch; /**< Called before a VT switch */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxVTPostSwitchProcPtr vt_post_switch; /**< Called after a VT switch */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxVTSwitchProcPtr vt_switch; /**< Causes a VT switch */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxCollectEventsProcPtr collect_events; /**< Collect and enqueue
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * events from the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * device*/
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxProcessInputProcPtr process_input; /**< Process event (from
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * queue) */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxFunctionsProcPtr functions;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxUpdateInfoProcPtr update_info; /**< Update window layout
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * information */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxMCtrlProcPtr mCtrl; /**< Pointer control */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxKBCtrlProcPtr kCtrl; /**< Keyboard control */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync dmxKBBellProcPtr kBell; /**< Bell control */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync pointer private; /**< Device-dependent private */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int isCore; /**< Is a DMX core device */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int sendsCore; /**< Sends DMX core events */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync KeybdCtrl kctrl; /**< Keyboard control */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync PtrCtrl mctrl; /**< Pointer control */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DeviceIntPtr pDevice; /**< X-level device */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int inputIdx; /**< High-level index */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int lastX, lastY; /**< Last known position;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * for XInput in
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * dmxevents.c */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int head; /**< XInput motion history
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * head */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int tail; /**< XInput motion history
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * tail */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned long *history; /**< XInput motion history */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int *valuators; /**< Cache of previous values */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /* for XInput ChangePointerDevice */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int (*savedMotionProc)(DeviceIntPtr,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync xTimecoord *,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned long,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned long,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ScreenPtr);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int savedMotionEvents; /**< Saved motion events */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int savedSendsCore; /**< Saved sends-core flag */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMXEventMap map[DMX_MAP_ENTRIES]; /**< XInput device id map */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int mapOptimize; /**< XInput device id
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * map
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * optimization */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync long deviceId; /**< device id on remote side,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * if any */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync const char *deviceName; /**< devive name on remote
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * side, if any */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} DMXLocalInputInfoRec;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern DMXLocalInputInfoPtr dmxLocalCorePointer, dmxLocalCoreKeyboard;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern void dmxLocalInitInput(DMXInputInfo *dmxInput);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern DMXLocalInputInfoPtr dmxInputCopyLocal(DMXInputInfo *dmxInput,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync DMXLocalInputInfoPtr s);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern void dmxChangePointerControl(DeviceIntPtr pDevice, PtrCtrl *ctrl);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern void dmxKeyboardKbdCtrlProc(DeviceIntPtr pDevice, KeybdCtrl *ctrl);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern void dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync pointer ctrl, int unknown);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int dmxInputExtensionErrorHandler(Display *dsp, char *name,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync char *reason);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int dmxInputDetach(DMXInputInfo *dmxInput);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern void dmxInputDetachAll(DMXScreenInfo *dmxScreen);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int dmxInputDetachId(int id);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern DMXInputInfo *dmxInputLocateId(int id);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int dmxInputAttachConsole(const char *name, int isCore,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int *id);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int dmxInputAttachBackend(int physicalScreen, int isCore,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int *id);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#endif