1 | /***********************************************************
|
---|
2 |
|
---|
3 | Copyright 1987, 1998 The Open Group
|
---|
4 |
|
---|
5 | Permission to use, copy, modify, distribute, and sell this software and its
|
---|
6 | documentation for any purpose is hereby granted without fee, provided that
|
---|
7 | the above copyright notice appear in all copies and that both that
|
---|
8 | copyright notice and this permission notice appear in supporting
|
---|
9 | documentation.
|
---|
10 |
|
---|
11 | The above copyright notice and this permission notice shall be included in
|
---|
12 | all copies or substantial portions of the Software.
|
---|
13 |
|
---|
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
17 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
18 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
20 |
|
---|
21 | Except as contained in this notice, the name of The Open Group shall not be
|
---|
22 | used in advertising or otherwise to promote the sale, use or other dealings
|
---|
23 | in this Software without prior written authorization from The Open Group.
|
---|
24 |
|
---|
25 |
|
---|
26 | Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
---|
27 |
|
---|
28 | All Rights Reserved
|
---|
29 |
|
---|
30 | Permission to use, copy, modify, and distribute this software and its
|
---|
31 | documentation for any purpose and without fee is hereby granted,
|
---|
32 | provided that the above copyright notice appear in all copies and that
|
---|
33 | both that copyright notice and this permission notice appear in
|
---|
34 | supporting documentation, and that the name of Digital not be
|
---|
35 | used in advertising or publicity pertaining to distribution of the
|
---|
36 | software without specific, written prior permission.
|
---|
37 |
|
---|
38 | DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
---|
39 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
---|
40 | DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
---|
41 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
---|
42 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
---|
43 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
---|
44 | SOFTWARE.
|
---|
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 |
|
---|
273 | typedef struct _TimeStamp *TimeStampPtr;
|
---|
274 |
|
---|
275 | #ifndef _XTYPEDEF_CLIENTPTR
|
---|
276 | typedef struct _Client *ClientPtr; /* also in misc.h */
|
---|
277 | #define _XTYPEDEF_CLIENTPTR
|
---|
278 | #endif
|
---|
279 |
|
---|
280 | typedef struct _WorkQueue *WorkQueuePtr;
|
---|
281 |
|
---|
282 | extern ClientPtr requestingClient;
|
---|
283 | extern ClientPtr *clients;
|
---|
284 | extern ClientPtr serverClient;
|
---|
285 | extern int currentMaxClients;
|
---|
286 | extern char dispatchExceptionAtReset;
|
---|
287 |
|
---|
288 | typedef int HWEventQueueType;
|
---|
289 | typedef HWEventQueueType* HWEventQueuePtr;
|
---|
290 |
|
---|
291 | extern HWEventQueuePtr checkForInput[2];
|
---|
292 |
|
---|
293 | typedef struct _TimeStamp {
|
---|
294 | CARD32 months; /* really ~49.7 days */
|
---|
295 | CARD32 milliseconds;
|
---|
296 | } TimeStamp;
|
---|
297 |
|
---|
298 | /* dispatch.c */
|
---|
299 |
|
---|
300 | extern void SetInputCheck(
|
---|
301 | HWEventQueuePtr /*c0*/,
|
---|
302 | HWEventQueuePtr /*c1*/);
|
---|
303 |
|
---|
304 | extern void CloseDownClient(
|
---|
305 | ClientPtr /*client*/);
|
---|
306 |
|
---|
307 | extern void UpdateCurrentTime(void);
|
---|
308 |
|
---|
309 | extern void UpdateCurrentTimeIf(void);
|
---|
310 |
|
---|
311 | extern void InitSelections(void);
|
---|
312 |
|
---|
313 | extern void FlushClientCaches(XID /*id*/);
|
---|
314 |
|
---|
315 | extern int dixDestroyPixmap(
|
---|
316 | pointer /*value*/,
|
---|
317 | XID /*pid*/);
|
---|
318 |
|
---|
319 | extern void CloseDownRetainedResources(void);
|
---|
320 |
|
---|
321 | extern void InitClient(
|
---|
322 | ClientPtr /*client*/,
|
---|
323 | int /*i*/,
|
---|
324 | pointer /*ospriv*/);
|
---|
325 |
|
---|
326 | extern ClientPtr NextAvailableClient(
|
---|
327 | pointer /*ospriv*/);
|
---|
328 |
|
---|
329 | extern void SendErrorToClient(
|
---|
330 | ClientPtr /*client*/,
|
---|
331 | unsigned int /*majorCode*/,
|
---|
332 | unsigned int /*minorCode*/,
|
---|
333 | XID /*resId*/,
|
---|
334 | int /*errorCode*/);
|
---|
335 |
|
---|
336 | extern void DeleteWindowFromAnySelections(
|
---|
337 | WindowPtr /*pWin*/);
|
---|
338 |
|
---|
339 | extern void MarkClientException(
|
---|
340 | ClientPtr /*client*/);
|
---|
341 |
|
---|
342 | extern int GetGeometry(
|
---|
343 | ClientPtr /*client*/,
|
---|
344 | xGetGeometryReply* /* wa */);
|
---|
345 |
|
---|
346 | extern int SendConnSetup(
|
---|
347 | ClientPtr /*client*/,
|
---|
348 | char* /*reason*/);
|
---|
349 |
|
---|
350 | extern 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)
|
---|
362 | extern void ddxBeforeReset (void);
|
---|
363 | #endif
|
---|
364 |
|
---|
365 | /* dixutils.c */
|
---|
366 |
|
---|
367 | extern void CopyISOLatin1Lowered(
|
---|
368 | unsigned char * /*dest*/,
|
---|
369 | unsigned char * /*source*/,
|
---|
370 | int /*length*/);
|
---|
371 |
|
---|
372 | extern int CompareISOLatin1Lowered(
|
---|
373 | unsigned char * /*a*/,
|
---|
374 | int alen,
|
---|
375 | unsigned char * /*b*/,
|
---|
376 | int blen);
|
---|
377 |
|
---|
378 | #ifdef XACE
|
---|
379 |
|
---|
380 | extern WindowPtr SecurityLookupWindow(
|
---|
381 | XID /*rid*/,
|
---|
382 | ClientPtr /*client*/,
|
---|
383 | Mask /*access_mode*/);
|
---|
384 |
|
---|
385 | extern pointer SecurityLookupDrawable(
|
---|
386 | XID /*rid*/,
|
---|
387 | ClientPtr /*client*/,
|
---|
388 | Mask /*access_mode*/);
|
---|
389 |
|
---|
390 | extern WindowPtr LookupWindow(
|
---|
391 | XID /*rid*/,
|
---|
392 | ClientPtr /*client*/);
|
---|
393 |
|
---|
394 | extern pointer LookupDrawable(
|
---|
395 | XID /*rid*/,
|
---|
396 | ClientPtr /*client*/);
|
---|
397 |
|
---|
398 | #else
|
---|
399 |
|
---|
400 | extern WindowPtr LookupWindow(
|
---|
401 | XID /*rid*/,
|
---|
402 | ClientPtr /*client*/);
|
---|
403 |
|
---|
404 | extern 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 |
|
---|
416 | extern ClientPtr LookupClient(
|
---|
417 | XID /*rid*/,
|
---|
418 | ClientPtr /*client*/);
|
---|
419 |
|
---|
420 | extern void NoopDDA(void);
|
---|
421 |
|
---|
422 | extern int AlterSaveSetForClient(
|
---|
423 | ClientPtr /*client*/,
|
---|
424 | WindowPtr /*pWin*/,
|
---|
425 | unsigned /*mode*/,
|
---|
426 | Bool /*toRoot*/,
|
---|
427 | Bool /*remap*/);
|
---|
428 |
|
---|
429 | extern void DeleteWindowFromAnySaveSet(
|
---|
430 | WindowPtr /*pWin*/);
|
---|
431 |
|
---|
432 | extern void BlockHandler(
|
---|
433 | pointer /*pTimeout*/,
|
---|
434 | pointer /*pReadmask*/);
|
---|
435 |
|
---|
436 | extern void WakeupHandler(
|
---|
437 | int /*result*/,
|
---|
438 | pointer /*pReadmask*/);
|
---|
439 |
|
---|
440 | typedef void (* WakeupHandlerProcPtr)(
|
---|
441 | pointer /* blockData */,
|
---|
442 | int /* result */,
|
---|
443 | pointer /* pReadmask */);
|
---|
444 |
|
---|
445 | extern Bool RegisterBlockAndWakeupHandlers(
|
---|
446 | BlockHandlerProcPtr /*blockHandler*/,
|
---|
447 | WakeupHandlerProcPtr /*wakeupHandler*/,
|
---|
448 | pointer /*blockData*/);
|
---|
449 |
|
---|
450 | extern void RemoveBlockAndWakeupHandlers(
|
---|
451 | BlockHandlerProcPtr /*blockHandler*/,
|
---|
452 | WakeupHandlerProcPtr /*wakeupHandler*/,
|
---|
453 | pointer /*blockData*/);
|
---|
454 |
|
---|
455 | extern void InitBlockAndWakeupHandlers(void);
|
---|
456 |
|
---|
457 | extern void ProcessWorkQueue(void);
|
---|
458 |
|
---|
459 | extern void ProcessWorkQueueZombies(void);
|
---|
460 |
|
---|
461 | extern Bool QueueWorkProc(
|
---|
462 | Bool (* /*function*/)(
|
---|
463 | ClientPtr /*clientUnused*/,
|
---|
464 | pointer /*closure*/),
|
---|
465 | ClientPtr /*client*/,
|
---|
466 | pointer /*closure*/
|
---|
467 | );
|
---|
468 |
|
---|
469 | typedef Bool (* ClientSleepProcPtr)(
|
---|
470 | ClientPtr /*client*/,
|
---|
471 | pointer /*closure*/);
|
---|
472 |
|
---|
473 | extern Bool ClientSleep(
|
---|
474 | ClientPtr /*client*/,
|
---|
475 | ClientSleepProcPtr /* function */,
|
---|
476 | pointer /*closure*/);
|
---|
477 |
|
---|
478 | #ifndef ___CLIENTSIGNAL_DEFINED___
|
---|
479 | #define ___CLIENTSIGNAL_DEFINED___
|
---|
480 | extern Bool ClientSignal(
|
---|
481 | ClientPtr /*client*/);
|
---|
482 | #endif /* ___CLIENTSIGNAL_DEFINED___ */
|
---|
483 |
|
---|
484 | extern void ClientWakeup(
|
---|
485 | ClientPtr /*client*/);
|
---|
486 |
|
---|
487 | extern Bool ClientIsAsleep(
|
---|
488 | ClientPtr /*client*/);
|
---|
489 |
|
---|
490 | /* atom.c */
|
---|
491 |
|
---|
492 | extern Atom MakeAtom(
|
---|
493 | char * /*string*/,
|
---|
494 | unsigned /*len*/,
|
---|
495 | Bool /*makeit*/);
|
---|
496 |
|
---|
497 | extern Bool ValidAtom(
|
---|
498 | Atom /*atom*/);
|
---|
499 |
|
---|
500 | extern char *NameForAtom(
|
---|
501 | Atom /*atom*/);
|
---|
502 |
|
---|
503 | extern void AtomError(void);
|
---|
504 |
|
---|
505 | extern void FreeAllAtoms(void);
|
---|
506 |
|
---|
507 | extern void InitAtoms(void);
|
---|
508 |
|
---|
509 | /* main.c */
|
---|
510 |
|
---|
511 | extern void SetVendorRelease(int release);
|
---|
512 |
|
---|
513 | extern void SetVendorString(char *string);
|
---|
514 |
|
---|
515 | /* events.c */
|
---|
516 |
|
---|
517 | extern void SetMaskForEvent(
|
---|
518 | Mask /* mask */,
|
---|
519 | int /* event */);
|
---|
520 |
|
---|
521 |
|
---|
522 | extern Bool IsParent(
|
---|
523 | WindowPtr /* maybeparent */,
|
---|
524 | WindowPtr /* child */);
|
---|
525 |
|
---|
526 | extern WindowPtr GetCurrentRootWindow(void);
|
---|
527 |
|
---|
528 | extern WindowPtr GetSpriteWindow(void);
|
---|
529 |
|
---|
530 |
|
---|
531 | extern void NoticeEventTime(xEventPtr /* xE */);
|
---|
532 |
|
---|
533 | extern void EnqueueEvent(
|
---|
534 | xEventPtr /* xE */,
|
---|
535 | DeviceIntPtr /* device */,
|
---|
536 | int /* count */);
|
---|
537 |
|
---|
538 | extern void ComputeFreezes(void);
|
---|
539 |
|
---|
540 | extern void CheckGrabForSyncs(
|
---|
541 | DeviceIntPtr /* dev */,
|
---|
542 | Bool /* thisMode */,
|
---|
543 | Bool /* otherMode */);
|
---|
544 |
|
---|
545 | extern void ActivatePointerGrab(
|
---|
546 | DeviceIntPtr /* mouse */,
|
---|
547 | GrabPtr /* grab */,
|
---|
548 | TimeStamp /* time */,
|
---|
549 | Bool /* autoGrab */);
|
---|
550 |
|
---|
551 | extern void DeactivatePointerGrab(
|
---|
552 | DeviceIntPtr /* mouse */);
|
---|
553 |
|
---|
554 | extern void ActivateKeyboardGrab(
|
---|
555 | DeviceIntPtr /* keybd */,
|
---|
556 | GrabPtr /* grab */,
|
---|
557 | TimeStamp /* time */,
|
---|
558 | Bool /* passive */);
|
---|
559 |
|
---|
560 | extern void DeactivateKeyboardGrab(
|
---|
561 | DeviceIntPtr /* keybd */);
|
---|
562 |
|
---|
563 | extern void AllowSome(
|
---|
564 | ClientPtr /* client */,
|
---|
565 | TimeStamp /* time */,
|
---|
566 | DeviceIntPtr /* thisDev */,
|
---|
567 | int /* newState */);
|
---|
568 |
|
---|
569 | extern void ReleaseActiveGrabs(
|
---|
570 | ClientPtr client);
|
---|
571 |
|
---|
572 | extern int DeliverEventsToWindow(
|
---|
573 | WindowPtr /* pWin */,
|
---|
574 | xEventPtr /* pEvents */,
|
---|
575 | int /* count */,
|
---|
576 | Mask /* filter */,
|
---|
577 | GrabPtr /* grab */,
|
---|
578 | int /* mskidx */);
|
---|
579 |
|
---|
580 | extern int DeliverDeviceEvents(
|
---|
581 | WindowPtr /* pWin */,
|
---|
582 | xEventPtr /* xE */,
|
---|
583 | GrabPtr /* grab */,
|
---|
584 | WindowPtr /* stopAt */,
|
---|
585 | DeviceIntPtr /* dev */,
|
---|
586 | int /* count */);
|
---|
587 |
|
---|
588 | extern void DefineInitialRootWindow(
|
---|
589 | WindowPtr /* win */);
|
---|
590 |
|
---|
591 | extern void WindowHasNewCursor(
|
---|
592 | WindowPtr /* pWin */);
|
---|
593 |
|
---|
594 | extern Bool CheckDeviceGrabs(
|
---|
595 | DeviceIntPtr /* device */,
|
---|
596 | xEventPtr /* xE */,
|
---|
597 | int /* checkFirst */,
|
---|
598 | int /* count */);
|
---|
599 |
|
---|
600 | extern void DeliverFocusedEvent(
|
---|
601 | DeviceIntPtr /* keybd */,
|
---|
602 | xEventPtr /* xE */,
|
---|
603 | WindowPtr /* window */,
|
---|
604 | int /* count */);
|
---|
605 |
|
---|
606 | extern void DeliverGrabbedEvent(
|
---|
607 | xEventPtr /* xE */,
|
---|
608 | DeviceIntPtr /* thisDev */,
|
---|
609 | Bool /* deactivateGrab */,
|
---|
610 | int /* count */);
|
---|
611 |
|
---|
612 | #ifdef XKB
|
---|
613 | extern void FixKeyState(
|
---|
614 | xEvent * /* xE */,
|
---|
615 | DeviceIntPtr /* keybd */);
|
---|
616 | #endif /* XKB */
|
---|
617 |
|
---|
618 | extern void RecalculateDeliverableEvents(
|
---|
619 | WindowPtr /* pWin */);
|
---|
620 |
|
---|
621 | extern int OtherClientGone(
|
---|
622 | pointer /* value */,
|
---|
623 | XID /* id */);
|
---|
624 |
|
---|
625 | extern void DoFocusEvents(
|
---|
626 | DeviceIntPtr /* dev */,
|
---|
627 | WindowPtr /* fromWin */,
|
---|
628 | WindowPtr /* toWin */,
|
---|
629 | int /* mode */);
|
---|
630 |
|
---|
631 | extern int SetInputFocus(
|
---|
632 | ClientPtr /* client */,
|
---|
633 | DeviceIntPtr /* dev */,
|
---|
634 | Window /* focusID */,
|
---|
635 | CARD8 /* revertTo */,
|
---|
636 | Time /* ctime */,
|
---|
637 | Bool /* followOK */);
|
---|
638 |
|
---|
639 | extern 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 |
|
---|
650 | extern void InitEvents(void);
|
---|
651 |
|
---|
652 | extern void CloseDownEvents(void);
|
---|
653 |
|
---|
654 | extern void DeleteWindowFromAnyEvents(
|
---|
655 | WindowPtr /* pWin */,
|
---|
656 | Bool /* freeResources */);
|
---|
657 |
|
---|
658 |
|
---|
659 | extern Mask EventMaskForClient(
|
---|
660 | WindowPtr /* pWin */,
|
---|
661 | ClientPtr /* client */);
|
---|
662 |
|
---|
663 |
|
---|
664 |
|
---|
665 | extern int DeliverEvents(
|
---|
666 | WindowPtr /*pWin*/,
|
---|
667 | xEventPtr /*xE*/,
|
---|
668 | int /*count*/,
|
---|
669 | WindowPtr /*otherParent*/);
|
---|
670 |
|
---|
671 |
|
---|
672 | extern void WriteEventsToClient(
|
---|
673 | ClientPtr /*pClient*/,
|
---|
674 | int /*count*/,
|
---|
675 | xEventPtr /*events*/);
|
---|
676 |
|
---|
677 | extern int TryClientEvents(
|
---|
678 | ClientPtr /*client*/,
|
---|
679 | xEventPtr /*pEvents*/,
|
---|
680 | int /*count*/,
|
---|
681 | Mask /*mask*/,
|
---|
682 | Mask /*filter*/,
|
---|
683 | GrabPtr /*grab*/);
|
---|
684 |
|
---|
685 | extern void WindowsRestructured(void);
|
---|
686 |
|
---|
687 | #ifdef PANORAMIX
|
---|
688 | extern void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff);
|
---|
689 | #endif
|
---|
690 |
|
---|
691 | #ifdef RANDR
|
---|
692 | void
|
---|
693 | ScreenRestructured (ScreenPtr pScreen);
|
---|
694 | #endif
|
---|
695 |
|
---|
696 | extern void ResetClientPrivates(void);
|
---|
697 |
|
---|
698 | extern int AllocateClientPrivateIndex(void);
|
---|
699 |
|
---|
700 | extern Bool AllocateClientPrivate(
|
---|
701 | int /*index*/,
|
---|
702 | unsigned /*amount*/);
|
---|
703 |
|
---|
704 | /*
|
---|
705 | * callback manager stuff
|
---|
706 | */
|
---|
707 |
|
---|
708 | #ifndef _XTYPEDEF_CALLBACKLISTPTR
|
---|
709 | typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */
|
---|
710 | #define _XTYPEDEF_CALLBACKLISTPTR
|
---|
711 | #endif
|
---|
712 |
|
---|
713 | typedef void (*CallbackProcPtr) (
|
---|
714 | CallbackListPtr *, pointer, pointer);
|
---|
715 |
|
---|
716 | typedef Bool (*AddCallbackProcPtr) (
|
---|
717 | CallbackListPtr *, CallbackProcPtr, pointer);
|
---|
718 |
|
---|
719 | typedef Bool (*DeleteCallbackProcPtr) (
|
---|
720 | CallbackListPtr *, CallbackProcPtr, pointer);
|
---|
721 |
|
---|
722 | typedef void (*CallCallbacksProcPtr) (
|
---|
723 | CallbackListPtr *, pointer);
|
---|
724 |
|
---|
725 | typedef void (*DeleteCallbackListProcPtr) (
|
---|
726 | CallbackListPtr *);
|
---|
727 |
|
---|
728 | typedef struct _CallbackProcs {
|
---|
729 | AddCallbackProcPtr AddCallback;
|
---|
730 | DeleteCallbackProcPtr DeleteCallback;
|
---|
731 | CallCallbacksProcPtr CallCallbacks;
|
---|
732 | DeleteCallbackListProcPtr DeleteCallbackList;
|
---|
733 | } CallbackFuncsRec, *CallbackFuncsPtr;
|
---|
734 |
|
---|
735 | extern Bool CreateCallbackList(
|
---|
736 | CallbackListPtr * /*pcbl*/,
|
---|
737 | CallbackFuncsPtr /*cbfuncs*/);
|
---|
738 |
|
---|
739 | extern Bool AddCallback(
|
---|
740 | CallbackListPtr * /*pcbl*/,
|
---|
741 | CallbackProcPtr /*callback*/,
|
---|
742 | pointer /*data*/);
|
---|
743 |
|
---|
744 | extern Bool DeleteCallback(
|
---|
745 | CallbackListPtr * /*pcbl*/,
|
---|
746 | CallbackProcPtr /*callback*/,
|
---|
747 | pointer /*data*/);
|
---|
748 |
|
---|
749 | extern void CallCallbacks(
|
---|
750 | CallbackListPtr * /*pcbl*/,
|
---|
751 | pointer /*call_data*/);
|
---|
752 |
|
---|
753 | extern void DeleteCallbackList(
|
---|
754 | CallbackListPtr * /*pcbl*/);
|
---|
755 |
|
---|
756 | extern void InitCallbackManager(void);
|
---|
757 |
|
---|
758 | /*
|
---|
759 | * ServerGrabCallback stuff
|
---|
760 | */
|
---|
761 |
|
---|
762 | extern CallbackListPtr ServerGrabCallback;
|
---|
763 |
|
---|
764 | typedef enum {SERVER_GRABBED, SERVER_UNGRABBED,
|
---|
765 | CLIENT_PERVIOUS, CLIENT_IMPERVIOUS } ServerGrabState;
|
---|
766 |
|
---|
767 | typedef struct {
|
---|
768 | ClientPtr client;
|
---|
769 | ServerGrabState grabstate;
|
---|
770 | } ServerGrabInfoRec;
|
---|
771 |
|
---|
772 | /*
|
---|
773 | * EventCallback stuff
|
---|
774 | */
|
---|
775 |
|
---|
776 | extern CallbackListPtr EventCallback;
|
---|
777 |
|
---|
778 | typedef struct {
|
---|
779 | ClientPtr client;
|
---|
780 | xEventPtr events;
|
---|
781 | int count;
|
---|
782 | } EventInfoRec;
|
---|
783 |
|
---|
784 | /*
|
---|
785 | * DeviceEventCallback stuff
|
---|
786 | */
|
---|
787 |
|
---|
788 | extern CallbackListPtr DeviceEventCallback;
|
---|
789 |
|
---|
790 | typedef struct {
|
---|
791 | xEventPtr events;
|
---|
792 | int count;
|
---|
793 | } DeviceEventInfoRec;
|
---|
794 |
|
---|
795 | /*
|
---|
796 | * SelectionCallback stuff
|
---|
797 | */
|
---|
798 |
|
---|
799 | extern CallbackListPtr SelectionCallback;
|
---|
800 |
|
---|
801 | typedef enum {
|
---|
802 | SelectionSetOwner,
|
---|
803 | SelectionWindowDestroy,
|
---|
804 | SelectionClientClose
|
---|
805 | } SelectionCallbackKind;
|
---|
806 |
|
---|
807 | typedef struct {
|
---|
808 | struct _Selection *selection;
|
---|
809 | SelectionCallbackKind kind;
|
---|
810 | } SelectionInfoRec;
|
---|
811 |
|
---|
812 | /* strcasecmp.c */
|
---|
813 | #if NEED_STRCASECMP
|
---|
814 | #define strcasecmp xstrcasecmp
|
---|
815 | extern int xstrcasecmp(char *s1, char *s2);
|
---|
816 | #endif
|
---|
817 |
|
---|
818 | /* ffs.c */
|
---|
819 | extern int ffs(int i);
|
---|
820 |
|
---|
821 | #endif /* DIX_H */
|
---|