117ca54c3Smrg/*
217ca54c3SmrgCopyright 1989, 1998  The Open Group
317ca54c3Smrg
417ca54c3SmrgPermission to use, copy, modify, distribute, and sell this software and its
517ca54c3Smrgdocumentation for any purpose is hereby granted without fee, provided that
617ca54c3Smrgthe above copyright notice appear in all copies and that both that
717ca54c3Smrgcopyright notice and this permission notice appear in supporting
817ca54c3Smrgdocumentation.
917ca54c3Smrg
1017ca54c3SmrgThe above copyright notice and this permission notice shall be included in
1117ca54c3Smrgall copies or substantial portions of the Software.
1217ca54c3Smrg
1317ca54c3SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1417ca54c3SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1517ca54c3SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
1617ca54c3SmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
1717ca54c3SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1817ca54c3SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1917ca54c3Smrg
2017ca54c3SmrgExcept as contained in this notice, the name of The Open Group shall not be
2117ca54c3Smrgused in advertising or otherwise to promote the sale, use or other dealings
2217ca54c3Smrgin this Software without prior written authorization from The Open Group.
2317ca54c3Smrg */
2417ca54c3Smrg
2517ca54c3Smrg#ifndef _MULTIBUFPROTO_H_
2617ca54c3Smrg#define _MULTIBUFPROTO_H_
2717ca54c3Smrg
2817ca54c3Smrg#include <X11/extensions/multibufconst.h>
2917ca54c3Smrg
3017ca54c3Smrg/*
3117ca54c3Smrg * Protocol requests constants and alignment values
3217ca54c3Smrg */
3317ca54c3Smrg
3417ca54c3Smrg#define Window CARD32
3517ca54c3Smrg#define Drawable CARD32
3617ca54c3Smrg#define VisualID CARD32
3717ca54c3Smrg#define Multibuffer CARD32
3817ca54c3Smrg
3917ca54c3Smrg#define X_MbufGetBufferVersion		0
4017ca54c3Smrg#define X_MbufCreateImageBuffers	1
4117ca54c3Smrg#define X_MbufDestroyImageBuffers	2
4217ca54c3Smrg#define X_MbufDisplayImageBuffers	3
4317ca54c3Smrg#define X_MbufSetMBufferAttributes	4
4417ca54c3Smrg#define X_MbufGetMBufferAttributes	5
4517ca54c3Smrg#define X_MbufSetBufferAttributes	6
4617ca54c3Smrg#define X_MbufGetBufferAttributes	7
4717ca54c3Smrg#define X_MbufGetBufferInfo		8
4817ca54c3Smrg#define X_MbufCreateStereoWindow	9
4917ca54c3Smrg#define X_MbufClearImageBufferArea	10
5017ca54c3Smrg
5117ca54c3Smrg
5217ca54c3Smrgtypedef struct xMbufBufferInfo {
53ea1d6981Smrg	CARD32	visualID;		/* associated visual */
54ea1d6981Smrg	CARD16	maxBuffers;		/* maximum supported buffers */
5517ca54c3Smrg	CARD8	depth;			/* depth of visual (redundant) */
5617ca54c3Smrg	CARD8	unused;
5717ca54c3Smrg} xMbufBufferInfo;
5817ca54c3Smrg#define sz_xMbufBufferInfo 8
5917ca54c3Smrg
6017ca54c3Smrgtypedef struct {
6117ca54c3Smrg    BYTE    type;
6217ca54c3Smrg    BYTE    unused;
63ea1d6981Smrg    CARD16  sequenceNumber;
64ea1d6981Smrg    CARD32  buffer;			/* affected buffer */
6517ca54c3Smrg    BYTE    state;			/* current status */
6617ca54c3Smrg    CARD8   unused1;
67ea1d6981Smrg    CARD16  unused2;
68ea1d6981Smrg    CARD32  unused3;
69ea1d6981Smrg    CARD32  unused4;
70ea1d6981Smrg    CARD32  unused5;
71ea1d6981Smrg    CARD32  unused6;
72ea1d6981Smrg    CARD32  unused7;
7317ca54c3Smrg} xMbufClobberNotifyEvent;
7417ca54c3Smrg
7517ca54c3Smrgtypedef struct {
7617ca54c3Smrg    BYTE    type;
7717ca54c3Smrg    BYTE    unused;
78ea1d6981Smrg    CARD16  sequenceNumber;
79ea1d6981Smrg    CARD32  buffer;			/* affected buffer */
80ea1d6981Smrg    CARD32  timeStamp;			/* update time */
81ea1d6981Smrg    CARD32  unused1;
82ea1d6981Smrg    CARD32  unused2;
83ea1d6981Smrg    CARD32  unused3;
84ea1d6981Smrg    CARD32  unused4;
85ea1d6981Smrg    CARD32  unused5;
86ea1d6981Smrg    CARD32  unused6;
8717ca54c3Smrg} xMbufUpdateNotifyEvent;
8817ca54c3Smrg
8917ca54c3Smrgtypedef struct {
9017ca54c3Smrg    CARD8	reqType;		/* always codes->major_opcode */
9117ca54c3Smrg    CARD8	mbufReqType;		/* always X_MbufGetBufferVersion */
92ea1d6981Smrg    CARD16	length;
9317ca54c3Smrg} xMbufGetBufferVersionReq;
9417ca54c3Smrg#define sz_xMbufGetBufferVersionReq	4
9517ca54c3Smrg
9617ca54c3Smrgtypedef struct {
9717ca54c3Smrg    BYTE	type;			/* X_Reply */
9817ca54c3Smrg    CARD8	unused;			/* not used */
99ea1d6981Smrg    CARD16	sequenceNumber;
100ea1d6981Smrg    CARD32	length;
10117ca54c3Smrg    CARD8	majorVersion;	/* major version of Multi-Buffering protocol */
10217ca54c3Smrg    CARD8	minorVersion;	/* minor version of Multi-Buffering protocol */
103ea1d6981Smrg    CARD16	pad1;
104ea1d6981Smrg    CARD32	pad2;
105ea1d6981Smrg    CARD32	pad3;
106ea1d6981Smrg    CARD32	pad4;
107ea1d6981Smrg    CARD32	pad5;
108ea1d6981Smrg    CARD32	pad6;
10917ca54c3Smrg} xMbufGetBufferVersionReply;
11017ca54c3Smrg#define sz_xMbufGetBufferVersionReply	32
11117ca54c3Smrg
11217ca54c3Smrgtypedef struct {
11317ca54c3Smrg    CARD8	reqType;	/* always codes->major_opcode */
11417ca54c3Smrg    CARD8	mbufReqType;	/* always X_MbufCreateImageBuffers */
115ea1d6981Smrg    CARD16	length;
116ea1d6981Smrg    CARD32	window; 	/* associated window */
11717ca54c3Smrg    CARD8	updateAction;	/* action at update */
11817ca54c3Smrg    CARD8	updateHint;	/* hint as to frequency of updates */
11917ca54c3Smrg    CARD16	unused;
12017ca54c3Smrg} xMbufCreateImageBuffersReq;	/* followed by buffer ids */
12117ca54c3Smrg#define sz_xMbufCreateImageBuffersReq	12
12217ca54c3Smrg
12317ca54c3Smrgtypedef struct {
12417ca54c3Smrg    BYTE	type;			/* X_Reply */
12517ca54c3Smrg    CARD8	unused;			/* not used */
126ea1d6981Smrg    CARD16	sequenceNumber;
127ea1d6981Smrg    CARD32	length;
128ea1d6981Smrg    CARD16	numberBuffer;		/* number successfully allocated */
129ea1d6981Smrg    CARD16	unused1;
130ea1d6981Smrg    CARD32	unused2;
131ea1d6981Smrg    CARD32	unused3;
132ea1d6981Smrg    CARD32	unused4;
133ea1d6981Smrg    CARD32	unused5;
134ea1d6981Smrg    CARD32	unused6;
13517ca54c3Smrg} xMbufCreateImageBuffersReply;
13617ca54c3Smrg#define sz_xMbufCreateImageBuffersReply 32
13717ca54c3Smrg
13817ca54c3Smrgtypedef struct {
13917ca54c3Smrg    CARD8	reqType;	/* always codes->major_opcode */
14017ca54c3Smrg    CARD8	mbufReqType;	/* always X_MbufDestroyImageBuffers */
141ea1d6981Smrg    CARD16	length;
142ea1d6981Smrg    CARD32	window; 	/* associated window */
14317ca54c3Smrg} xMbufDestroyImageBuffersReq;
14417ca54c3Smrg#define sz_xMbufDestroyImageBuffersReq	8
14517ca54c3Smrg
14617ca54c3Smrgtypedef struct {
14717ca54c3Smrg    CARD8	reqType;	/* always codes->major_opcode */
14817ca54c3Smrg    CARD8	mbufReqType;	/* always X_MbufDisplayImageBuffers */
149ea1d6981Smrg    CARD16	length;
150ea1d6981Smrg    CARD16	minDelay;	/* minimum time between last update and now */
151ea1d6981Smrg    CARD16	maxDelay;	/* maximum time between last update and now */
15217ca54c3Smrg} xMbufDisplayImageBuffersReq;	/* followed by list of buffers */
15317ca54c3Smrg#define sz_xMbufDisplayImageBuffersReq	8
15417ca54c3Smrg
15517ca54c3Smrgtypedef struct {
15617ca54c3Smrg    CARD8	reqType;	/* always codes->major_opcode */
15717ca54c3Smrg    CARD8	mbufReqType;	/* always X_MbufSetMBufferAttributes */
158ea1d6981Smrg    CARD16	length;
159ea1d6981Smrg    CARD32	window; 	/* associated window */
160ea1d6981Smrg    CARD32	valueMask;	/* modified entries */
16117ca54c3Smrg} xMbufSetMBufferAttributesReq;	/* followed by values */
16217ca54c3Smrg#define sz_xMbufSetMBufferAttributesReq 12
16317ca54c3Smrg
16417ca54c3Smrgtypedef struct {
16517ca54c3Smrg    CARD8	reqType;	/* always codes->major_opcode */
16617ca54c3Smrg    CARD8	mbufReqType;	/* always X_MbufGetMBufferAttributes */
167ea1d6981Smrg    CARD16	length;
168ea1d6981Smrg    CARD32	window; 	/* associated window */
16917ca54c3Smrg} xMbufGetMBufferAttributesReq;
17017ca54c3Smrg#define sz_xMbufGetMBufferAttributesReq 8
17117ca54c3Smrg
17217ca54c3Smrgtypedef struct {
17317ca54c3Smrg    BYTE	type;			/* X_Reply */
17417ca54c3Smrg    CARD8	unused;			/* not used */
175ea1d6981Smrg    CARD16	sequenceNumber;
176ea1d6981Smrg    CARD32	length;
177ea1d6981Smrg    CARD16	displayedBuffer;	/* currently visible buffer */
17817ca54c3Smrg    CARD8	updateAction;
17917ca54c3Smrg    CARD8	updateHint;
18017ca54c3Smrg    CARD8	windowMode;
18117ca54c3Smrg    CARD8	unused0;
182ea1d6981Smrg    CARD16	unused1;
183ea1d6981Smrg    CARD32	unused2;
184ea1d6981Smrg    CARD32	unused3;
185ea1d6981Smrg    CARD32	unused4;
186ea1d6981Smrg    CARD32	unused5;
18717ca54c3Smrg} xMbufGetMBufferAttributesReply;
18817ca54c3Smrg#define sz_xMbufGetMBufferAttributesReply 32
18917ca54c3Smrg
19017ca54c3Smrgtypedef struct {
19117ca54c3Smrg    CARD8	reqType;	/* always codes->major_opcode */
19217ca54c3Smrg    CARD8	mbufReqType;	/* always X_MbufSetBufferAttributes */
193ea1d6981Smrg    CARD16	length;
194ea1d6981Smrg    CARD32	buffer;
195ea1d6981Smrg    CARD32	valueMask;
19617ca54c3Smrg} xMbufSetBufferAttributesReq;	/* followed by values */
19717ca54c3Smrg#define sz_xMbufSetBufferAttributesReq 12
19817ca54c3Smrg
19917ca54c3Smrgtypedef struct {
20017ca54c3Smrg    CARD8	reqType;	/* always codes->major_opcode */
20117ca54c3Smrg    CARD8	mbufReqType;	/* always X_MbufGetBufferAttributes */
202ea1d6981Smrg    CARD16	length;
203ea1d6981Smrg    CARD32	buffer;
20417ca54c3Smrg} xMbufGetBufferAttributesReq;
20517ca54c3Smrg#define sz_xMbufGetBufferAttributesReq 8
20617ca54c3Smrg
20717ca54c3Smrgtypedef struct {
20817ca54c3Smrg    BYTE	type;			/* X_Reply */
20917ca54c3Smrg    CARD8	unused;			/* not used */
210ea1d6981Smrg    CARD16	sequenceNumber;
211ea1d6981Smrg    CARD32	length;
212ea1d6981Smrg    CARD32	window;
213ea1d6981Smrg    CARD32	eventMask;
214ea1d6981Smrg    CARD16	bufferIndex;
21517ca54c3Smrg    CARD8	side;
21617ca54c3Smrg    CARD8	unused0;
217ea1d6981Smrg    CARD32	unused1;
218ea1d6981Smrg    CARD32	unused2;
219ea1d6981Smrg    CARD32	unused3;
22017ca54c3Smrg} xMbufGetBufferAttributesReply;
22117ca54c3Smrg#define sz_xMbufGetBufferAttributesReply 32
22217ca54c3Smrg
22317ca54c3Smrgtypedef struct {
22417ca54c3Smrg    CARD8	reqType;	/* always codes->major_opcode */
22517ca54c3Smrg    CARD8	mbufReqType;	/* always X_MbufGetBufferInfo */
226ea1d6981Smrg    CARD16	length;
227ea1d6981Smrg    Drawable	drawable;
22817ca54c3Smrg} xMbufGetBufferInfoReq;
22917ca54c3Smrg#define sz_xMbufGetBufferInfoReq 8
23017ca54c3Smrg
23117ca54c3Smrgtypedef struct {
23217ca54c3Smrg    BYTE	type;			/* X_Reply */
23317ca54c3Smrg    CARD8	unused;			/* not used */
234ea1d6981Smrg    CARD16	sequenceNumber;
235ea1d6981Smrg    CARD32	length;
236ea1d6981Smrg    CARD16	normalInfo;
237ea1d6981Smrg    CARD16	stereoInfo;
238ea1d6981Smrg    CARD32	unused1;
239ea1d6981Smrg    CARD32	unused2;
240ea1d6981Smrg    CARD32	unused3;
241ea1d6981Smrg    CARD32	unused4;
242ea1d6981Smrg    CARD32	unused5;
24317ca54c3Smrg} xMbufGetBufferInfoReply;			/* followed by buffer infos */
24417ca54c3Smrg#define sz_xMbufGetBufferInfoReply 32
24517ca54c3Smrg
24617ca54c3Smrg
24717ca54c3Smrgtypedef struct {
24817ca54c3Smrg    CARD8	reqType;	/* always codes->major_opcode */
24917ca54c3Smrg    CARD8	mbufReqType;	/* always X_MbufCreateStereoWindow */
250ea1d6981Smrg    CARD16	length;
25117ca54c3Smrg    CARD8	unused0;
25217ca54c3Smrg    CARD8	unused1;
25317ca54c3Smrg    CARD8	unused2;
25417ca54c3Smrg    CARD8	depth;
255ea1d6981Smrg    Window	wid;
256ea1d6981Smrg    Window	parent;
257ea1d6981Smrg    Multibuffer	left;		/* associated buffers */
258ea1d6981Smrg    Multibuffer	right;
259ea1d6981Smrg    INT16	x;
260ea1d6981Smrg    INT16	y;
261ea1d6981Smrg    CARD16	width;
262ea1d6981Smrg    CARD16	height;
263ea1d6981Smrg    CARD16	borderWidth;
26417ca54c3Smrg#if defined(__cplusplus) || defined(c_plusplus)
265ea1d6981Smrg    CARD16	c_class;
26617ca54c3Smrg#else
267ea1d6981Smrg    CARD16	class;
26817ca54c3Smrg#endif
269ea1d6981Smrg    VisualID	visual;
270ea1d6981Smrg    CARD32	mask;
27117ca54c3Smrg} xMbufCreateStereoWindowReq;		/* followed by value list */
27217ca54c3Smrg#define sz_xMbufCreateStereoWindowReq 44
27317ca54c3Smrg
27417ca54c3Smrgtypedef struct {
27517ca54c3Smrg    CARD8     reqType;        /* always codes->major_opcode */
27617ca54c3Smrg    CARD8     mbufReqType;    /* always X_MbufClearImageBufferArea */
277ea1d6981Smrg    CARD16    length;
278ea1d6981Smrg    Multibuffer       buffer;
279ea1d6981Smrg    INT16     x;
280ea1d6981Smrg    INT16     y;
281ea1d6981Smrg    CARD16    width;
282ea1d6981Smrg    CARD16    height;
28317ca54c3Smrg    CARD8     unused0;
28417ca54c3Smrg    CARD8     unused1;
28517ca54c3Smrg    CARD8     unused2;
28617ca54c3Smrg    BOOL      exposures;
28717ca54c3Smrg} xMbufClearImageBufferAreaReq;
28817ca54c3Smrg#define sz_xMbufClearImageBufferAreaReq 20
28917ca54c3Smrg
29017ca54c3Smrg#undef Window
29117ca54c3Smrg#undef Drawable
29217ca54c3Smrg#undef VisualID
29317ca54c3Smrg#undef Multibuffer
29417ca54c3Smrg
29517ca54c3Smrg#endif /* _MULTIBUFPROTO_H_ */
296