VirtualBox

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

最後變更 在這個檔案從68753是 40349,由 vboxsync 提交於 13 年 前

Additions/xorg: support X.Org Server 1.12.

  • 屬性 svn:eol-style 設為 native
檔案大小: 24.2 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 <stdint.h>
56#include "window.h" /* for WindowPtr */
57#include "xkbrules.h"
58#include "events.h"
59#include "list.h"
60#include <X11/extensions/XI2.h>
61
62#define DEVICE_INIT 0
63#define DEVICE_ON 1
64#define DEVICE_OFF 2
65#define DEVICE_CLOSE 3
66
67#define POINTER_RELATIVE (1 << 1)
68#define POINTER_ABSOLUTE (1 << 2)
69#define POINTER_ACCELERATE (1 << 3)
70#define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */
71#define POINTER_NORAW (1 << 5) /* Don't generate RawEvents */
72#define POINTER_EMULATED (1 << 6) /* Event was emulated from another event */
73
74/* GetTouchEvent flags */
75#define TOUCH_ACCEPT (1 << 0)
76#define TOUCH_REJECT (1 << 1)
77#define TOUCH_PENDING_END (1 << 2)
78#define TOUCH_CLIENT_ID (1 << 3) /* touch ID is the client-visible id */
79#define TOUCH_REPLAYING (1 << 4) /* event is being replayed */
80#define TOUCH_POINTER_EMULATED (1 << 5) /* touch event may be pointer emulated */
81#define TOUCH_END (1 << 6) /* really end this touch now */
82
83/*int constants for pointer acceleration schemes*/
84#define PtrAccelNoOp 0
85#define PtrAccelPredictable 1
86#define PtrAccelLightweight 2
87#define PtrAccelDefault PtrAccelPredictable
88
89#define MAX_VALUATORS 36
90/* Maximum number of valuators, divided by six, rounded up, to get number
91 * of events. */
92#define MAX_VALUATOR_EVENTS 6
93#define MAX_BUTTONS 256 /* completely arbitrarily chosen */
94
95#define NO_AXIS_LIMITS -1
96
97#define MAP_LENGTH 256
98#define DOWN_LENGTH 32 /* 256/8 => number of bytes to hold 256 bits */
99#define NullGrab ((GrabPtr)NULL)
100#define PointerRootWin ((WindowPtr)PointerRoot)
101#define NoneWin ((WindowPtr)None)
102#define NullDevice ((DevicePtr)NULL)
103
104#ifndef FollowKeyboard
105#define FollowKeyboard 3
106#endif
107#ifndef FollowKeyboardWin
108#define FollowKeyboardWin ((WindowPtr) FollowKeyboard)
109#endif
110#ifndef RevertToFollowKeyboard
111#define RevertToFollowKeyboard 3
112#endif
113
114enum InputLevel {
115 CORE,
116 XI,
117 XI2,
118};
119
120typedef unsigned long Leds;
121typedef struct _OtherClients *OtherClientsPtr;
122typedef struct _InputClients *InputClientsPtr;
123typedef struct _DeviceIntRec *DeviceIntPtr;
124typedef struct _ValuatorClassRec *ValuatorClassPtr;
125typedef struct _ClassesRec *ClassesPtr;
126typedef struct _SpriteRec *SpritePtr;
127typedef struct _TouchClassRec *TouchClassPtr;
128typedef struct _TouchPointInfo *TouchPointInfoPtr;
129typedef struct _DDXTouchPointInfo *DDXTouchPointInfoPtr;
130typedef union _GrabMask GrabMask;
131
132typedef struct _ValuatorMask ValuatorMask;
133
134/* The DIX stores incoming input events in this list */
135extern InternalEvent* InputEventList;
136
137typedef int (*DeviceProc)(
138 DeviceIntPtr /*device*/,
139 int /*what*/);
140
141typedef void (*ProcessInputProc)(
142 InternalEvent * /*event*/,
143 DeviceIntPtr /*device*/);
144
145typedef Bool (*DeviceHandleProc)(
146 DeviceIntPtr /*device*/,
147 void* /*data*/
148 );
149
150typedef void (*DeviceUnwrapProc)(
151 DeviceIntPtr /*device*/,
152 DeviceHandleProc /*proc*/,
153 void* /*data*/
154 );
155
156/* pointer acceleration handling */
157typedef void (*PointerAccelSchemeProc)(
158 DeviceIntPtr /*device*/,
159 ValuatorMask* /*valuators*/,
160 CARD32 /*evtime*/);
161
162typedef void (*DeviceCallbackProc)(
163 DeviceIntPtr /*pDev*/);
164
165struct _ValuatorAccelerationRec;
166typedef Bool (*PointerAccelSchemeInitProc)(
167 DeviceIntPtr /*dev*/,
168 struct _ValuatorAccelerationRec* /*protoScheme*/);
169
170typedef struct _DeviceRec {
171 pointer devicePrivate;
172 ProcessInputProc processInputProc; /* current */
173 ProcessInputProc realInputProc; /* deliver */
174 ProcessInputProc enqueueInputProc; /* enqueue */
175 Bool on; /* used by DDX to keep state */
176} DeviceRec, *DevicePtr;
177
178typedef struct {
179 int click, bell, bell_pitch, bell_duration;
180 Bool autoRepeat;
181 unsigned char autoRepeats[32];
182 Leds leds;
183 unsigned char id;
184} KeybdCtrl;
185
186typedef struct {
187 KeySym *map;
188 KeyCode minKeyCode,
189 maxKeyCode;
190 int mapWidth;
191} KeySymsRec, *KeySymsPtr;
192
193typedef struct {
194 int num, den, threshold;
195 unsigned char id;
196} PtrCtrl;
197
198typedef struct {
199 int resolution, min_value, max_value;
200 int integer_displayed;
201 unsigned char id;
202} IntegerCtrl;
203
204typedef struct {
205 int max_symbols, num_symbols_supported;
206 int num_symbols_displayed;
207 KeySym *symbols_supported;
208 KeySym *symbols_displayed;
209 unsigned char id;
210} StringCtrl;
211
212typedef struct {
213 int percent, pitch, duration;
214 unsigned char id;
215} BellCtrl;
216
217typedef struct {
218 Leds led_values;
219 Mask led_mask;
220 unsigned char id;
221} LedCtrl;
222
223extern _X_EXPORT KeybdCtrl defaultKeyboardControl;
224extern _X_EXPORT PtrCtrl defaultPointerControl;
225
226typedef struct _InputOption InputOption;
227typedef struct _XI2Mask XI2Mask;
228
229typedef struct _InputAttributes {
230 char *product;
231 char *vendor;
232 char *device;
233 char *pnp_id;
234 char *usb_id;
235 char **tags; /* null-terminated */
236 uint32_t flags;
237} InputAttributes;
238
239#define ATTR_KEYBOARD (1<<0)
240#define ATTR_POINTER (1<<1)
241#define ATTR_JOYSTICK (1<<2)
242#define ATTR_TABLET (1<<3)
243#define ATTR_TOUCHPAD (1<<4)
244#define ATTR_TOUCHSCREEN (1<<5)
245
246/* Key/Button has been run through all input processing and events sent to clients. */
247#define KEY_PROCESSED 1
248#define BUTTON_PROCESSED 1
249/* Key/Button has not been fully processed, no events have been sent. */
250#define KEY_POSTED 2
251#define BUTTON_POSTED 2
252
253extern void set_key_down(DeviceIntPtr pDev, int key_code, int type);
254extern void set_key_up(DeviceIntPtr pDev, int key_code, int type);
255extern int key_is_down(DeviceIntPtr pDev, int key_code, int type);
256extern void set_button_down(DeviceIntPtr pDev, int button, int type);
257extern void set_button_up(DeviceIntPtr pDev, int button, int type);
258extern int button_is_down(DeviceIntPtr pDev, int button, int type);
259
260extern void InitCoreDevices(void);
261extern void InitXTestDevices(void);
262
263extern _X_EXPORT DeviceIntPtr AddInputDevice(
264 ClientPtr /*client*/,
265 DeviceProc /*deviceProc*/,
266 Bool /*autoStart*/);
267
268extern _X_EXPORT Bool EnableDevice(
269 DeviceIntPtr /*device*/,
270 BOOL /* sendevent */);
271
272extern _X_EXPORT Bool ActivateDevice(
273 DeviceIntPtr /*device*/,
274 BOOL /* sendevent */);
275
276extern _X_EXPORT Bool DisableDevice(
277 DeviceIntPtr /*device*/,
278 BOOL /* sendevent */);
279
280extern int InitAndStartDevices(void);
281
282extern void CloseDownDevices(void);
283
284extern void UndisplayDevices(void);
285
286extern _X_EXPORT int RemoveDevice(
287 DeviceIntPtr /*dev*/,
288 BOOL /* sendevent */);
289
290extern _X_EXPORT int NumMotionEvents(void);
291
292extern _X_EXPORT int dixLookupDevice(
293 DeviceIntPtr * /* dev */,
294 int /* id */,
295 ClientPtr /* client */,
296 Mask /* access_mode */);
297
298extern _X_EXPORT void QueryMinMaxKeyCodes(
299 KeyCode* /*minCode*/,
300 KeyCode* /*maxCode*/);
301
302extern _X_EXPORT Bool SetKeySymsMap(
303 KeySymsPtr /*dst*/,
304 KeySymsPtr /*src*/);
305
306extern _X_EXPORT Bool InitButtonClassDeviceStruct(
307 DeviceIntPtr /*device*/,
308 int /*numButtons*/,
309 Atom* /* labels */,
310 CARD8* /*map*/);
311
312extern _X_INTERNAL ValuatorClassPtr AllocValuatorClass(
313 ValuatorClassPtr src,
314 int numAxes);
315
316extern _X_EXPORT Bool InitValuatorClassDeviceStruct(
317 DeviceIntPtr /*device*/,
318 int /*numAxes*/,
319 Atom* /* labels */,
320 int /*numMotionEvents*/,
321 int /*mode*/);
322
323extern _X_EXPORT Bool InitPointerAccelerationScheme(
324 DeviceIntPtr /*dev*/,
325 int /*scheme*/);
326
327extern _X_EXPORT Bool InitFocusClassDeviceStruct(
328 DeviceIntPtr /*device*/);
329
330extern _X_EXPORT Bool InitTouchClassDeviceStruct(
331 DeviceIntPtr /*device*/,
332 unsigned int /*max_touches*/,
333 unsigned int /*mode*/,
334 unsigned int /*numAxes*/);
335
336typedef void (*BellProcPtr)(
337 int /*percent*/,
338 DeviceIntPtr /*device*/,
339 pointer /*ctrl*/,
340 int);
341
342typedef void (*KbdCtrlProcPtr)(
343 DeviceIntPtr /*device*/,
344 KeybdCtrl * /*ctrl*/);
345
346typedef void (*PtrCtrlProcPtr)(
347 DeviceIntPtr /*device*/,
348 PtrCtrl * /*ctrl*/);
349
350extern _X_EXPORT Bool InitPtrFeedbackClassDeviceStruct(
351 DeviceIntPtr /*device*/,
352 PtrCtrlProcPtr /*controlProc*/);
353
354typedef void (*StringCtrlProcPtr)(
355 DeviceIntPtr /*device*/,
356 StringCtrl * /*ctrl*/);
357
358extern _X_EXPORT Bool InitStringFeedbackClassDeviceStruct(
359 DeviceIntPtr /*device*/,
360 StringCtrlProcPtr /*controlProc*/,
361 int /*max_symbols*/,
362 int /*num_symbols_supported*/,
363 KeySym* /*symbols*/);
364
365typedef void (*BellCtrlProcPtr)(
366 DeviceIntPtr /*device*/,
367 BellCtrl * /*ctrl*/);
368
369extern _X_EXPORT Bool InitBellFeedbackClassDeviceStruct(
370 DeviceIntPtr /*device*/,
371 BellProcPtr /*bellProc*/,
372 BellCtrlProcPtr /*controlProc*/);
373
374typedef void (*LedCtrlProcPtr)(
375 DeviceIntPtr /*device*/,
376 LedCtrl * /*ctrl*/);
377
378extern _X_EXPORT Bool InitLedFeedbackClassDeviceStruct(
379 DeviceIntPtr /*device*/,
380 LedCtrlProcPtr /*controlProc*/);
381
382typedef void (*IntegerCtrlProcPtr)(
383 DeviceIntPtr /*device*/,
384 IntegerCtrl * /*ctrl*/);
385
386
387extern _X_EXPORT Bool InitIntegerFeedbackClassDeviceStruct(
388 DeviceIntPtr /*device*/,
389 IntegerCtrlProcPtr /*controlProc*/);
390
391extern _X_EXPORT Bool InitPointerDeviceStruct(
392 DevicePtr /*device*/,
393 CARD8* /*map*/,
394 int /*numButtons*/,
395 Atom* /* btn_labels */,
396 PtrCtrlProcPtr /*controlProc*/,
397 int /*numMotionEvents*/,
398 int /*numAxes*/,
399 Atom* /* axes_labels */);
400
401extern _X_EXPORT Bool InitKeyboardDeviceStruct(
402 DeviceIntPtr /*device*/,
403 XkbRMLVOSet * /*rmlvo*/,
404 BellProcPtr /*bellProc*/,
405 KbdCtrlProcPtr /*controlProc*/);
406
407extern int ApplyPointerMapping(
408 DeviceIntPtr /* pDev */,
409 CARD8 * /* map */,
410 int /* len */,
411 ClientPtr /* client */);
412
413extern Bool BadDeviceMap(
414 BYTE* /*buff*/,
415 int /*length*/,
416 unsigned /*low*/,
417 unsigned /*high*/,
418 XID* /*errval*/);
419
420extern void NoteLedState(
421 DeviceIntPtr /*keybd*/,
422 int /*led*/,
423 Bool /*on*/);
424
425extern void MaybeStopHint(
426 DeviceIntPtr /*device*/,
427 ClientPtr /*client*/);
428
429extern void ProcessPointerEvent(
430 InternalEvent* /* ev */,
431 DeviceIntPtr /*mouse*/);
432
433extern void ProcessKeyboardEvent(
434 InternalEvent* /*ev*/,
435 DeviceIntPtr /*keybd*/);
436
437extern Bool LegalModifier(
438 unsigned int /*key*/,
439 DeviceIntPtr /*pDev*/);
440
441extern _X_EXPORT void ProcessInputEvents(void);
442
443extern _X_EXPORT void InitInput(
444 int /*argc*/,
445 char ** /*argv*/);
446extern _X_EXPORT void CloseInput(void);
447
448extern _X_EXPORT int GetMaximumEventsNum(void);
449
450extern _X_EXPORT InternalEvent *InitEventList(int num_events);
451extern _X_EXPORT void FreeEventList(InternalEvent *list, int num_events);
452
453extern void CreateClassesChangedEvent(InternalEvent *event,
454 DeviceIntPtr master,
455 DeviceIntPtr slave,
456 int flags);
457
458extern InternalEvent * UpdateFromMaster(
459 InternalEvent *events,
460 DeviceIntPtr pDev,
461 int type,
462 int *num_events);
463
464extern _X_EXPORT int GetPointerEvents(
465 InternalEvent *events,
466 DeviceIntPtr pDev,
467 int type,
468 int buttons,
469 int flags,
470 const ValuatorMask *mask);
471
472extern _X_EXPORT void QueuePointerEvents(
473 DeviceIntPtr pDev,
474 int type,
475 int buttons,
476 int flags,
477 const ValuatorMask *mask);
478
479extern _X_EXPORT int GetKeyboardEvents(
480 InternalEvent *events,
481 DeviceIntPtr pDev,
482 int type,
483 int key_code,
484 const ValuatorMask *mask);
485
486extern _X_EXPORT void QueueKeyboardEvents(
487 DeviceIntPtr pDev,
488 int type,
489 int key_code,
490 const ValuatorMask *mask);
491
492extern int GetTouchEvents(
493 InternalEvent *events,
494 DeviceIntPtr pDev,
495 uint32_t ddx_touchid,
496 uint16_t type,
497 uint32_t flags,
498 const ValuatorMask *mask);
499
500void QueueTouchEvents(DeviceIntPtr device,
501 int type,
502 uint32_t ddx_touchid,
503 int flags,
504 const ValuatorMask *mask);
505
506extern int GetTouchOwnershipEvents(
507 InternalEvent *events,
508 DeviceIntPtr pDev,
509 TouchPointInfoPtr ti,
510 uint8_t mode,
511 XID resource,
512 uint32_t flags);
513
514extern _X_EXPORT int GetProximityEvents(
515 InternalEvent *events,
516 DeviceIntPtr pDev,
517 int type,
518 const ValuatorMask *mask);
519
520extern _X_EXPORT void QueueProximityEvents(
521 DeviceIntPtr pDev,
522 int type,
523 const ValuatorMask *mask);
524
525extern void PostSyntheticMotion(
526 DeviceIntPtr pDev,
527 int x,
528 int y,
529 int screen,
530 unsigned long time);
531
532extern _X_EXPORT int GetMotionHistorySize(
533 void);
534
535extern _X_EXPORT void AllocateMotionHistory(
536 DeviceIntPtr pDev);
537
538extern _X_EXPORT int GetMotionHistory(
539 DeviceIntPtr pDev,
540 xTimecoord **buff,
541 unsigned long start,
542 unsigned long stop,
543 ScreenPtr pScreen,
544 BOOL core);
545
546extern void ReleaseButtonsAndKeys(DeviceIntPtr dev);
547
548extern int AttachDevice(ClientPtr client,
549 DeviceIntPtr slave,
550 DeviceIntPtr master);
551
552extern _X_EXPORT DeviceIntPtr GetPairedDevice(DeviceIntPtr kbd);
553extern DeviceIntPtr GetMaster(DeviceIntPtr dev, int type);
554
555extern _X_EXPORT int AllocDevicePair(ClientPtr client,
556 const char* name,
557 DeviceIntPtr* ptr,
558 DeviceIntPtr* keybd,
559 DeviceProc ptr_proc,
560 DeviceProc keybd_proc,
561 Bool master);
562extern void DeepCopyDeviceClasses(DeviceIntPtr from,
563 DeviceIntPtr to,
564 DeviceChangedEvent *dce);
565
566/* Helper functions. */
567extern _X_EXPORT int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
568 KeyCode **modkeymap, int *max_keys_per_mod);
569extern int change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *map,
570 int max_keys_per_mod);
571extern int AllocXTestDevice(ClientPtr client,
572 const char* name,
573 DeviceIntPtr* ptr,
574 DeviceIntPtr* keybd,
575 DeviceIntPtr master_ptr,
576 DeviceIntPtr master_keybd);
577extern BOOL IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master);
578extern DeviceIntPtr GetXTestDevice(DeviceIntPtr master);
579extern void SendDevicePresenceEvent(int deviceid, int type);
580extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *attrs);
581extern _X_EXPORT void FreeInputAttributes(InputAttributes *attrs);
582
583enum TouchListenerState{
584 LISTENER_AWAITING_BEGIN = 0, /**< Waiting for a TouchBegin event */
585 LISTENER_AWAITING_OWNER, /**< Waiting for a TouchOwnership event */
586 LISTENER_EARLY_ACCEPT, /**< Waiting for ownership, has already
587 accepted */
588 LISTENER_IS_OWNER, /**< Is the current owner */
589 LISTENER_HAS_END, /**< Has already received the end event */
590};
591
592enum TouchListenerType {
593 LISTENER_GRAB,
594 LISTENER_POINTER_GRAB,
595 LISTENER_REGULAR,
596 LISTENER_POINTER_REGULAR,
597};
598
599extern void TouchInitDDXTouchPoint(DeviceIntPtr dev, DDXTouchPointInfoPtr ddxtouch);
600extern DDXTouchPointInfoPtr TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id);
601extern void TouchEndDDXTouch(DeviceIntPtr dev, DDXTouchPointInfoPtr ti);
602extern DDXTouchPointInfoPtr TouchFindByDDXID(DeviceIntPtr dev,
603 uint32_t ddx_id,
604 Bool create);
605extern Bool TouchInitTouchPoint(TouchClassPtr touch, ValuatorClassPtr v, int index);
606extern void TouchFreeTouchPoint(DeviceIntPtr dev, int index);
607extern TouchPointInfoPtr TouchBeginTouch(DeviceIntPtr dev, int sourceid,
608 uint32_t touchid, Bool emulate_pointer);
609extern TouchPointInfoPtr TouchFindByClientID(DeviceIntPtr dev,
610 uint32_t client_id);
611extern void TouchEndTouch(DeviceIntPtr dev, TouchPointInfoPtr ti);
612extern Bool TouchEventHistoryAllocate(TouchPointInfoPtr ti);
613extern void TouchEventHistoryFree(TouchPointInfoPtr ti);
614extern void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev);
615extern void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource);
616extern Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource);
617extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level,
618 enum TouchListenerType type, enum TouchListenerState state,
619 WindowPtr window);
620extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource);
621extern void TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev);
622extern Bool TouchEnsureSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
623 InternalEvent *ev);
624extern Bool TouchBuildDependentSpriteTrace(DeviceIntPtr dev, SpritePtr sprite);
625extern int TouchConvertToPointerEvent(const InternalEvent *ev,
626 InternalEvent *motion, InternalEvent *button);
627extern int TouchGetPointerEventType(const InternalEvent *ev);
628extern void TouchRemovePointerGrab(DeviceIntPtr dev);
629extern void TouchListenerGone(XID resource);
630extern int TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode,
631 uint32_t touchid, Window grab_window, XID *error);
632
633/* misc event helpers */
634extern Mask GetEventMask(DeviceIntPtr dev, xEvent* ev, InputClientsPtr clients);
635extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event);
636extern Bool WindowXI2MaskIsset(DeviceIntPtr dev, WindowPtr win, xEvent* ev);
637extern int GetXI2MaskByte(XI2Mask *mask, DeviceIntPtr dev, int event_type);
638void FixUpEventFromWindow(SpritePtr pSprite,
639 xEvent *xE,
640 WindowPtr pWin,
641 Window child,
642 Bool calcChild);
643extern WindowPtr XYToWindow(SpritePtr pSprite, int x, int y);
644extern int EventIsDeliverable(DeviceIntPtr dev, int evtype, WindowPtr win);
645extern Bool ActivatePassiveGrab(DeviceIntPtr dev, GrabPtr grab,
646 InternalEvent *ev, InternalEvent *real_event);
647/**
648 * Masks specifying the type of event to deliver for an InternalEvent; used
649 * by EventIsDeliverable.
650 * @defgroup EventIsDeliverable return flags
651 * @{
652 */
653#define EVENT_XI1_MASK (1 << 0) /**< XI1.x event */
654#define EVENT_CORE_MASK (1 << 1) /**< Core event */
655#define EVENT_DONT_PROPAGATE_MASK (1 << 2) /**< DontPropagate mask set */
656#define EVENT_XI2_MASK (1 << 3) /**< XI2 mask set on window */
657/* @} */
658
659enum EventDeliveryState {
660 EVENT_DELIVERED, /**< Event has been delivered to a client */
661 EVENT_NOT_DELIVERED, /**< Event was not delivered to any client */
662 EVENT_SKIP, /**< Event can be discarded by the caller */
663 EVENT_REJECTED, /**< Event was rejected for delivery to the client */
664};
665
666/* Implemented by the DDX. */
667extern _X_EXPORT int NewInputDeviceRequest(
668 InputOption *options,
669 InputAttributes *attrs,
670 DeviceIntPtr *dev);
671extern _X_EXPORT void DeleteInputDeviceRequest(
672 DeviceIntPtr dev);
673
674extern _X_EXPORT void DDXRingBell(
675 int volume,
676 int pitch,
677 int duration);
678
679#define VALUATOR_MODE_ALL_AXES -1
680extern _X_HIDDEN int valuator_get_mode(DeviceIntPtr dev, int axis);
681extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode);
682
683/* Set to TRUE by default - os/utils.c sets it to FALSE on user request,
684 xfixes/cursor.c uses it to determine if the cursor is enabled */
685extern Bool EnableCursor;
686
687extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
688extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask);
689extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
690 int first_valuator, int num_valuators,
691 const int* valuators);
692extern _X_EXPORT void valuator_mask_set(ValuatorMask *mask,
693 int valuator,
694 int data);
695extern _X_EXPORT void valuator_mask_set_double(ValuatorMask *mask,
696 int valuator,
697 double data);
698extern _X_EXPORT void valuator_mask_zero(ValuatorMask *mask);
699extern _X_EXPORT int valuator_mask_size(const ValuatorMask *mask);
700extern _X_EXPORT int valuator_mask_isset(const ValuatorMask *mask, int bit);
701extern _X_EXPORT void valuator_mask_unset(ValuatorMask *mask, int bit);
702extern _X_EXPORT int valuator_mask_num_valuators(const ValuatorMask *mask);
703extern _X_EXPORT void valuator_mask_copy(ValuatorMask *dest,
704 const ValuatorMask *src);
705extern _X_EXPORT int valuator_mask_get(const ValuatorMask *mask, int valnum);
706extern _X_EXPORT double valuator_mask_get_double(const ValuatorMask *mask,
707 int valnum);
708extern _X_EXPORT Bool valuator_mask_fetch(const ValuatorMask *mask,
709 int valnum, int *val);
710extern _X_EXPORT Bool valuator_mask_fetch_double(const ValuatorMask *mask,
711 int valnum, double *val);
712
713/* InputOption handling interface */
714extern _X_EXPORT InputOption* input_option_new(InputOption *list, const char *key, const char *value);
715extern _X_EXPORT void input_option_free_list(InputOption **opt);
716extern _X_EXPORT InputOption* input_option_free_element(InputOption *opt, const char *key);
717extern _X_EXPORT InputOption* input_option_find(InputOption *list, const char *key);
718extern _X_EXPORT const char* input_option_get_key(const InputOption *opt);
719extern _X_EXPORT const char* input_option_get_value(const InputOption *opt);
720extern _X_EXPORT void input_option_set_key(InputOption *opt, const char* key);
721extern _X_EXPORT void input_option_set_value(InputOption *opt, const char* value);
722
723extern _X_HIDDEN Bool point_on_screen(ScreenPtr pScreen, int x, int y);
724extern _X_HIDDEN void update_desktop_dimensions(void);
725
726#endif /* INPUT_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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