VirtualBox

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

Last change on this file since 86603 was 25078, checked in by vboxsync, 15 years ago

Additions/x11/x11include: exported and set eol-style on new headers

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