]> git.sesse.net Git - rdpsrv/blob - Xserver/include/extensions/multibufst.h
Support RDP5 logon packets.
[rdpsrv] / Xserver / include / extensions / multibufst.h
1 /*
2  * $XConsortium: multibufst.h,v 1.16 95/06/08 23:20:39 gildea Exp $
3  * $XFree86: xc/include/extensions/multibufst.h,v 3.1 1996/05/06 05:52:39 dawes Exp $
4  *
5 Copyright (c) 1989  X Consortium
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
20 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24 Except as contained in this notice, the name of the X Consortium shall not be
25 used in advertising or otherwise to promote the sale, use or other dealings
26 in this Software without prior written authorization from the X Consortium.
27  */
28
29 #ifndef _MULTIBUFST_H_
30 #define _MULTIBUFST_H_
31
32 /*
33  * Protocol requests constants and alignment values
34  */
35
36 #include "multibuf.h"
37 #ifdef _MULTIBUF_SERVER_
38 #include "input.h"
39 #endif
40
41 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
42 #define MbufGetReq(name,req,info) GetReq (name, req); \
43         req->reqType = info->codes->major_opcode; \
44         req->mbufReqType = X_##name;
45 #else
46 #define MbufGetReq(name,req,info) GetReq (name, req); \
47         req->reqType = info->codes->major_opcode; \
48         req->mbufReqType = X_/**/name;
49 #endif
50
51 #define Window CARD32
52 #define Drawable CARD32
53 #define VisualID CARD32
54 #define Multibuffer CARD32
55
56 typedef struct xMbufBufferInfo {
57         CARD32  visualID B32;           /* associated visual */
58         CARD16  maxBuffers B16;         /* maximum supported buffers */
59         CARD8   depth;                  /* depth of visual (redundant) */
60         CARD8   unused;
61 } xMbufBufferInfo;
62 #define sz_xMbufBufferInfo 8
63
64 typedef struct {
65     BYTE    type;
66     BYTE    unused;
67     CARD16  sequenceNumber B16;
68     CARD32  buffer B32;                 /* affected buffer */
69     BYTE    state;                      /* current status */
70     CARD8   unused1;
71     CARD16  unused2 B16;
72     CARD32  unused3 B32;
73     CARD32  unused4 B32;
74     CARD32  unused5 B32;
75     CARD32  unused6 B32;
76     CARD32  unused7 B32;
77 } xMbufClobberNotifyEvent;
78
79 typedef struct {
80     BYTE    type;
81     BYTE    unused;
82     CARD16  sequenceNumber B16;
83     CARD32  buffer B32;                 /* affected buffer */
84     CARD32  timeStamp B32;              /* update time */
85     CARD32  unused1 B32;
86     CARD32  unused2 B32;
87     CARD32  unused3 B32;
88     CARD32  unused4 B32;
89     CARD32  unused5 B32;
90     CARD32  unused6 B32;
91 } xMbufUpdateNotifyEvent;
92
93 typedef struct {
94     CARD8       reqType;                /* always codes->major_opcode */
95     CARD8       mbufReqType;            /* always X_MbufGetBufferVersion */
96     CARD16      length B16;
97 } xMbufGetBufferVersionReq;
98 #define sz_xMbufGetBufferVersionReq     4
99
100 typedef struct {
101     BYTE        type;                   /* X_Reply */
102     CARD8       unused;                 /* not used */
103     CARD16      sequenceNumber B16;
104     CARD32      length B32;
105     CARD8       majorVersion;   /* major version of Multi-Buffering protocol */
106     CARD8       minorVersion;   /* minor version of Multi-Buffering protocol */
107     CARD16      pad1 B16;
108     CARD32      pad2 B32;
109     CARD32      pad3 B32;
110     CARD32      pad4 B32;
111     CARD32      pad5 B32;
112     CARD32      pad6 B32;
113 } xMbufGetBufferVersionReply;
114 #define sz_xMbufGetBufferVersionReply   32
115
116 typedef struct {
117     CARD8       reqType;        /* always codes->major_opcode */
118     CARD8       mbufReqType;    /* always X_MbufCreateImageBuffers */
119     CARD16      length B16;
120     CARD32      window B32;     /* associated window */
121     CARD8       updateAction;   /* action at update */
122     CARD8       updateHint;     /* hint as to frequency of updates */
123     CARD16      unused;
124 } xMbufCreateImageBuffersReq;   /* followed by buffer ids */
125 #define sz_xMbufCreateImageBuffersReq   12
126
127 typedef struct {
128     BYTE        type;                   /* X_Reply */
129     CARD8       unused;                 /* not used */
130     CARD16      sequenceNumber B16;
131     CARD32      length B32;
132     CARD16      numberBuffer B16;       /* number successfully allocated */
133     CARD16      unused1 B16;
134     CARD32      unused2 B32;
135     CARD32      unused3 B32;
136     CARD32      unused4 B32;
137     CARD32      unused5 B32;
138     CARD32      unused6 B32;
139 } xMbufCreateImageBuffersReply;
140 #define sz_xMbufCreateImageBuffersReply 32
141
142 typedef struct {
143     CARD8       reqType;        /* always codes->major_opcode */
144     CARD8       mbufReqType;    /* always X_MbufDestroyImageBuffers */
145     CARD16      length B16;
146     CARD32      window B32;     /* associated window */
147 } xMbufDestroyImageBuffersReq;
148 #define sz_xMbufDestroyImageBuffersReq  8
149
150 typedef struct {
151     CARD8       reqType;        /* always codes->major_opcode */
152     CARD8       mbufReqType;    /* always X_MbufDisplayImageBuffers */
153     CARD16      length B16;
154     CARD16      minDelay B16;   /* minimum time between last update and now */
155     CARD16      maxDelay B16;   /* maximum time between last update and now */
156 } xMbufDisplayImageBuffersReq;  /* followed by list of buffers */
157 #define sz_xMbufDisplayImageBuffersReq  8
158
159 typedef struct {
160     CARD8       reqType;        /* always codes->major_opcode */
161     CARD8       mbufReqType;    /* always X_MbufSetMBufferAttributes */
162     CARD16      length B16;
163     CARD32      window B32;     /* associated window */
164     CARD32      valueMask B32;  /* modified entries */
165 } xMbufSetMBufferAttributesReq; /* followed by values */
166 #define sz_xMbufSetMBufferAttributesReq 12
167
168 typedef struct {
169     CARD8       reqType;        /* always codes->major_opcode */
170     CARD8       mbufReqType;    /* always X_MbufGetMBufferAttributes */
171     CARD16      length B16;
172     CARD32      window B32;     /* associated window */
173 } xMbufGetMBufferAttributesReq;
174 #define sz_xMbufGetMBufferAttributesReq 8
175
176 typedef struct {
177     BYTE        type;                   /* X_Reply */
178     CARD8       unused;                 /* not used */
179     CARD16      sequenceNumber B16;
180     CARD32      length B32;
181     CARD16      displayedBuffer B16;    /* currently visible buffer */
182     CARD8       updateAction;
183     CARD8       updateHint;
184     CARD8       windowMode;
185     CARD8       unused0;
186     CARD16      unused1 B16;
187     CARD32      unused2 B32;
188     CARD32      unused3 B32;
189     CARD32      unused4 B32;
190     CARD32      unused5 B32;
191 } xMbufGetMBufferAttributesReply;
192 #define sz_xMbufGetMBufferAttributesReply 32
193
194 typedef struct {
195     CARD8       reqType;        /* always codes->major_opcode */
196     CARD8       mbufReqType;    /* always X_MbufSetBufferAttributes */
197     CARD16      length B16;
198     CARD32      buffer B32;
199     CARD32      valueMask B32;
200 } xMbufSetBufferAttributesReq;  /* followed by values */
201 #define sz_xMbufSetBufferAttributesReq 12
202
203 typedef struct {
204     CARD8       reqType;        /* always codes->major_opcode */
205     CARD8       mbufReqType;    /* always X_MbufGetBufferAttributes */
206     CARD16      length B16;
207     CARD32      buffer B32;
208 } xMbufGetBufferAttributesReq;
209 #define sz_xMbufGetBufferAttributesReq 8
210
211 typedef struct {
212     BYTE        type;                   /* X_Reply */
213     CARD8       unused;                 /* not used */
214     CARD16      sequenceNumber B16;
215     CARD32      length B32;
216     CARD32      window B32;
217     CARD32      eventMask B32;
218     CARD16      bufferIndex B16;
219     CARD8       side;
220     CARD8       unused0;
221     CARD32      unused1 B32;
222     CARD32      unused2 B32;
223     CARD32      unused3 B32;
224 } xMbufGetBufferAttributesReply;
225 #define sz_xMbufGetBufferAttributesReply 32
226
227 typedef struct {
228     CARD8       reqType;        /* always codes->major_opcode */
229     CARD8       mbufReqType;    /* always X_MbufGetBufferInfo */
230     CARD16      length B16;
231     Drawable    drawable B32;
232 } xMbufGetBufferInfoReq;
233 #define sz_xMbufGetBufferInfoReq 8
234
235 typedef struct {
236     BYTE        type;                   /* X_Reply */
237     CARD8       unused;                 /* not used */
238     CARD16      sequenceNumber B16;
239     CARD32      length B32;
240     CARD16      normalInfo B16;
241     CARD16      stereoInfo B16;
242     CARD32      unused1 B32;
243     CARD32      unused2 B32;
244     CARD32      unused3 B32;
245     CARD32      unused4 B32;
246     CARD32      unused5 B32;
247 } xMbufGetBufferInfoReply;                      /* followed by buffer infos */
248 #define sz_xMbufGetBufferInfoReply 32
249
250
251 typedef struct {
252     CARD8       reqType;        /* always codes->major_opcode */
253     CARD8       mbufReqType;    /* always X_MbufCreateStereoWindow */
254     CARD16      length B16;
255     CARD8       unused0;
256     CARD8       unused1;
257     CARD8       unused2;
258     CARD8       depth;
259     Window      wid B32;
260     Window      parent B32;
261     Multibuffer left B32;       /* associated buffers */
262     Multibuffer right B32;
263     INT16       x B16;
264     INT16       y B16;
265     CARD16      width B16;
266     CARD16      height B16;
267     CARD16      borderWidth B16;  
268     CARD16      class B16;
269     VisualID    visual B32;
270     CARD32      mask B32;
271 } xMbufCreateStereoWindowReq;           /* followed by value list */
272 #define sz_xMbufCreateStereoWindowReq 44
273
274 typedef struct {
275     CARD8     reqType;        /* always codes->major_opcode */
276     CARD8     mbufReqType;    /* always X_MbufClearImageBufferArea */
277     CARD16    length B16;
278     Multibuffer       buffer B32;
279     INT16     x B16;
280     INT16     y B16;
281     CARD16    width B16;
282     CARD16    height B16;
283     CARD8     unused0;
284     CARD8     unused1;
285     CARD8     unused2;
286     BOOL      exposures;
287 } xMbufClearImageBufferAreaReq;
288 #define sz_xMbufClearImageBufferAreaReq 20
289
290 #undef Window
291 #undef Drawable
292 #undef VisualID
293 #undef Multibuffer
294
295
296 #ifdef _MULTIBUF_SERVER_
297 /* Macros for wrapping and unwrapping functions */
298
299 #define SWAP_FUNC_VECTOR(pSTRUCT1,pSTRUCT2,DATA_TYPE,FUNC_NAME)         \
300 {                                                                       \
301     DATA_TYPE (* tmpFn)();                                              \
302                                                                         \
303     tmpFn = pSTRUCT1->FUNC_NAME;                                        \
304     pSTRUCT1->FUNC_NAME = pSTRUCT2->FUNC_NAME;                          \
305     pSTRUCT2->FUNC_NAME = tmpFn;                                        \
306 }
307
308 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
309 #define WRAP_SCREEN_FUNC(pSCREEN,pPRIV,FUNC_NAME, PRIV_FUNC_NAME)       \
310 {                                                                       \
311     if ((pPRIV->funcsWrapped & FUNC_NAME##Mask) == 0)                   \
312     {                                                                   \
313         pPRIV->FUNC_NAME   = pSCREEN->FUNC_NAME;                        \
314         pSCREEN->FUNC_NAME = PRIV_FUNC_NAME;                            \
315         pPRIV->funcsWrapped |= FUNC_NAME##Mask;                         \
316     }                                                                   \
317 }
318
319 #define UNWRAP_SCREEN_FUNC(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME)           \
320 {                                                                       \
321     SWAP_FUNC_VECTOR(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME);                \
322     pPRIV->funcsWrapped &= ~(FUNC_NAME##Mask);                          \
323 }
324
325 #define REWRAP_SCREEN_FUNC(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME)           \
326 {                                                                       \
327     if (MB_SCREEN_PRIV(pSCREEN)->mbufWindowCount)                       \
328     {                                                                   \
329         SWAP_FUNC_VECTOR(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME);            \
330         pPRIV->funcsWrapped |= FUNC_NAME##Mask;                         \
331     }                                                                   \
332 }
333 #else
334 #define WRAP_SCREEN_FUNC(pSCREEN,pPRIV,FUNC_NAME, PRIV_FUNC_NAME)       \
335 {                                                                       \
336     if ((pPRIV->funcsWrapped & FUNC_NAME/**/Mask) == 0)                 \
337     {                                                                   \
338         pPRIV->FUNC_NAME   = pSCREEN->FUNC_NAME;                        \
339         pSCREEN->FUNC_NAME = PRIV_FUNC_NAME;                            \
340         pPRIV->funcsWrapped |= FUNC_NAME/**/Mask;                       \
341     }                                                                   \
342 }
343
344 #define UNWRAP_SCREEN_FUNC(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME)           \
345 {                                                                       \
346     SWAP_FUNC_VECTOR(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME);                \
347     pPRIV->funcsWrapped &= ~(FUNC_NAME/**/Mask);                        \
348 }
349
350 #define REWRAP_SCREEN_FUNC(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME)           \
351 {                                                                       \
352     if (MB_SCREEN_PRIV(pSCREEN)->mbufWindowCount)                       \
353     {                                                                   \
354         SWAP_FUNC_VECTOR(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME);            \
355         pPRIV->funcsWrapped |= FUNC_NAME/**/Mask;                       \
356     }                                                                   \
357 }
358 #endif
359
360 /* The _Multibuffer and _Multibuffers structures below refer to each other,
361  * so we need this forward declaration
362  */
363 typedef struct _Multibuffers    *MultibuffersPtr;
364
365 /*
366  * per-Multibuffer data
367  */
368  
369 typedef struct _Multibuffer {
370     MultibuffersPtr pMultibuffers;  /* associated window data */
371     Mask            eventMask;      /* MultibufferClobberNotifyMask|ExposureMask|MultibufferUpdateNotifyMask */
372     Mask            otherEventMask; /* mask of all other clients event masks */
373     OtherClients    *otherClients;  /* other clients that want events */
374     int             number;         /* index of this buffer into array */
375     int             side;           /* always Mono */
376     int             clobber;        /* Unclobbered, PartiallyClobbered, FullClobbered */
377     PixmapPtr       pPixmap;        /* associated pixmap */
378 } MultibufferRec, *MultibufferPtr;
379
380 /*
381  * per-window data
382  */
383
384 typedef struct _Multibuffers {
385     WindowPtr   pWindow;                /* associated window */
386     int         numMultibuffer;         /* count of buffers */
387     int         refcnt;                 /* ref count for delete */
388     int         displayedMultibuffer;   /* currently active buffer */
389     int         updateAction;           /* Undefined, Background, Untouched, Copied */
390     int         updateHint;             /* Frequent, Intermittent, Static */
391     int         windowMode;             /* always Mono */
392
393     TimeStamp   lastUpdate;             /* time of last update */
394
395     unsigned short      width, height;  /* last known window size */
396     short               x, y;           /* for static gravity */
397
398     MultibufferPtr      buffers;        /* array of numMultibuffer buffers */
399 } MultibuffersRec;
400
401 /*
402  * per-screen data
403  */
404 typedef struct _MultibufferScreen {
405     PositionWindowProcPtr PositionWindow;               /* pWin, x,y */
406 } MultibufferScreenRec, *MultibufferScreenPtr;
407
408 /*
409  * per display-image-buffers request data.
410  */
411
412 typedef struct _DisplayRequest {
413     struct _DisplayRequest      *next;
414     TimeStamp                   activateTime;
415     ClientPtr                   pClient;
416     XID                         id;
417 } DisplayRequestRec, *DisplayRequestPtr;
418
419 #define DestroyWindowMask               (1L<<0)
420 #define PositionWindowMask              (1L<<1)
421 #define PostValidateTreeMask            (1L<<2)
422 #define ClipNotifyMask                  (1L<<3)
423 #define WindowExposuresMask             (1L<<4)
424 #define CopyWindowMask                  (1L<<5)
425 #define ClearToBackgroundMask           (1L<<6)
426 #define ChangeWindowAttributesMask      (1L<<7)    
427
428 extern int              MultibufferScreenIndex;
429 extern int              MultibufferWindowIndex;
430
431 extern RESTYPE          MultibufferDrawableResType;
432
433 extern void             MultibufferUpdate(      /* pMbuffer, time */
434 #if NeedFunctionPrototypes
435                                 MultibufferPtr /* pMultibuffer */,
436                                 CARD32 /* time */
437 #endif
438                                 );
439 extern void             MultibufferExpose(      /* pMbuffer, pRegion */
440 #if NeedFunctionPrototypes
441                                 MultibufferPtr /* pMultibuffer */,
442                                 RegionPtr /* pRegion */
443 #endif
444                                 );
445 extern void             MultibufferClobber(     /* pMbuffer */
446 #if NeedFunctionPrototypes
447                                 MultibufferPtr /* pMultibuffer */
448 #endif
449                                 );
450
451 typedef struct _mbufWindow      *mbufWindowPtr;
452
453 /*
454  * per-buffer data
455  */
456
457 #define MB_DISPLAYED_BUFFER(pMBWindow) \
458     ((pMBWindow)->buffers + (pMBWindow)->displayedMultibuffer)
459  
460 typedef struct _mbufBuffer {
461     mbufWindowPtr   pMBWindow;      /* associated window data */
462     Mask            eventMask;      /* client event mask */
463     Mask            otherEventMask; /* union of other clients' event masks */
464     OtherClientsPtr otherClients;   /* other clients that want events */
465     int             number;         /* index of this buffer into array */
466     int             side;           /* stero side: always Mono */
467     int             clobber;        /* clober state */
468     DrawablePtr     pDrawable;      /* associated drawable */
469 } mbufBufferRec, *mbufBufferPtr;
470
471
472 /*
473  * per-window data
474  */
475
476 #define MB_WINDOW_PRIV(pWin) \
477     ((mbufWindowPtr)((pWin)->devPrivates[MultibufferWindowIndex].ptr))
478
479 typedef struct _mbufWindow {
480     WindowPtr   pWindow;                /* associated window */
481     int         numMultibuffer;         /* count of buffers */
482     mbufBufferPtr buffers;              /* array of (numMultibuffer) buffers */
483     int         displayedMultibuffer;   /* currently active buffer */
484     int         updateAction;           /* Undefined, Background,
485                                            Untouched, Copied */
486     int         updateHint;             /* Frequent, Intermittent, Static */
487     int         windowMode;             /* always Mono */
488     TimeStamp   lastUpdate;             /* time of last update */
489     short               x, y;           /* for static gravity */
490     unsigned short      width, height;  /* last known window size */
491     DevUnion            devPrivate;
492 } mbufWindowRec;
493
494
495 /*
496  * per-screen data
497  */
498
499 #define MB_SCREEN_PRIV(pScreen) \
500     ((mbufScreenPtr)((pScreen)->devPrivates[MultibufferScreenIndex].ptr))
501
502 typedef struct _mbufScreen {
503     long mbufWindowCount;               /* count of multibuffered windows */
504
505     /* Wrap pScreen->DestroyWindow */
506     DestroyWindowProcPtr DestroyWindow;
507     long funcsWrapped;                  /* flags which functions are wrapped */
508
509     /* Initialized by device-dependent section */
510     int  nInfo;                         /* number of buffer info rec's */
511     xMbufBufferInfo *pInfo;             /* buffer info (for Normal buffers) */
512
513     int  (* CreateImageBuffers)(
514 #if NeedNestedPrototypes
515                 WindowPtr               /* pWin */,
516                 int                     /* nbuf */,
517                 XID *                   /* ids */,
518                 int                     /* action */,
519                 int                     /* hint */
520 #endif
521                 );
522     void (* DestroyImageBuffers)(
523 #if NeedNestedPrototypes
524                 WindowPtr               /* pWin */
525 #endif
526                 );
527     void (* DisplayImageBuffers)(
528 #if NeedNestedPrototypes
529                 ScreenPtr               /* pScreen */,
530                 mbufBufferPtr *         /* ppMBBuffer */,
531                 mbufWindowPtr *         /* ppMBWindow */,
532                 int                     /* nbuf */
533 #endif
534                 );
535     void (* ClearImageBufferArea)(
536 #if NeedNestedPrototypes
537                 mbufBufferPtr           /* pMBBuffer */,
538                 short                   /* x */,
539                 short                   /* y */,
540                 unsigned short          /* width */,
541                 unsigned short          /* height */,
542                 Bool                    /* exposures */
543 #endif
544                 );
545     Bool (* ChangeMBufferAttributes)(   /* pMBWindow, vmask */ 
546 #if NeedNestedPrototypes
547                 /* FIXME */
548 #endif
549                 );
550     Bool (* ChangeBufferAttributes)(    /* pMBBuffer, vmask */
551 #if NeedNestedPrototypes
552                 /* FIXME */
553 #endif
554                 );
555     void (* DeleteBufferDrawable)(
556 #if NeedNestedPrototypes
557                 DrawablePtr             /* pDrawable */
558 #endif
559                 );
560     void (* WrapScreenFuncs)(
561 #if NeedNestedPrototypes
562                 ScreenPtr               /* pScreen */
563 #endif
564                 );
565     void (* ResetProc)(
566 #if NeedNestedPrototypes
567                 ScreenPtr               /* pScreen */
568 #endif
569                 );
570     DevUnion    devPrivate;
571 } mbufScreenRec, *mbufScreenPtr;
572
573
574 /* Privates to mbufScreenRec */
575
576 #ifdef _MULTIBUF_PIXMAP_
577 #define MB_SCREEN_PRIV_PIXMAP(pScreen) \
578     ((mbufPixmapPrivPtr) MB_SCREEN_PRIV((pScreen))->devPrivate.ptr)
579
580 typedef struct _mbufPixmapPriv
581 {
582     /* Pointers to wrapped functions */
583     PositionWindowProcPtr PositionWindow;               /* pWin, x,y */
584     long funcsWrapped;                  /* flags which functions are wrapped */
585 } mbufPixmapPrivRec, *mbufPixmapPrivPtr;
586 #endif /* _MULTIBUF_PIXMAP_ */
587
588
589 #ifdef _MULTIBUF_BUFFER_
590
591 extern int frameWindowPrivateIndex;
592
593 #define MB_SCREEN_PRIV_BUFFER(pScreen) \
594     ((mbufBufferPrivPtr) MB_SCREEN_PRIV((pScreen))->devPrivate.ptr)
595
596 typedef struct _mbufBufferPriv
597 {
598     DevUnion    *frameBuffer;   /* Array of screen framebuffers */
599     DevUnion    selectPlane;    /* Plane(s) that select displayed buffer */
600
601     /* 
602      * Note: subtractRgn and unionRgn may overlap. subtractRgn is a union
603      * of all the old clipLists of the windows that are displaying
604      * the backbuffer. unionRgn is the union of all the new clipLists
605      * of the same windows.
606      */
607
608     RegionRec   backBuffer;     /* Area of screen displaying back buffer */
609     RegionRec   subtractRgn;    /* Regions lost to backBuffer   */
610     RegionRec   unionRgn;       /* Regions gained by backBuffer */
611     Bool        rgnChanged;     /* TRUE if "backBuffer" needs to be updated */
612
613     void (* CopyBufferBits)();  /* pMBWindow, srcBufferNum, dstBufferNum */
614     void (* DrawSelectPlane)(); /* pScreen, selectPlane, pRegion, bufferNum */
615
616     /* Pointers to wrapped functions */
617     PostValidateTreeProcPtr     PostValidateTree; /* pParent, pChild, kind */
618     ClipNotifyProcPtr           ClipNotify;       /* pWin, dx, dy */
619     WindowExposuresProcPtr      WindowExposures;  /* pWin, pRegion */
620     CopyWindowProcPtr           CopyWindow;       /* pWin, oldPt, pOldRegion */
621     ClearToBackgroundProcPtr    ClearToBackground; /* pWin, x,y,w,h, sendExpose */
622     ChangeWindowAttributesProcPtr ChangeWindowAttributes; /* pWin, vmask */
623     long funcsWrapped;                  /* flags which functions are wrapped */
624     unsigned  inClearToBackground:1;    /* used by WindowExposure */
625 } mbufBufferPrivRec, *mbufBufferPrivPtr;
626 #endif /* _MULTIBUF_BUFFER_ */
627
628 #endif /* _MULTIBUF_SERVER_ */
629 #endif /* _MULTIBUFST_H_ */