VirtualBox

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

Last change on this file since 62489 was 49174, checked in by vboxsync, 11 years ago

Additions/x11: replace header files for X.Org Server 1.6.0 with those for version 1.6.5 due to an ABI bump in-between.

  • Property svn:eol-style set to native
File size: 16.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
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 "input.h"
53#include "window.h"
54#include "dixstruct.h"
55#include "cursorstr.h"
56#include "geext.h"
57#include "privates.h"
58
59#define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))
60
61#define SameClient(obj,client) \
62 (CLIENT_BITS((obj)->resource) == (client)->clientAsMask)
63
64#define EMASKSIZE MAXDEVICES + 1
65
66extern DevPrivateKey CoreDevicePrivateKey;
67
68/* Kludge: OtherClients and InputClients must be compatible, see code */
69
70typedef struct _OtherClients {
71 OtherClientsPtr next;
72 XID resource; /* id for putting into resource manager */
73 Mask mask;
74} OtherClients;
75
76typedef struct _InputClients {
77 InputClientsPtr next;
78 XID resource; /* id for putting into resource manager */
79 Mask mask[EMASKSIZE];
80} InputClients;
81
82typedef struct _OtherInputMasks {
83 Mask deliverableEvents[EMASKSIZE];
84 Mask inputEvents[EMASKSIZE];
85 Mask dontPropagateMask[EMASKSIZE];
86 InputClientsPtr inputClients;
87} OtherInputMasks;
88
89/*
90 * The following structure gets used for both active and passive grabs. For
91 * active grabs some of the fields (e.g. modifiers) are not used. However,
92 * that is not much waste since there aren't many active grabs (one per
93 * keyboard/pointer device) going at once in the server.
94 */
95
96#define MasksPerDetailMask 8 /* 256 keycodes and 256 possible
97 modifier combinations, but only
98 3 buttons. */
99
100typedef struct _DetailRec { /* Grab details may be bit masks */
101 unsigned short exact;
102 Mask *pMask;
103} DetailRec;
104
105/**
106 * Central struct for device grabs.
107 * The same struct is used for both core grabs and device grabs, with
108 * different fields being set.
109 * If the grab is a core grab (GrabPointer/GrabKeyboard), then the eventMask
110 * is a combination of standard event masks (i.e. PointerMotionMask |
111 * ButtonPressMask).
112 * If the grab is a device grab (GrabDevice), then the eventMask is a
113 * combination of event masks for a given XI event type (see SetEventInfo).
114 *
115 * If the grab is a result of a ButtonPress, then eventMask is the core mask
116 * and deviceMask is set to the XI event mask for the grab.
117 */
118typedef struct _GrabRec {
119 GrabPtr next; /* for chain of passive grabs */
120 XID resource;
121 DeviceIntPtr device;
122 WindowPtr window;
123 unsigned ownerEvents:1;
124 unsigned keyboardMode:1;
125 unsigned pointerMode:1;
126 unsigned coreGrab:1; /* grab is on core device */
127 unsigned coreMods:1; /* modifiers are on core keyboard */
128 CARD8 type; /* event type */
129 DetailRec modifiersDetail;
130 DeviceIntPtr modifierDevice;
131 DetailRec detail; /* key or button */
132 WindowPtr confineTo; /* always NULL for keyboards */
133 CursorPtr cursor; /* always NULL for keyboards */
134 Mask eventMask;
135 Mask deviceMask;
136 GenericMaskPtr genericMasks;
137} GrabRec;
138
139typedef struct _KeyClassRec {
140 CARD8 down[DOWN_LENGTH];
141 CARD8 postdown[DOWN_LENGTH];
142 KeyCode *modifierKeyMap;
143 KeySymsRec curKeySyms;
144 int modifierKeyCount[8];
145 CARD8 modifierMap[MAP_LENGTH];
146 CARD8 maxKeysPerModifier;
147 unsigned short state;
148 unsigned short prev_state;
149#ifdef XKB
150 struct _XkbSrvInfo *xkbInfo;
151#else
152 void *pad0;
153#endif
154} KeyClassRec, *KeyClassPtr;
155
156typedef struct _AxisInfo {
157 int resolution;
158 int min_resolution;
159 int max_resolution;
160 int min_value;
161 int max_value;
162} AxisInfo, *AxisInfoPtr;
163
164typedef struct _ValuatorAccelerationRec {
165 int number;
166 PointerAccelSchemeProc AccelSchemeProc;
167 void *accelData; /* at disposal of AccelScheme */
168 DeviceCallbackProc AccelCleanupProc;
169} ValuatorAccelerationRec, *ValuatorAccelerationPtr;
170
171typedef struct _ValuatorClassRec {
172 int numMotionEvents;
173 int first_motion;
174 int last_motion;
175 void *motion; /* motion history buffer. Different layout
176 for MDs and SDs!*/
177 WindowPtr motionHintWindow;
178
179 AxisInfoPtr axes;
180 unsigned short numAxes;
181 int *axisVal; /* always absolute, but device-coord system */
182 CARD8 mode;
183 ValuatorAccelerationRec accelScheme;
184} ValuatorClassRec, *ValuatorClassPtr;
185
186typedef struct _ButtonClassRec {
187 CARD8 numButtons;
188 CARD8 buttonsDown; /* number of buttons currently down
189 This counts logical buttons, not
190 physical ones, i.e if some buttons
191 are mapped to 0, they're not counted
192 here */
193 unsigned short state;
194 Mask motionMask;
195 CARD8 down[DOWN_LENGTH];
196 CARD8 map[MAP_LENGTH];
197#ifdef XKB
198 union _XkbAction *xkb_acts;
199#else
200 void *pad0;
201#endif
202} ButtonClassRec, *ButtonClassPtr;
203
204typedef struct _FocusClassRec {
205 WindowPtr win; /* May be set to a int constant (e.g. PointerRootWin)! */
206 int revert;
207 TimeStamp time;
208 WindowPtr *trace;
209 int traceSize;
210 int traceGood;
211} FocusClassRec, *FocusClassPtr;
212
213typedef struct _ProximityClassRec {
214 char pad;
215} ProximityClassRec, *ProximityClassPtr;
216
217typedef struct _AbsoluteClassRec {
218 /* Calibration. */
219 int min_x;
220 int max_x;
221 int min_y;
222 int max_y;
223 int flip_x;
224 int flip_y;
225 int rotation;
226 int button_threshold;
227
228 /* Area. */
229 int offset_x;
230 int offset_y;
231 int width;
232 int height;
233 int screen;
234 XID following;
235} AbsoluteClassRec, *AbsoluteClassPtr;
236
237typedef struct _KbdFeedbackClassRec *KbdFeedbackPtr;
238typedef struct _PtrFeedbackClassRec *PtrFeedbackPtr;
239typedef struct _IntegerFeedbackClassRec *IntegerFeedbackPtr;
240typedef struct _StringFeedbackClassRec *StringFeedbackPtr;
241typedef struct _BellFeedbackClassRec *BellFeedbackPtr;
242typedef struct _LedFeedbackClassRec *LedFeedbackPtr;
243
244typedef struct _KbdFeedbackClassRec {
245 BellProcPtr BellProc;
246 KbdCtrlProcPtr CtrlProc;
247 KeybdCtrl ctrl;
248 KbdFeedbackPtr next;
249#ifdef XKB
250 struct _XkbSrvLedInfo *xkb_sli;
251#else
252 void *pad0;
253#endif
254} KbdFeedbackClassRec;
255
256typedef struct _PtrFeedbackClassRec {
257 PtrCtrlProcPtr CtrlProc;
258 PtrCtrl ctrl;
259 PtrFeedbackPtr next;
260} PtrFeedbackClassRec;
261
262typedef struct _IntegerFeedbackClassRec {
263 IntegerCtrlProcPtr CtrlProc;
264 IntegerCtrl ctrl;
265 IntegerFeedbackPtr next;
266} IntegerFeedbackClassRec;
267
268typedef struct _StringFeedbackClassRec {
269 StringCtrlProcPtr CtrlProc;
270 StringCtrl ctrl;
271 StringFeedbackPtr next;
272} StringFeedbackClassRec;
273
274typedef struct _BellFeedbackClassRec {
275 BellProcPtr BellProc;
276 BellCtrlProcPtr CtrlProc;
277 BellCtrl ctrl;
278 BellFeedbackPtr next;
279} BellFeedbackClassRec;
280
281typedef struct _LedFeedbackClassRec {
282 LedCtrlProcPtr CtrlProc;
283 LedCtrl ctrl;
284 LedFeedbackPtr next;
285#ifdef XKB
286 struct _XkbSrvLedInfo *xkb_sli;
287#else
288 void *pad0;
289#endif
290} LedFeedbackClassRec;
291
292
293typedef struct _ClassesRec {
294 KeyClassPtr key;
295 ValuatorClassPtr valuator;
296 ButtonClassPtr button;
297 FocusClassPtr focus;
298 ProximityClassPtr proximity;
299 AbsoluteClassPtr absolute;
300 KbdFeedbackPtr kbdfeed;
301 PtrFeedbackPtr ptrfeed;
302 IntegerFeedbackPtr intfeed;
303 StringFeedbackPtr stringfeed;
304 BellFeedbackPtr bell;
305 LedFeedbackPtr leds;
306} ClassesRec;
307
308
309/**
310 * Sprite information for a device.
311 */
312typedef struct {
313 CursorPtr current;
314 BoxRec hotLimits; /* logical constraints of hot spot */
315 Bool confined; /* confined to screen */
316 RegionPtr hotShape; /* additional logical shape constraint */
317 BoxRec physLimits; /* physical constraints of hot spot */
318 WindowPtr win; /* window of logical position */
319 HotSpot hot; /* logical pointer position */
320 HotSpot hotPhys; /* physical pointer position */
321#ifdef PANORAMIX
322 ScreenPtr screen; /* all others are in Screen 0 coordinates */
323 RegionRec Reg1; /* Region 1 for confining motion */
324 RegionRec Reg2; /* Region 2 for confining virtual motion */
325 WindowPtr windows[MAXSCREENS];
326 WindowPtr confineWin; /* confine window */
327#endif
328 /* The window trace information is used at dix/events.c to avoid having
329 * to compute all the windows between the root and the current pointer
330 * window each time a button or key goes down. The grabs on each of those
331 * windows must be checked.
332 * spriteTraces should only be used at dix/events.c! */
333 WindowPtr *spriteTrace;
334 int spriteTraceSize;
335 int spriteTraceGood;
336
337 ScreenPtr pEnqueueScreen; /* screen events are being delivered to */
338 ScreenPtr pDequeueScreen; /* screen events are being dispatched to */
339
340} SpriteRec, *SpritePtr;
341
342/* Device properties */
343typedef struct _XIPropertyValue
344{
345 Atom type; /* ignored by server */
346 short format; /* format of data for swapping - 8,16,32 */
347 long size; /* size of data in (format/8) bytes */
348 pointer data; /* private to client */
349} XIPropertyValueRec;
350
351typedef struct _XIProperty
352{
353 struct _XIProperty *next;
354 Atom propertyName;
355 BOOL deletable; /* clients can delete this prop? */
356 XIPropertyValueRec value;
357} XIPropertyRec;
358
359typedef XIPropertyRec *XIPropertyPtr;
360typedef XIPropertyValueRec *XIPropertyValuePtr;
361
362
363typedef struct _XIPropertyHandler
364{
365 struct _XIPropertyHandler* next;
366 long id;
367 int (*SetProperty) (DeviceIntPtr dev,
368 Atom property,
369 XIPropertyValuePtr prop,
370 BOOL checkonly);
371 int (*GetProperty) (DeviceIntPtr dev,
372 Atom property);
373 int (*DeleteProperty) (DeviceIntPtr dev,
374 Atom property);
375} XIPropertyHandler, *XIPropertyHandlerPtr;
376
377/* states for devices */
378
379#define NOT_GRABBED 0
380#define THAWED 1
381#define THAWED_BOTH 2 /* not a real state */
382#define FREEZE_NEXT_EVENT 3
383#define FREEZE_BOTH_NEXT_EVENT 4
384#define FROZEN 5 /* any state >= has device frozen */
385#define FROZEN_NO_EVENT 5
386#define FROZEN_WITH_EVENT 6
387#define THAW_OTHERS 7
388
389
390typedef struct _GrabInfoRec {
391 TimeStamp grabTime;
392 Bool fromPassiveGrab; /* true if from passive grab */
393 Bool implicitGrab; /* implicit from ButtonPress */
394 GrabRec activeGrab;
395 GrabPtr grab;
396 CARD8 activatingKey;
397 void (*ActivateGrab) (
398 DeviceIntPtr /*device*/,
399 GrabPtr /*grab*/,
400 TimeStamp /*time*/,
401 Bool /*autoGrab*/);
402 void (*DeactivateGrab)(
403 DeviceIntPtr /*device*/);
404 struct {
405 Bool frozen;
406 int state;
407 GrabPtr other; /* if other grab has this frozen */
408 xEvent *event; /* saved to be replayed */
409 int evcount;
410 } sync;
411} GrabInfoRec, *GrabInfoPtr;
412
413typedef struct _SpriteInfoRec {
414 /* sprite must always point to a valid sprite. For devices sharing the
415 * sprite, let sprite point to a paired spriteOwner's sprite. */
416 SpritePtr sprite; /* sprite information */
417 Bool spriteOwner; /* True if device owns the sprite */
418 DeviceIntPtr paired; /* The paired device. Keyboard if
419 spriteOwner is TRUE, otherwise the
420 pointer that owns the sprite. */
421} SpriteInfoRec, *SpriteInfoPtr;
422
423typedef struct _DeviceIntRec {
424 DeviceRec public;
425 DeviceIntPtr next;
426 Bool startup; /* true if needs to be turned on at
427 server intialization time */
428 DeviceProc deviceProc; /* proc(DevicePtr, DEVICE_xx). It is
429 used to initialize, turn on, or
430 turn off the device */
431 Bool inited; /* TRUE if INIT returns Success */
432 Bool enabled; /* TRUE if ON returns Success */
433 Bool coreEvents; /* TRUE if device also sends core */
434 GrabInfoRec deviceGrab; /* grab on the device */
435 Bool isMaster; /* TRUE if device is master */
436 Atom type;
437 char *name;
438 CARD8 id;
439 KeyClassPtr key;
440 ValuatorClassPtr valuator;
441 ButtonClassPtr button;
442 FocusClassPtr focus;
443 ProximityClassPtr proximity;
444 AbsoluteClassPtr absolute;
445 KbdFeedbackPtr kbdfeed;
446 PtrFeedbackPtr ptrfeed;
447 IntegerFeedbackPtr intfeed;
448 StringFeedbackPtr stringfeed;
449 BellFeedbackPtr bell;
450 LedFeedbackPtr leds;
451#ifdef XKB
452 struct _XkbInterest *xkb_interest;
453#else
454 void *pad0;
455#endif
456 char *config_info; /* used by the hotplug layer */
457 PrivateRec *devPrivates;
458 int nPrivates;
459 DeviceUnwrapProc unwrapProc;
460 SpriteInfoPtr spriteInfo;
461 union {
462 DeviceIntPtr master; /* master device */
463 DeviceIntPtr lastSlave; /* last slave device used */
464 } u;
465
466 /* last valuator values recorded, not posted to client;
467 * for slave devices, valuators is in device coordinates
468 * for master devices, valuators is in screen coordinates
469 * see dix/getevents.c
470 * remainder supports acceleration
471 */
472 struct {
473 int valuators[MAX_VALUATORS];
474 float remainder[MAX_VALUATORS];
475 int numValuators;
476 } last;
477
478 /* Input device property handling. */
479 struct {
480 XIPropertyPtr properties;
481 XIPropertyHandlerPtr handlers; /* NULL-terminated */
482 } properties;
483} DeviceIntRec;
484
485typedef struct {
486 int numDevices; /* total number of devices */
487 DeviceIntPtr devices; /* all devices turned on */
488 DeviceIntPtr off_devices; /* all devices turned off */
489 DeviceIntPtr keyboard; /* the main one for the server */
490 DeviceIntPtr pointer;
491} InputInfo;
492
493extern InputInfo inputInfo;
494
495/* for keeping the events for devices grabbed synchronously */
496typedef struct _QdEvent *QdEventPtr;
497typedef struct _QdEvent {
498 QdEventPtr next;
499 DeviceIntPtr device;
500 ScreenPtr pScreen; /* what screen the pointer was on */
501 unsigned long months; /* milliseconds is in the event */
502 xEvent *event;
503 int evcount;
504} QdEventRec;
505
506#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