1 | /************************************************************
|
---|
2 |
|
---|
3 | Copyright 1987, 1998 The Open Group
|
---|
4 |
|
---|
5 | Permission to use, copy, modify, distribute, and sell this software and its
|
---|
6 | documentation for any purpose is hereby granted without fee, provided that
|
---|
7 | the above copyright notice appear in all copies and that both that
|
---|
8 | copyright notice and this permission notice appear in supporting
|
---|
9 | documentation.
|
---|
10 |
|
---|
11 | The above copyright notice and this permission notice shall be included in
|
---|
12 | all copies or substantial portions of the Software.
|
---|
13 |
|
---|
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
17 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
18 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
20 |
|
---|
21 | Except as contained in this notice, the name of The Open Group shall not be
|
---|
22 | used in advertising or otherwise to promote the sale, use or other dealings
|
---|
23 | in this Software without prior written authorization from The Open Group.
|
---|
24 |
|
---|
25 |
|
---|
26 | Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
---|
27 |
|
---|
28 | All Rights Reserved
|
---|
29 |
|
---|
30 | Permission to use, copy, modify, and distribute this software and its
|
---|
31 | documentation for any purpose and without fee is hereby granted,
|
---|
32 | provided that the above copyright notice appear in all copies and that
|
---|
33 | both that copyright notice and this permission notice appear in
|
---|
34 | supporting documentation, and that the name of Digital not be
|
---|
35 | used in advertising or publicity pertaining to distribution of the
|
---|
36 | software without specific, written prior permission.
|
---|
37 |
|
---|
38 | DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
---|
39 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
---|
40 | DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
---|
41 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
---|
42 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
---|
43 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
---|
44 | SOFTWARE.
|
---|
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 <stdint.h>
|
---|
56 | #include "window.h" /* for WindowPtr */
|
---|
57 | #include "xkbrules.h"
|
---|
58 | #include "events.h"
|
---|
59 |
|
---|
60 | #define DEVICE_INIT 0
|
---|
61 | #define DEVICE_ON 1
|
---|
62 | #define DEVICE_OFF 2
|
---|
63 | #define DEVICE_CLOSE 3
|
---|
64 |
|
---|
65 | #define POINTER_RELATIVE (1 << 1)
|
---|
66 | #define POINTER_ABSOLUTE (1 << 2)
|
---|
67 | #define POINTER_ACCELERATE (1 << 3)
|
---|
68 | #define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */
|
---|
69 |
|
---|
70 | /*int constants for pointer acceleration schemes*/
|
---|
71 | #define PtrAccelNoOp 0
|
---|
72 | #define PtrAccelPredictable 1
|
---|
73 | #define PtrAccelLightweight 2
|
---|
74 | #define PtrAccelDefault PtrAccelPredictable
|
---|
75 |
|
---|
76 | #define MAX_VALUATORS 36
|
---|
77 | /* Maximum number of valuators, divided by six, rounded up, to get number
|
---|
78 | * of events. */
|
---|
79 | #define MAX_VALUATOR_EVENTS 6
|
---|
80 | #define MAX_BUTTONS 256 /* completely arbitrarily chosen */
|
---|
81 |
|
---|
82 | #define NO_AXIS_LIMITS -1
|
---|
83 |
|
---|
84 | #define MAP_LENGTH 256
|
---|
85 | #define DOWN_LENGTH 32 /* 256/8 => number of bytes to hold 256 bits */
|
---|
86 | #define NullGrab ((GrabPtr)NULL)
|
---|
87 | #define PointerRootWin ((WindowPtr)PointerRoot)
|
---|
88 | #define NoneWin ((WindowPtr)None)
|
---|
89 | #define NullDevice ((DevicePtr)NULL)
|
---|
90 |
|
---|
91 | #ifndef FollowKeyboard
|
---|
92 | #define FollowKeyboard 3
|
---|
93 | #endif
|
---|
94 | #ifndef FollowKeyboardWin
|
---|
95 | #define FollowKeyboardWin ((WindowPtr) FollowKeyboard)
|
---|
96 | #endif
|
---|
97 | #ifndef RevertToFollowKeyboard
|
---|
98 | #define RevertToFollowKeyboard 3
|
---|
99 | #endif
|
---|
100 |
|
---|
101 | typedef unsigned long Leds;
|
---|
102 | typedef struct _OtherClients *OtherClientsPtr;
|
---|
103 | typedef struct _InputClients *InputClientsPtr;
|
---|
104 | typedef struct _DeviceIntRec *DeviceIntPtr;
|
---|
105 | typedef struct _ClassesRec *ClassesPtr;
|
---|
106 | typedef union _GrabMask GrabMask;
|
---|
107 |
|
---|
108 | typedef struct _EventList {
|
---|
109 | xEvent* event;
|
---|
110 | int evlen; /* length of allocated memory for event in bytes. This is not
|
---|
111 | the actual length of the event. The event's actual length is
|
---|
112 | 32 for standard events or 32 +
|
---|
113 | ((xGenericEvent*)event)->length * 4 for GenericEvents.
|
---|
114 | For events in the EQ, the length is
|
---|
115 | ((InternalEvent*)event)->u.any.length */
|
---|
116 | } EventList, *EventListPtr;
|
---|
117 |
|
---|
118 | /* The DIX stores incoming input events in this list */
|
---|
119 | extern EventListPtr InputEventList;
|
---|
120 | extern int InputEventListLen;
|
---|
121 |
|
---|
122 | typedef int (*DeviceProc)(
|
---|
123 | DeviceIntPtr /*device*/,
|
---|
124 | int /*what*/);
|
---|
125 |
|
---|
126 | typedef void (*ProcessInputProc)(
|
---|
127 | InternalEvent * /*event*/,
|
---|
128 | DeviceIntPtr /*device*/);
|
---|
129 |
|
---|
130 | typedef Bool (*DeviceHandleProc)(
|
---|
131 | DeviceIntPtr /*device*/,
|
---|
132 | void* /*data*/
|
---|
133 | );
|
---|
134 |
|
---|
135 | typedef void (*DeviceUnwrapProc)(
|
---|
136 | DeviceIntPtr /*device*/,
|
---|
137 | DeviceHandleProc /*proc*/,
|
---|
138 | void* /*data*/
|
---|
139 | );
|
---|
140 |
|
---|
141 | /* pointer acceleration handling */
|
---|
142 | typedef void (*PointerAccelSchemeProc)(
|
---|
143 | DeviceIntPtr /*pDev*/,
|
---|
144 | int /*first_valuator*/,
|
---|
145 | int /*num_valuators*/,
|
---|
146 | int* /*valuators*/,
|
---|
147 | int /*evtime*/);
|
---|
148 |
|
---|
149 | typedef void (*DeviceCallbackProc)(
|
---|
150 | DeviceIntPtr /*pDev*/);
|
---|
151 |
|
---|
152 | typedef struct _DeviceRec {
|
---|
153 | pointer devicePrivate;
|
---|
154 | ProcessInputProc processInputProc; /* current */
|
---|
155 | ProcessInputProc realInputProc; /* deliver */
|
---|
156 | ProcessInputProc enqueueInputProc; /* enqueue */
|
---|
157 | Bool on; /* used by DDX to keep state */
|
---|
158 | } DeviceRec, *DevicePtr;
|
---|
159 |
|
---|
160 | typedef struct {
|
---|
161 | int click, bell, bell_pitch, bell_duration;
|
---|
162 | Bool autoRepeat;
|
---|
163 | unsigned char autoRepeats[32];
|
---|
164 | Leds leds;
|
---|
165 | unsigned char id;
|
---|
166 | } KeybdCtrl;
|
---|
167 |
|
---|
168 | typedef struct {
|
---|
169 | KeySym *map;
|
---|
170 | KeyCode minKeyCode,
|
---|
171 | maxKeyCode;
|
---|
172 | int mapWidth;
|
---|
173 | } KeySymsRec, *KeySymsPtr;
|
---|
174 |
|
---|
175 | typedef struct {
|
---|
176 | int num, den, threshold;
|
---|
177 | unsigned char id;
|
---|
178 | } PtrCtrl;
|
---|
179 |
|
---|
180 | typedef struct {
|
---|
181 | int resolution, min_value, max_value;
|
---|
182 | int integer_displayed;
|
---|
183 | unsigned char id;
|
---|
184 | } IntegerCtrl;
|
---|
185 |
|
---|
186 | typedef struct {
|
---|
187 | int max_symbols, num_symbols_supported;
|
---|
188 | int num_symbols_displayed;
|
---|
189 | KeySym *symbols_supported;
|
---|
190 | KeySym *symbols_displayed;
|
---|
191 | unsigned char id;
|
---|
192 | } StringCtrl;
|
---|
193 |
|
---|
194 | typedef struct {
|
---|
195 | int percent, pitch, duration;
|
---|
196 | unsigned char id;
|
---|
197 | } BellCtrl;
|
---|
198 |
|
---|
199 | typedef struct {
|
---|
200 | Leds led_values;
|
---|
201 | Mask led_mask;
|
---|
202 | unsigned char id;
|
---|
203 | } LedCtrl;
|
---|
204 |
|
---|
205 | extern _X_EXPORT KeybdCtrl defaultKeyboardControl;
|
---|
206 | extern _X_EXPORT PtrCtrl defaultPointerControl;
|
---|
207 |
|
---|
208 | typedef struct _InputOption {
|
---|
209 | char *key;
|
---|
210 | char *value;
|
---|
211 | struct _InputOption *next;
|
---|
212 | } InputOption;
|
---|
213 |
|
---|
214 | typedef struct _InputAttributes {
|
---|
215 | char *product;
|
---|
216 | char *vendor;
|
---|
217 | char *device;
|
---|
218 | char *pnp_id;
|
---|
219 | char *usb_id;
|
---|
220 | char **tags; /* null-terminated */
|
---|
221 | uint32_t flags;
|
---|
222 | } InputAttributes;
|
---|
223 |
|
---|
224 | #define ATTR_KEYBOARD (1<<0)
|
---|
225 | #define ATTR_POINTER (1<<1)
|
---|
226 | #define ATTR_JOYSTICK (1<<2)
|
---|
227 | #define ATTR_TABLET (1<<3)
|
---|
228 | #define ATTR_TOUCHPAD (1<<4)
|
---|
229 | #define ATTR_TOUCHSCREEN (1<<5)
|
---|
230 |
|
---|
231 | /* Key/Button has been run through all input processing and events sent to clients. */
|
---|
232 | #define KEY_PROCESSED 1
|
---|
233 | #define BUTTON_PROCESSED 1
|
---|
234 | /* Key/Button has not been fully processed, no events have been sent. */
|
---|
235 | #define KEY_POSTED 2
|
---|
236 | #define BUTTON_POSTED 2
|
---|
237 |
|
---|
238 | extern void set_key_down(DeviceIntPtr pDev, int key_code, int type);
|
---|
239 | extern void set_key_up(DeviceIntPtr pDev, int key_code, int type);
|
---|
240 | extern int key_is_down(DeviceIntPtr pDev, int key_code, int type);
|
---|
241 | extern void set_button_down(DeviceIntPtr pDev, int button, int type);
|
---|
242 | extern void set_button_up(DeviceIntPtr pDev, int button, int type);
|
---|
243 | extern int button_is_down(DeviceIntPtr pDev, int button, int type);
|
---|
244 |
|
---|
245 | extern void InitCoreDevices(void);
|
---|
246 | extern void InitXTestDevices(void);
|
---|
247 |
|
---|
248 | extern _X_EXPORT DeviceIntPtr AddInputDevice(
|
---|
249 | ClientPtr /*client*/,
|
---|
250 | DeviceProc /*deviceProc*/,
|
---|
251 | Bool /*autoStart*/);
|
---|
252 |
|
---|
253 | extern _X_EXPORT Bool EnableDevice(
|
---|
254 | DeviceIntPtr /*device*/,
|
---|
255 | BOOL /* sendevent */);
|
---|
256 |
|
---|
257 | extern _X_EXPORT Bool ActivateDevice(
|
---|
258 | DeviceIntPtr /*device*/,
|
---|
259 | BOOL /* sendevent */);
|
---|
260 |
|
---|
261 | extern _X_EXPORT Bool DisableDevice(
|
---|
262 | DeviceIntPtr /*device*/,
|
---|
263 | BOOL /* sendevent */);
|
---|
264 |
|
---|
265 | extern int InitAndStartDevices(void);
|
---|
266 |
|
---|
267 | extern void CloseDownDevices(void);
|
---|
268 |
|
---|
269 | extern void UndisplayDevices(void);
|
---|
270 |
|
---|
271 | extern _X_EXPORT int RemoveDevice(
|
---|
272 | DeviceIntPtr /*dev*/,
|
---|
273 | BOOL /* sendevent */);
|
---|
274 |
|
---|
275 | extern _X_EXPORT int NumMotionEvents(void);
|
---|
276 |
|
---|
277 | extern void RegisterPointerDevice(
|
---|
278 | DeviceIntPtr /*device*/);
|
---|
279 |
|
---|
280 | extern void RegisterKeyboardDevice(
|
---|
281 | DeviceIntPtr /*device*/);
|
---|
282 |
|
---|
283 | extern _X_EXPORT int dixLookupDevice(
|
---|
284 | DeviceIntPtr * /* dev */,
|
---|
285 | int /* id */,
|
---|
286 | ClientPtr /* client */,
|
---|
287 | Mask /* access_mode */);
|
---|
288 |
|
---|
289 | extern _X_EXPORT void QueryMinMaxKeyCodes(
|
---|
290 | KeyCode* /*minCode*/,
|
---|
291 | KeyCode* /*maxCode*/);
|
---|
292 |
|
---|
293 | extern _X_EXPORT Bool SetKeySymsMap(
|
---|
294 | KeySymsPtr /*dst*/,
|
---|
295 | KeySymsPtr /*src*/);
|
---|
296 |
|
---|
297 | extern _X_EXPORT Bool InitButtonClassDeviceStruct(
|
---|
298 | DeviceIntPtr /*device*/,
|
---|
299 | int /*numButtons*/,
|
---|
300 | Atom* /* labels */,
|
---|
301 | CARD8* /*map*/);
|
---|
302 |
|
---|
303 | extern _X_EXPORT Bool InitValuatorClassDeviceStruct(
|
---|
304 | DeviceIntPtr /*device*/,
|
---|
305 | int /*numAxes*/,
|
---|
306 | Atom* /* labels */,
|
---|
307 | int /*numMotionEvents*/,
|
---|
308 | int /*mode*/);
|
---|
309 |
|
---|
310 | extern _X_EXPORT Bool InitPointerAccelerationScheme(
|
---|
311 | DeviceIntPtr /*dev*/,
|
---|
312 | int /*scheme*/);
|
---|
313 |
|
---|
314 | extern _X_EXPORT Bool InitAbsoluteClassDeviceStruct(
|
---|
315 | DeviceIntPtr /*device*/);
|
---|
316 |
|
---|
317 | extern _X_EXPORT Bool InitFocusClassDeviceStruct(
|
---|
318 | DeviceIntPtr /*device*/);
|
---|
319 |
|
---|
320 | typedef void (*BellProcPtr)(
|
---|
321 | int /*percent*/,
|
---|
322 | DeviceIntPtr /*device*/,
|
---|
323 | pointer /*ctrl*/,
|
---|
324 | int);
|
---|
325 |
|
---|
326 | typedef void (*KbdCtrlProcPtr)(
|
---|
327 | DeviceIntPtr /*device*/,
|
---|
328 | KeybdCtrl * /*ctrl*/);
|
---|
329 |
|
---|
330 | typedef void (*PtrCtrlProcPtr)(
|
---|
331 | DeviceIntPtr /*device*/,
|
---|
332 | PtrCtrl * /*ctrl*/);
|
---|
333 |
|
---|
334 | extern _X_EXPORT Bool InitPtrFeedbackClassDeviceStruct(
|
---|
335 | DeviceIntPtr /*device*/,
|
---|
336 | PtrCtrlProcPtr /*controlProc*/);
|
---|
337 |
|
---|
338 | typedef void (*StringCtrlProcPtr)(
|
---|
339 | DeviceIntPtr /*device*/,
|
---|
340 | StringCtrl * /*ctrl*/);
|
---|
341 |
|
---|
342 | extern _X_EXPORT Bool InitStringFeedbackClassDeviceStruct(
|
---|
343 | DeviceIntPtr /*device*/,
|
---|
344 | StringCtrlProcPtr /*controlProc*/,
|
---|
345 | int /*max_symbols*/,
|
---|
346 | int /*num_symbols_supported*/,
|
---|
347 | KeySym* /*symbols*/);
|
---|
348 |
|
---|
349 | typedef void (*BellCtrlProcPtr)(
|
---|
350 | DeviceIntPtr /*device*/,
|
---|
351 | BellCtrl * /*ctrl*/);
|
---|
352 |
|
---|
353 | extern _X_EXPORT Bool InitBellFeedbackClassDeviceStruct(
|
---|
354 | DeviceIntPtr /*device*/,
|
---|
355 | BellProcPtr /*bellProc*/,
|
---|
356 | BellCtrlProcPtr /*controlProc*/);
|
---|
357 |
|
---|
358 | typedef void (*LedCtrlProcPtr)(
|
---|
359 | DeviceIntPtr /*device*/,
|
---|
360 | LedCtrl * /*ctrl*/);
|
---|
361 |
|
---|
362 | extern _X_EXPORT Bool InitLedFeedbackClassDeviceStruct(
|
---|
363 | DeviceIntPtr /*device*/,
|
---|
364 | LedCtrlProcPtr /*controlProc*/);
|
---|
365 |
|
---|
366 | typedef void (*IntegerCtrlProcPtr)(
|
---|
367 | DeviceIntPtr /*device*/,
|
---|
368 | IntegerCtrl * /*ctrl*/);
|
---|
369 |
|
---|
370 |
|
---|
371 | extern _X_EXPORT Bool InitIntegerFeedbackClassDeviceStruct(
|
---|
372 | DeviceIntPtr /*device*/,
|
---|
373 | IntegerCtrlProcPtr /*controlProc*/);
|
---|
374 |
|
---|
375 | extern _X_EXPORT Bool InitPointerDeviceStruct(
|
---|
376 | DevicePtr /*device*/,
|
---|
377 | CARD8* /*map*/,
|
---|
378 | int /*numButtons*/,
|
---|
379 | Atom* /* btn_labels */,
|
---|
380 | PtrCtrlProcPtr /*controlProc*/,
|
---|
381 | int /*numMotionEvents*/,
|
---|
382 | int /*numAxes*/,
|
---|
383 | Atom* /* axes_labels */);
|
---|
384 |
|
---|
385 | extern _X_EXPORT Bool InitKeyboardDeviceStruct(
|
---|
386 | DeviceIntPtr /*device*/,
|
---|
387 | XkbRMLVOSet * /*rmlvo*/,
|
---|
388 | BellProcPtr /*bellProc*/,
|
---|
389 | KbdCtrlProcPtr /*controlProc*/);
|
---|
390 |
|
---|
391 | extern int ApplyPointerMapping(
|
---|
392 | DeviceIntPtr /* pDev */,
|
---|
393 | CARD8 * /* map */,
|
---|
394 | int /* len */,
|
---|
395 | ClientPtr /* client */);
|
---|
396 |
|
---|
397 | extern Bool BadDeviceMap(
|
---|
398 | BYTE* /*buff*/,
|
---|
399 | int /*length*/,
|
---|
400 | unsigned /*low*/,
|
---|
401 | unsigned /*high*/,
|
---|
402 | XID* /*errval*/);
|
---|
403 |
|
---|
404 | extern void NoteLedState(
|
---|
405 | DeviceIntPtr /*keybd*/,
|
---|
406 | int /*led*/,
|
---|
407 | Bool /*on*/);
|
---|
408 |
|
---|
409 | extern void MaybeStopHint(
|
---|
410 | DeviceIntPtr /*device*/,
|
---|
411 | ClientPtr /*client*/);
|
---|
412 |
|
---|
413 | extern void ProcessPointerEvent(
|
---|
414 | InternalEvent* /* ev */,
|
---|
415 | DeviceIntPtr /*mouse*/);
|
---|
416 |
|
---|
417 | extern void ProcessKeyboardEvent(
|
---|
418 | InternalEvent* /*ev*/,
|
---|
419 | DeviceIntPtr /*keybd*/);
|
---|
420 |
|
---|
421 | extern Bool LegalModifier(
|
---|
422 | unsigned int /*key*/,
|
---|
423 | DeviceIntPtr /*pDev*/);
|
---|
424 |
|
---|
425 | extern _X_EXPORT void ProcessInputEvents(void);
|
---|
426 |
|
---|
427 | extern _X_EXPORT void InitInput(
|
---|
428 | int /*argc*/,
|
---|
429 | char ** /*argv*/);
|
---|
430 | extern _X_EXPORT void CloseInput(void);
|
---|
431 |
|
---|
432 | extern _X_EXPORT int GetMaximumEventsNum(void);
|
---|
433 |
|
---|
434 | extern _X_EXPORT int GetEventList(EventListPtr* list);
|
---|
435 | extern _X_EXPORT EventListPtr InitEventList(int num_events);
|
---|
436 | extern _X_EXPORT void FreeEventList(EventListPtr list, int num_events);
|
---|
437 |
|
---|
438 | extern void CreateClassesChangedEvent(EventListPtr event,
|
---|
439 | DeviceIntPtr master,
|
---|
440 | DeviceIntPtr slave,
|
---|
441 | int type);
|
---|
442 | extern EventListPtr UpdateFromMaster(
|
---|
443 | EventListPtr events,
|
---|
444 | DeviceIntPtr pDev,
|
---|
445 | int type,
|
---|
446 | int *num_events);
|
---|
447 |
|
---|
448 | extern _X_EXPORT int GetPointerEvents(
|
---|
449 | EventListPtr events,
|
---|
450 | DeviceIntPtr pDev,
|
---|
451 | int type,
|
---|
452 | int buttons,
|
---|
453 | int flags,
|
---|
454 | int first_valuator,
|
---|
455 | int num_valuators,
|
---|
456 | int *valuators);
|
---|
457 |
|
---|
458 | extern _X_EXPORT int GetKeyboardEvents(
|
---|
459 | EventListPtr events,
|
---|
460 | DeviceIntPtr pDev,
|
---|
461 | int type,
|
---|
462 | int key_code);
|
---|
463 |
|
---|
464 | extern int GetKeyboardValuatorEvents(
|
---|
465 | EventListPtr events,
|
---|
466 | DeviceIntPtr pDev,
|
---|
467 | int type,
|
---|
468 | int key_code,
|
---|
469 | int first_valuator,
|
---|
470 | int num_valuator,
|
---|
471 | int *valuators);
|
---|
472 |
|
---|
473 | extern int GetProximityEvents(
|
---|
474 | EventListPtr events,
|
---|
475 | DeviceIntPtr pDev,
|
---|
476 | int type,
|
---|
477 | int first_valuator,
|
---|
478 | int num_valuators,
|
---|
479 | int *valuators);
|
---|
480 |
|
---|
481 | extern void PostSyntheticMotion(
|
---|
482 | DeviceIntPtr pDev,
|
---|
483 | int x,
|
---|
484 | int y,
|
---|
485 | int screen,
|
---|
486 | unsigned long time);
|
---|
487 |
|
---|
488 | extern _X_EXPORT int GetMotionHistorySize(
|
---|
489 | void);
|
---|
490 |
|
---|
491 | extern _X_EXPORT void AllocateMotionHistory(
|
---|
492 | DeviceIntPtr pDev);
|
---|
493 |
|
---|
494 | extern _X_EXPORT int GetMotionHistory(
|
---|
495 | DeviceIntPtr pDev,
|
---|
496 | xTimecoord **buff,
|
---|
497 | unsigned long start,
|
---|
498 | unsigned long stop,
|
---|
499 | ScreenPtr pScreen,
|
---|
500 | BOOL core);
|
---|
501 |
|
---|
502 | extern int AttachDevice(ClientPtr client,
|
---|
503 | DeviceIntPtr slave,
|
---|
504 | DeviceIntPtr master);
|
---|
505 |
|
---|
506 | extern _X_EXPORT DeviceIntPtr GetPairedDevice(DeviceIntPtr kbd);
|
---|
507 | extern DeviceIntPtr GetMaster(DeviceIntPtr dev, int type);
|
---|
508 |
|
---|
509 | extern _X_EXPORT int AllocDevicePair(ClientPtr client,
|
---|
510 | char* name,
|
---|
511 | DeviceIntPtr* ptr,
|
---|
512 | DeviceIntPtr* keybd,
|
---|
513 | DeviceProc ptr_proc,
|
---|
514 | DeviceProc keybd_proc,
|
---|
515 | Bool master);
|
---|
516 | extern void DeepCopyDeviceClasses(DeviceIntPtr from,
|
---|
517 | DeviceIntPtr to,
|
---|
518 | DeviceChangedEvent *dce);
|
---|
519 |
|
---|
520 | /* Helper functions. */
|
---|
521 | extern _X_EXPORT int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
|
---|
522 | KeyCode **modkeymap, int *max_keys_per_mod);
|
---|
523 | extern int change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *map,
|
---|
524 | int max_keys_per_mod);
|
---|
525 | extern int AllocXTestDevice(ClientPtr client,
|
---|
526 | char* name,
|
---|
527 | DeviceIntPtr* ptr,
|
---|
528 | DeviceIntPtr* keybd,
|
---|
529 | DeviceIntPtr master_ptr,
|
---|
530 | DeviceIntPtr master_keybd);
|
---|
531 | extern BOOL IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master);
|
---|
532 | extern DeviceIntPtr GetXTestDevice(DeviceIntPtr master);
|
---|
533 | extern void SendDevicePresenceEvent(int deviceid, int type);
|
---|
534 | extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *attrs);
|
---|
535 | extern _X_EXPORT void FreeInputAttributes(InputAttributes *attrs);
|
---|
536 |
|
---|
537 | /* misc event helpers */
|
---|
538 | extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event);
|
---|
539 | extern Mask GetWindowXI2Mask(DeviceIntPtr dev, WindowPtr win, xEvent* ev);
|
---|
540 | void FixUpEventFromWindow(DeviceIntPtr pDev,
|
---|
541 | xEvent *xE,
|
---|
542 | WindowPtr pWin,
|
---|
543 | Window child,
|
---|
544 | Bool calcChild);
|
---|
545 |
|
---|
546 | /* Implemented by the DDX. */
|
---|
547 | extern _X_EXPORT int NewInputDeviceRequest(
|
---|
548 | InputOption *options,
|
---|
549 | InputAttributes *attrs,
|
---|
550 | DeviceIntPtr *dev);
|
---|
551 | extern _X_EXPORT void DeleteInputDeviceRequest(
|
---|
552 | DeviceIntPtr dev);
|
---|
553 |
|
---|
554 | extern _X_EXPORT void DDXRingBell(
|
---|
555 | int volume,
|
---|
556 | int pitch,
|
---|
557 | int duration);
|
---|
558 |
|
---|
559 | /* Set to TRUE by default - os/utils.c sets it to FALSE on user request,
|
---|
560 | xfixes/cursor.c uses it to determine if the cursor is enabled */
|
---|
561 | extern Bool EnableCursor;
|
---|
562 |
|
---|
563 | #endif /* INPUT_H */
|
---|