VirtualBox

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

Last change on this file since 78293 was 50218, checked in by vboxsync, 11 years ago

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

  • 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(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
318NoticeTime(const DeviceIntPtr dev,
319 TimeStamp time);
320extern _X_EXPORT void
321NoticeEventTime(InternalEvent *ev,
322 DeviceIntPtr dev);
323extern _X_EXPORT TimeStamp
324LastEventTime(int deviceid);
325extern _X_EXPORT Bool
326LastEventTimeWasReset(int deviceid);
327extern _X_EXPORT void
328LastEventTimeToggleResetFlag(int deviceid, Bool state);
329extern _X_EXPORT void
330LastEventTimeToggleResetAll(Bool state);
331
332extern void
333EnqueueEvent(InternalEvent * /* ev */ ,
334 DeviceIntPtr /* device */ );
335extern void
336PlayReleasedEvents(void);
337
338extern void
339ActivatePointerGrab(DeviceIntPtr /* mouse */ ,
340 GrabPtr /* grab */ ,
341 TimeStamp /* time */ ,
342 Bool /* autoGrab */ );
343
344extern void
345DeactivatePointerGrab(DeviceIntPtr /* mouse */ );
346
347extern void
348ActivateKeyboardGrab(DeviceIntPtr /* keybd */ ,
349 GrabPtr /* grab */ ,
350 TimeStamp /* time */ ,
351 Bool /* passive */ );
352
353extern void
354DeactivateKeyboardGrab(DeviceIntPtr /* keybd */ );
355
356extern BOOL
357ActivateFocusInGrab(DeviceIntPtr /* dev */ ,
358 WindowPtr /* old */ ,
359 WindowPtr /* win */ );
360
361extern void
362AllowSome(ClientPtr /* client */ ,
363 TimeStamp /* time */ ,
364 DeviceIntPtr /* thisDev */ ,
365 int /* newState */ );
366
367extern void
368ReleaseActiveGrabs(ClientPtr client);
369
370extern GrabPtr
371CheckPassiveGrabsOnWindow(WindowPtr /* pWin */ ,
372 DeviceIntPtr /* device */ ,
373 InternalEvent * /* event */ ,
374 BOOL /* checkCore */ ,
375 BOOL /* activate */ );
376
377extern _X_EXPORT int
378DeliverEventsToWindow(DeviceIntPtr /* pWin */ ,
379 WindowPtr /* pWin */ ,
380 xEventPtr /* pEvents */ ,
381 int /* count */ ,
382 Mask /* filter */ ,
383 GrabPtr /* grab */ );
384
385extern _X_EXPORT void
386DeliverRawEvent(RawDeviceEvent * /* ev */ ,
387 DeviceIntPtr /* dev */
388 );
389
390extern int
391DeliverDeviceEvents(WindowPtr /* pWin */ ,
392 InternalEvent * /* event */ ,
393 GrabPtr /* grab */ ,
394 WindowPtr /* stopAt */ ,
395 DeviceIntPtr /* dev */ );
396
397extern int
398DeliverOneGrabbedEvent(InternalEvent * /* event */ ,
399 DeviceIntPtr /* dev */ ,
400 enum InputLevel /* level */ );
401
402extern void
403DeliverTouchEvents(DeviceIntPtr /* dev */ ,
404 TouchPointInfoPtr /* ti */ ,
405 InternalEvent * /* ev */ ,
406 XID /* resource */ );
407
408extern void
409InitializeSprite(DeviceIntPtr /* pDev */ ,
410 WindowPtr /* pWin */ );
411extern void
412FreeSprite(DeviceIntPtr pDev);
413
414extern void
415UpdateSpriteForScreen(DeviceIntPtr /* pDev */ ,
416 ScreenPtr /* pScreen */ );
417
418extern _X_EXPORT void
419WindowHasNewCursor(WindowPtr /* pWin */ );
420
421extern Bool
422CheckDeviceGrabs(DeviceIntPtr /* device */ ,
423 DeviceEvent * /* event */ ,
424 WindowPtr /* ancestor */ );
425
426extern void
427DeliverFocusedEvent(DeviceIntPtr /* keybd */ ,
428 InternalEvent * /* event */ ,
429 WindowPtr /* window */ );
430
431extern int
432DeliverGrabbedEvent(InternalEvent * /* event */ ,
433 DeviceIntPtr /* thisDev */ ,
434 Bool /* deactivateGrab */ );
435
436extern void
437FixKeyState(DeviceEvent * /* event */ ,
438 DeviceIntPtr /* keybd */ );
439
440extern void
441RecalculateDeliverableEvents(WindowPtr /* pWin */ );
442
443extern _X_EXPORT int
444OtherClientGone(pointer /* value */ ,
445 XID /* id */ );
446
447extern void
448DoFocusEvents(DeviceIntPtr /* dev */ ,
449 WindowPtr /* fromWin */ ,
450 WindowPtr /* toWin */ ,
451 int /* mode */ );
452
453extern int
454SetInputFocus(ClientPtr /* client */ ,
455 DeviceIntPtr /* dev */ ,
456 Window /* focusID */ ,
457 CARD8 /* revertTo */ ,
458 Time /* ctime */ ,
459 Bool /* followOK */ );
460
461extern int
462GrabDevice(ClientPtr /* client */ ,
463 DeviceIntPtr /* dev */ ,
464 unsigned /* this_mode */ ,
465 unsigned /* other_mode */ ,
466 Window /* grabWindow */ ,
467 unsigned /* ownerEvents */ ,
468 Time /* ctime */ ,
469 GrabMask * /* mask */ ,
470 int /* grabtype */ ,
471 Cursor /* curs */ ,
472 Window /* confineToWin */ ,
473 CARD8 * /* status */ );
474
475extern void
476InitEvents(void);
477
478extern void
479CloseDownEvents(void);
480
481extern void
482DeleteWindowFromAnyEvents(WindowPtr /* pWin */ ,
483 Bool /* freeResources */ );
484
485extern Mask
486EventMaskForClient(WindowPtr /* pWin */ ,
487 ClientPtr /* client */ );
488
489extern _X_EXPORT int
490DeliverEvents(WindowPtr /*pWin */ ,
491 xEventPtr /*xE */ ,
492 int /*count */ ,
493 WindowPtr /*otherParent */ );
494
495extern Bool
496CheckMotion(DeviceEvent * /* ev */ ,
497 DeviceIntPtr /* pDev */ );
498
499extern _X_EXPORT void
500WriteEventsToClient(ClientPtr /*pClient */ ,
501 int /*count */ ,
502 xEventPtr /*events */ );
503
504extern _X_EXPORT int
505TryClientEvents(ClientPtr /*client */ ,
506 DeviceIntPtr /* device */ ,
507 xEventPtr /*pEvents */ ,
508 int /*count */ ,
509 Mask /*mask */ ,
510 Mask /*filter */ ,
511 GrabPtr /*grab */ );
512
513extern _X_EXPORT void
514WindowsRestructured(void);
515
516extern int
517SetClientPointer(ClientPtr /* client */ ,
518 DeviceIntPtr /* device */ );
519
520extern _X_EXPORT DeviceIntPtr
521PickPointer(ClientPtr /* client */ );
522
523extern _X_EXPORT DeviceIntPtr
524PickKeyboard(ClientPtr /* client */ );
525
526extern Bool
527IsInterferingGrab(ClientPtr /* client */ ,
528 DeviceIntPtr /* dev */ ,
529 xEvent * /* events */ );
530
531#ifdef PANORAMIX
532extern _X_EXPORT void
533ReinitializeRootWindow(WindowPtr win, int xoff, int yoff);
534#endif
535
536#ifdef RANDR
537extern _X_EXPORT void
538ScreenRestructured(ScreenPtr pScreen);
539#endif
540
541#ifndef HAVE_FFS
542extern _X_EXPORT int
543ffs(int i);
544#endif
545
546/*
547 * ServerGrabCallback stuff
548 */
549
550extern _X_EXPORT CallbackListPtr ServerGrabCallback;
551
552typedef enum { SERVER_GRABBED, SERVER_UNGRABBED,
553 CLIENT_PERVIOUS, CLIENT_IMPERVIOUS
554} ServerGrabState;
555
556typedef struct {
557 ClientPtr client;
558 ServerGrabState grabstate;
559} ServerGrabInfoRec;
560
561/*
562 * EventCallback stuff
563 */
564
565extern _X_EXPORT CallbackListPtr EventCallback;
566
567typedef struct {
568 ClientPtr client;
569 xEventPtr events;
570 int count;
571} EventInfoRec;
572
573/*
574 * DeviceEventCallback stuff
575 */
576
577extern _X_EXPORT CallbackListPtr DeviceEventCallback;
578
579typedef struct {
580 InternalEvent *event;
581 DeviceIntPtr device;
582} DeviceEventInfoRec;
583
584extern int
585XItoCoreType(int xi_type);
586extern Bool
587DevHasCursor(DeviceIntPtr pDev);
588extern _X_EXPORT Bool
589IsPointerDevice(DeviceIntPtr dev);
590extern _X_EXPORT Bool
591IsKeyboardDevice(DeviceIntPtr dev);
592extern Bool
593IsPointerEvent(InternalEvent *event);
594extern Bool
595IsTouchEvent(InternalEvent *event);
596extern _X_EXPORT Bool
597IsMaster(DeviceIntPtr dev);
598extern _X_EXPORT Bool
599IsFloating(DeviceIntPtr dev);
600
601extern _X_HIDDEN void
602CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
603extern _X_HIDDEN int
604CorePointerProc(DeviceIntPtr dev, int what);
605extern _X_HIDDEN int
606CoreKeyboardProc(DeviceIntPtr dev, int what);
607
608#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