]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4con/examples/xf86_stub/include-xorg-6.9.0/xserver/dix.h
Inital import
[l4.git] / l4 / pkg / l4con / examples / xf86_stub / include-xorg-6.9.0 / xserver / dix.h
1 /* $XFree86: xc/programs/Xserver/include/dix.h,v 3.26 2003/01/12 02:44:27 dawes Exp $ */
2 /***********************************************************
3
4 Copyright 1987, 1998  The Open Group
5
6 Permission to use, copy, modify, distribute, and sell this software and its
7 documentation for any purpose is hereby granted without fee, provided that
8 the above copyright notice appear in all copies and that both that
9 copyright notice and this permission notice appear in supporting
10 documentation.
11
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
18 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22 Except as contained in this notice, the name of The Open Group shall not be
23 used in advertising or otherwise to promote the sale, use or other dealings
24 in this Software without prior written authorization from The Open Group.
25
26
27 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
28
29                         All Rights Reserved
30
31 Permission to use, copy, modify, and distribute this software and its 
32 documentation for any purpose and without fee is hereby granted, 
33 provided that the above copyright notice appear in all copies and that
34 both that copyright notice and this permission notice appear in 
35 supporting documentation, and that the name of Digital not be
36 used in advertising or publicity pertaining to distribution of the
37 software without specific, written prior permission.  
38
39 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
40 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
41 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
42 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
43 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
44 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
45 SOFTWARE.
46
47 ******************************************************************/
48 /* $Xorg: dix.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
49
50 #ifndef DIX_H
51 #define DIX_H
52
53 #include "gc.h"
54 #include "window.h"
55 #include "input.h"
56
57 #define EARLIER -1
58 #define SAMETIME 0
59 #define LATER 1
60
61 #define NullClient ((ClientPtr) 0)
62 #define REQUEST(type) \
63         register type *stuff = (type *)client->requestBuffer
64
65
66 #define REQUEST_SIZE_MATCH(req)\
67     if ((sizeof(req) >> 2) != client->req_len)\
68          return(BadLength)
69
70 #define REQUEST_AT_LEAST_SIZE(req) \
71     if ((sizeof(req) >> 2) > client->req_len )\
72          return(BadLength)
73
74 #define REQUEST_FIXED_SIZE(req, n)\
75     if (((sizeof(req) >> 2) > client->req_len) || \
76         (((sizeof(req) + (n) + 3) >> 2) != client->req_len)) \
77          return(BadLength)
78
79 #define LEGAL_NEW_RESOURCE(id,client)\
80     if (!LegalNewID(id,client)) \
81     {\
82         client->errorValue = id;\
83         return(BadIDChoice);\
84     }
85
86 /* XXX if you are using this macro, you are probably not generating Match
87  * errors where appropriate */
88 #define LOOKUP_DRAWABLE(did, client)\
89     ((client->lastDrawableID == did) ? \
90      client->lastDrawable : (DrawablePtr)LookupDrawable(did, client))
91
92 #ifdef XCSECURITY
93
94 #define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\
95     if (client->lastDrawableID == did && !client->trustLevel)\
96         pDraw = client->lastDrawable;\
97     else \
98     {\
99         pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \
100                                                       RC_DRAWABLE, mode);\
101         if (!pDraw) \
102         {\
103             client->errorValue = did; \
104             return BadDrawable;\
105         }\
106         if (pDraw->type == UNDRAWABLE_WINDOW)\
107             return BadMatch;\
108     }
109
110 #define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\
111     if (client->lastDrawableID == did && !client->trustLevel)\
112         pDraw = client->lastDrawable;\
113     else \
114     {\
115         pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \
116                                                       RC_DRAWABLE, mode);\
117         if (!pDraw) \
118         {\
119             client->errorValue = did; \
120             return BadDrawable;\
121         }\
122     }
123
124 #define SECURITY_VERIFY_GC(pGC, rid, client, mode)\
125     if (client->lastGCID == rid && !client->trustLevel)\
126         pGC = client->lastGC;\
127     else\
128         pGC = (GC *) SecurityLookupIDByType(client, rid, RT_GC, mode);\
129     if (!pGC)\
130     {\
131         client->errorValue = rid;\
132         return (BadGC);\
133     }
134
135 #define VERIFY_DRAWABLE(pDraw, did, client)\
136         SECURITY_VERIFY_DRAWABLE(pDraw, did, client, SecurityUnknownAccess)
137
138 #define VERIFY_GEOMETRABLE(pDraw, did, client)\
139         SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, SecurityUnknownAccess)
140
141 #define VERIFY_GC(pGC, rid, client)\
142         SECURITY_VERIFY_GC(pGC, rid, client, SecurityUnknownAccess)
143
144 #else /* not XCSECURITY */
145
146 #define VERIFY_DRAWABLE(pDraw, did, client)\
147     if (client->lastDrawableID == did)\
148         pDraw = client->lastDrawable;\
149     else \
150     {\
151         pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\
152         if (!pDraw) \
153         {\
154             client->errorValue = did; \
155             return BadDrawable;\
156         }\
157         if (pDraw->type == UNDRAWABLE_WINDOW)\
158             return BadMatch;\
159     }
160
161 #define VERIFY_GEOMETRABLE(pDraw, did, client)\
162     if (client->lastDrawableID == did)\
163         pDraw = client->lastDrawable;\
164     else \
165     {\
166         pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\
167         if (!pDraw) \
168         {\
169             client->errorValue = did; \
170             return BadDrawable;\
171         }\
172     }
173
174 #define VERIFY_GC(pGC, rid, client)\
175     if (client->lastGCID == rid)\
176         pGC = client->lastGC;\
177     else\
178         pGC = (GC *)LookupIDByType(rid, RT_GC);\
179     if (!pGC)\
180     {\
181         client->errorValue = rid;\
182         return (BadGC);\
183     }
184
185 #define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\
186         VERIFY_DRAWABLE(pDraw, did, client)
187
188 #define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\
189         VERIFY_GEOMETRABLE(pDraw, did, client)
190
191 #define SECURITY_VERIFY_GC(pGC, rid, client, mode)\
192         VERIFY_GC(pGC, rid, client)
193
194 #endif /* XCSECURITY */
195
196 /*
197  * We think that most hardware implementations of DBE will want
198  * LookupID*(dbe_back_buffer_id) to return the window structure that the
199  * id is a back buffer for.  Since both front and back buffers will
200  * return the same structure, you need to be able to distinguish
201  * somewhere what kind of buffer (front/back) was being asked for, so
202  * that ddx can render to the right place.  That's the problem that the
203  * following code solves.  Note: we couldn't embed this in the LookupID*
204  * functions because the VALIDATE_DRAWABLE_AND_GC macro often circumvents
205  * those functions by checking a one-element cache.  That's why we're
206  * mucking with VALIDATE_DRAWABLE_AND_GC.
207  * 
208  * If you put -DNEED_DBE_BUF_BITS into PervasiveDBEDefines, the window
209  * structure will have two additional bits defined, srcBuffer and
210  * dstBuffer, and their values will be maintained via the macros
211  * SET_DBE_DSTBUF and SET_DBE_SRCBUF (below).  If you also
212  * put -DNEED_DBE_BUF_VALIDATE into PervasiveDBEDefines, the function
213  * DbeValidateBuffer will be called any time the bits change to give you
214  * a chance to do some setup.  See the DBE code for more details on this
215  * function.  We put in these levels of conditionality so that you can do
216  * just what you need to do, and no more.  If neither of these defines
217  * are used, the bits won't be there, and VALIDATE_DRAWABLE_AND_GC will
218  * be unchanged.        dpw
219  */
220
221 #if defined(NEED_DBE_BUF_BITS)
222 #define SET_DBE_DSTBUF(_pDraw, _drawID) \
223         SET_DBE_BUF(_pDraw, _drawID, dstBuffer, TRUE)
224 #define SET_DBE_SRCBUF(_pDraw, _drawID) \
225         SET_DBE_BUF(_pDraw, _drawID, srcBuffer, FALSE)
226 #if defined (NEED_DBE_BUF_VALIDATE)
227 #define SET_DBE_BUF(_pDraw, _drawID, _whichBuffer, _dstbuf) \
228     if (_pDraw->type == DRAWABLE_WINDOW)\
229     {\
230         int thisbuf = (_pDraw->id == _drawID);\
231         if (thisbuf != ((WindowPtr)_pDraw)->_whichBuffer)\
232         {\
233              ((WindowPtr)_pDraw)->_whichBuffer = thisbuf;\
234              DbeValidateBuffer((WindowPtr)_pDraw, _drawID, _dstbuf);\
235         }\
236      }
237 #else /* want buffer bits, but don't need to call DbeValidateBuffer */
238 #define SET_DBE_BUF(_pDraw, _drawID, _whichBuffer, _dstbuf) \
239     if (_pDraw->type == DRAWABLE_WINDOW)\
240     {\
241         ((WindowPtr)_pDraw)->_whichBuffer = (_pDraw->id == _drawID);\
242     }
243 #endif /* NEED_DBE_BUF_VALIDATE */
244 #else /* don't want buffer bits in window */
245 #define SET_DBE_DSTBUF(_pDraw, _drawID) /**/
246 #define SET_DBE_SRCBUF(_pDraw, _drawID) /**/
247 #endif /* NEED_DBE_BUF_BITS */
248
249 #define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, pGC, client)\
250     if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\
251         (client->lastDrawableID != drawID))\
252     {\
253         SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, SecurityWriteAccess);\
254         SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityReadAccess);\
255         if ((pGC->depth != pDraw->depth) ||\
256             (pGC->pScreen != pDraw->pScreen))\
257             return (BadMatch);\
258         client->lastDrawable = pDraw;\
259         client->lastDrawableID = drawID;\
260         client->lastGC = pGC;\
261         client->lastGCID = stuff->gc;\
262     }\
263     else\
264     {\
265         pGC = client->lastGC;\
266         pDraw = client->lastDrawable;\
267     }\
268     SET_DBE_DSTBUF(pDraw, drawID);\
269     if (pGC->serialNumber != pDraw->serialNumber)\
270         ValidateGC(pDraw, pGC);
271
272
273 #define WriteReplyToClient(pClient, size, pReply) { \
274    if ((pClient)->swapped) \
275       (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \
276            (pClient, (int)(size), pReply); \
277       else (void) WriteToClient(pClient, (int)(size), (char *)(pReply)); }
278
279 #define WriteSwappedDataToClient(pClient, size, pbuf) \
280    if ((pClient)->swapped) \
281       (*(pClient)->pSwapReplyFunc)(pClient, (int)(size), pbuf); \
282    else (void) WriteToClient (pClient, (int)(size), (char *)(pbuf));
283
284 typedef struct _TimeStamp *TimeStampPtr;
285
286 #ifndef _XTYPEDEF_CLIENTPTR
287 typedef struct _Client *ClientPtr; /* also in misc.h */
288 #define _XTYPEDEF_CLIENTPTR
289 #endif
290
291 typedef struct _WorkQueue       *WorkQueuePtr;
292
293 extern ClientPtr requestingClient;
294 extern ClientPtr *clients;
295 extern ClientPtr serverClient;
296 extern int currentMaxClients;
297
298 typedef int HWEventQueueType;
299 typedef HWEventQueueType* HWEventQueuePtr;
300
301 extern HWEventQueuePtr checkForInput[2];
302
303 typedef struct _TimeStamp {
304     CARD32 months;      /* really ~49.7 days */
305     CARD32 milliseconds;
306 }           TimeStamp;
307
308 /* dispatch.c */
309
310 extern void SetInputCheck(
311     HWEventQueuePtr /*c0*/,
312     HWEventQueuePtr /*c1*/);
313
314 extern void CloseDownClient(
315     ClientPtr /*client*/);
316
317 extern void UpdateCurrentTime(void);
318
319 extern void UpdateCurrentTimeIf(void);
320
321 extern void InitSelections(void);
322
323 extern void FlushClientCaches(XID /*id*/);
324
325 extern int dixDestroyPixmap(
326     pointer /*value*/,
327     XID /*pid*/);
328
329 extern void CloseDownRetainedResources(void);
330
331 extern void InitClient(
332     ClientPtr /*client*/,
333     int /*i*/,
334     pointer /*ospriv*/);
335
336 extern ClientPtr NextAvailableClient(
337     pointer /*ospriv*/);
338
339 extern void SendErrorToClient(
340     ClientPtr /*client*/,
341     unsigned int /*majorCode*/,
342     unsigned int /*minorCode*/,
343     XID /*resId*/,
344     int /*errorCode*/);
345
346 extern void DeleteWindowFromAnySelections(
347     WindowPtr /*pWin*/);
348
349 extern void MarkClientException(
350     ClientPtr /*client*/);
351
352 extern int GetGeometry(
353     ClientPtr /*client*/,
354     xGetGeometryReply* /* wa */);
355
356 extern int SendConnSetup(
357     ClientPtr /*client*/,
358     char* /*reason*/);
359
360 extern int DoGetImage(
361     ClientPtr   /*client*/,
362     int /*format*/,
363     Drawable /*drawable*/,
364     int /*x*/, 
365     int /*y*/, 
366     int /*width*/, 
367     int /*height*/,
368     Mask /*planemask*/,
369     xGetImageReply ** /*im_return*/);
370
371 #ifdef LBX
372 extern void IncrementClientCount(void);
373 #endif /* LBX */
374
375 #if defined(DDXBEFORERESET)
376 extern void ddxBeforeReset (void);
377 #endif
378
379 /* dixutils.c */
380
381 extern void CopyISOLatin1Lowered(
382     unsigned char * /*dest*/,
383     unsigned char * /*source*/,
384     int /*length*/);
385
386 extern int CompareISOLatin1Lowered(
387     unsigned char * /*a*/,
388     int alen,
389     unsigned char * /*b*/,
390     int blen);
391
392 #ifdef XCSECURITY
393
394 extern WindowPtr SecurityLookupWindow(
395     XID /*rid*/,
396     ClientPtr /*client*/,
397     Mask /*access_mode*/);
398
399 extern pointer SecurityLookupDrawable(
400     XID /*rid*/,
401     ClientPtr /*client*/,
402     Mask /*access_mode*/);
403
404 extern WindowPtr LookupWindow(
405     XID /*rid*/,
406     ClientPtr /*client*/);
407
408 extern pointer LookupDrawable(
409     XID /*rid*/,
410     ClientPtr /*client*/);
411
412 #else
413
414 extern WindowPtr LookupWindow(
415     XID /*rid*/,
416     ClientPtr /*client*/);
417
418 extern pointer LookupDrawable(
419     XID /*rid*/,
420     ClientPtr /*client*/);
421
422 #define SecurityLookupWindow(rid, client, access_mode) \
423         LookupWindow(rid, client)
424
425 #define SecurityLookupDrawable(rid, client, access_mode) \
426         LookupDrawable(rid, client)
427
428 #endif /* XCSECURITY */
429
430 extern ClientPtr LookupClient(
431     XID /*rid*/,
432     ClientPtr /*client*/);
433
434 extern void NoopDDA(void);
435
436 extern int AlterSaveSetForClient(
437     ClientPtr /*client*/,
438     WindowPtr /*pWin*/,
439     unsigned /*mode*/,
440     Bool /*toRoot*/,
441     Bool /*remap*/);
442   
443 extern void DeleteWindowFromAnySaveSet(
444     WindowPtr /*pWin*/);
445
446 extern void BlockHandler(
447     pointer /*pTimeout*/,
448     pointer /*pReadmask*/);
449
450 extern void WakeupHandler(
451     int /*result*/,
452     pointer /*pReadmask*/);
453
454 typedef void (* WakeupHandlerProcPtr)(
455     pointer /* blockData */,
456     int /* result */,
457     pointer /* pReadmask */);
458
459 extern Bool RegisterBlockAndWakeupHandlers(
460     BlockHandlerProcPtr /*blockHandler*/,
461     WakeupHandlerProcPtr /*wakeupHandler*/,
462     pointer /*blockData*/);
463
464 extern void RemoveBlockAndWakeupHandlers(
465     BlockHandlerProcPtr /*blockHandler*/,
466     WakeupHandlerProcPtr /*wakeupHandler*/,
467     pointer /*blockData*/);
468
469 extern void InitBlockAndWakeupHandlers(void);
470
471 extern void ProcessWorkQueue(void);
472
473 extern void ProcessWorkQueueZombies(void);
474
475 extern Bool QueueWorkProc(
476     Bool (* /*function*/)(
477         ClientPtr /*clientUnused*/,
478         pointer /*closure*/),
479     ClientPtr /*client*/,
480     pointer /*closure*/
481 );
482
483 typedef Bool (* ClientSleepProcPtr)(
484     ClientPtr /*client*/,
485     pointer /*closure*/);
486
487 extern Bool ClientSleep(
488     ClientPtr /*client*/,
489     ClientSleepProcPtr /* function */,
490     pointer /*closure*/);
491
492 #ifndef ___CLIENTSIGNAL_DEFINED___
493 #define ___CLIENTSIGNAL_DEFINED___
494 extern Bool ClientSignal(
495     ClientPtr /*client*/);
496 #endif /* ___CLIENTSIGNAL_DEFINED___ */
497
498 extern void ClientWakeup(
499     ClientPtr /*client*/);
500
501 extern Bool ClientIsAsleep(
502     ClientPtr /*client*/);
503
504 /* atom.c */
505
506 extern Atom MakeAtom(
507     char * /*string*/,
508     unsigned /*len*/,
509     Bool /*makeit*/);
510
511 extern Bool ValidAtom(
512     Atom /*atom*/);
513
514 extern char *NameForAtom(
515     Atom /*atom*/);
516
517 extern void AtomError(void);
518
519 extern void FreeAllAtoms(void);
520
521 extern void InitAtoms(void);
522
523 /* events.c */
524
525 extern void SetMaskForEvent(
526     Mask /* mask */,
527     int /* event */);
528
529
530 extern Bool IsParent(
531     WindowPtr /* maybeparent */,
532     WindowPtr /* child */);
533
534 extern WindowPtr GetCurrentRootWindow(void);
535
536 extern WindowPtr GetSpriteWindow(void);
537
538
539 extern void NoticeEventTime(xEventPtr /* xE */);
540
541 extern void EnqueueEvent(
542     xEventPtr /* xE */,
543     DeviceIntPtr /* device */,
544     int /* count */);
545
546 extern void ComputeFreezes(void);
547
548 extern void CheckGrabForSyncs(
549     DeviceIntPtr /* dev */,
550     Bool /* thisMode */,
551     Bool /* otherMode */);
552
553 extern void ActivatePointerGrab(
554     DeviceIntPtr /* mouse */,
555     GrabPtr /* grab */,
556     TimeStamp /* time */,
557     Bool /* autoGrab */);
558
559 extern void DeactivatePointerGrab(
560     DeviceIntPtr /* mouse */);
561
562 extern void ActivateKeyboardGrab(
563     DeviceIntPtr /* keybd */,
564     GrabPtr /* grab */,
565     TimeStamp /* time */,
566     Bool /* passive */);
567
568 extern void DeactivateKeyboardGrab(
569     DeviceIntPtr /* keybd */);
570
571 extern void AllowSome(
572     ClientPtr   /* client */,
573     TimeStamp /* time */,
574     DeviceIntPtr /* thisDev */,
575     int /* newState */);
576
577 extern void ReleaseActiveGrabs(
578     ClientPtr client);
579
580 extern int DeliverEventsToWindow(
581     WindowPtr /* pWin */,
582     xEventPtr /* pEvents */,
583     int /* count */,
584     Mask /* filter */,
585     GrabPtr /* grab */,
586     int /* mskidx */);
587
588 extern int DeliverDeviceEvents(
589     WindowPtr /* pWin */,
590     xEventPtr /* xE */,
591     GrabPtr /* grab */,
592     WindowPtr /* stopAt */,
593     DeviceIntPtr /* dev */,
594     int /* count */);
595
596 extern void DefineInitialRootWindow(
597     WindowPtr /* win */);
598
599 extern void WindowHasNewCursor(
600     WindowPtr /* pWin */);
601
602 extern Bool CheckDeviceGrabs(
603     DeviceIntPtr /* device */,
604     xEventPtr /* xE */,
605     int /* checkFirst */,
606     int /* count */);
607
608 extern void DeliverFocusedEvent(
609     DeviceIntPtr /* keybd */,
610     xEventPtr /* xE */,
611     WindowPtr /* window */,
612     int /* count */);
613
614 extern void DeliverGrabbedEvent(
615     xEventPtr /* xE */,
616     DeviceIntPtr /* thisDev */,
617     Bool /* deactivateGrab */,
618     int /* count */);
619
620 #ifdef XKB
621 extern void FixKeyState(
622     xEvent * /* xE */,
623     DeviceIntPtr /* keybd */);
624 #endif /* XKB */
625
626 extern void RecalculateDeliverableEvents(
627     WindowPtr /* pWin */);
628
629 extern int OtherClientGone(
630     pointer /* value */,
631     XID /* id */);
632
633 extern void DoFocusEvents(
634     DeviceIntPtr /* dev */,
635     WindowPtr /* fromWin */,
636     WindowPtr /* toWin */,
637     int /* mode */);
638
639 extern int SetInputFocus(
640     ClientPtr /* client */,
641     DeviceIntPtr /* dev */,
642     Window /* focusID */,
643     CARD8 /* revertTo */,
644     Time /* ctime */,
645     Bool /* followOK */);
646
647 extern int GrabDevice(
648     ClientPtr /* client */,
649     DeviceIntPtr /* dev */,
650     unsigned /* this_mode */,
651     unsigned /* other_mode */,
652     Window /* grabWindow */,
653     unsigned /* ownerEvents */,
654     Time /* ctime */,
655     Mask /* mask */,
656     CARD8 * /* status */);
657
658 extern void InitEvents(void);
659
660 extern void CloseDownEvents(void);
661
662 extern void DeleteWindowFromAnyEvents(
663     WindowPtr   /* pWin */,
664     Bool /* freeResources */);
665
666
667 extern Mask EventMaskForClient(
668     WindowPtr /* pWin */,
669     ClientPtr /* client */);
670
671
672
673 extern int DeliverEvents(
674     WindowPtr /*pWin*/,
675     xEventPtr /*xE*/,
676     int /*count*/,
677     WindowPtr /*otherParent*/);
678
679
680 extern void WriteEventsToClient(
681     ClientPtr /*pClient*/,
682     int      /*count*/,
683     xEventPtr /*events*/);
684
685 extern int TryClientEvents(
686     ClientPtr /*client*/,
687     xEventPtr /*pEvents*/,
688     int /*count*/,
689     Mask /*mask*/,
690     Mask /*filter*/,
691     GrabPtr /*grab*/);
692
693 extern void WindowsRestructured(void);
694
695
696 #ifdef RANDR
697 void
698 ScreenRestructured (ScreenPtr pScreen);
699 #endif
700
701 extern void ResetClientPrivates(void);
702
703 extern int AllocateClientPrivateIndex(void);
704
705 extern Bool AllocateClientPrivate(
706     int /*index*/,
707     unsigned /*amount*/);
708
709 /*
710  *  callback manager stuff
711  */
712
713 #ifndef _XTYPEDEF_CALLBACKLISTPTR
714 typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */
715 #define _XTYPEDEF_CALLBACKLISTPTR
716 #endif
717
718 typedef void (*CallbackProcPtr) (
719     CallbackListPtr *, pointer, pointer);
720
721 typedef Bool (*AddCallbackProcPtr) (
722     CallbackListPtr *, CallbackProcPtr, pointer);
723
724 typedef Bool (*DeleteCallbackProcPtr) (
725     CallbackListPtr *, CallbackProcPtr, pointer);
726
727 typedef void (*CallCallbacksProcPtr) (
728     CallbackListPtr *, pointer);
729
730 typedef void (*DeleteCallbackListProcPtr) (
731     CallbackListPtr *);
732
733 typedef struct _CallbackProcs {
734     AddCallbackProcPtr          AddCallback;
735     DeleteCallbackProcPtr       DeleteCallback;
736     CallCallbacksProcPtr        CallCallbacks;
737     DeleteCallbackListProcPtr   DeleteCallbackList;
738 } CallbackFuncsRec, *CallbackFuncsPtr;
739
740 extern Bool CreateCallbackList(
741     CallbackListPtr * /*pcbl*/,
742     CallbackFuncsPtr /*cbfuncs*/);
743
744 extern Bool AddCallback(
745     CallbackListPtr * /*pcbl*/,
746     CallbackProcPtr /*callback*/,
747     pointer /*data*/);
748
749 extern Bool DeleteCallback(
750     CallbackListPtr * /*pcbl*/,
751     CallbackProcPtr /*callback*/,
752     pointer /*data*/);
753
754 extern void CallCallbacks(
755     CallbackListPtr * /*pcbl*/,
756     pointer /*call_data*/);
757
758 extern void DeleteCallbackList(
759     CallbackListPtr * /*pcbl*/);
760
761 extern void InitCallbackManager(void);
762
763 /*
764  *  ServerGrabCallback stuff
765  */
766
767 extern CallbackListPtr ServerGrabCallback;
768
769 typedef enum {SERVER_GRABBED, SERVER_UNGRABBED,
770               CLIENT_PERVIOUS, CLIENT_IMPERVIOUS } ServerGrabState;
771
772 typedef struct {
773     ClientPtr client;
774     ServerGrabState grabstate;
775 } ServerGrabInfoRec;
776
777 /*
778  *  EventCallback stuff
779  */
780
781 extern CallbackListPtr EventCallback;
782
783 typedef struct {
784     ClientPtr client;
785     xEventPtr events;
786     int count;
787 } EventInfoRec;
788
789 /*
790  *  DeviceEventCallback stuff
791  */
792
793 extern CallbackListPtr DeviceEventCallback;
794
795 typedef struct {
796     xEventPtr events;
797     int count;
798 } DeviceEventInfoRec;
799
800 /*
801  * SelectionCallback stuff
802  */
803
804 extern CallbackListPtr SelectionCallback;
805
806 typedef enum {
807     SelectionSetOwner,
808     SelectionWindowDestroy,
809     SelectionClientClose
810 } SelectionCallbackKind;
811
812 typedef struct {
813     struct _Selection       *selection;
814     SelectionCallbackKind   kind;
815 } SelectionInfoRec;
816
817 #endif /* DIX_H */