Debian Codegraph @

nx-X11/include/extensions/Xdbeproto.h

raw
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
34 #ifndef XDBE_PROTO_H
35 #define XDBE_PROTO_H
36
37 /* INCLUDES */
38
39
40 /* DEFINES */
41
42 /* Values for swap_action field of XdbeSwapInfo structure */
43 #define XdbeUndefined 0
44 #define XdbeBackground 1
45 #define XdbeUntouched 2
46 #define XdbeCopied 3
47
48 #ifdef NEED_DBE_PROTOCOL
49
50 #define DBE_PROTOCOL_NAME "DOUBLE-BUFFER"
51
52 /* Current version numbers */
53 #define DBE_MAJOR_VERSION 1
54 #define DBE_MINOR_VERSION 0
55
56 /* Used when adding extension; also used in Xdbe macros */
57 #define DbeNumberEvents 0
58 #define DbeBadBuffer 0
59 #define DbeNumberErrors (DbeBadBuffer + 1)
60
61 /* Request values used in (S)ProcDbeDispatch() */
62 #define X_DbeGetVersion 0
63 #define X_DbeAllocateBackBufferName 1
64 #define X_DbeDeallocateBackBufferName 2
65 #define X_DbeSwapBuffers 3
66 #define X_DbeBeginIdiom 4
67 #define X_DbeEndIdiom 5
68 #define X_DbeGetVisualInfo 6
69 #define X_DbeGetBackBufferAttributes 7
70
71 typedef CARD8 xDbeSwapAction;
72 typedef CARD32 xDbeBackBuffer;
73
74 #endif /* NEED_DBE_PROTOCOL */
75
76
77 /* TYPEDEFS */
78
79 /* Client data types */
80
81 /* XdbeVisualInfo and XdbeScreenVisualInfo are defined in this file,
82 * "Xdbeproto.h", rather than "Xdbe.h" because the server uses these data
83 * types.
84 */
85
86 typedef struct
87 {
88 VisualID visual; /* one visual ID that supports double-buffering */
89 int depth; /* depth of visual in bits */
90 int perflevel; /* performance level of visual */
91 }
92 XdbeVisualInfo;
93
94 typedef struct
95 {
96 int count; /* number of items in visual_depth */
97 XdbeVisualInfo *visinfo; /* list of visuals & depths for scrn */
98 }
99 XdbeScreenVisualInfo;
100
101 /* Protocol data types */
102
103 #ifdef NEED_DBE_PROTOCOL
104
105 typedef struct
106 {
107 CARD32 window B32; /* window */
108 xDbeSwapAction swapAction; /* swap action */
109 CARD8 pad1; /* unused */
110 CARD16 pad2 B16;
111
112 } xDbeSwapInfo;
113
114 typedef struct
115 {
116 CARD32 visualID B32; /* associated visual */
117 CARD8 depth; /* depth of visual */
118 CARD8 perfLevel; /* performance level hint */
119 CARD16 pad1 B16;
120
121 } xDbeVisInfo;
122 #define sz_xDbeVisInfo 8
123
124 typedef struct
125 {
126 CARD32 n B32; /* number of visual info items in list */
127
128 } xDbeScreenVisInfo; /* followed by n xDbeVisInfo items */
129
130 typedef struct
131 {
132 CARD32 window B32; /* window */
133
134 } xDbeBufferAttributes;
135
136
137 /* Requests and replies */
138
139 typedef struct
140 {
141 CARD8 reqType; /* major-opcode: always codes->major_opcode */
142 CARD8 dbeReqType; /* minor-opcode: always X_DbeGetVersion (0) */
143 CARD16 length B16; /* request length: (2) */
144 CARD8 majorVersion; /* client-major-version */
145 CARD8 minorVersion; /* client-minor-version */
146 CARD16 unused B16; /* unused */
147
148 } xDbeGetVersionReq;
149 #define sz_xDbeGetVersionReq 8
150
151 typedef struct
152 {
153 BYTE type; /* Reply: X_Reply (1) */
154 CARD8 unused; /* unused */
155 CARD16 sequenceNumber B16; /* sequence number */
156 CARD32 length B32; /* reply length: (0) */
157 CARD8 majorVersion; /* server-major-version */
158 CARD8 minorVersion; /* server-minor-version */
159 CARD16 pad1 B16; /* unused */
160 CARD32 pad2 B32;
161 CARD32 pad3 B32;
162 CARD32 pad4 B32;
163 CARD32 pad5 B32;
164 CARD32 pad6 B32;
165
166 } xDbeGetVersionReply;
167 #define sz_xDbeGetVersionReply 32
168
169 typedef struct
170 {
171 CARD8 reqType; /* major-opcode: codes->major_opcode */
172 CARD8 dbeReqType; /* X_DbeAllocateBackBufferName (1) */
173 CARD16 length B16; /* request length: (4) */
174 CARD32 window B32; /* window */
175 xDbeBackBuffer buffer B32; /* back buffer name */
176 xDbeSwapAction swapAction; /* swap action hint */
177 CARD8 pad1; /* unused */
178 CARD16 pad2 B16;
179
180 } xDbeAllocateBackBufferNameReq;
181 #define sz_xDbeAllocateBackBufferNameReq 16
182
183 typedef struct
184 {
185 CARD8 reqType; /* major-opcode: codes->major_opcode */
186 CARD8 dbeReqType; /* X_DbeDeallocateBackBufferName (2) */
187 CARD16 length B16; /* request length: (2) */
188 xDbeBackBuffer buffer B32; /* back buffer name */
189
190 } xDbeDeallocateBackBufferNameReq;
191 #define sz_xDbeDeallocateBackBufferNameReq 8
192
193 typedef struct
194 {
195 CARD8 reqType; /* major-opcode: always codes->major_opcode */
196 CARD8 dbeReqType; /* minor-opcode: always X_DbeSwapBuffers (3) */
197 CARD16 length B16; /* request length: (2+2n) */
198 CARD32 n B32; /* n, number of window/swap action pairs */
199
200 } xDbeSwapBuffersReq; /* followed by n window/swap action pairs */
201 #define sz_xDbeSwapBuffersReq 8
202
203 typedef struct
204 {
205 CARD8 reqType; /* major-opcode: always codes->major_opcode */
206 CARD8 dbeReqType; /* minor-opcode: always X_DbeBeginIdom (4) */
207 CARD16 length B16; /* request length: (1) */
208
209 } xDbeBeginIdiomReq;
210 #define sz_xDbeBeginIdiomReq 4
211
212 typedef struct
213 {
214 CARD8 reqType; /* major-opcode: always codes->major_opcode */
215 CARD8 dbeReqType; /* minor-opcode: always X_DbeEndIdom (5) */
216 CARD16 length B16; /* request length: (1) */
217
218 } xDbeEndIdiomReq;
219 #define sz_xDbeEndIdiomReq 4
220
221 typedef struct
222 {
223 CARD8 reqType; /* always codes->major_opcode */
224 CARD8 dbeReqType; /* always X_DbeGetVisualInfo (6) */
225 CARD16 length B16; /* request length: (2+n) */
226 CARD32 n B32; /* n, number of drawables in list */
227
228 } xDbeGetVisualInfoReq; /* followed by n drawables */
229 #define sz_xDbeGetVisualInfoReq 8
230
231 typedef struct
232 {
233 BYTE type; /* Reply: X_Reply (1) */
234 CARD8 unused; /* unused */
235 CARD16 sequenceNumber B16; /* sequence number */
236 CARD32 length B32; /* reply length */
237 CARD32 m; /* m, number of visual infos in list */
238 CARD32 pad1 B32; /* unused */
239 CARD32 pad2 B32;
240 CARD32 pad3 B32;
241 CARD32 pad4 B32;
242 CARD32 pad5 B32;
243
244 } xDbeGetVisualInfoReply; /* followed by m visual infos */
245 #define sz_xDbeGetVisualInfoReply 32
246
247 typedef struct
248 {
249 CARD8 reqType; /* always codes->major_opcode */
250 CARD8 dbeReqType; /* X_DbeGetBackBufferAttributes (7) */
251 CARD16 length B16; /* request length: (2) */
252 xDbeBackBuffer buffer B32; /* back buffer name */
253
254 } xDbeGetBackBufferAttributesReq;
255 #define sz_xDbeGetBackBufferAttributesReq 8
256
257 typedef struct
258 {
259 BYTE type; /* Reply: X_Reply (1) */
260 CARD8 unused; /* unused */
261 CARD16 sequenceNumber B16; /* sequence number */
262 CARD32 length B32; /* reply length: (0) */
263 CARD32 attributes; /* attributes */
264 CARD32 pad1 B32; /* unused */
265 CARD32 pad2 B32;
266 CARD32 pad3 B32;
267 CARD32 pad4 B32;
268 CARD32 pad5 B32;
269
270 } xDbeGetBackBufferAttributesReply;
271 #define sz_xDbeGetBackBufferAttributesReply 32
272
273 #endif /* NEED_DBE_PROTOCOL */
274
275 #endif /* XDBE_PROTO_H */
276