VirtualBox

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

最後變更 在這個檔案從61386是 25078,由 vboxsync 提交於 15 年 前

Additions/x11/x11include: exported and set eol-style on new headers

  • 屬性 svn:eol-style 設為 native
檔案大小: 9.4 KB
 
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 MAP_LENGTH 256
63#define DOWN_LENGTH 32 /* 256/8 => number of bytes to hold 256 bits */
64#define NullGrab ((GrabPtr)NULL)
65#define PointerRootWin ((WindowPtr)PointerRoot)
66#define NoneWin ((WindowPtr)None)
67#define NullDevice ((DevicePtr)NULL)
68
69#ifndef FollowKeyboard
70#define FollowKeyboard 3
71#endif
72#ifndef FollowKeyboardWin
73#define FollowKeyboardWin ((WindowPtr) FollowKeyboard)
74#endif
75#ifndef RevertToFollowKeyboard
76#define RevertToFollowKeyboard 3
77#endif
78
79typedef unsigned long Leds;
80typedef struct _OtherClients *OtherClientsPtr;
81typedef struct _InputClients *InputClientsPtr;
82typedef struct _DeviceIntRec *DeviceIntPtr;
83
84typedef int (*DeviceProc)(
85 DeviceIntPtr /*device*/,
86 int /*what*/);
87
88typedef void (*ProcessInputProc)(
89 xEventPtr /*events*/,
90 DeviceIntPtr /*device*/,
91 int /*count*/);
92
93typedef Bool (*DeviceHandleProc)(
94 DeviceIntPtr /*device*/,
95 void* /*data*/
96 );
97
98typedef void (*DeviceUnwrapProc)(
99 DeviceIntPtr /*device*/,
100 DeviceHandleProc /*proc*/,
101 void* /*data*/
102 );
103
104typedef struct _DeviceRec {
105 pointer devicePrivate;
106 ProcessInputProc processInputProc; /* current */
107 ProcessInputProc realInputProc; /* deliver */
108 ProcessInputProc enqueueInputProc; /* enqueue */
109 Bool on; /* used by DDX to keep state */
110} DeviceRec, *DevicePtr;
111
112typedef struct {
113 int click, bell, bell_pitch, bell_duration;
114 Bool autoRepeat;
115 unsigned char autoRepeats[32];
116 Leds leds;
117 unsigned char id;
118} KeybdCtrl;
119
120typedef struct {
121 KeySym *map;
122 KeyCode minKeyCode,
123 maxKeyCode;
124 int mapWidth;
125} KeySymsRec, *KeySymsPtr;
126
127typedef struct {
128 int num, den, threshold;
129 unsigned char id;
130} PtrCtrl;
131
132typedef struct {
133 int resolution, min_value, max_value;
134 int integer_displayed;
135 unsigned char id;
136} IntegerCtrl;
137
138typedef struct {
139 int max_symbols, num_symbols_supported;
140 int num_symbols_displayed;
141 KeySym *symbols_supported;
142 KeySym *symbols_displayed;
143 unsigned char id;
144} StringCtrl;
145
146typedef struct {
147 int percent, pitch, duration;
148 unsigned char id;
149} BellCtrl;
150
151typedef struct {
152 Leds led_values;
153 Mask led_mask;
154 unsigned char id;
155} LedCtrl;
156
157extern int AllocateDevicePrivateIndex(void);
158extern Bool AllocateDevicePrivate(DeviceIntPtr device, int index);
159extern void ResetDevicePrivateIndex(void);
160
161extern KeybdCtrl defaultKeyboardControl;
162extern PtrCtrl defaultPointerControl;
163
164extern DeviceIntPtr AddInputDevice(
165 DeviceProc /*deviceProc*/,
166 Bool /*autoStart*/);
167
168extern Bool EnableDevice(
169 DeviceIntPtr /*device*/);
170
171extern Bool DisableDevice(
172 DeviceIntPtr /*device*/);
173
174extern int InitAndStartDevices(void);
175
176extern void CloseDownDevices(void);
177
178extern void RemoveDevice(
179 DeviceIntPtr /*dev*/);
180
181extern int NumMotionEvents(void);
182
183extern void RegisterPointerDevice(
184 DeviceIntPtr /*device*/);
185
186extern void RegisterKeyboardDevice(
187 DeviceIntPtr /*device*/);
188
189extern DevicePtr LookupKeyboardDevice(void);
190
191extern DevicePtr LookupPointerDevice(void);
192
193extern DevicePtr LookupDevice(
194 int /* id */);
195
196extern void QueryMinMaxKeyCodes(
197 KeyCode* /*minCode*/,
198 KeyCode* /*maxCode*/);
199
200extern Bool SetKeySymsMap(
201 KeySymsPtr /*dst*/,
202 KeySymsPtr /*src*/);
203
204extern Bool InitKeyClassDeviceStruct(
205 DeviceIntPtr /*device*/,
206 KeySymsPtr /*pKeySyms*/,
207 CARD8 /*pModifiers*/[]);
208
209extern Bool InitButtonClassDeviceStruct(
210 DeviceIntPtr /*device*/,
211 int /*numButtons*/,
212 CARD8* /*map*/);
213
214typedef int (*ValuatorMotionProcPtr)(
215 DeviceIntPtr /*pdevice*/,
216 xTimecoord * /*coords*/,
217 unsigned long /*start*/,
218 unsigned long /*stop*/,
219 ScreenPtr /*pScreen*/);
220
221extern Bool InitValuatorClassDeviceStruct(
222 DeviceIntPtr /*device*/,
223 int /*numAxes*/,
224 ValuatorMotionProcPtr /* motionProc */,
225 int /*numMotionEvents*/,
226 int /*mode*/);
227
228extern Bool InitFocusClassDeviceStruct(
229 DeviceIntPtr /*device*/);
230
231typedef void (*BellProcPtr)(
232 int /*percent*/,
233 DeviceIntPtr /*device*/,
234 pointer /*ctrl*/,
235 int);
236
237typedef void (*KbdCtrlProcPtr)(
238 DeviceIntPtr /*device*/,
239 KeybdCtrl * /*ctrl*/);
240
241extern Bool InitKbdFeedbackClassDeviceStruct(
242 DeviceIntPtr /*device*/,
243 BellProcPtr /*bellProc*/,
244 KbdCtrlProcPtr /*controlProc*/);
245
246typedef void (*PtrCtrlProcPtr)(
247 DeviceIntPtr /*device*/,
248 PtrCtrl * /*ctrl*/);
249
250extern Bool InitPtrFeedbackClassDeviceStruct(
251 DeviceIntPtr /*device*/,
252 PtrCtrlProcPtr /*controlProc*/);
253
254typedef void (*StringCtrlProcPtr)(
255 DeviceIntPtr /*device*/,
256 StringCtrl * /*ctrl*/);
257
258extern Bool InitStringFeedbackClassDeviceStruct(
259 DeviceIntPtr /*device*/,
260 StringCtrlProcPtr /*controlProc*/,
261 int /*max_symbols*/,
262 int /*num_symbols_supported*/,
263 KeySym* /*symbols*/);
264
265typedef void (*BellCtrlProcPtr)(
266 DeviceIntPtr /*device*/,
267 BellCtrl * /*ctrl*/);
268
269extern Bool InitBellFeedbackClassDeviceStruct(
270 DeviceIntPtr /*device*/,
271 BellProcPtr /*bellProc*/,
272 BellCtrlProcPtr /*controlProc*/);
273
274typedef void (*LedCtrlProcPtr)(
275 DeviceIntPtr /*device*/,
276 LedCtrl * /*ctrl*/);
277
278extern Bool InitLedFeedbackClassDeviceStruct(
279 DeviceIntPtr /*device*/,
280 LedCtrlProcPtr /*controlProc*/);
281
282typedef void (*IntegerCtrlProcPtr)(
283 DeviceIntPtr /*device*/,
284 IntegerCtrl * /*ctrl*/);
285
286
287extern Bool InitIntegerFeedbackClassDeviceStruct(
288 DeviceIntPtr /*device*/,
289 IntegerCtrlProcPtr /*controlProc*/);
290
291extern Bool InitPointerDeviceStruct(
292 DevicePtr /*device*/,
293 CARD8* /*map*/,
294 int /*numButtons*/,
295 ValuatorMotionProcPtr /*motionProc*/,
296 PtrCtrlProcPtr /*controlProc*/,
297 int /*numMotionEvents*/);
298
299extern Bool InitKeyboardDeviceStruct(
300 DevicePtr /*device*/,
301 KeySymsPtr /*pKeySyms*/,
302 CARD8 /*pModifiers*/[],
303 BellProcPtr /*bellProc*/,
304 KbdCtrlProcPtr /*controlProc*/);
305
306extern void SendMappingNotify(
307 unsigned int /*request*/,
308 unsigned int /*firstKeyCode*/,
309 unsigned int /*count*/,
310 ClientPtr /* client */);
311
312extern Bool BadDeviceMap(
313 BYTE* /*buff*/,
314 int /*length*/,
315 unsigned /*low*/,
316 unsigned /*high*/,
317 XID* /*errval*/);
318
319extern Bool AllModifierKeysAreUp(
320 DeviceIntPtr /*device*/,
321 CARD8* /*map1*/,
322 int /*per1*/,
323 CARD8* /*map2*/,
324 int /*per2*/);
325
326extern void NoteLedState(
327 DeviceIntPtr /*keybd*/,
328 int /*led*/,
329 Bool /*on*/);
330
331extern void MaybeStopHint(
332 DeviceIntPtr /*device*/,
333 ClientPtr /*client*/);
334
335extern void ProcessPointerEvent(
336 xEventPtr /*xE*/,
337 DeviceIntPtr /*mouse*/,
338 int /*count*/);
339
340extern void ProcessKeyboardEvent(
341 xEventPtr /*xE*/,
342 DeviceIntPtr /*keybd*/,
343 int /*count*/);
344
345#ifdef XKB
346extern void CoreProcessPointerEvent(
347 xEventPtr /*xE*/,
348 DeviceIntPtr /*mouse*/,
349 int /*count*/);
350
351extern void CoreProcessKeyboardEvent(
352 xEventPtr /*xE*/,
353 DeviceIntPtr /*keybd*/,
354 int /*count*/);
355#endif
356
357extern Bool LegalModifier(
358 unsigned int /*key*/,
359 DevicePtr /*pDev*/);
360
361extern void ProcessInputEvents(void);
362
363extern void InitInput(
364 int /*argc*/,
365 char ** /*argv*/);
366
367#endif /* INPUT_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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