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