VirtualBox

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

Last change on this file since 74087 was 58634, checked in by vboxsync, 9 years ago

Additions/x11: added header files for building X.Org video driver against X.Org Server 1.18.

  • Property svn:eol-style set to native
File size: 31.4 KB
Line 
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 MAX_BUTTONS
99#define DOWN_LENGTH (MAX_BUTTONS/8) /* 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 = 1,
117 XI = 2,
118 XI2 = 3,
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 void *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 _X_EXPORT void set_key_down(DeviceIntPtr pDev, int key_code, int type);
248extern _X_EXPORT void set_key_up(DeviceIntPtr pDev, int key_code, int type);
249extern _X_EXPORT int key_is_down(DeviceIntPtr pDev, int key_code, int type);
250extern _X_EXPORT void set_button_down(DeviceIntPtr pDev, int button, int type);
251extern _X_EXPORT void set_button_up(DeviceIntPtr pDev, int button, int type);
252extern _X_EXPORT 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 InitButtonClassDeviceStruct(DeviceIntPtr /*device */ ,
291 int /*numButtons */ ,
292 Atom * /* labels */ ,
293 CARD8 * /*map */ );
294
295extern _X_INTERNAL ValuatorClassPtr AllocValuatorClass(ValuatorClassPtr src,
296 int numAxes);
297
298extern _X_EXPORT Bool InitValuatorClassDeviceStruct(DeviceIntPtr /*device */ ,
299 int /*numAxes */ ,
300 Atom * /* labels */ ,
301 int /*numMotionEvents */ ,
302 int /*mode */ );
303
304extern _X_EXPORT Bool InitPointerAccelerationScheme(DeviceIntPtr /*dev */ ,
305 int /*scheme */ );
306
307extern _X_EXPORT Bool InitFocusClassDeviceStruct(DeviceIntPtr /*device */ );
308
309extern _X_EXPORT Bool InitTouchClassDeviceStruct(DeviceIntPtr /*device */ ,
310 unsigned int /*max_touches */ ,
311 unsigned int /*mode */ ,
312 unsigned int /*numAxes */ );
313
314typedef void (*BellProcPtr) (int percent,
315 DeviceIntPtr device,
316 void *ctrl,
317 int feedbackClass);
318
319typedef void (*KbdCtrlProcPtr) (DeviceIntPtr /*device */ ,
320 KeybdCtrl * /*ctrl */ );
321
322typedef void (*PtrCtrlProcPtr) (DeviceIntPtr /*device */ ,
323 PtrCtrl * /*ctrl */ );
324
325extern _X_EXPORT Bool InitPtrFeedbackClassDeviceStruct(DeviceIntPtr /*device */
326 ,
327 PtrCtrlProcPtr
328 /*controlProc */ );
329
330typedef void (*StringCtrlProcPtr) (DeviceIntPtr /*device */ ,
331 StringCtrl * /*ctrl */ );
332
333extern _X_EXPORT Bool InitStringFeedbackClassDeviceStruct(DeviceIntPtr
334 /*device */ ,
335 StringCtrlProcPtr
336 /*controlProc */ ,
337 int /*max_symbols */ ,
338 int
339 /*num_symbols_supported */
340 ,
341 KeySym * /*symbols */
342 );
343
344typedef void (*BellCtrlProcPtr) (DeviceIntPtr /*device */ ,
345 BellCtrl * /*ctrl */ );
346
347extern _X_EXPORT Bool InitBellFeedbackClassDeviceStruct(DeviceIntPtr /*device */
348 ,
349 BellProcPtr
350 /*bellProc */ ,
351 BellCtrlProcPtr
352 /*controlProc */ );
353
354typedef void (*LedCtrlProcPtr) (DeviceIntPtr /*device */ ,
355 LedCtrl * /*ctrl */ );
356
357extern _X_EXPORT Bool InitLedFeedbackClassDeviceStruct(DeviceIntPtr /*device */
358 ,
359 LedCtrlProcPtr
360 /*controlProc */ );
361
362typedef void (*IntegerCtrlProcPtr) (DeviceIntPtr /*device */ ,
363 IntegerCtrl * /*ctrl */ );
364
365extern _X_EXPORT Bool InitIntegerFeedbackClassDeviceStruct(DeviceIntPtr
366 /*device */ ,
367 IntegerCtrlProcPtr
368 /*controlProc */ );
369
370extern _X_EXPORT Bool InitPointerDeviceStruct(DevicePtr /*device */ ,
371 CARD8 * /*map */ ,
372 int /*numButtons */ ,
373 Atom * /* btn_labels */ ,
374 PtrCtrlProcPtr /*controlProc */ ,
375 int /*numMotionEvents */ ,
376 int /*numAxes */ ,
377 Atom * /* axes_labels */ );
378
379extern _X_EXPORT Bool InitKeyboardDeviceStruct(DeviceIntPtr /*device */ ,
380 XkbRMLVOSet * /*rmlvo */ ,
381 BellProcPtr /*bellProc */ ,
382 KbdCtrlProcPtr /*controlProc */
383 );
384
385extern _X_EXPORT Bool InitKeyboardDeviceStructFromString(DeviceIntPtr dev,
386 const char *keymap,
387 int keymap_length,
388 BellProcPtr bell_func,
389 KbdCtrlProcPtr ctrl_func);
390
391extern int ApplyPointerMapping(DeviceIntPtr /* pDev */ ,
392 CARD8 * /* map */ ,
393 int /* len */ ,
394 ClientPtr /* client */ );
395
396extern Bool BadDeviceMap(BYTE * /*buff */ ,
397 int /*length */ ,
398 unsigned /*low */ ,
399 unsigned /*high */ ,
400 XID * /*errval */ );
401
402extern void NoteLedState(DeviceIntPtr /*keybd */ ,
403 int /*led */ ,
404 Bool /*on */ );
405
406extern void MaybeStopHint(DeviceIntPtr /*device */ ,
407 ClientPtr /*client */ );
408
409extern void ProcessPointerEvent(InternalEvent * /* ev */ ,
410 DeviceIntPtr /*mouse */ );
411
412extern void ProcessKeyboardEvent(InternalEvent * /*ev */ ,
413 DeviceIntPtr /*keybd */ );
414
415extern Bool LegalModifier(unsigned int /*key */ ,
416 DeviceIntPtr /*pDev */ );
417
418extern _X_EXPORT void ProcessInputEvents(void);
419
420extern _X_EXPORT void InitInput(int /*argc */ ,
421 char ** /*argv */ );
422extern _X_EXPORT void CloseInput(void);
423
424extern _X_EXPORT int GetMaximumEventsNum(void);
425
426extern _X_EXPORT InternalEvent *InitEventList(int num_events);
427extern _X_EXPORT void FreeEventList(InternalEvent *list, int num_events);
428
429extern void CreateClassesChangedEvent(InternalEvent *event,
430 DeviceIntPtr master,
431 DeviceIntPtr slave, int flags);
432
433extern InternalEvent *UpdateFromMaster(InternalEvent *events,
434 DeviceIntPtr pDev,
435 int type, int *num_events);
436
437extern _X_EXPORT int GetPointerEvents(InternalEvent *events,
438 DeviceIntPtr pDev,
439 int type,
440 int buttons,
441 int flags, const ValuatorMask *mask);
442
443extern _X_EXPORT void QueuePointerEvents(DeviceIntPtr pDev,
444 int type,
445 int buttons,
446 int flags, const ValuatorMask *mask);
447
448extern _X_EXPORT int GetKeyboardEvents(InternalEvent *events,
449 DeviceIntPtr pDev,
450 int type,
451 int key_code);
452
453extern _X_EXPORT void QueueKeyboardEvents(DeviceIntPtr pDev,
454 int type,
455 int key_code);
456
457extern int GetTouchEvents(InternalEvent *events,
458 DeviceIntPtr pDev,
459 uint32_t ddx_touchid,
460 uint16_t type,
461 uint32_t flags, const ValuatorMask *mask);
462
463void QueueTouchEvents(DeviceIntPtr device,
464 int type,
465 uint32_t ddx_touchid,
466 int flags, const ValuatorMask *mask);
467
468extern int GetTouchOwnershipEvents(InternalEvent *events,
469 DeviceIntPtr pDev,
470 TouchPointInfoPtr ti,
471 uint8_t mode, XID resource, uint32_t flags);
472
473extern void GetDixTouchEnd(InternalEvent *ievent,
474 DeviceIntPtr dev,
475 TouchPointInfoPtr ti,
476 uint32_t flags);
477
478extern _X_EXPORT int GetProximityEvents(InternalEvent *events,
479 DeviceIntPtr pDev,
480 int type, const ValuatorMask *mask);
481
482extern _X_EXPORT void QueueProximityEvents(DeviceIntPtr pDev,
483 int type, const ValuatorMask *mask);
484
485#ifdef PANORAMIX
486_X_EXPORT
487#endif
488extern void PostSyntheticMotion(DeviceIntPtr pDev,
489 int x, int y, int screen, unsigned long time);
490
491extern _X_EXPORT int GetMotionHistorySize(void);
492
493extern _X_EXPORT void AllocateMotionHistory(DeviceIntPtr pDev);
494
495extern _X_EXPORT int GetMotionHistory(DeviceIntPtr pDev,
496 xTimecoord ** buff,
497 unsigned long start,
498 unsigned long stop,
499 ScreenPtr pScreen, BOOL core);
500
501extern void ReleaseButtonsAndKeys(DeviceIntPtr dev);
502
503extern int AttachDevice(ClientPtr client,
504 DeviceIntPtr slave, DeviceIntPtr master);
505
506extern _X_EXPORT DeviceIntPtr GetPairedDevice(DeviceIntPtr kbd);
507extern _X_EXPORT DeviceIntPtr GetMaster(DeviceIntPtr dev, int type);
508
509extern _X_EXPORT int AllocDevicePair(ClientPtr client,
510 const char *name,
511 DeviceIntPtr *ptr,
512 DeviceIntPtr *keybd,
513 DeviceProc ptr_proc,
514 DeviceProc keybd_proc, Bool master);
515extern void DeepCopyDeviceClasses(DeviceIntPtr from,
516 DeviceIntPtr to, DeviceChangedEvent *dce);
517
518/* Helper functions. */
519extern _X_EXPORT int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
520 KeyCode **modkeymap,
521 int *max_keys_per_mod);
522extern int change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *map,
523 int max_keys_per_mod);
524extern int AllocXTestDevice(ClientPtr client, const char *name,
525 DeviceIntPtr *ptr, DeviceIntPtr *keybd,
526 DeviceIntPtr master_ptr, DeviceIntPtr master_keybd);
527extern BOOL IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master);
528extern DeviceIntPtr GetXTestDevice(DeviceIntPtr master);
529extern void SendDevicePresenceEvent(int deviceid, int type);
530extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *
531 attrs);
532extern _X_EXPORT void FreeInputAttributes(InputAttributes * attrs);
533
534enum TouchListenerState {
535 LISTENER_AWAITING_BEGIN = 0, /**< Waiting for a TouchBegin event */
536 LISTENER_AWAITING_OWNER, /**< Waiting for a TouchOwnership event */
537 LISTENER_EARLY_ACCEPT, /**< Waiting for ownership, has already
538 accepted */
539 LISTENER_IS_OWNER, /**< Is the current owner, hasn't accepted */
540 LISTENER_HAS_ACCEPTED, /**< Is the current owner, has accepted */
541 LISTENER_HAS_END, /**< Has already received the end event */
542};
543
544enum TouchListenerType {
545 LISTENER_GRAB,
546 LISTENER_POINTER_GRAB,
547 LISTENER_REGULAR,
548 LISTENER_POINTER_REGULAR,
549};
550
551extern void TouchInitDDXTouchPoint(DeviceIntPtr dev,
552 DDXTouchPointInfoPtr ddxtouch);
553extern DDXTouchPointInfoPtr TouchBeginDDXTouch(DeviceIntPtr dev,
554 uint32_t ddx_id);
555extern void TouchEndDDXTouch(DeviceIntPtr dev, DDXTouchPointInfoPtr ti);
556extern DDXTouchPointInfoPtr TouchFindByDDXID(DeviceIntPtr dev,
557 uint32_t ddx_id, Bool create);
558extern Bool TouchInitTouchPoint(TouchClassPtr touch, ValuatorClassPtr v,
559 int index);
560extern void TouchFreeTouchPoint(DeviceIntPtr dev, int index);
561extern TouchPointInfoPtr TouchBeginTouch(DeviceIntPtr dev, int sourceid,
562 uint32_t touchid,
563 Bool emulate_pointer);
564extern TouchPointInfoPtr TouchFindByClientID(DeviceIntPtr dev,
565 uint32_t client_id);
566extern void TouchEndTouch(DeviceIntPtr dev, TouchPointInfoPtr ti);
567extern Bool TouchEventHistoryAllocate(TouchPointInfoPtr ti);
568extern void TouchEventHistoryFree(TouchPointInfoPtr ti);
569extern void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev);
570extern void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev,
571 XID resource);
572extern Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource);
573extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, int resource_type,
574 enum InputLevel level, enum TouchListenerType type,
575 enum TouchListenerState state, WindowPtr window, GrabPtr grab);
576extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource);
577extern void TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti,
578 InternalEvent *ev);
579extern Bool TouchBuildSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
580 InternalEvent *ev);
581extern Bool TouchBuildDependentSpriteTrace(DeviceIntPtr dev, SpritePtr sprite);
582extern int TouchConvertToPointerEvent(const InternalEvent *ev,
583 InternalEvent *motion,
584 InternalEvent *button);
585extern int TouchGetPointerEventType(const InternalEvent *ev);
586extern void TouchRemovePointerGrab(DeviceIntPtr dev);
587extern void TouchListenerGone(XID resource);
588extern int TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti,
589 int listener, int mode);
590extern int TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode,
591 uint32_t touchid, Window grab_window, XID *error);
592extern void TouchEndPhysicallyActiveTouches(DeviceIntPtr dev);
593extern void TouchDeliverDeviceClassesChangedEvent(TouchPointInfoPtr ti,
594 Time time, XID resource);
595extern void TouchEmitTouchEnd(DeviceIntPtr dev, TouchPointInfoPtr ti, int flags, XID resource);
596extern void TouchAcceptAndEnd(DeviceIntPtr dev, int touchid);
597
598/* misc event helpers */
599extern Mask GetEventMask(DeviceIntPtr dev, xEvent *ev, InputClientsPtr clients);
600extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event);
601extern Bool WindowXI2MaskIsset(DeviceIntPtr dev, WindowPtr win, xEvent *ev);
602extern int GetXI2MaskByte(XI2Mask *mask, DeviceIntPtr dev, int event_type);
603void FixUpEventFromWindow(SpritePtr pSprite,
604 xEvent *xE,
605 WindowPtr pWin, Window child, Bool calcChild);
606extern Bool PointInBorderSize(WindowPtr pWin, int x, int y);
607extern WindowPtr XYToWindow(SpritePtr pSprite, int x, int y);
608extern int EventIsDeliverable(DeviceIntPtr dev, int evtype, WindowPtr win);
609extern Bool ActivatePassiveGrab(DeviceIntPtr dev, GrabPtr grab,
610 InternalEvent *ev, InternalEvent *real_event);
611/**
612 * Masks specifying the type of event to deliver for an InternalEvent; used
613 * by EventIsDeliverable.
614 * @defgroup EventIsDeliverable return flags
615 * @{
616 */
617#define EVENT_XI1_MASK (1 << 0) /**< XI1.x event */
618#define EVENT_CORE_MASK (1 << 1) /**< Core event */
619#define EVENT_DONT_PROPAGATE_MASK (1 << 2) /**< DontPropagate mask set */
620#define EVENT_XI2_MASK (1 << 3) /**< XI2 mask set on window */
621/* @} */
622
623enum EventDeliveryState {
624 EVENT_DELIVERED, /**< Event has been delivered to a client */
625 EVENT_NOT_DELIVERED, /**< Event was not delivered to any client */
626 EVENT_SKIP, /**< Event can be discarded by the caller */
627 EVENT_REJECTED, /**< Event was rejected for delivery to the client */
628};
629
630/* Implemented by the DDX. */
631extern _X_EXPORT int NewInputDeviceRequest(InputOption *options,
632 InputAttributes * attrs,
633 DeviceIntPtr *dev);
634extern _X_EXPORT void DeleteInputDeviceRequest(DeviceIntPtr dev);
635
636extern _X_EXPORT void DDXRingBell(int volume, int pitch, int duration);
637
638#define VALUATOR_MODE_ALL_AXES -1
639extern _X_HIDDEN int valuator_get_mode(DeviceIntPtr dev, int axis);
640extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode);
641
642/* Set to TRUE by default - os/utils.c sets it to FALSE on user request,
643 xfixes/cursor.c uses it to determine if the cursor is enabled */
644extern Bool EnableCursor;
645
646/* Set to FALSE by default - ChangeWindowAttributes sets it to TRUE on
647 * CWCursor, xfixes/cursor.c uses it to determine if the cursor is enabled
648 */
649extern Bool CursorVisible;
650
651extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
652extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask);
653extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
654 int first_valuator,
655 int num_valuators,
656 const int *valuators);
657extern _X_EXPORT void valuator_mask_set(ValuatorMask *mask, int valuator,
658 int data);
659extern _X_EXPORT void valuator_mask_set_double(ValuatorMask *mask, int valuator,
660 double data);
661extern _X_EXPORT void valuator_mask_zero(ValuatorMask *mask);
662extern _X_EXPORT int valuator_mask_size(const ValuatorMask *mask);
663extern _X_EXPORT int valuator_mask_isset(const ValuatorMask *mask, int bit);
664extern _X_EXPORT void valuator_mask_unset(ValuatorMask *mask, int bit);
665extern _X_EXPORT int valuator_mask_num_valuators(const ValuatorMask *mask);
666extern _X_EXPORT void valuator_mask_copy(ValuatorMask *dest,
667 const ValuatorMask *src);
668extern _X_EXPORT int valuator_mask_get(const ValuatorMask *mask, int valnum);
669extern _X_EXPORT double valuator_mask_get_double(const ValuatorMask *mask,
670 int valnum);
671extern _X_EXPORT Bool valuator_mask_fetch(const ValuatorMask *mask,
672 int valnum, int *val);
673extern _X_EXPORT Bool valuator_mask_fetch_double(const ValuatorMask *mask,
674 int valnum, double *val);
675
676extern _X_EXPORT Bool valuator_mask_has_unaccelerated(const ValuatorMask *mask);
677extern _X_EXPORT void valuator_mask_set_unaccelerated(ValuatorMask *mask,
678 int valuator,
679 double accel,
680 double unaccel);
681extern _X_EXPORT double valuator_mask_get_accelerated(const ValuatorMask *mask,
682 int valuator);
683extern _X_EXPORT double valuator_mask_get_unaccelerated(const ValuatorMask *mask,
684 int valuator);
685extern _X_EXPORT Bool valuator_mask_fetch_unaccelerated(const ValuatorMask *mask,
686 int valuator,
687 double *accel,
688 double *unaccel);
689extern _X_HIDDEN void valuator_mask_drop_unaccelerated(ValuatorMask *mask);
690
691/* InputOption handling interface */
692extern _X_EXPORT InputOption *input_option_new(InputOption *list,
693 const char *key,
694 const char *value);
695extern _X_EXPORT void input_option_free_list(InputOption **opt);
696extern _X_EXPORT InputOption *input_option_free_element(InputOption *opt,
697 const char *key);
698extern _X_EXPORT InputOption *input_option_find(InputOption *list,
699 const char *key);
700extern _X_EXPORT const char *input_option_get_key(const InputOption *opt);
701extern _X_EXPORT const char *input_option_get_value(const InputOption *opt);
702extern _X_EXPORT void input_option_set_key(InputOption *opt, const char *key);
703extern _X_EXPORT void input_option_set_value(InputOption *opt,
704 const char *value);
705
706extern _X_HIDDEN Bool point_on_screen(ScreenPtr pScreen, int x, int y);
707extern _X_HIDDEN void update_desktop_dimensions(void);
708
709extern _X_HIDDEN void input_constrain_cursor(DeviceIntPtr pDev, ScreenPtr screen,
710 int current_x, int current_y,
711 int dest_x, int dest_y,
712 int *out_x, int *out_y,
713 int *nevents, InternalEvent* events);
714
715#endif /* INPUT_H */
Note: See TracBrowser for help on using the repository browser.

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