VirtualBox

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

最後變更 在這個檔案從67129是 51223,由 vboxsync 提交於 11 年 前

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

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

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