2
* Copyright 2002,2003 Red Hat Inc., Durham, North Carolina.
6
* Permission is hereby granted, free of charge, to any person obtaining
7
* a copy of this software and associated documentation files (the
8
* "Software"), to deal in the Software without restriction, including
9
* without limitation on the rights to use, copy, modify, merge,
10
* publish, distribute, sublicense, and/or sell copies of the Software,
11
* and to permit persons to whom the Software is furnished to do so,
12
* subject to the following conditions:
14
* The above copyright notice and this permission notice (including the
15
* next paragraph) shall be included in all copies or substantial
16
* portions of the Software.
18
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
* NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
22
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
* Rickard E. (Rik) Faith <faith@redhat.com>
35
* Interface to functions used by backend and console input devices.
36
* \see dmxcommon.c \see dmxbackend.c \see dmxconsole.c */
41
#define DMX_COMMON_OTHER \
45
DMXLocalInputInfoPtr dmxLocal; \
53
KeybdCtrl savedKctrl; \
54
XModifierKeymap *savedModMap; \
57
#define DMX_COMMON_XKB \
60
XkbIndicatorRec savedIndicators
62
#define DMX_COMMON_PRIVATE \
66
#define GETONLYPRIVFROMPRIVATE \
67
myPrivate *priv = private
69
#define GETPRIVFROMPRIVATE \
70
GETONLYPRIVFROMPRIVATE; \
71
DMXInputInfo *dmxInput = &dmxInputs[priv->dmxLocal->inputIdx]
73
#define GETDMXLOCALFROMPDEVICE \
74
DevicePtr pDev = &pDevice->public; \
75
DMXLocalInputInfoPtr dmxLocal = pDev->devicePrivate
77
#define GETDMXINPUTFROMPRIV \
78
DMXInputInfo *dmxInput = &dmxInputs[priv->dmxLocal->inputIdx]
80
#define GETDMXINPUTFROMPDEVICE \
81
GETDMXLOCALFROMPDEVICE; \
82
DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx]
84
#define GETDMXLOCALFROMPDEV \
85
DMXLocalInputInfoPtr dmxLocal = pDev->devicePrivate
87
#define GETDMXINPUTFROMPDEV \
88
GETDMXLOCALFROMPDEV; \
89
DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx]
91
#define GETPRIVFROMPDEV \
92
GETDMXLOCALFROMPDEV; \
93
myPrivate *priv = dmxLocal->private
95
#define DMX_KEYBOARD_EVENT_MASK \
96
(KeyPressMask | KeyReleaseMask | KeymapStateMask)
98
#define DMX_POINTER_EVENT_MASK \
99
(ButtonPressMask | ButtonReleaseMask | PointerMotionMask)
101
extern void dmxCommonKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
102
extern void dmxCommonKbdGetMap(DevicePtr pDev,
103
KeySymsPtr pKeySyms, CARD8 *pModMap);
104
extern void dmxCommonKbdCtrl(DevicePtr pDev, KeybdCtrl * ctrl);
105
extern void dmxCommonKbdBell(DevicePtr pDev, int percent,
106
int volume, int pitch, int duration);
107
extern int dmxCommonKbdOn(DevicePtr pDev);
108
extern void dmxCommonKbdOff(DevicePtr pDev);
109
extern void dmxCommonMouGetMap(DevicePtr pDev,
110
unsigned char *map, int *nButtons);
111
extern void dmxCommonMouCtrl(DevicePtr pDev, PtrCtrl * ctrl);
112
extern int dmxCommonMouOn(DevicePtr pDev);
113
extern void dmxCommonMouOff(DevicePtr pDev);
114
extern int dmxFindPointerScreen(int x, int y);
116
extern int dmxCommonOthOn(DevicePtr pDev);
117
extern void dmxCommonOthOff(DevicePtr pDev);
118
extern void dmxCommonOthGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
120
/* helper functions */
121
extern void *dmxCommonCopyPrivate(DeviceIntPtr pDevice);
122
extern void dmxCommonSaveState(void *private);
123
extern void dmxCommonRestoreState(void *private);