1/******************************************************************************
2 *
3 * Copyright (c) 1994, 1995  Hewlett-Packard Company
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
22 * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Except as contained in this notice, the name of the Hewlett-Packard
25 * Company shall not be used in advertising or otherwise to promote the
26 * sale, use or other dealings in this Software without prior written
27 * authorization from the Hewlett-Packard Company.
28 *
29 *     Header file for Xlib-related DBE
30 *
31 *****************************************************************************/
32
33#ifndef DBE_PROTO_H
34#define DBE_PROTO_H
35
36#include <X11/extensions/dbe.h>
37
38/* Request values used in (S)ProcDbeDispatch() */
39#define X_DbeGetVersion                 0
40#define X_DbeAllocateBackBufferName     1
41#define X_DbeDeallocateBackBufferName   2
42#define X_DbeSwapBuffers                3
43#define X_DbeBeginIdiom                 4
44#define X_DbeEndIdiom                   5
45#define X_DbeGetVisualInfo              6
46#define X_DbeGetBackBufferAttributes    7
47
48typedef CARD8  xDbeSwapAction;
49typedef CARD32 xDbeBackBuffer;
50
51/* TYPEDEFS */
52
53/* Protocol data types */
54
55typedef struct
56{
57    CARD32		window B32;	/* window      */
58    xDbeSwapAction	swapAction;	/* swap action */
59    CARD8		pad1;		/* unused      */
60    CARD16		pad2 B16;
61
62} xDbeSwapInfo;
63
64typedef struct
65{
66    CARD32	visualID B32;	/* associated visual      */
67    CARD8	depth;		/* depth of visual        */
68    CARD8	perfLevel;	/* performance level hint */
69    CARD16	pad1 B16;
70
71} xDbeVisInfo;
72#define sz_xDbeVisInfo	8
73
74typedef struct
75{
76    CARD32	n B32;	/* number of visual info items in list  */
77
78} xDbeScreenVisInfo;	/* followed by n xDbeVisInfo items */
79
80typedef struct
81{
82    CARD32	window B32;	/* window */
83
84} xDbeBufferAttributes;
85
86
87/* Requests and replies */
88
89typedef struct
90{
91    CARD8	reqType;	/* major-opcode: always codes->major_opcode */
92    CARD8	dbeReqType;	/* minor-opcode: always X_DbeGetVersion (0) */
93    CARD16	length B16;	/* request length: (2)                      */
94    CARD8	majorVersion;	/* client-major-version                     */
95    CARD8	minorVersion;	/* client-minor-version                     */
96    CARD16	unused B16;	/* unused                                   */
97
98} xDbeGetVersionReq;
99#define sz_xDbeGetVersionReq	8
100
101typedef struct
102{
103    BYTE	type;			/* Reply: X_Reply (1)   */
104    CARD8	unused;			/* unused               */
105    CARD16	sequenceNumber B16;	/* sequence number      */
106    CARD32	length B32;		/* reply length: (0)    */
107    CARD8	majorVersion;		/* server-major-version */
108    CARD8	minorVersion;		/* server-minor-version */
109    CARD16	pad1 B16;		/* unused               */
110    CARD32	pad2 B32;
111    CARD32	pad3 B32;
112    CARD32	pad4 B32;
113    CARD32	pad5 B32;
114    CARD32	pad6 B32;
115
116} xDbeGetVersionReply;
117#define sz_xDbeGetVersionReply	32
118
119typedef struct
120{
121    CARD8		reqType;	/* major-opcode: codes->major_opcode */
122    CARD8		dbeReqType;	/* X_DbeAllocateBackBufferName (1)   */
123    CARD16		length B16;	/* request length: (4)               */
124    CARD32		window B32;	/* window                            */
125    xDbeBackBuffer	buffer B32;	/* back buffer name                  */
126    xDbeSwapAction	swapAction;	/* swap action hint                  */
127    CARD8		pad1;		/* unused                            */
128    CARD16		pad2 B16;
129
130} xDbeAllocateBackBufferNameReq;
131#define sz_xDbeAllocateBackBufferNameReq	16
132
133typedef struct
134{
135    CARD8		reqType;	/* major-opcode: codes->major_opcode */
136    CARD8		dbeReqType;	/* X_DbeDeallocateBackBufferName (2) */
137    CARD16		length B16;	/* request length: (2)               */
138    xDbeBackBuffer	buffer B32;	/* back buffer name                  */
139
140} xDbeDeallocateBackBufferNameReq;
141#define sz_xDbeDeallocateBackBufferNameReq	8
142
143typedef struct
144{
145    CARD8	reqType;	/* major-opcode: always codes->major_opcode  */
146    CARD8	dbeReqType;	/* minor-opcode: always X_DbeSwapBuffers (3) */
147    CARD16	length B16;	/* request length: (2+2n)                    */
148    CARD32	n B32;		/* n, number of window/swap action pairs     */
149
150} xDbeSwapBuffersReq;		/* followed by n window/swap action pairs    */
151#define sz_xDbeSwapBuffersReq	8
152
153typedef struct
154{
155    CARD8	reqType;	/* major-opcode: always codes->major_opcode */
156    CARD8	dbeReqType;	/* minor-opcode: always X_DbeBeginIdom (4)  */
157    CARD16	length B16;	/* request length: (1)                      */
158
159} xDbeBeginIdiomReq;
160#define sz_xDbeBeginIdiomReq	4
161
162typedef struct
163{
164    CARD8	reqType;	/* major-opcode: always codes->major_opcode */
165    CARD8	dbeReqType;	/* minor-opcode: always X_DbeEndIdom (5)    */
166    CARD16	length B16;	/* request length: (1)                      */
167
168} xDbeEndIdiomReq;
169#define sz_xDbeEndIdiomReq	4
170
171typedef struct
172{
173    CARD8	reqType;	/* always codes->major_opcode     */
174    CARD8	dbeReqType;	/* always X_DbeGetVisualInfo (6)  */
175    CARD16	length B16;	/* request length: (2+n)          */
176    CARD32	n B32;		/* n, number of drawables in list */
177
178} xDbeGetVisualInfoReq;		/* followed by n drawables        */
179#define sz_xDbeGetVisualInfoReq	8
180
181typedef struct
182{
183    BYTE	type;			/* Reply: X_Reply (1)                */
184    CARD8	unused;			/* unused                            */
185    CARD16	sequenceNumber B16;	/* sequence number                   */
186    CARD32	length B32;		/* reply length                      */
187    CARD32	m;			/* m, number of visual infos in list */
188    CARD32	pad1 B32;		/* unused                            */
189    CARD32	pad2 B32;
190    CARD32	pad3 B32;
191    CARD32	pad4 B32;
192    CARD32	pad5 B32;
193
194} xDbeGetVisualInfoReply;		/* followed by m visual infos        */
195#define sz_xDbeGetVisualInfoReply	32
196
197typedef struct
198{
199    CARD8		reqType;	/* always codes->major_opcode       */
200    CARD8		dbeReqType;	/* X_DbeGetBackBufferAttributes (7) */
201    CARD16		length B16;	/* request length: (2)              */
202    xDbeBackBuffer	buffer B32;	/* back buffer name                 */
203
204} xDbeGetBackBufferAttributesReq;
205#define sz_xDbeGetBackBufferAttributesReq	8
206
207typedef struct
208{
209    BYTE	type;			/* Reply: X_Reply (1) */
210    CARD8	unused;			/* unused             */
211    CARD16	sequenceNumber B16;	/* sequence number    */
212    CARD32	length B32;		/* reply length: (0)  */
213    CARD32	attributes;		/* attributes         */
214    CARD32	pad1 B32;		/* unused             */
215    CARD32	pad2 B32;
216    CARD32	pad3 B32;
217    CARD32	pad4 B32;
218    CARD32	pad5 B32;
219
220} xDbeGetBackBufferAttributesReply;
221#define sz_xDbeGetBackBufferAttributesReply	32
222
223#endif /* DBE_PROTO_H */
224
225