VirtualBox

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

最後變更 在這個檔案從62425是 45134,由 vboxsync 提交於 12 年 前

Additions/X11: build vboxvideo_drv.so for X.Org Server 1.14.

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

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