VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.1.0/dmxinputinit.h@ 107044

Last change on this file since 107044 was 51223, checked in by vboxsync, 11 years ago

Additions/x11/x11include: added header files for X.Org Server 1.0 and 1.1.

  • Property svn:eol-style set to native
File size: 13.9 KB
Line 
1/* $XFree86$ */
2/*
3 * Copyright 2002 Red Hat Inc., Durham, North Carolina.
4 *
5 * All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation on the rights to use, copy, modify, merge,
11 * publish, distribute, sublicense, and/or sell copies of the Software,
12 * and to permit persons to whom the Software is furnished to do so,
13 * subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial
17 * portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
23 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 * SOFTWARE.
27 */
28
29/*
30 * Authors:
31 * Rickard E. (Rik) Faith <[email protected]>
32 *
33 */
34
35/** \file
36 * Interface for low-level input support. \see dmxinputinit.c */
37
38#ifndef _DMXINPUTINIT_H_
39#define _DMXINPUTINIT_H_
40
41#include "dmx.h"
42#include "dmxinput.h"
43#include "dmxlog.h"
44
45
46#define DMX_LOCAL_DEFAULT_KEYBOARD "kbd"
47#define DMX_LOCAL_DEFAULT_POINTER "ps2"
48#define DMX_MAX_BUTTONS 256
49#define DMX_MOTION_SIZE 256
50#define DMX_MAX_VALUATORS 32
51#define DMX_MAX_AXES 32
52#define DMX_MAX_XINPUT_EVENT_TYPES 100
53#define DMX_MAP_ENTRIES 16 /* Must be a power of 2 */
54#define DMX_MAP_MASK (DMX_MAP_ENTRIES - 1)
55
56typedef enum {
57 DMX_FUNCTION_GRAB,
58 DMX_FUNCTION_TERMINATE,
59 DMX_FUNCTION_FINE
60} DMXFunctionType;
61
62typedef enum {
63 DMX_LOCAL_HIGHLEVEL,
64 DMX_LOCAL_KEYBOARD,
65 DMX_LOCAL_MOUSE,
66 DMX_LOCAL_OTHER
67} DMXLocalInputType;
68
69typedef enum {
70 DMX_LOCAL_TYPE_LOCAL,
71 DMX_LOCAL_TYPE_CONSOLE,
72 DMX_LOCAL_TYPE_BACKEND,
73 DMX_LOCAL_TYPE_COMMON
74} DMXLocalInputExtType;
75
76typedef enum {
77 DMX_RELATIVE,
78 DMX_ABSOLUTE,
79 DMX_ABSOLUTE_CONFINED
80} DMXMotionType;
81
82/** Stores information from low-level device that is used to initialize
83 * the device at the dix level. */
84typedef struct _DMXLocalInitInfo {
85 int keyboard; /**< Non-zero if the device is a keyboard */
86
87 int keyClass; /**< Non-zero if keys are present */
88 KeySymsRec keySyms; /**< Key symbols */
89 int freemap; /**< If non-zero, free keySyms.map */
90 CARD8 modMap[MAP_LENGTH]; /**< Modifier map */
91#ifdef XKB
92 XkbDescPtr xkb; /**< XKB description */
93 XkbComponentNamesRec names; /**< XKB component names */
94 int freenames; /**< Non-zero if names should be free'd */
95 int force; /**< Do not allow command line override */
96#endif
97
98 int buttonClass; /**< Non-zero if buttons are present */
99 int numButtons; /**< Number of buttons */
100 unsigned char map[DMX_MAX_BUTTONS]; /**< Button map */
101
102 int valuatorClass; /**< Non-zero if valuators are
103 * present */
104 int numRelAxes; /**< Number of relative axes */
105 int numAbsAxes; /**< Number of absolute axes */
106 int minval[DMX_MAX_AXES]; /**< Minimum values */
107 int maxval[DMX_MAX_AXES]; /**< Maximum values */
108 int res[DMX_MAX_AXES]; /**< Resolution */
109 int minres[DMX_MAX_AXES]; /**< Minimum resolutions */
110 int maxres[DMX_MAX_AXES]; /**< Maximum resolutions */
111
112 int focusClass; /**< Non-zero if device can
113 * cause focus */
114 int proximityClass; /**< Non-zero if device
115 * causes proximity events */
116 int kbdFeedbackClass; /**< Non-zero if device has
117 * keyboard feedback */
118 int ptrFeedbackClass; /**< Non-zero if device has
119 * pointer feedback */
120 int ledFeedbackClass; /**< Non-zero if device has
121 * LED indicators */
122 int belFeedbackClass; /**< Non-zero if device has a
123 * bell */
124 int intFeedbackClass; /**< Non-zero if device has
125 * integer feedback */
126 int strFeedbackClass; /**< Non-zero if device has
127 * string feedback */
128
129 int maxSymbols; /**< Maximum symbols */
130 int maxSymbolsSupported; /**< Maximum symbols supported */
131 KeySym *symbols; /**< Key symbols */
132} DMXLocalInitInfo, *DMXLocalInitInfoPtr;
133
134typedef pointer (*dmxCreatePrivateProcPtr)(DeviceIntPtr);
135typedef void (*dmxDestroyPrivateProcPtr)(pointer);
136
137typedef void (*dmxInitProcPtr)(DevicePtr);
138typedef void (*dmxReInitProcPtr)(DevicePtr);
139typedef void (*dmxLateReInitProcPtr)(DevicePtr);
140typedef void (*dmxGetInfoProcPtr)(DevicePtr, DMXLocalInitInfoPtr);
141typedef int (*dmxOnProcPtr)(DevicePtr);
142typedef void (*dmxOffProcPtr)(DevicePtr);
143typedef void (*dmxUpdatePositionProcPtr)(pointer, int x, int y);
144
145typedef void (*dmxVTPreSwitchProcPtr)(pointer); /* Turn I/O Off */
146typedef void (*dmxVTPostSwitchProcPtr)(pointer); /* Turn I/O On */
147typedef void (*dmxVTSwitchReturnProcPtr)(pointer);
148typedef int (*dmxVTSwitchProcPtr)(pointer, int vt,
149 dmxVTSwitchReturnProcPtr, pointer);
150
151typedef void (*dmxMotionProcPtr)(DevicePtr,
152 int *valuators,
153 int firstAxis,
154 int axesCount,
155 DMXMotionType type,
156 DMXBlockType block);
157typedef void (*dmxEnqueueProcPtr)(DevicePtr, int type, int detail,
158 KeySym keySym, XEvent *e,
159 DMXBlockType block);
160typedef int (*dmxCheckSpecialProcPtr)(DevicePtr, KeySym keySym);
161typedef void (*dmxCollectEventsProcPtr)(DevicePtr,
162 dmxMotionProcPtr,
163 dmxEnqueueProcPtr,
164 dmxCheckSpecialProcPtr,
165 DMXBlockType);
166typedef void (*dmxProcessInputProcPtr)(pointer);
167typedef void (*dmxUpdateInfoProcPtr)(pointer, DMXUpdateType, WindowPtr);
168typedef int (*dmxFunctionsProcPtr)(pointer, DMXFunctionType);
169
170typedef void (*dmxKBCtrlProcPtr)(DevicePtr, KeybdCtrl *ctrl);
171typedef void (*dmxMCtrlProcPtr)(DevicePtr, PtrCtrl *ctrl);
172typedef void (*dmxKBBellProcPtr)(DevicePtr, int percent,
173 int volume, int pitch, int duration);
174
175/** Stores a mapping between the device id on the remote X server and
176 * the id on the DMX server */
177typedef struct _DMXEventMap {
178 int remote; /**< Event number on remote X server */
179 int server; /**< Event number (unbiased) on DMX server */
180} DMXEventMap;
181
182/** This is the device-independent structure used by the low-level input
183 * routines. The contents are not exposed to top-level .c files (except
184 * dmxextensions.c). \see dmxinput.h \see dmxextensions.c */
185typedef struct _DMXLocalInputInfo {
186 const char *name; /**< Device name */
187 DMXLocalInputType type; /**< Device type */
188 DMXLocalInputExtType extType; /**< Extended device type */
189 int binding; /**< Count of how many consecutive
190 * structs are bound to the same
191 * device */
192
193 /* Low-level (e.g., keyboard/mouse drivers) */
194
195 dmxCreatePrivateProcPtr create_private; /**< Create
196 * device-dependent
197 * private */
198 dmxDestroyPrivateProcPtr destroy_private; /**< Destroy
199 * device-dependent
200 * private */
201 dmxInitProcPtr init; /**< Initialize device */
202 dmxReInitProcPtr reinit; /**< Reinitialize device
203 * (during a
204 * reconfiguration) */
205 dmxLateReInitProcPtr latereinit; /**< Reinitialize a device
206 * (called very late
207 * during a
208 * reconfiguration) */
209 dmxGetInfoProcPtr get_info; /**< Get device information */
210 dmxOnProcPtr on; /**< Turn device on */
211 dmxOffProcPtr off; /**< Turn device off */
212 dmxUpdatePositionProcPtr update_position; /**< Called when another
213 * device updates the
214 * cursor position */
215 dmxVTPreSwitchProcPtr vt_pre_switch; /**< Called before a VT switch */
216 dmxVTPostSwitchProcPtr vt_post_switch; /**< Called after a VT switch */
217 dmxVTSwitchProcPtr vt_switch; /**< Causes a VT switch */
218
219 dmxCollectEventsProcPtr collect_events; /**< Collect and enqueue
220 * events from the
221 * device*/
222 dmxProcessInputProcPtr process_input; /**< Process event (from
223 * queue) */
224 dmxFunctionsProcPtr functions;
225 dmxUpdateInfoProcPtr update_info; /**< Update window layout
226 * information */
227
228 dmxMCtrlProcPtr mCtrl; /**< Pointer control */
229 dmxKBCtrlProcPtr kCtrl; /**< Keyboard control */
230 dmxKBBellProcPtr kBell; /**< Bell control */
231
232 pointer private; /**< Device-dependent private */
233 int isCore; /**< Is a DMX core device */
234 int sendsCore; /**< Sends DMX core events */
235 KeybdCtrl kctrl; /**< Keyboard control */
236 PtrCtrl mctrl; /**< Pointer control */
237
238 DeviceIntPtr pDevice; /**< X-level device */
239 int inputIdx; /**< High-level index */
240 int lastX, lastY; /**< Last known position;
241 * for XInput in
242 * dmxevents.c */
243
244 int head; /**< XInput motion history
245 * head */
246 int tail; /**< XInput motion history
247 * tail */
248 unsigned long *history; /**< XInput motion history */
249 int *valuators; /**< Cache of previous values */
250
251 /* for XInput ChangePointerDevice */
252 int (*savedMotionProc)(DeviceIntPtr,
253 xTimecoord *,
254 unsigned long,
255 unsigned long,
256 ScreenPtr);
257 int savedMotionEvents; /**< Saved motion events */
258 int savedSendsCore; /**< Saved sends-core flag */
259
260 DMXEventMap map[DMX_MAP_ENTRIES]; /**< XInput device id map */
261 int mapOptimize; /**< XInput device id
262 * map
263 * optimization */
264
265 long deviceId; /**< device id on remote side,
266 * if any */
267 const char *deviceName; /**< devive name on remote
268 * side, if any */
269} DMXLocalInputInfoRec;
270
271extern DMXLocalInputInfoPtr dmxLocalCorePointer, dmxLocalCoreKeyboard;
272
273extern void dmxLocalInitInput(DMXInputInfo *dmxInput);
274extern DMXLocalInputInfoPtr dmxInputCopyLocal(DMXInputInfo *dmxInput,
275 DMXLocalInputInfoPtr s);
276
277extern void dmxChangePointerControl(DeviceIntPtr pDevice, PtrCtrl *ctrl);
278extern void dmxKeyboardKbdCtrlProc(DeviceIntPtr pDevice, KeybdCtrl *ctrl);
279extern void dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice,
280 pointer ctrl, int unknown);
281
282extern int dmxInputExtensionErrorHandler(Display *dsp, char *name,
283 char *reason);
284
285extern int dmxInputDetach(DMXInputInfo *dmxInput);
286extern void dmxInputDetachAll(DMXScreenInfo *dmxScreen);
287extern int dmxInputDetachId(int id);
288extern DMXInputInfo *dmxInputLocateId(int id);
289extern int dmxInputAttachConsole(const char *name, int isCore,
290 int *id);
291extern int dmxInputAttachBackend(int physicalScreen, int isCore,
292 int *id);
293
294#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette