VirtualBox

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

最後變更 在這個檔案從62425是 28062,由 vboxsync 提交於 15 年 前

Additions/x11/x11include: header files for building X.Org server 1.8 drivers

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette