VirtualBox

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

Last change on this file since 43310 was 40349, checked in by vboxsync, 13 years ago

Additions/xorg: support X.Org Server 1.12.

  • Property svn:eol-style set to native
File size: 24.1 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
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
49#ifndef INPUTSTRUCT_H
50#define INPUTSTRUCT_H
51
52#include <X11/extensions/XI2proto.h>
53
54#include <pixman.h>
55#include "input.h"
56#include "window.h"
57#include "dixstruct.h"
58#include "cursorstr.h"
59#include "geext.h"
60#include "privates.h"
61
62#define BitIsOn(ptr, bit) (!!(((const BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))))
63#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
64#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
65extern _X_EXPORT int CountBits(const uint8_t *mask, int len);
66
67#define SameClient(obj,client) \
68 (CLIENT_BITS((obj)->resource) == (client)->clientAsMask)
69
70#define EMASKSIZE MAXDEVICES + 2
71
72/* This is the last XI2 event supported by the server. If you add
73 * events to the protocol, the server will not support these events until
74 * this number here is bumped.
75 */
76#define XI2LASTEVENT XI_RawTouchEnd
77#define XI2MASKSIZE ((XI2LASTEVENT >> 3) + 1) /* no of bytes for masks */
78
79/**
80 * Scroll types for ::SetScrollValuator and the scroll type in the
81 * ::ScrollInfoPtr.
82 */
83enum ScrollType {
84 SCROLL_TYPE_NONE = 0, /**< Not a scrolling valuator */
85 SCROLL_TYPE_VERTICAL = 8,
86 SCROLL_TYPE_HORIZONTAL = 9,
87};
88
89/**
90 * This struct stores the core event mask for each client except the client
91 * that created the window.
92 *
93 * Each window that has events selected from other clients has at least one of
94 * these masks. If multiple clients selected for events on the same window,
95 * these masks are in a linked list.
96 *
97 * The event mask for the client that created the window is stored in
98 * win->eventMask instead.
99 *
100 * The resource id is simply a fake client ID to associate this mask with a
101 * client.
102 *
103 * Kludge: OtherClients and InputClients must be compatible, see code.
104 */
105typedef struct _OtherClients {
106 OtherClientsPtr next; /**< Pointer to the next mask */
107 XID resource; /**< id for putting into resource manager */
108 Mask mask; /**< Core event mask */
109} OtherClients;
110
111/**
112 * This struct stores the XI event mask for each client.
113 *
114 * Each window that has events selected has at least one of these masks. If
115 * multiple client selected for events on the same window, these masks are in
116 * a linked list.
117 */
118typedef struct _InputClients {
119 InputClientsPtr next; /**< Pointer to the next mask */
120 XID resource; /**< id for putting into resource manager */
121 Mask mask[EMASKSIZE]; /**< Actual XI event mask, deviceid is index */
122 /** XI2 event masks. One per device, each bit is a mask of (1 << type) */
123 struct _XI2Mask *xi2mask;
124} InputClients;
125
126/**
127 * Combined XI event masks from all devices.
128 *
129 * This is the XI equivalent of the deliverableEvents, eventMask and
130 * dontPropagate mask of the WindowRec (or WindowOptRec).
131 *
132 * A window that has an XI client selecting for events has exactly one
133 * OtherInputMasks struct and exactly one InputClients struct hanging off
134 * inputClients. Each further client appends to the inputClients list.
135 * Each Mask field is per-device, with the device id as the index.
136 * Exception: for non-device events (Presence events), the MAXDEVICES
137 * deviceid is used.
138 */
139typedef struct _OtherInputMasks {
140 /**
141 * Bitwise OR of all masks by all clients and the window's parent's masks.
142 */
143 Mask deliverableEvents[EMASKSIZE];
144 /**
145 * Bitwise OR of all masks by all clients on this window.
146 */
147 Mask inputEvents[EMASKSIZE];
148 /** The do-not-propagate masks for each device. */
149 Mask dontPropagateMask[EMASKSIZE];
150 /** The clients that selected for events */
151 InputClientsPtr inputClients;
152 /* XI2 event masks. One per device, each bit is a mask of (1 << type) */
153 struct _XI2Mask *xi2mask;
154} OtherInputMasks;
155
156/*
157 * The following structure gets used for both active and passive grabs. For
158 * active grabs some of the fields (e.g. modifiers) are not used. However,
159 * that is not much waste since there aren't many active grabs (one per
160 * keyboard/pointer device) going at once in the server.
161 */
162
163#define MasksPerDetailMask 8 /* 256 keycodes and 256 possible
164 modifier combinations, but only
165 3 buttons. */
166
167typedef struct _DetailRec { /* Grab details may be bit masks */
168 unsigned int exact;
169 Mask *pMask;
170} DetailRec;
171
172union _GrabMask {
173 Mask core;
174 Mask xi;
175 struct _XI2Mask *xi2mask;
176};
177
178/**
179 * Central struct for device grabs.
180 * The same struct is used for both core grabs and device grabs, with
181 * different fields being set.
182 * If the grab is a core grab (GrabPointer/GrabKeyboard), then the eventMask
183 * is a combination of standard event masks (i.e. PointerMotionMask |
184 * ButtonPressMask).
185 * If the grab is a device grab (GrabDevice), then the eventMask is a
186 * combination of event masks for a given XI event type (see SetEventInfo).
187 *
188 * If the grab is a result of a ButtonPress, then eventMask is the core mask
189 * and deviceMask is set to the XI event mask for the grab.
190 */
191typedef struct _GrabRec {
192 GrabPtr next; /* for chain of passive grabs */
193 XID resource;
194 DeviceIntPtr device;
195 WindowPtr window;
196 unsigned ownerEvents:1;
197 unsigned keyboardMode:1;
198 unsigned pointerMode:1;
199 enum InputLevel grabtype;
200 CARD8 type; /* event type */
201 DetailRec modifiersDetail;
202 DeviceIntPtr modifierDevice;
203 DetailRec detail; /* key or button */
204 WindowPtr confineTo; /* always NULL for keyboards */
205 CursorPtr cursor; /* always NULL for keyboards */
206 Mask eventMask;
207 Mask deviceMask;
208 /* XI2 event masks. One per device, each bit is a mask of (1 << type) */
209 struct _XI2Mask *xi2mask;
210} GrabRec;
211
212/**
213 * Sprite information for a device.
214 */
215typedef struct _SpriteRec {
216 CursorPtr current;
217 BoxRec hotLimits; /* logical constraints of hot spot */
218 Bool confined; /* confined to screen */
219 RegionPtr hotShape; /* additional logical shape constraint */
220 BoxRec physLimits; /* physical constraints of hot spot */
221 WindowPtr win; /* window of logical position */
222 HotSpot hot; /* logical pointer position */
223 HotSpot hotPhys; /* physical pointer position */
224#ifdef PANORAMIX
225 ScreenPtr screen; /* all others are in Screen 0 coordinates */
226 RegionRec Reg1; /* Region 1 for confining motion */
227 RegionRec Reg2; /* Region 2 for confining virtual motion */
228 WindowPtr windows[MAXSCREENS];
229 WindowPtr confineWin; /* confine window */
230#endif
231 /* The window trace information is used at dix/events.c to avoid having
232 * to compute all the windows between the root and the current pointer
233 * window each time a button or key goes down. The grabs on each of those
234 * windows must be checked.
235 * spriteTraces should only be used at dix/events.c! */
236 WindowPtr *spriteTrace;
237 int spriteTraceSize;
238 int spriteTraceGood;
239
240 /* Due to delays between event generation and event processing, it is
241 * possible that the pointer has crossed screen boundaries between the
242 * time in which it begins generating events and the time when
243 * those events are processed.
244 *
245 * pEnqueueScreen: screen the pointer was on when the event was generated
246 * pDequeueScreen: screen the pointer was on when the event is processed
247 */
248 ScreenPtr pEnqueueScreen;
249 ScreenPtr pDequeueScreen;
250
251} SpriteRec;
252
253typedef struct _KeyClassRec {
254 int sourceid;
255 CARD8 down[DOWN_LENGTH];
256 CARD8 postdown[DOWN_LENGTH];
257 int modifierKeyCount[8];
258 struct _XkbSrvInfo *xkbInfo;
259} KeyClassRec, *KeyClassPtr;
260
261typedef struct _ScrollInfo {
262 enum ScrollType type;
263 double increment;
264 int flags;
265} ScrollInfo, *ScrollInfoPtr;
266
267typedef struct _AxisInfo {
268 int resolution;
269 int min_resolution;
270 int max_resolution;
271 int min_value;
272 int max_value;
273 Atom label;
274 CARD8 mode;
275 ScrollInfo scroll;
276} AxisInfo, *AxisInfoPtr;
277
278typedef struct _ValuatorAccelerationRec {
279 int number;
280 PointerAccelSchemeProc AccelSchemeProc;
281 void *accelData; /* at disposal of AccelScheme */
282 PointerAccelSchemeInitProc AccelInitProc;
283 DeviceCallbackProc AccelCleanupProc;
284} ValuatorAccelerationRec, *ValuatorAccelerationPtr;
285
286typedef struct _ValuatorClassRec {
287 int sourceid;
288 int numMotionEvents;
289 int first_motion;
290 int last_motion;
291 void *motion; /* motion history buffer. Different layout
292 for MDs and SDs!*/
293 WindowPtr motionHintWindow;
294
295 AxisInfoPtr axes;
296 unsigned short numAxes;
297 double *axisVal; /* always absolute, but device-coord system */
298 ValuatorAccelerationRec accelScheme;
299 int h_scroll_axis; /* horiz smooth-scrolling axis */
300 int v_scroll_axis; /* vert smooth-scrolling axis */
301} ValuatorClassRec;
302
303typedef struct _TouchPointInfo {
304 uint32_t client_id; /* touch ID as seen in client events */
305 int sourceid; /* Source device's ID for this touchpoint */
306 Bool active; /* whether or not the touch is active */
307 Bool pending_finish; /* true if the touch is physically inactive
308 * but still owned by a grab */
309 SpriteRec sprite; /* window trace for delivery */
310 ValuatorMask *valuators; /* last recorded axis values */
311 struct _TouchListener {
312 XID listener; /* grabs/event selection IDs receiving
313 * events for this touch */
314 enum TouchListenerType type;
315 enum TouchListenerState state;
316 enum InputLevel level; /* matters only for emulating touches */
317 WindowPtr window;
318 } *listeners;
319 int num_listeners;
320 int num_grabs; /* number of open grabs on this touch
321 * which have not accepted or rejected */
322 Bool emulate_pointer;
323 DeviceEvent *history; /* History of events on this touchpoint */
324 size_t history_elements; /* Number of current elements in history */
325 size_t history_size; /* Size of history in elements */
326} TouchPointInfoRec;
327
328typedef struct _TouchListener TouchListener;
329
330typedef struct _DDXTouchPointInfo {
331 uint32_t client_id; /* touch ID as seen in client events */
332 Bool active; /* whether or not the touch is active */
333 uint32_t ddx_id; /* touch ID given by the DDX */
334 Bool emulate_pointer;
335
336 ValuatorMask* valuators; /* last recorded axis values */
337} DDXTouchPointInfoRec;
338
339typedef struct _TouchClassRec {
340 int sourceid;
341 TouchPointInfoPtr touches;
342 unsigned short num_touches; /* number of allocated touches */
343 unsigned short max_touches; /* maximum number of touches, may be 0 */
344 CARD8 mode; /* ::XIDirectTouch, XIDependentTouch */
345 /* for pointer-emulation */
346 CARD8 buttonsDown; /* number of buttons down */
347 unsigned short state; /* logical button state */
348 Mask motionMask;
349} TouchClassRec;
350
351typedef struct _ButtonClassRec {
352 int sourceid;
353 CARD8 numButtons;
354 CARD8 buttonsDown; /* number of buttons currently down
355 This counts logical buttons, not
356 physical ones, i.e if some buttons
357 are mapped to 0, they're not counted
358 here */
359 unsigned short state;
360 Mask motionMask;
361 CARD8 down[DOWN_LENGTH];
362 CARD8 postdown[DOWN_LENGTH];
363 CARD8 map[MAP_LENGTH];
364 union _XkbAction *xkb_acts;
365 Atom labels[MAX_BUTTONS];
366} ButtonClassRec, *ButtonClassPtr;
367
368typedef struct _FocusClassRec {
369 int sourceid;
370 WindowPtr win; /* May be set to a int constant (e.g. PointerRootWin)! */
371 int revert;
372 TimeStamp time;
373 WindowPtr *trace;
374 int traceSize;
375 int traceGood;
376} FocusClassRec, *FocusClassPtr;
377
378typedef struct _ProximityClassRec {
379 int sourceid;
380 char in_proximity;
381} ProximityClassRec, *ProximityClassPtr;
382
383typedef struct _KbdFeedbackClassRec *KbdFeedbackPtr;
384typedef struct _PtrFeedbackClassRec *PtrFeedbackPtr;
385typedef struct _IntegerFeedbackClassRec *IntegerFeedbackPtr;
386typedef struct _StringFeedbackClassRec *StringFeedbackPtr;
387typedef struct _BellFeedbackClassRec *BellFeedbackPtr;
388typedef struct _LedFeedbackClassRec *LedFeedbackPtr;
389
390typedef struct _KbdFeedbackClassRec {
391 BellProcPtr BellProc;
392 KbdCtrlProcPtr CtrlProc;
393 KeybdCtrl ctrl;
394 KbdFeedbackPtr next;
395 struct _XkbSrvLedInfo *xkb_sli;
396} KbdFeedbackClassRec;
397
398typedef struct _PtrFeedbackClassRec {
399 PtrCtrlProcPtr CtrlProc;
400 PtrCtrl ctrl;
401 PtrFeedbackPtr next;
402} PtrFeedbackClassRec;
403
404typedef struct _IntegerFeedbackClassRec {
405 IntegerCtrlProcPtr CtrlProc;
406 IntegerCtrl ctrl;
407 IntegerFeedbackPtr next;
408} IntegerFeedbackClassRec;
409
410typedef struct _StringFeedbackClassRec {
411 StringCtrlProcPtr CtrlProc;
412 StringCtrl ctrl;
413 StringFeedbackPtr next;
414} StringFeedbackClassRec;
415
416typedef struct _BellFeedbackClassRec {
417 BellProcPtr BellProc;
418 BellCtrlProcPtr CtrlProc;
419 BellCtrl ctrl;
420 BellFeedbackPtr next;
421} BellFeedbackClassRec;
422
423typedef struct _LedFeedbackClassRec {
424 LedCtrlProcPtr CtrlProc;
425 LedCtrl ctrl;
426 LedFeedbackPtr next;
427 struct _XkbSrvLedInfo *xkb_sli;
428} LedFeedbackClassRec;
429
430
431typedef struct _ClassesRec {
432 KeyClassPtr key;
433 ValuatorClassPtr valuator;
434 TouchClassPtr touch;
435 ButtonClassPtr button;
436 FocusClassPtr focus;
437 ProximityClassPtr proximity;
438 KbdFeedbackPtr kbdfeed;
439 PtrFeedbackPtr ptrfeed;
440 IntegerFeedbackPtr intfeed;
441 StringFeedbackPtr stringfeed;
442 BellFeedbackPtr bell;
443 LedFeedbackPtr leds;
444} ClassesRec;
445
446
447/* Device properties */
448typedef struct _XIPropertyValue
449{
450 Atom type; /* ignored by server */
451 short format; /* format of data for swapping - 8,16,32 */
452 long size; /* size of data in (format/8) bytes */
453 pointer data; /* private to client */
454} XIPropertyValueRec;
455
456typedef struct _XIProperty
457{
458 struct _XIProperty *next;
459 Atom propertyName;
460 BOOL deletable; /* clients can delete this prop? */
461 XIPropertyValueRec value;
462} XIPropertyRec;
463
464typedef XIPropertyRec *XIPropertyPtr;
465typedef XIPropertyValueRec *XIPropertyValuePtr;
466
467
468typedef struct _XIPropertyHandler
469{
470 struct _XIPropertyHandler* next;
471 long id;
472 int (*SetProperty) (DeviceIntPtr dev,
473 Atom property,
474 XIPropertyValuePtr prop,
475 BOOL checkonly);
476 int (*GetProperty) (DeviceIntPtr dev,
477 Atom property);
478 int (*DeleteProperty) (DeviceIntPtr dev,
479 Atom property);
480} XIPropertyHandler, *XIPropertyHandlerPtr;
481
482/* states for devices */
483
484#define NOT_GRABBED 0
485#define THAWED 1
486#define THAWED_BOTH 2 /* not a real state */
487#define FREEZE_NEXT_EVENT 3
488#define FREEZE_BOTH_NEXT_EVENT 4
489#define FROZEN 5 /* any state >= has device frozen */
490#define FROZEN_NO_EVENT 5
491#define FROZEN_WITH_EVENT 6
492#define THAW_OTHERS 7
493
494
495typedef struct _GrabInfoRec {
496 TimeStamp grabTime;
497 Bool fromPassiveGrab; /* true if from passive grab */
498 Bool implicitGrab; /* implicit from ButtonPress */
499 GrabPtr activeGrab;
500 GrabPtr grab;
501 CARD8 activatingKey;
502 void (*ActivateGrab) (
503 DeviceIntPtr /*device*/,
504 GrabPtr /*grab*/,
505 TimeStamp /*time*/,
506 Bool /*autoGrab*/);
507 void (*DeactivateGrab)(
508 DeviceIntPtr /*device*/);
509 struct {
510 Bool frozen;
511 int state;
512 GrabPtr other; /* if other grab has this frozen */
513 DeviceEvent *event; /* saved to be replayed */
514 } sync;
515} GrabInfoRec, *GrabInfoPtr;
516
517typedef struct _SpriteInfoRec {
518 /* sprite must always point to a valid sprite. For devices sharing the
519 * sprite, let sprite point to a paired spriteOwner's sprite. */
520 SpritePtr sprite; /* sprite information */
521 Bool spriteOwner; /* True if device owns the sprite */
522 DeviceIntPtr paired; /* The paired device. Keyboard if
523 spriteOwner is TRUE, otherwise the
524 pointer that owns the sprite. */
525
526 /* keep states for animated cursor */
527 struct {
528 CursorPtr pCursor;
529 ScreenPtr pScreen;
530 int elt;
531 CARD32 time;
532 } anim;
533} SpriteInfoRec, *SpriteInfoPtr;
534
535/* device types */
536#define MASTER_POINTER 1
537#define MASTER_KEYBOARD 2
538#define SLAVE 3
539/* special types for GetMaster */
540#define MASTER_ATTACHED 4 /* Master for this device */
541#define KEYBOARD_OR_FLOAT 5 /* Keyboard master for this device or this device if floating */
542#define POINTER_OR_FLOAT 6 /* Pointer master for this device or this device if floating */
543
544typedef struct _DeviceIntRec {
545 DeviceRec public;
546 DeviceIntPtr next;
547 Bool startup; /* true if needs to be turned on at
548 server initialization time */
549 DeviceProc deviceProc; /* proc(DevicePtr, DEVICE_xx). It is
550 used to initialize, turn on, or
551 turn off the device */
552 Bool inited; /* TRUE if INIT returns Success */
553 Bool enabled; /* TRUE if ON returns Success */
554 Bool coreEvents; /* TRUE if device also sends core */
555 GrabInfoRec deviceGrab; /* grab on the device */
556 int type; /* MASTER_POINTER, MASTER_KEYBOARD, SLAVE */
557 Atom xinput_type;
558 char *name;
559 int id;
560 KeyClassPtr key;
561 ValuatorClassPtr valuator;
562 TouchClassPtr touch;
563 ButtonClassPtr button;
564 FocusClassPtr focus;
565 ProximityClassPtr proximity;
566 KbdFeedbackPtr kbdfeed;
567 PtrFeedbackPtr ptrfeed;
568 IntegerFeedbackPtr intfeed;
569 StringFeedbackPtr stringfeed;
570 BellFeedbackPtr bell;
571 LedFeedbackPtr leds;
572 struct _XkbInterest *xkb_interest;
573 char *config_info; /* used by the hotplug layer */
574 ClassesPtr unused_classes; /* for master devices */
575 int saved_master_id; /* for slaves while grabbed */
576 PrivateRec *devPrivates;
577 DeviceUnwrapProc unwrapProc;
578 SpriteInfoPtr spriteInfo;
579 DeviceIntPtr master; /* master device */
580 DeviceIntPtr lastSlave; /* last slave device used */
581
582 /* last valuator values recorded, not posted to client;
583 * for slave devices, valuators is in device coordinates, mapped to the
584 * desktop
585 * for master devices, valuators is in desktop coordinates.
586 * see dix/getevents.c
587 * remainder supports acceleration
588 */
589 struct {
590 double valuators[MAX_VALUATORS];
591 int numValuators;
592 DeviceIntPtr slave;
593 ValuatorMask *scroll;
594 int num_touches; /* size of the touches array */
595 DDXTouchPointInfoPtr touches;
596 } last;
597
598 /* Input device property handling. */
599 struct {
600 XIPropertyPtr properties;
601 XIPropertyHandlerPtr handlers; /* NULL-terminated */
602 } properties;
603
604 /* coordinate transformation matrix for absolute input devices */
605 struct pixman_f_transform transform;
606
607 /* XTest related master device id */
608 int xtest_master_id;
609} DeviceIntRec;
610
611typedef struct {
612 int numDevices; /* total number of devices */
613 DeviceIntPtr devices; /* all devices turned on */
614 DeviceIntPtr off_devices; /* all devices turned off */
615 DeviceIntPtr keyboard; /* the main one for the server */
616 DeviceIntPtr pointer;
617 DeviceIntPtr all_devices;
618 DeviceIntPtr all_master_devices;
619} InputInfo;
620
621extern _X_EXPORT InputInfo inputInfo;
622
623/* for keeping the events for devices grabbed synchronously */
624typedef struct _QdEvent *QdEventPtr;
625typedef struct _QdEvent {
626 struct xorg_list next;
627 DeviceIntPtr device;
628 ScreenPtr pScreen; /* what screen the pointer was on */
629 unsigned long months; /* milliseconds is in the event */
630 InternalEvent *event;
631} QdEventRec;
632
633/**
634 * syncEvents is the global structure for queued events.
635 *
636 * Devices can be frozen through GrabModeSync pointer grabs. If this is the
637 * case, events from these devices are added to "pending" instead of being
638 * processed normally. When the device is unfrozen, events in "pending" are
639 * replayed and processed as if they would come from the device directly.
640 */
641typedef struct _EventSyncInfo {
642 struct xorg_list pending;
643
644 /** The device to replay events for. Only set in AllowEvents(), in which
645 * case it is set to the device specified in the request. */
646 DeviceIntPtr replayDev; /* kludgy rock to put flag for */
647
648 /**
649 * The window the events are supposed to be replayed on.
650 * This window may be set to the grab's window (but only when
651 * Replay{Pointer|Keyboard} is given in the XAllowEvents()
652 * request. */
653 WindowPtr replayWin; /* ComputeFreezes */
654 /**
655 * Flag to indicate whether we're in the process of
656 * replaying events. Only set in ComputeFreezes(). */
657 Bool playingEvents;
658 TimeStamp time;
659} EventSyncInfoRec, *EventSyncInfoPtr;
660
661extern EventSyncInfoRec syncEvents;
662
663/**
664 * Given a sprite, returns the window at the bottom of the trace (i.e. the
665 * furthest window from the root).
666 */
667static inline WindowPtr DeepestSpriteWin(SpritePtr sprite)
668{
669 assert(sprite->spriteTraceGood > 0);
670 return sprite->spriteTrace[sprite->spriteTraceGood - 1];
671}
672
673struct _XI2Mask {
674 unsigned char **masks; /* event mask in masks[deviceid][event type byte] */
675 size_t nmasks; /* number of masks */
676 size_t mask_size; /* size of each mask in bytes */
677};
678
679#endif /* INPUTSTRUCT_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