VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.5.3/input.h@ 17448

Last change on this file since 17448 was 17448, checked in by vboxsync, 16 years ago

Additions/x11: added a full header set for X.Org server 1.5 and 1.6

  • Property svn:eol-style set to native
File size: 11.1 KB
Line 
1/************************************************************
2
3Copyright 1987, 1998 The Open Group
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting
9documentation.
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21Except as contained in this notice, the name of The Open Group shall not be
22used in advertising or otherwise to promote the sale, use or other dealings
23in this Software without prior written authorization from The Open Group.
24
25
26Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
27
28 All Rights Reserved
29
30Permission to use, copy, modify, and distribute this software and its
31documentation for any purpose and without fee is hereby granted,
32provided that the above copyright notice appear in all copies and that
33both that copyright notice and this permission notice appear in
34supporting documentation, and that the name of Digital not be
35used in advertising or publicity pertaining to distribution of the
36software without specific, written prior permission.
37
38DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
39ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
40DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
41ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
42WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
43ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
44SOFTWARE.
45
46********************************************************/
47
48#ifndef INPUT_H
49#define INPUT_H
50
51#include "misc.h"
52#include "screenint.h"
53#include <X11/Xmd.h>
54#include <X11/Xproto.h>
55#include "window.h" /* for WindowPtr */
56
57#define DEVICE_INIT 0
58#define DEVICE_ON 1
59#define DEVICE_OFF 2
60#define DEVICE_CLOSE 3
61
62#define POINTER_RELATIVE (1 << 1)
63#define POINTER_ABSOLUTE (1 << 2)
64#define POINTER_ACCELERATE (1 << 3)
65
66#define MAP_LENGTH 256
67#define DOWN_LENGTH 32 /* 256/8 => number of bytes to hold 256 bits */
68#define NullGrab ((GrabPtr)NULL)
69#define PointerRootWin ((WindowPtr)PointerRoot)
70#define NoneWin ((WindowPtr)None)
71#define NullDevice ((DevicePtr)NULL)
72
73#ifndef FollowKeyboard
74#define FollowKeyboard 3
75#endif
76#ifndef FollowKeyboardWin
77#define FollowKeyboardWin ((WindowPtr) FollowKeyboard)
78#endif
79#ifndef RevertToFollowKeyboard
80#define RevertToFollowKeyboard 3
81#endif
82
83typedef unsigned long Leds;
84typedef struct _OtherClients *OtherClientsPtr;
85typedef struct _InputClients *InputClientsPtr;
86typedef struct _DeviceIntRec *DeviceIntPtr;
87
88typedef int (*DeviceProc)(
89 DeviceIntPtr /*device*/,
90 int /*what*/);
91
92typedef void (*ProcessInputProc)(
93 xEventPtr /*events*/,
94 DeviceIntPtr /*device*/,
95 int /*count*/);
96
97typedef Bool (*DeviceHandleProc)(
98 DeviceIntPtr /*device*/,
99 void* /*data*/
100 );
101
102typedef void (*DeviceUnwrapProc)(
103 DeviceIntPtr /*device*/,
104 DeviceHandleProc /*proc*/,
105 void* /*data*/
106 );
107
108typedef struct _DeviceRec {
109 pointer devicePrivate;
110 ProcessInputProc processInputProc; /* current */
111 ProcessInputProc realInputProc; /* deliver */
112 ProcessInputProc enqueueInputProc; /* enqueue */
113 Bool on; /* used by DDX to keep state */
114} DeviceRec, *DevicePtr;
115
116typedef struct {
117 int click, bell, bell_pitch, bell_duration;
118 Bool autoRepeat;
119 unsigned char autoRepeats[32];
120 Leds leds;
121 unsigned char id;
122} KeybdCtrl;
123
124typedef struct {
125 KeySym *map;
126 KeyCode minKeyCode,
127 maxKeyCode;
128 int mapWidth;
129} KeySymsRec, *KeySymsPtr;
130
131typedef struct {
132 int num, den, threshold;
133 unsigned char id;
134} PtrCtrl;
135
136typedef struct {
137 int resolution, min_value, max_value;
138 int integer_displayed;
139 unsigned char id;
140} IntegerCtrl;
141
142typedef struct {
143 int max_symbols, num_symbols_supported;
144 int num_symbols_displayed;
145 KeySym *symbols_supported;
146 KeySym *symbols_displayed;
147 unsigned char id;
148} StringCtrl;
149
150typedef struct {
151 int percent, pitch, duration;
152 unsigned char id;
153} BellCtrl;
154
155typedef struct {
156 Leds led_values;
157 Mask led_mask;
158 unsigned char id;
159} LedCtrl;
160
161extern KeybdCtrl defaultKeyboardControl;
162extern PtrCtrl defaultPointerControl;
163
164typedef struct _InputOption {
165 char *key;
166 char *value;
167 struct _InputOption *next;
168} InputOption;
169
170extern void InitCoreDevices(void);
171
172extern DeviceIntPtr AddInputDevice(
173 DeviceProc /*deviceProc*/,
174 Bool /*autoStart*/);
175
176extern Bool EnableDevice(
177 DeviceIntPtr /*device*/);
178
179extern Bool ActivateDevice(
180 DeviceIntPtr /*device*/);
181
182extern Bool DisableDevice(
183 DeviceIntPtr /*device*/);
184
185extern int InitAndStartDevices(void);
186
187extern void CloseDownDevices(void);
188
189extern int RemoveDevice(
190 DeviceIntPtr /*dev*/);
191
192extern int NumMotionEvents(void);
193
194extern void RegisterPointerDevice(
195 DeviceIntPtr /*device*/);
196
197extern void RegisterKeyboardDevice(
198 DeviceIntPtr /*device*/);
199
200extern int dixLookupDevice(
201 DeviceIntPtr * /* dev */,
202 int /* id */,
203 ClientPtr /* client */,
204 Mask /* access_mode */);
205
206extern void QueryMinMaxKeyCodes(
207 KeyCode* /*minCode*/,
208 KeyCode* /*maxCode*/);
209
210extern Bool SetKeySymsMap(
211 KeySymsPtr /*dst*/,
212 KeySymsPtr /*src*/);
213
214extern Bool InitKeyClassDeviceStruct(
215 DeviceIntPtr /*device*/,
216 KeySymsPtr /*pKeySyms*/,
217 CARD8 /*pModifiers*/[]);
218
219extern Bool InitButtonClassDeviceStruct(
220 DeviceIntPtr /*device*/,
221 int /*numButtons*/,
222 CARD8* /*map*/);
223
224typedef int (*ValuatorMotionProcPtr)(
225 DeviceIntPtr /*pdevice*/,
226 xTimecoord * /*coords*/,
227 unsigned long /*start*/,
228 unsigned long /*stop*/,
229 ScreenPtr /*pScreen*/);
230
231extern Bool InitValuatorClassDeviceStruct(
232 DeviceIntPtr /*device*/,
233 int /*numAxes*/,
234 ValuatorMotionProcPtr /* motionProc */,
235 int /*numMotionEvents*/,
236 int /*mode*/);
237
238extern Bool InitAbsoluteClassDeviceStruct(
239 DeviceIntPtr /*device*/);
240
241extern Bool InitFocusClassDeviceStruct(
242 DeviceIntPtr /*device*/);
243
244typedef void (*BellProcPtr)(
245 int /*percent*/,
246 DeviceIntPtr /*device*/,
247 pointer /*ctrl*/,
248 int);
249
250typedef void (*KbdCtrlProcPtr)(
251 DeviceIntPtr /*device*/,
252 KeybdCtrl * /*ctrl*/);
253
254extern Bool InitKbdFeedbackClassDeviceStruct(
255 DeviceIntPtr /*device*/,
256 BellProcPtr /*bellProc*/,
257 KbdCtrlProcPtr /*controlProc*/);
258
259typedef void (*PtrCtrlProcPtr)(
260 DeviceIntPtr /*device*/,
261 PtrCtrl * /*ctrl*/);
262
263extern Bool InitPtrFeedbackClassDeviceStruct(
264 DeviceIntPtr /*device*/,
265 PtrCtrlProcPtr /*controlProc*/);
266
267typedef void (*StringCtrlProcPtr)(
268 DeviceIntPtr /*device*/,
269 StringCtrl * /*ctrl*/);
270
271extern Bool InitStringFeedbackClassDeviceStruct(
272 DeviceIntPtr /*device*/,
273 StringCtrlProcPtr /*controlProc*/,
274 int /*max_symbols*/,
275 int /*num_symbols_supported*/,
276 KeySym* /*symbols*/);
277
278typedef void (*BellCtrlProcPtr)(
279 DeviceIntPtr /*device*/,
280 BellCtrl * /*ctrl*/);
281
282extern Bool InitBellFeedbackClassDeviceStruct(
283 DeviceIntPtr /*device*/,
284 BellProcPtr /*bellProc*/,
285 BellCtrlProcPtr /*controlProc*/);
286
287typedef void (*LedCtrlProcPtr)(
288 DeviceIntPtr /*device*/,
289 LedCtrl * /*ctrl*/);
290
291extern Bool InitLedFeedbackClassDeviceStruct(
292 DeviceIntPtr /*device*/,
293 LedCtrlProcPtr /*controlProc*/);
294
295typedef void (*IntegerCtrlProcPtr)(
296 DeviceIntPtr /*device*/,
297 IntegerCtrl * /*ctrl*/);
298
299
300extern Bool InitIntegerFeedbackClassDeviceStruct(
301 DeviceIntPtr /*device*/,
302 IntegerCtrlProcPtr /*controlProc*/);
303
304extern Bool InitPointerDeviceStruct(
305 DevicePtr /*device*/,
306 CARD8* /*map*/,
307 int /*numButtons*/,
308 ValuatorMotionProcPtr /*motionProc*/,
309 PtrCtrlProcPtr /*controlProc*/,
310 int /*numMotionEvents*/,
311 int /*numAxes*/);
312
313extern Bool InitKeyboardDeviceStruct(
314 DevicePtr /*device*/,
315 KeySymsPtr /*pKeySyms*/,
316 CARD8 /*pModifiers*/[],
317 BellProcPtr /*bellProc*/,
318 KbdCtrlProcPtr /*controlProc*/);
319
320extern void SendMappingNotify(
321 unsigned int /*request*/,
322 unsigned int /*firstKeyCode*/,
323 unsigned int /*count*/,
324 ClientPtr /* client */);
325
326extern Bool BadDeviceMap(
327 BYTE* /*buff*/,
328 int /*length*/,
329 unsigned /*low*/,
330 unsigned /*high*/,
331 XID* /*errval*/);
332
333extern Bool AllModifierKeysAreUp(
334 DeviceIntPtr /*device*/,
335 CARD8* /*map1*/,
336 int /*per1*/,
337 CARD8* /*map2*/,
338 int /*per2*/);
339
340extern void NoteLedState(
341 DeviceIntPtr /*keybd*/,
342 int /*led*/,
343 Bool /*on*/);
344
345extern void MaybeStopHint(
346 DeviceIntPtr /*device*/,
347 ClientPtr /*client*/);
348
349extern void ProcessPointerEvent(
350 xEventPtr /*xE*/,
351 DeviceIntPtr /*mouse*/,
352 int /*count*/);
353
354extern void ProcessKeyboardEvent(
355 xEventPtr /*xE*/,
356 DeviceIntPtr /*keybd*/,
357 int /*count*/);
358
359#ifdef XKB
360extern void CoreProcessPointerEvent(
361 xEventPtr /*xE*/,
362 DeviceIntPtr /*mouse*/,
363 int /*count*/);
364
365extern void CoreProcessKeyboardEvent(
366 xEventPtr /*xE*/,
367 DeviceIntPtr /*keybd*/,
368 int /*count*/);
369#endif
370
371extern Bool LegalModifier(
372 unsigned int /*key*/,
373 DeviceIntPtr /*pDev*/);
374
375extern void ProcessInputEvents(void);
376
377extern void InitInput(
378 int /*argc*/,
379 char ** /*argv*/);
380
381extern int GetMaximumEventsNum(void);
382
383extern int GetPointerEvents(
384 xEvent *events,
385 DeviceIntPtr pDev,
386 int type,
387 int buttons,
388 int flags,
389 int first_valuator,
390 int num_valuators,
391 int *valuators);
392
393extern int GetKeyboardEvents(
394 xEvent *events,
395 DeviceIntPtr pDev,
396 int type,
397 int key_code);
398
399extern int GetKeyboardValuatorEvents(
400 xEvent *events,
401 DeviceIntPtr pDev,
402 int type,
403 int key_code,
404 int first_valuator,
405 int num_valuator,
406 int *valuators);
407
408extern int GetProximityEvents(
409 xEvent *events,
410 DeviceIntPtr pDev,
411 int type,
412 int first_valuator,
413 int num_valuators,
414 int *valuators);
415
416extern void PostSyntheticMotion(
417 int x,
418 int y,
419 int screen,
420 unsigned long time);
421
422extern int GetMotionHistorySize(
423 void);
424
425extern void AllocateMotionHistory(
426 DeviceIntPtr pDev);
427
428extern int GetMotionHistory(
429 DeviceIntPtr pDev,
430 xTimecoord *buff,
431 unsigned long start,
432 unsigned long stop,
433 ScreenPtr pScreen);
434
435extern void SwitchCoreKeyboard(DeviceIntPtr pDev);
436extern void SwitchCorePointer(DeviceIntPtr pDev);
437
438/* Implemented by the DDX. */
439extern int NewInputDeviceRequest(
440 InputOption *options,
441 DeviceIntPtr *dev);
442extern void DeleteInputDeviceRequest(
443 DeviceIntPtr dev);
444
445extern void DDXRingBell(
446 int volume,
447 int pitch,
448 int duration);
449
450#endif /* INPUT_H */
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