VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.16.0/dix.h@ 64670

Last change on this file since 64670 was 52145, checked in by vboxsync, 10 years ago

Additions/x11/x11include: add header files for X.Org Server 1.16.

  • Property svn:eol-style set to native
File size: 18.3 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 DIX_H
48#define DIX_H
49
50#include "callback.h"
51#include "gc.h"
52#include "window.h"
53#include "input.h"
54#include "cursor.h"
55#include "geext.h"
56#include "events.h"
57#include <X11/extensions/XI.h>
58
59#define EARLIER -1
60#define SAMETIME 0
61#define LATER 1
62
63#define NullClient ((ClientPtr) 0)
64#define REQUEST(type) \
65 type *stuff = (type *)client->requestBuffer
66
67#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
68
69#define REQUEST_SIZE_MATCH(req)\
70 if ((sizeof(req) >> 2) != client->req_len)\
71 return(BadLength)
72
73#define REQUEST_AT_LEAST_SIZE(req) \
74 if ((sizeof(req) >> 2) > client->req_len )\
75 return(BadLength)
76
77#define REQUEST_FIXED_SIZE(req, n)\
78 if (((sizeof(req) >> 2) > client->req_len) || \
79 (((sizeof(req) + (n) + 3) >> 2) != client->req_len)) \
80 return(BadLength)
81
82#define LEGAL_NEW_RESOURCE(id,client)\
83 if (!LegalNewID(id,client)) \
84 {\
85 client->errorValue = id;\
86 return BadIDChoice;\
87 }
88
89#define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, mode)\
90 {\
91 int tmprc = dixLookupDrawable(&(pDraw), drawID, client, M_ANY, mode);\
92 if (tmprc != Success)\
93 return tmprc;\
94 tmprc = dixLookupGC(&(pGC), stuff->gc, client, DixUseAccess);\
95 if (tmprc != Success)\
96 return tmprc;\
97 if ((pGC->depth != pDraw->depth) || (pGC->pScreen != pDraw->pScreen))\
98 return BadMatch;\
99 }\
100 if (pGC->serialNumber != pDraw->serialNumber)\
101 ValidateGC(pDraw, pGC);
102
103#define WriteReplyToClient(pClient, size, pReply) { \
104 if ((pClient)->swapped) \
105 (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \
106 (pClient, (int)(size), pReply); \
107 else WriteToClient(pClient, (int)(size), (pReply)); }
108
109#define WriteSwappedDataToClient(pClient, size, pbuf) \
110 if ((pClient)->swapped) \
111 (*(pClient)->pSwapReplyFunc)(pClient, (int)(size), pbuf); \
112 else WriteToClient(pClient, (int)(size), (pbuf));
113
114typedef struct _TimeStamp *TimeStampPtr;
115
116#ifndef _XTYPEDEF_CLIENTPTR
117typedef struct _Client *ClientPtr; /* also in misc.h */
118
119#define _XTYPEDEF_CLIENTPTR
120#endif
121
122typedef struct _WorkQueue *WorkQueuePtr;
123
124extern _X_EXPORT ClientPtr clients[MAXCLIENTS];
125extern _X_EXPORT ClientPtr serverClient;
126extern _X_EXPORT int currentMaxClients;
127extern _X_EXPORT char dispatchExceptionAtReset;
128
129typedef int HWEventQueueType;
130typedef HWEventQueueType *HWEventQueuePtr;
131
132extern _X_EXPORT HWEventQueuePtr checkForInput[2];
133
134typedef struct _TimeStamp {
135 CARD32 months; /* really ~49.7 days */
136 CARD32 milliseconds;
137} TimeStamp;
138
139/* dispatch.c */
140
141extern _X_EXPORT void SetInputCheck(HWEventQueuePtr /*c0 */ ,
142 HWEventQueuePtr /*c1 */ );
143
144extern _X_EXPORT void CloseDownClient(ClientPtr /*client */ );
145
146extern _X_EXPORT void UpdateCurrentTime(void);
147
148extern _X_EXPORT void UpdateCurrentTimeIf(void);
149
150extern _X_EXPORT int dixDestroyPixmap(void */*value */ ,
151 XID /*pid */ );
152
153extern _X_EXPORT void InitClient(ClientPtr /*client */ ,
154 int /*i */ ,
155 void */*ospriv */ );
156
157extern _X_EXPORT ClientPtr NextAvailableClient(void */*ospriv */ );
158
159extern _X_EXPORT void SendErrorToClient(ClientPtr /*client */ ,
160 unsigned int /*majorCode */ ,
161 unsigned int /*minorCode */ ,
162 XID /*resId */ ,
163 int /*errorCode */ );
164
165extern _X_EXPORT void MarkClientException(ClientPtr /*client */ );
166
167extern _X_HIDDEN Bool CreateConnectionBlock(void);
168
169/* dixutils.c */
170
171extern _X_EXPORT int CompareISOLatin1Lowered(const unsigned char * /*a */ ,
172 int alen,
173 const unsigned char * /*b */ ,
174 int blen);
175
176extern _X_EXPORT int dixLookupWindow(WindowPtr *result,
177 XID id,
178 ClientPtr client, Mask access_mode);
179
180extern _X_EXPORT int dixLookupDrawable(DrawablePtr *result,
181 XID id,
182 ClientPtr client,
183 Mask type_mask, Mask access_mode);
184
185extern _X_EXPORT int dixLookupGC(GCPtr *result,
186 XID id, ClientPtr client, Mask access_mode);
187
188extern _X_EXPORT int dixLookupFontable(FontPtr *result,
189 XID id,
190 ClientPtr client, Mask access_mode);
191
192extern _X_EXPORT int dixLookupClient(ClientPtr *result,
193 XID id,
194 ClientPtr client, Mask access_mode);
195
196extern _X_EXPORT void NoopDDA(void);
197
198extern _X_EXPORT int AlterSaveSetForClient(ClientPtr /*client */ ,
199 WindowPtr /*pWin */ ,
200 unsigned /*mode */ ,
201 Bool /*toRoot */ ,
202 Bool /*map */ );
203
204extern _X_EXPORT void DeleteWindowFromAnySaveSet(WindowPtr /*pWin */ );
205
206extern _X_EXPORT void BlockHandler(void */*pTimeout */ ,
207 void */*pReadmask */ );
208
209extern _X_EXPORT void WakeupHandler(int /*result */ ,
210 void */*pReadmask */ );
211
212void
213 EnableLimitedSchedulingLatency(void);
214
215void
216 DisableLimitedSchedulingLatency(void);
217
218typedef void (*WakeupHandlerProcPtr) (void */* blockData */ ,
219 int /* result */ ,
220 void */* pReadmask */ );
221
222extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr
223 /*blockHandler */ ,
224 WakeupHandlerProcPtr
225 /*wakeupHandler */ ,
226 void */*blockData */ );
227
228extern _X_EXPORT void RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr
229 /*blockHandler */ ,
230 WakeupHandlerProcPtr
231 /*wakeupHandler */ ,
232 void */*blockData */ );
233
234extern _X_EXPORT void InitBlockAndWakeupHandlers(void);
235
236extern _X_EXPORT void ProcessWorkQueue(void);
237
238extern _X_EXPORT void ProcessWorkQueueZombies(void);
239
240extern _X_EXPORT Bool QueueWorkProc(Bool (* /*function */ )(
241 ClientPtr
242 /*clientUnused */
243 ,
244 void *
245 /*closure */ ),
246 ClientPtr /*client */ ,
247 void */*closure */
248 );
249
250typedef Bool (*ClientSleepProcPtr) (ClientPtr /*client */ ,
251 void */*closure */ );
252
253extern _X_EXPORT Bool ClientSleep(ClientPtr /*client */ ,
254 ClientSleepProcPtr /* function */ ,
255 void */*closure */ );
256
257#ifndef ___CLIENTSIGNAL_DEFINED___
258#define ___CLIENTSIGNAL_DEFINED___
259extern _X_EXPORT Bool ClientSignal(ClientPtr /*client */ );
260#endif /* ___CLIENTSIGNAL_DEFINED___ */
261
262extern _X_EXPORT void ClientWakeup(ClientPtr /*client */ );
263
264extern _X_EXPORT Bool ClientIsAsleep(ClientPtr /*client */ );
265
266/* atom.c */
267
268extern _X_EXPORT Atom MakeAtom(const char * /*string */ ,
269 unsigned /*len */ ,
270 Bool /*makeit */ );
271
272extern _X_EXPORT Bool ValidAtom(Atom /*atom */ );
273
274extern _X_EXPORT const char *NameForAtom(Atom /*atom */ );
275
276extern _X_EXPORT void
277AtomError(void)
278 _X_NORETURN;
279
280extern _X_EXPORT void
281FreeAllAtoms(void);
282
283extern _X_EXPORT void
284InitAtoms(void);
285
286/* main.c */
287
288extern _X_EXPORT void
289SetVendorRelease(int release);
290
291extern _X_EXPORT void
292SetVendorString(const char *string);
293
294int
295dix_main(int argc, char *argv[], char *envp[]);
296
297/* events.c */
298
299extern void
300SetMaskForEvent(int /* deviceid */ ,
301 Mask /* mask */ ,
302 int /* event */ );
303
304extern _X_EXPORT void
305ConfineToShape(DeviceIntPtr /* pDev */ ,
306 RegionPtr /* shape */ ,
307 int * /* px */ ,
308 int * /* py */ );
309
310extern _X_EXPORT Bool
311IsParent(WindowPtr /* maybeparent */ ,
312 WindowPtr /* child */ );
313
314extern _X_EXPORT WindowPtr
315GetCurrentRootWindow(DeviceIntPtr pDev);
316
317extern _X_EXPORT WindowPtr
318GetSpriteWindow(DeviceIntPtr pDev);
319
320extern _X_EXPORT void
321NoticeTime(const DeviceIntPtr dev,
322 TimeStamp time);
323extern _X_EXPORT void
324NoticeEventTime(InternalEvent *ev,
325 DeviceIntPtr dev);
326extern _X_EXPORT TimeStamp
327LastEventTime(int deviceid);
328extern _X_EXPORT Bool
329LastEventTimeWasReset(int deviceid);
330extern _X_EXPORT void
331LastEventTimeToggleResetFlag(int deviceid, Bool state);
332extern _X_EXPORT void
333LastEventTimeToggleResetAll(Bool state);
334
335extern void
336EnqueueEvent(InternalEvent * /* ev */ ,
337 DeviceIntPtr /* device */ );
338extern void
339PlayReleasedEvents(void);
340
341extern void
342ActivatePointerGrab(DeviceIntPtr /* mouse */ ,
343 GrabPtr /* grab */ ,
344 TimeStamp /* time */ ,
345 Bool /* autoGrab */ );
346
347extern void
348DeactivatePointerGrab(DeviceIntPtr /* mouse */ );
349
350extern void
351ActivateKeyboardGrab(DeviceIntPtr /* keybd */ ,
352 GrabPtr /* grab */ ,
353 TimeStamp /* time */ ,
354 Bool /* passive */ );
355
356extern void
357DeactivateKeyboardGrab(DeviceIntPtr /* keybd */ );
358
359extern BOOL
360ActivateFocusInGrab(DeviceIntPtr /* dev */ ,
361 WindowPtr /* old */ ,
362 WindowPtr /* win */ );
363
364extern void
365AllowSome(ClientPtr /* client */ ,
366 TimeStamp /* time */ ,
367 DeviceIntPtr /* thisDev */ ,
368 int /* newState */ );
369
370extern void
371ReleaseActiveGrabs(ClientPtr client);
372
373extern GrabPtr
374CheckPassiveGrabsOnWindow(WindowPtr /* pWin */ ,
375 DeviceIntPtr /* device */ ,
376 InternalEvent * /* event */ ,
377 BOOL /* checkCore */ ,
378 BOOL /* activate */ );
379
380extern _X_EXPORT int
381DeliverEventsToWindow(DeviceIntPtr /* pWin */ ,
382 WindowPtr /* pWin */ ,
383 xEventPtr /* pEvents */ ,
384 int /* count */ ,
385 Mask /* filter */ ,
386 GrabPtr /* grab */ );
387
388extern _X_EXPORT void
389DeliverRawEvent(RawDeviceEvent * /* ev */ ,
390 DeviceIntPtr /* dev */
391 );
392
393extern int
394DeliverDeviceEvents(WindowPtr /* pWin */ ,
395 InternalEvent * /* event */ ,
396 GrabPtr /* grab */ ,
397 WindowPtr /* stopAt */ ,
398 DeviceIntPtr /* dev */ );
399
400extern int
401DeliverOneGrabbedEvent(InternalEvent * /* event */ ,
402 DeviceIntPtr /* dev */ ,
403 enum InputLevel /* level */ );
404
405extern void
406DeliverTouchEvents(DeviceIntPtr /* dev */ ,
407 TouchPointInfoPtr /* ti */ ,
408 InternalEvent * /* ev */ ,
409 XID /* resource */ );
410
411extern void
412InitializeSprite(DeviceIntPtr /* pDev */ ,
413 WindowPtr /* pWin */ );
414extern void
415FreeSprite(DeviceIntPtr pDev);
416
417extern void
418UpdateSpriteForScreen(DeviceIntPtr /* pDev */ ,
419 ScreenPtr /* pScreen */ );
420
421extern _X_EXPORT void
422WindowHasNewCursor(WindowPtr /* pWin */ );
423
424extern Bool
425CheckDeviceGrabs(DeviceIntPtr /* device */ ,
426 DeviceEvent * /* event */ ,
427 WindowPtr /* ancestor */ );
428
429extern void
430DeliverFocusedEvent(DeviceIntPtr /* keybd */ ,
431 InternalEvent * /* event */ ,
432 WindowPtr /* window */ );
433
434extern int
435DeliverGrabbedEvent(InternalEvent * /* event */ ,
436 DeviceIntPtr /* thisDev */ ,
437 Bool /* deactivateGrab */ );
438
439extern void
440FixKeyState(DeviceEvent * /* event */ ,
441 DeviceIntPtr /* keybd */ );
442
443extern void
444RecalculateDeliverableEvents(WindowPtr /* pWin */ );
445
446extern _X_EXPORT int
447OtherClientGone(void */* value */ ,
448 XID /* id */ );
449
450extern void
451DoFocusEvents(DeviceIntPtr /* dev */ ,
452 WindowPtr /* fromWin */ ,
453 WindowPtr /* toWin */ ,
454 int /* mode */ );
455
456extern int
457SetInputFocus(ClientPtr /* client */ ,
458 DeviceIntPtr /* dev */ ,
459 Window /* focusID */ ,
460 CARD8 /* revertTo */ ,
461 Time /* ctime */ ,
462 Bool /* followOK */ );
463
464extern int
465GrabDevice(ClientPtr /* client */ ,
466 DeviceIntPtr /* dev */ ,
467 unsigned /* this_mode */ ,
468 unsigned /* other_mode */ ,
469 Window /* grabWindow */ ,
470 unsigned /* ownerEvents */ ,
471 Time /* ctime */ ,
472 GrabMask * /* mask */ ,
473 int /* grabtype */ ,
474 Cursor /* curs */ ,
475 Window /* confineToWin */ ,
476 CARD8 * /* status */ );
477
478extern void
479InitEvents(void);
480
481extern void
482CloseDownEvents(void);
483
484extern void
485DeleteWindowFromAnyEvents(WindowPtr /* pWin */ ,
486 Bool /* freeResources */ );
487
488extern Mask
489EventMaskForClient(WindowPtr /* pWin */ ,
490 ClientPtr /* client */ );
491
492extern _X_EXPORT int
493DeliverEvents(WindowPtr /*pWin */ ,
494 xEventPtr /*xE */ ,
495 int /*count */ ,
496 WindowPtr /*otherParent */ );
497
498extern Bool
499CheckMotion(DeviceEvent * /* ev */ ,
500 DeviceIntPtr /* pDev */ );
501
502extern _X_EXPORT void
503WriteEventsToClient(ClientPtr /*pClient */ ,
504 int /*count */ ,
505 xEventPtr /*events */ );
506
507extern _X_EXPORT int
508TryClientEvents(ClientPtr /*client */ ,
509 DeviceIntPtr /* device */ ,
510 xEventPtr /*pEvents */ ,
511 int /*count */ ,
512 Mask /*mask */ ,
513 Mask /*filter */ ,
514 GrabPtr /*grab */ );
515
516extern _X_EXPORT void
517WindowsRestructured(void);
518
519extern int
520SetClientPointer(ClientPtr /* client */ ,
521 DeviceIntPtr /* device */ );
522
523extern _X_EXPORT DeviceIntPtr
524PickPointer(ClientPtr /* client */ );
525
526extern _X_EXPORT DeviceIntPtr
527PickKeyboard(ClientPtr /* client */ );
528
529extern Bool
530IsInterferingGrab(ClientPtr /* client */ ,
531 DeviceIntPtr /* dev */ ,
532 xEvent * /* events */ );
533
534#ifdef PANORAMIX
535extern _X_EXPORT void
536ReinitializeRootWindow(WindowPtr win, int xoff, int yoff);
537#endif
538
539#ifdef RANDR
540extern _X_EXPORT void
541ScreenRestructured(ScreenPtr pScreen);
542#endif
543
544#ifndef HAVE_FFS
545extern _X_EXPORT int
546ffs(int i);
547#endif
548
549/*
550 * ServerGrabCallback stuff
551 */
552
553extern _X_EXPORT CallbackListPtr ServerGrabCallback;
554
555typedef enum { SERVER_GRABBED, SERVER_UNGRABBED,
556 CLIENT_PERVIOUS, CLIENT_IMPERVIOUS
557} ServerGrabState;
558
559typedef struct {
560 ClientPtr client;
561 ServerGrabState grabstate;
562} ServerGrabInfoRec;
563
564/*
565 * EventCallback stuff
566 */
567
568extern _X_EXPORT CallbackListPtr EventCallback;
569
570typedef struct {
571 ClientPtr client;
572 xEventPtr events;
573 int count;
574} EventInfoRec;
575
576/*
577 * DeviceEventCallback stuff
578 */
579
580extern _X_EXPORT CallbackListPtr DeviceEventCallback;
581
582typedef struct {
583 InternalEvent *event;
584 DeviceIntPtr device;
585} DeviceEventInfoRec;
586
587extern int
588XItoCoreType(int xi_type);
589extern Bool
590DevHasCursor(DeviceIntPtr pDev);
591extern _X_EXPORT Bool
592IsPointerDevice(DeviceIntPtr dev);
593extern _X_EXPORT Bool
594IsKeyboardDevice(DeviceIntPtr dev);
595extern Bool
596IsPointerEvent(InternalEvent *event);
597extern Bool
598IsTouchEvent(InternalEvent *event);
599extern _X_EXPORT Bool
600IsMaster(DeviceIntPtr dev);
601extern _X_EXPORT Bool
602IsFloating(DeviceIntPtr dev);
603
604extern _X_HIDDEN void
605CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
606extern _X_HIDDEN int
607CorePointerProc(DeviceIntPtr dev, int what);
608extern _X_HIDDEN int
609CoreKeyboardProc(DeviceIntPtr dev, int what);
610
611extern _X_EXPORT void *lastGLContext;
612
613#endif /* DIX_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