VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/1.4/xorg/input.h@ 6202

Last change on this file since 6202 was 6202, checked in by vboxsync, 17 years ago

re-export x11

  • Property svn:eol-style set to native
File size: 11.3 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 int AllocateDevicePrivateIndex(void);
162extern Bool AllocateDevicePrivate(DeviceIntPtr device, int index);
163extern void ResetDevicePrivateIndex(void);
164
165extern KeybdCtrl defaultKeyboardControl;
166extern PtrCtrl defaultPointerControl;
167
168typedef struct _InputOption {
169 char *key;
170 char *value;
171 struct _InputOption *next;
172} InputOption;
173
174extern void InitCoreDevices(void);
175
176extern DeviceIntPtr AddInputDevice(
177 DeviceProc /*deviceProc*/,
178 Bool /*autoStart*/);
179
180extern Bool EnableDevice(
181 DeviceIntPtr /*device*/);
182
183extern Bool ActivateDevice(
184 DeviceIntPtr /*device*/);
185
186extern Bool DisableDevice(
187 DeviceIntPtr /*device*/);
188
189extern int InitAndStartDevices(void);
190
191extern void CloseDownDevices(void);
192
193extern int RemoveDevice(
194 DeviceIntPtr /*dev*/);
195
196extern int NumMotionEvents(void);
197
198extern void RegisterPointerDevice(
199 DeviceIntPtr /*device*/);
200
201extern void RegisterKeyboardDevice(
202 DeviceIntPtr /*device*/);
203
204extern DevicePtr LookupKeyboardDevice(void);
205
206extern DevicePtr LookupPointerDevice(void);
207
208extern DevicePtr LookupDevice(
209 int /* id */);
210
211extern void QueryMinMaxKeyCodes(
212 KeyCode* /*minCode*/,
213 KeyCode* /*maxCode*/);
214
215extern Bool SetKeySymsMap(
216 KeySymsPtr /*dst*/,
217 KeySymsPtr /*src*/);
218
219extern Bool InitKeyClassDeviceStruct(
220 DeviceIntPtr /*device*/,
221 KeySymsPtr /*pKeySyms*/,
222 CARD8 /*pModifiers*/[]);
223
224extern Bool InitButtonClassDeviceStruct(
225 DeviceIntPtr /*device*/,
226 int /*numButtons*/,
227 CARD8* /*map*/);
228
229typedef int (*ValuatorMotionProcPtr)(
230 DeviceIntPtr /*pdevice*/,
231 xTimecoord * /*coords*/,
232 unsigned long /*start*/,
233 unsigned long /*stop*/,
234 ScreenPtr /*pScreen*/);
235
236extern Bool InitValuatorClassDeviceStruct(
237 DeviceIntPtr /*device*/,
238 int /*numAxes*/,
239 ValuatorMotionProcPtr /* motionProc */,
240 int /*numMotionEvents*/,
241 int /*mode*/);
242
243extern Bool InitAbsoluteClassDeviceStruct(
244 DeviceIntPtr /*device*/);
245
246extern Bool InitFocusClassDeviceStruct(
247 DeviceIntPtr /*device*/);
248
249typedef void (*BellProcPtr)(
250 int /*percent*/,
251 DeviceIntPtr /*device*/,
252 pointer /*ctrl*/,
253 int);
254
255typedef void (*KbdCtrlProcPtr)(
256 DeviceIntPtr /*device*/,
257 KeybdCtrl * /*ctrl*/);
258
259extern Bool InitKbdFeedbackClassDeviceStruct(
260 DeviceIntPtr /*device*/,
261 BellProcPtr /*bellProc*/,
262 KbdCtrlProcPtr /*controlProc*/);
263
264typedef void (*PtrCtrlProcPtr)(
265 DeviceIntPtr /*device*/,
266 PtrCtrl * /*ctrl*/);
267
268extern Bool InitPtrFeedbackClassDeviceStruct(
269 DeviceIntPtr /*device*/,
270 PtrCtrlProcPtr /*controlProc*/);
271
272typedef void (*StringCtrlProcPtr)(
273 DeviceIntPtr /*device*/,
274 StringCtrl * /*ctrl*/);
275
276extern Bool InitStringFeedbackClassDeviceStruct(
277 DeviceIntPtr /*device*/,
278 StringCtrlProcPtr /*controlProc*/,
279 int /*max_symbols*/,
280 int /*num_symbols_supported*/,
281 KeySym* /*symbols*/);
282
283typedef void (*BellCtrlProcPtr)(
284 DeviceIntPtr /*device*/,
285 BellCtrl * /*ctrl*/);
286
287extern Bool InitBellFeedbackClassDeviceStruct(
288 DeviceIntPtr /*device*/,
289 BellProcPtr /*bellProc*/,
290 BellCtrlProcPtr /*controlProc*/);
291
292typedef void (*LedCtrlProcPtr)(
293 DeviceIntPtr /*device*/,
294 LedCtrl * /*ctrl*/);
295
296extern Bool InitLedFeedbackClassDeviceStruct(
297 DeviceIntPtr /*device*/,
298 LedCtrlProcPtr /*controlProc*/);
299
300typedef void (*IntegerCtrlProcPtr)(
301 DeviceIntPtr /*device*/,
302 IntegerCtrl * /*ctrl*/);
303
304
305extern Bool InitIntegerFeedbackClassDeviceStruct(
306 DeviceIntPtr /*device*/,
307 IntegerCtrlProcPtr /*controlProc*/);
308
309extern Bool InitPointerDeviceStruct(
310 DevicePtr /*device*/,
311 CARD8* /*map*/,
312 int /*numButtons*/,
313 ValuatorMotionProcPtr /*motionProc*/,
314 PtrCtrlProcPtr /*controlProc*/,
315 int /*numMotionEvents*/,
316 int /*numAxes*/);
317
318extern Bool InitKeyboardDeviceStruct(
319 DevicePtr /*device*/,
320 KeySymsPtr /*pKeySyms*/,
321 CARD8 /*pModifiers*/[],
322 BellProcPtr /*bellProc*/,
323 KbdCtrlProcPtr /*controlProc*/);
324
325extern void SendMappingNotify(
326 unsigned int /*request*/,
327 unsigned int /*firstKeyCode*/,
328 unsigned int /*count*/,
329 ClientPtr /* client */);
330
331extern Bool BadDeviceMap(
332 BYTE* /*buff*/,
333 int /*length*/,
334 unsigned /*low*/,
335 unsigned /*high*/,
336 XID* /*errval*/);
337
338extern Bool AllModifierKeysAreUp(
339 DeviceIntPtr /*device*/,
340 CARD8* /*map1*/,
341 int /*per1*/,
342 CARD8* /*map2*/,
343 int /*per2*/);
344
345extern void NoteLedState(
346 DeviceIntPtr /*keybd*/,
347 int /*led*/,
348 Bool /*on*/);
349
350extern void MaybeStopHint(
351 DeviceIntPtr /*device*/,
352 ClientPtr /*client*/);
353
354extern void ProcessPointerEvent(
355 xEventPtr /*xE*/,
356 DeviceIntPtr /*mouse*/,
357 int /*count*/);
358
359extern void ProcessKeyboardEvent(
360 xEventPtr /*xE*/,
361 DeviceIntPtr /*keybd*/,
362 int /*count*/);
363
364#ifdef XKB
365extern void CoreProcessPointerEvent(
366 xEventPtr /*xE*/,
367 DeviceIntPtr /*mouse*/,
368 int /*count*/);
369
370extern void CoreProcessKeyboardEvent(
371 xEventPtr /*xE*/,
372 DeviceIntPtr /*keybd*/,
373 int /*count*/);
374#endif
375
376extern Bool LegalModifier(
377 unsigned int /*key*/,
378 DeviceIntPtr /*pDev*/);
379
380extern void ProcessInputEvents(void);
381
382extern void InitInput(
383 int /*argc*/,
384 char ** /*argv*/);
385
386extern int GetMaximumEventsNum(void);
387
388extern int GetPointerEvents(
389 xEvent *events,
390 DeviceIntPtr pDev,
391 int type,
392 int buttons,
393 int flags,
394 int first_valuator,
395 int num_valuators,
396 int *valuators);
397
398extern int GetKeyboardEvents(
399 xEvent *events,
400 DeviceIntPtr pDev,
401 int type,
402 int key_code);
403
404extern int GetKeyboardValuatorEvents(
405 xEvent *events,
406 DeviceIntPtr pDev,
407 int type,
408 int key_code,
409 int first_valuator,
410 int num_valuator,
411 int *valuators);
412
413extern int GetProximityEvents(
414 xEvent *events,
415 DeviceIntPtr pDev,
416 int type,
417 int first_valuator,
418 int num_valuators,
419 int *valuators);
420
421extern void PostSyntheticMotion(
422 int x,
423 int y,
424 int screen,
425 unsigned long time);
426
427extern int GetMotionHistorySize(
428 void);
429
430extern void AllocateMotionHistory(
431 DeviceIntPtr pDev);
432
433extern int GetMotionHistory(
434 DeviceIntPtr pDev,
435 xTimecoord *buff,
436 unsigned long start,
437 unsigned long stop,
438 ScreenPtr pScreen);
439
440extern void SwitchCoreKeyboard(DeviceIntPtr pDev);
441extern void SwitchCorePointer(DeviceIntPtr pDev);
442
443extern DeviceIntPtr LookupDeviceIntRec(
444 CARD8 deviceid);
445
446/* Implemented by the DDX. */
447extern int NewInputDeviceRequest(
448 InputOption *options,
449 DeviceIntPtr *dev);
450extern void DeleteInputDeviceRequest(
451 DeviceIntPtr dev);
452
453extern void DDXRingBell(
454 int volume,
455 int pitch,
456 int duration);
457
458#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