VirtualBox

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

Last change on this file was 43251, checked in by vboxsync, 12 years ago

Additions/x11: added headers for X.Org Server 1.13.

  • Property svn:eol-style set to native
File size: 17.9 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 rc = dixLookupDrawable(&(pDraw), drawID, client, M_ANY, mode);\
92 if (rc != Success)\
93 return rc;\
94 rc = dixLookupGC(&(pGC), stuff->gc, client, DixUseAccess);\
95 if (rc != Success)\
96 return rc;\
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(pointer /*value */ ,
151 XID /*pid */ );
152
153extern _X_EXPORT void InitClient(ClientPtr /*client */ ,
154 int /*i */ ,
155 pointer /*ospriv */ );
156
157extern _X_EXPORT ClientPtr NextAvailableClient(pointer /*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(pointer /*pTimeout */ ,
207 pointer /*pReadmask */ );
208
209extern _X_EXPORT void WakeupHandler(int /*result */ ,
210 pointer /*pReadmask */ );
211
212void
213 EnableLimitedSchedulingLatency(void);
214
215void
216 DisableLimitedSchedulingLatency(void);
217
218typedef void (*WakeupHandlerProcPtr) (pointer /* blockData */ ,
219 int /* result */ ,
220 pointer /* pReadmask */ );
221
222extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr
223 /*blockHandler */ ,
224 WakeupHandlerProcPtr
225 /*wakeupHandler */ ,
226 pointer /*blockData */ );
227
228extern _X_EXPORT void RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr
229 /*blockHandler */ ,
230 WakeupHandlerProcPtr
231 /*wakeupHandler */ ,
232 pointer /*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 pointer
245 /*closure */ ),
246 ClientPtr /*client */ ,
247 pointer /*closure */
248 );
249
250typedef Bool (*ClientSleepProcPtr) (ClientPtr /*client */ ,
251 pointer /*closure */ );
252
253extern _X_EXPORT Bool ClientSleep(ClientPtr /*client */ ,
254 ClientSleepProcPtr /* function */ ,
255 pointer /*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(char *string);
293
294/* events.c */
295
296extern void
297SetMaskForEvent(int /* deviceid */ ,
298 Mask /* mask */ ,
299 int /* event */ );
300
301extern _X_EXPORT void
302ConfineToShape(DeviceIntPtr /* pDev */ ,
303 RegionPtr /* shape */ ,
304 int * /* px */ ,
305 int * /* py */ );
306
307extern _X_EXPORT Bool
308IsParent(WindowPtr /* maybeparent */ ,
309 WindowPtr /* child */ );
310
311extern _X_EXPORT WindowPtr
312GetCurrentRootWindow(DeviceIntPtr pDev);
313
314extern _X_EXPORT WindowPtr
315GetSpriteWindow(DeviceIntPtr pDev);
316
317extern _X_EXPORT void
318NoticeEventTime(InternalEvent *ev,
319 DeviceIntPtr dev);
320
321extern void
322EnqueueEvent(InternalEvent * /* ev */ ,
323 DeviceIntPtr /* device */ );
324extern void
325PlayReleasedEvents(void);
326
327extern void
328ActivatePointerGrab(DeviceIntPtr /* mouse */ ,
329 GrabPtr /* grab */ ,
330 TimeStamp /* time */ ,
331 Bool /* autoGrab */ );
332
333extern void
334DeactivatePointerGrab(DeviceIntPtr /* mouse */ );
335
336extern void
337ActivateKeyboardGrab(DeviceIntPtr /* keybd */ ,
338 GrabPtr /* grab */ ,
339 TimeStamp /* time */ ,
340 Bool /* passive */ );
341
342extern void
343DeactivateKeyboardGrab(DeviceIntPtr /* keybd */ );
344
345extern BOOL
346ActivateFocusInGrab(DeviceIntPtr /* dev */ ,
347 WindowPtr /* old */ ,
348 WindowPtr /* win */ );
349
350extern void
351AllowSome(ClientPtr /* client */ ,
352 TimeStamp /* time */ ,
353 DeviceIntPtr /* thisDev */ ,
354 int /* newState */ );
355
356extern void
357ReleaseActiveGrabs(ClientPtr client);
358
359extern GrabPtr
360CheckPassiveGrabsOnWindow(WindowPtr /* pWin */ ,
361 DeviceIntPtr /* device */ ,
362 InternalEvent * /* event */ ,
363 BOOL /* checkCore */ ,
364 BOOL /* activate */ );
365
366extern _X_EXPORT int
367DeliverEventsToWindow(DeviceIntPtr /* pWin */ ,
368 WindowPtr /* pWin */ ,
369 xEventPtr /* pEvents */ ,
370 int /* count */ ,
371 Mask /* filter */ ,
372 GrabPtr /* grab */ );
373
374extern _X_EXPORT void
375DeliverRawEvent(RawDeviceEvent * /* ev */ ,
376 DeviceIntPtr /* dev */
377 );
378
379extern int
380DeliverDeviceEvents(WindowPtr /* pWin */ ,
381 InternalEvent * /* event */ ,
382 GrabPtr /* grab */ ,
383 WindowPtr /* stopAt */ ,
384 DeviceIntPtr /* dev */ );
385
386extern int
387DeliverOneGrabbedEvent(InternalEvent * /* event */ ,
388 DeviceIntPtr /* dev */ ,
389 enum InputLevel /* level */ );
390
391extern void
392DeliverTouchEvents(DeviceIntPtr /* dev */ ,
393 TouchPointInfoPtr /* ti */ ,
394 InternalEvent * /* ev */ ,
395 XID /* resource */ );
396
397extern void
398InitializeSprite(DeviceIntPtr /* pDev */ ,
399 WindowPtr /* pWin */ );
400extern void
401FreeSprite(DeviceIntPtr pDev);
402
403extern void
404UpdateSpriteForScreen(DeviceIntPtr /* pDev */ ,
405 ScreenPtr /* pScreen */ );
406
407extern _X_EXPORT void
408WindowHasNewCursor(WindowPtr /* pWin */ );
409
410extern Bool
411CheckDeviceGrabs(DeviceIntPtr /* device */ ,
412 DeviceEvent * /* event */ ,
413 WindowPtr /* ancestor */ );
414
415extern void
416DeliverFocusedEvent(DeviceIntPtr /* keybd */ ,
417 InternalEvent * /* event */ ,
418 WindowPtr /* window */ );
419
420extern int
421DeliverGrabbedEvent(InternalEvent * /* event */ ,
422 DeviceIntPtr /* thisDev */ ,
423 Bool /* deactivateGrab */ );
424
425extern void
426FixKeyState(DeviceEvent * /* event */ ,
427 DeviceIntPtr /* keybd */ );
428
429extern void
430RecalculateDeliverableEvents(WindowPtr /* pWin */ );
431
432extern _X_EXPORT int
433OtherClientGone(pointer /* value */ ,
434 XID /* id */ );
435
436extern void
437DoFocusEvents(DeviceIntPtr /* dev */ ,
438 WindowPtr /* fromWin */ ,
439 WindowPtr /* toWin */ ,
440 int /* mode */ );
441
442extern int
443SetInputFocus(ClientPtr /* client */ ,
444 DeviceIntPtr /* dev */ ,
445 Window /* focusID */ ,
446 CARD8 /* revertTo */ ,
447 Time /* ctime */ ,
448 Bool /* followOK */ );
449
450extern int
451GrabDevice(ClientPtr /* client */ ,
452 DeviceIntPtr /* dev */ ,
453 unsigned /* this_mode */ ,
454 unsigned /* other_mode */ ,
455 Window /* grabWindow */ ,
456 unsigned /* ownerEvents */ ,
457 Time /* ctime */ ,
458 GrabMask * /* mask */ ,
459 int /* grabtype */ ,
460 Cursor /* curs */ ,
461 Window /* confineToWin */ ,
462 CARD8 * /* status */ );
463
464extern void
465InitEvents(void);
466
467extern void
468CloseDownEvents(void);
469
470extern void
471DeleteWindowFromAnyEvents(WindowPtr /* pWin */ ,
472 Bool /* freeResources */ );
473
474extern Mask
475EventMaskForClient(WindowPtr /* pWin */ ,
476 ClientPtr /* client */ );
477
478extern _X_EXPORT int
479DeliverEvents(WindowPtr /*pWin */ ,
480 xEventPtr /*xE */ ,
481 int /*count */ ,
482 WindowPtr /*otherParent */ );
483
484extern Bool
485CheckMotion(DeviceEvent * /* ev */ ,
486 DeviceIntPtr /* pDev */ );
487
488extern _X_EXPORT void
489WriteEventsToClient(ClientPtr /*pClient */ ,
490 int /*count */ ,
491 xEventPtr /*events */ );
492
493extern _X_EXPORT int
494TryClientEvents(ClientPtr /*client */ ,
495 DeviceIntPtr /* device */ ,
496 xEventPtr /*pEvents */ ,
497 int /*count */ ,
498 Mask /*mask */ ,
499 Mask /*filter */ ,
500 GrabPtr /*grab */ );
501
502extern _X_EXPORT void
503WindowsRestructured(void);
504
505extern int
506SetClientPointer(ClientPtr /* client */ ,
507 DeviceIntPtr /* device */ );
508
509extern _X_EXPORT DeviceIntPtr
510PickPointer(ClientPtr /* client */ );
511
512extern _X_EXPORT DeviceIntPtr
513PickKeyboard(ClientPtr /* client */ );
514
515extern Bool
516IsInterferingGrab(ClientPtr /* client */ ,
517 DeviceIntPtr /* dev */ ,
518 xEvent * /* events */ );
519
520#ifdef PANORAMIX
521extern _X_EXPORT void
522ReinitializeRootWindow(WindowPtr win, int xoff, int yoff);
523#endif
524
525#ifdef RANDR
526extern _X_EXPORT void
527ScreenRestructured(ScreenPtr pScreen);
528#endif
529
530#ifndef HAVE_FFS
531extern _X_EXPORT int
532ffs(int i);
533#endif
534
535/*
536 * ServerGrabCallback stuff
537 */
538
539extern _X_EXPORT CallbackListPtr ServerGrabCallback;
540
541typedef enum { SERVER_GRABBED, SERVER_UNGRABBED,
542 CLIENT_PERVIOUS, CLIENT_IMPERVIOUS
543} ServerGrabState;
544
545typedef struct {
546 ClientPtr client;
547 ServerGrabState grabstate;
548} ServerGrabInfoRec;
549
550/*
551 * EventCallback stuff
552 */
553
554extern _X_EXPORT CallbackListPtr EventCallback;
555
556typedef struct {
557 ClientPtr client;
558 xEventPtr events;
559 int count;
560} EventInfoRec;
561
562/*
563 * DeviceEventCallback stuff
564 */
565
566extern _X_EXPORT CallbackListPtr DeviceEventCallback;
567
568typedef struct {
569 InternalEvent *event;
570 DeviceIntPtr device;
571} DeviceEventInfoRec;
572
573extern int
574XItoCoreType(int xi_type);
575extern Bool
576DevHasCursor(DeviceIntPtr pDev);
577extern _X_EXPORT Bool
578IsPointerDevice(DeviceIntPtr dev);
579extern _X_EXPORT Bool
580IsKeyboardDevice(DeviceIntPtr dev);
581extern Bool
582IsPointerEvent(InternalEvent *event);
583extern Bool
584IsTouchEvent(InternalEvent *event);
585extern _X_EXPORT Bool
586IsMaster(DeviceIntPtr dev);
587extern _X_EXPORT Bool
588IsFloating(DeviceIntPtr dev);
589
590extern _X_HIDDEN void
591CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
592extern _X_HIDDEN int
593CorePointerProc(DeviceIntPtr dev, int what);
594extern _X_HIDDEN int
595CoreKeyboardProc(DeviceIntPtr dev, int what);
596
597#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