VirtualBox

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

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