1 /* $Xorg: Xdbeproto.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
2 /******************************************************************************
4 * Copyright (c) 1994, 1995 Hewlett-Packard Company
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
23 * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 * Except as contained in this notice, the name of the Hewlett-Packard
26 * Company shall not be used in advertising or otherwise to promote the
27 * sale, use or other dealings in this Software without prior written
28 * authorization from the Hewlett-Packard Company.
30 * Header file for Xlib-related DBE
32 *****************************************************************************/
43 /* Values for swap_action field of XdbeSwapInfo structure */
44 #define XdbeUndefined 0
45 #define XdbeBackground 1
46 #define XdbeUntouched 2
49 #ifdef NEED_DBE_PROTOCOL
51 #define DBE_PROTOCOL_NAME "DOUBLE-BUFFER"
53 /* Current version numbers */
54 #define DBE_MAJOR_VERSION 1
55 #define DBE_MINOR_VERSION 0
57 /* Used when adding extension; also used in Xdbe macros */
58 #define DbeNumberEvents 0
59 #define DbeBadBuffer 0
60 #define DbeNumberErrors (DbeBadBuffer + 1)
62 /* Request values used in (S)ProcDbeDispatch() */
63 #define X_DbeGetVersion 0
64 #define X_DbeAllocateBackBufferName 1
65 #define X_DbeDeallocateBackBufferName 2
66 #define X_DbeSwapBuffers 3
67 #define X_DbeBeginIdiom 4
68 #define X_DbeEndIdiom 5
69 #define X_DbeGetVisualInfo 6
70 #define X_DbeGetBackBufferAttributes 7
72 typedef CARD8 xDbeSwapAction;
73 typedef CARD32 xDbeBackBuffer;
75 #endif /* NEED_DBE_PROTOCOL */
80 /* Client data types */
82 /* XdbeVisualInfo and XdbeScreenVisualInfo are defined in this file,
83 * "Xdbeproto.h", rather than "Xdbe.h" because the server uses these data
89 VisualID visual; /* one visual ID that supports double-buffering */
90 int depth; /* depth of visual in bits */
91 int perflevel; /* performance level of visual */
97 int count; /* number of items in visual_depth */
98 XdbeVisualInfo *visinfo; /* list of visuals & depths for scrn */
100 XdbeScreenVisualInfo;
102 /* Protocol data types */
104 #ifdef NEED_DBE_PROTOCOL
108 CARD32 window B32; /* window */
109 xDbeSwapAction swapAction; /* swap action */
110 CARD8 pad1; /* unused */
117 CARD32 visualID B32; /* associated visual */
118 CARD8 depth; /* depth of visual */
119 CARD8 perfLevel; /* performance level hint */
123 #define sz_xDbeVisInfo 8
127 CARD32 n B32; /* number of visual info items in list */
129 } xDbeScreenVisInfo; /* followed by n xDbeVisInfo items */
133 CARD32 window B32; /* window */
135 } xDbeBufferAttributes;
138 /* Requests and replies */
142 CARD8 reqType; /* major-opcode: always codes->major_opcode */
143 CARD8 dbeReqType; /* minor-opcode: always X_DbeGetVersion (0) */
144 CARD16 length B16; /* request length: (2) */
145 CARD8 majorVersion; /* client-major-version */
146 CARD8 minorVersion; /* client-minor-version */
147 CARD16 unused B16; /* unused */
150 #define sz_xDbeGetVersionReq 8
154 BYTE type; /* Reply: X_Reply (1) */
155 CARD8 unused; /* unused */
156 CARD16 sequenceNumber B16; /* sequence number */
157 CARD32 length B32; /* reply length: (0) */
158 CARD8 majorVersion; /* server-major-version */
159 CARD8 minorVersion; /* server-minor-version */
160 CARD16 pad1 B16; /* unused */
167 } xDbeGetVersionReply;
168 #define sz_xDbeGetVersionReply 32
172 CARD8 reqType; /* major-opcode: codes->major_opcode */
173 CARD8 dbeReqType; /* X_DbeAllocateBackBufferName (1) */
174 CARD16 length B16; /* request length: (4) */
175 CARD32 window B32; /* window */
176 xDbeBackBuffer buffer B32; /* back buffer name */
177 xDbeSwapAction swapAction; /* swap action hint */
178 CARD8 pad1; /* unused */
181 } xDbeAllocateBackBufferNameReq;
182 #define sz_xDbeAllocateBackBufferNameReq 16
186 CARD8 reqType; /* major-opcode: codes->major_opcode */
187 CARD8 dbeReqType; /* X_DbeDeallocateBackBufferName (2) */
188 CARD16 length B16; /* request length: (2) */
189 xDbeBackBuffer buffer B32; /* back buffer name */
191 } xDbeDeallocateBackBufferNameReq;
192 #define sz_xDbeDeallocateBackBufferNameReq 8
196 CARD8 reqType; /* major-opcode: always codes->major_opcode */
197 CARD8 dbeReqType; /* minor-opcode: always X_DbeSwapBuffers (3) */
198 CARD16 length B16; /* request length: (2+2n) */
199 CARD32 n B32; /* n, number of window/swap action pairs */
201 } xDbeSwapBuffersReq; /* followed by n window/swap action pairs */
202 #define sz_xDbeSwapBuffersReq 8
206 CARD8 reqType; /* major-opcode: always codes->major_opcode */
207 CARD8 dbeReqType; /* minor-opcode: always X_DbeBeginIdom (4) */
208 CARD16 length B16; /* request length: (1) */
211 #define sz_xDbeBeginIdiomReq 4
215 CARD8 reqType; /* major-opcode: always codes->major_opcode */
216 CARD8 dbeReqType; /* minor-opcode: always X_DbeEndIdom (5) */
217 CARD16 length B16; /* request length: (1) */
220 #define sz_xDbeEndIdiomReq 4
224 CARD8 reqType; /* always codes->major_opcode */
225 CARD8 dbeReqType; /* always X_DbeGetVisualInfo (6) */
226 CARD16 length B16; /* request length: (2+n) */
227 CARD32 n B32; /* n, number of drawables in list */
229 } xDbeGetVisualInfoReq; /* followed by n drawables */
230 #define sz_xDbeGetVisualInfoReq 8
234 BYTE type; /* Reply: X_Reply (1) */
235 CARD8 unused; /* unused */
236 CARD16 sequenceNumber B16; /* sequence number */
237 CARD32 length B32; /* reply length */
238 CARD32 m; /* m, number of visual infos in list */
239 CARD32 pad1 B32; /* unused */
245 } xDbeGetVisualInfoReply; /* followed by m visual infos */
246 #define sz_xDbeGetVisualInfoReply 32
250 CARD8 reqType; /* always codes->major_opcode */
251 CARD8 dbeReqType; /* X_DbeGetBackBufferAttributes (7) */
252 CARD16 length B16; /* request length: (2) */
253 xDbeBackBuffer buffer B32; /* back buffer name */
255 } xDbeGetBackBufferAttributesReq;
256 #define sz_xDbeGetBackBufferAttributesReq 8
260 BYTE type; /* Reply: X_Reply (1) */
261 CARD8 unused; /* unused */
262 CARD16 sequenceNumber B16; /* sequence number */
263 CARD32 length B32; /* reply length: (0) */
264 CARD32 attributes; /* attributes */
265 CARD32 pad1 B32; /* unused */
271 } xDbeGetBackBufferAttributesReply;
272 #define sz_xDbeGetBackBufferAttributesReply 32
274 #endif /* NEED_DBE_PROTOCOL */
276 #endif /* XDBE_PROTO_H */