2 * $XConsortium: multibuf.h,v 1.18 94/04/17 20:11:21 dpw Exp $
3 * $XFree86: xc/include/extensions/multibuf.h,v 3.0 1996/05/06 05:52:38 dawes Exp $
5 Copyright (c) 1989 X Consortium
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:
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
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.
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.
32 #include <X11/Xfuncproto.h>
34 #define MULTIBUFFER_PROTOCOL_NAME "Multi-Buffering"
36 #define MULTIBUFFER_MAJOR_VERSION 1 /* current version numbers */
37 #define MULTIBUFFER_MINOR_VERSION 1 /* has ClearImageBufferArea */
39 #define X_MbufGetBufferVersion 0
40 #define X_MbufCreateImageBuffers 1
41 #define X_MbufDestroyImageBuffers 2
42 #define X_MbufDisplayImageBuffers 3
43 #define X_MbufSetMBufferAttributes 4
44 #define X_MbufGetMBufferAttributes 5
45 #define X_MbufSetBufferAttributes 6
46 #define X_MbufGetBufferAttributes 7
47 #define X_MbufGetBufferInfo 8
48 #define X_MbufCreateStereoWindow 9
49 #define X_MbufClearImageBufferArea 10
54 #define MultibufferUpdateActionUndefined 0
55 #define MultibufferUpdateActionBackground 1
56 #define MultibufferUpdateActionUntouched 2
57 #define MultibufferUpdateActionCopied 3
62 #define MultibufferUpdateHintFrequent 0
63 #define MultibufferUpdateHintIntermittent 1
64 #define MultibufferUpdateHintStatic 2
69 #define MultibufferWindowUpdateHint (1L << 0)
70 #define MultibufferBufferEventMask (1L << 0)
73 * mono vs. stereo and left vs. right
75 #define MultibufferModeMono 0
76 #define MultibufferModeStereo 1
77 #define MultibufferSideMono 0
78 #define MultibufferSideLeft 1
79 #define MultibufferSideRight 2
84 #define MultibufferUnclobbered 0
85 #define MultibufferPartiallyClobbered 1
86 #define MultibufferFullyClobbered 2
91 #define MultibufferClobberNotifyMask 0x02000000
92 #define MultibufferUpdateNotifyMask 0x04000000
94 #define MultibufferClobberNotify 0
95 #define MultibufferUpdateNotify 1
96 #define MultibufferNumberEvents (MultibufferUpdateNotify + 1)
98 #define MultibufferBadBuffer 0
99 #define MultibufferNumberErrors (MultibufferBadBuffer + 1)
102 #ifndef _MULTIBUF_SERVER_
104 * Extra definitions that will only be needed in the client
106 typedef XID Multibuffer;
109 int type; /* of event */
110 unsigned long serial; /* # of last request processed by server */
111 int send_event; /* true if this came frome a SendEvent request */
112 Display *display; /* Display the event was read from */
113 Multibuffer buffer; /* buffer of event */
114 int state; /* see Clobbered constants above */
115 } XmbufClobberNotifyEvent;
118 int type; /* of event */
119 unsigned long serial; /* # of last request processed by server */
120 int send_event; /* true if this came frome a SendEvent request */
121 Display *display; /* Display the event was read from */
122 Multibuffer buffer; /* buffer of event */
123 } XmbufUpdateNotifyEvent;
127 * per-window attributes that can be got
130 int displayed_index; /* which buffer is being displayed */
131 int update_action; /* Undefined, Background, Untouched, Copied */
132 int update_hint; /* Frequent, Intermittent, Static */
133 int window_mode; /* Mono, Stereo */
134 int nbuffers; /* Number of buffers */
135 Multibuffer *buffers; /* Buffers */
136 } XmbufWindowAttributes;
139 * per-window attributes that can be set
142 int update_hint; /* Frequent, Intermittent, Static */
143 } XmbufSetWindowAttributes;
147 * per-buffer attributes that can be got
150 Window window; /* which window this belongs to */
151 unsigned long event_mask; /* events that have been selected */
152 int buffer_index; /* which buffer is this */
153 int side; /* Mono, Left, Right */
154 } XmbufBufferAttributes;
157 * per-buffer attributes that can be set
160 unsigned long event_mask; /* events that have been selected */
161 } XmbufSetBufferAttributes;
165 * per-screen buffer info (there will be lists of them)
168 VisualID visualid; /* visual usuable at this depth */
169 int max_buffers; /* most buffers for this visual */
170 int depth; /* depth of buffers to be created */
175 extern Bool XmbufQueryExtension(
176 #if NeedFunctionPrototypes
178 int* /* event_base_return */,
179 int* /* error_base_return */
183 extern Status XmbufGetVersion(
184 #if NeedFunctionPrototypes
186 int* /* major_version_return */,
187 int* /* minor_version_return */
191 extern int XmbufCreateBuffers(
192 #if NeedFunctionPrototypes
196 int /* update_action */,
197 int /* update_hint */,
198 Multibuffer* /* buffers */
202 extern void XmbufDestroyBuffers(
203 #if NeedFunctionPrototypes
209 extern void XmbufDisplayBuffers(
210 #if NeedFunctionPrototypes
213 Multibuffer* /* buffers */,
219 extern Status XmbufGetWindowAttributes(
220 #if NeedFunctionPrototypes
223 XmbufWindowAttributes* /* attr */
227 extern void XmbufChangeWindowAttributes(
228 #if NeedFunctionPrototypes
231 unsigned long /* valuemask */,
232 XmbufSetWindowAttributes* /* attr */
236 extern Status XmbufGetBufferAttributes(
237 #if NeedFunctionPrototypes
240 XmbufBufferAttributes* /* attr */
244 extern void XmbufChangeBufferAttributes(
245 #if NeedFunctionPrototypes
248 unsigned long /* valuemask */,
249 XmbufSetBufferAttributes* /* attr */
253 extern Status XmbufGetScreenInfo(
254 #if NeedFunctionPrototypes
257 int* /* nmono_return */,
258 XmbufBufferInfo** /* mono_info_return */,
259 int* /* nstereo_return */,
260 XmbufBufferInfo** /* stereo_info_return */
264 extern Window XmbufCreateStereoWindow(
265 #if NeedFunctionPrototypes
270 unsigned int /* width */,
271 unsigned int /* height */,
272 unsigned int /* border_width */,
274 unsigned int /* class */,
275 Visual* /* visual */,
276 unsigned long /* valuemask */,
277 XSetWindowAttributes* /* attr */,
278 Multibuffer* /* leftp */,
279 Multibuffer* /* rightp */
283 extern void XmbufClearBufferArea(
284 #if NeedFunctionPrototypes
286 Multibuffer /* buffer */,
289 unsigned int /* width */,
290 unsigned int /* height */,
299 typedef Bool (* mbInitFunc)();
301 struct _mbufScreen; /* declared in multibufst.h */
303 extern void RegisterMultibufferInit(
304 #if NeedFunctionPrototypes
305 ScreenPtr /* pScreen */,
306 Bool (* /* bufMultibufferInit */)(
307 #if NeedNestedPrototypes
308 ScreenPtr /* pScreen */,
309 struct _mbufScreen * /* pMBScreen */
315 struct xMbufBufferInfo; /* declared in multibufst.h */
317 extern void RegisterDoubleBufferHardware(
318 #if NeedFunctionPrototypes
319 ScreenPtr /* pScreen */,
321 struct xMbufBufferInfo * /* pInfo */,
322 DevUnion * /* frameBuffer */,
323 DevUnion /* selectPlane */,
324 void (* /* CopyBufferBitsFunc */ )(),
325 void (* /* DrawSelectPlaneFunc */ )()
329 extern int CreateImageBuffers (
330 #if NeedFunctionPrototypes
331 WindowPtr /* pWin */,
338 extern void DestroyImageBuffers (
339 #if NeedFunctionPrototypes
343 extern int DisplayImageBuffers (
344 #if NeedFunctionPrototypes
350 #endif /* _MULTIBUF_SERVER_ */
351 #endif /* _MULTIBUF_H_ */