2 * $Xorg: multibuf.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $
4 Copyright 1989, 1998 The Open Group
6 Permission to use, copy, modify, distribute, and sell this software and its
7 documentation for any purpose is hereby granted without fee, provided that
8 the above copyright notice appear in all copies and that both that
9 copyright notice and this permission notice appear in supporting
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 Except as contained in this notice, the name of The Open Group shall not be
23 used in advertising or otherwise to promote the sale, use or other dealings
24 in this Software without prior written authorization from The Open Group.
27 /* $XFree86: xc/include/extensions/multibuf.h,v 3.4 2001/12/14 19:53:28 dawes Exp $ */
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(
177 int* /* event_base_return */,
178 int* /* error_base_return */
181 extern Status XmbufGetVersion(
183 int* /* major_version_return */,
184 int* /* minor_version_return */
187 extern int XmbufCreateBuffers(
191 int /* update_action */,
192 int /* update_hint */,
193 Multibuffer* /* buffers */
196 extern void XmbufDestroyBuffers(
201 extern void XmbufDisplayBuffers(
204 Multibuffer* /* buffers */,
209 extern Status XmbufGetWindowAttributes(
212 XmbufWindowAttributes* /* attr */
215 extern void XmbufChangeWindowAttributes(
218 unsigned long /* valuemask */,
219 XmbufSetWindowAttributes* /* attr */
222 extern Status XmbufGetBufferAttributes(
225 XmbufBufferAttributes* /* attr */
228 extern void XmbufChangeBufferAttributes(
231 unsigned long /* valuemask */,
232 XmbufSetBufferAttributes* /* attr */
235 extern Status XmbufGetScreenInfo(
238 int* /* nmono_return */,
239 XmbufBufferInfo** /* mono_info_return */,
240 int* /* nstereo_return */,
241 XmbufBufferInfo** /* stereo_info_return */
244 extern Window XmbufCreateStereoWindow(
249 unsigned int /* width */,
250 unsigned int /* height */,
251 unsigned int /* border_width */,
253 unsigned int /* class */,
254 Visual* /* visual */,
255 unsigned long /* valuemask */,
256 XSetWindowAttributes* /* attr */,
257 Multibuffer* /* leftp */,
258 Multibuffer* /* rightp */
261 extern void XmbufClearBufferArea(
263 Multibuffer /* buffer */,
266 unsigned int /* width */,
267 unsigned int /* height */,
275 #include "scrnintstr.h"
277 typedef Bool (* mbInitFunc)();
279 struct _mbufScreen; /* declared in multibufst.h */
281 extern void RegisterMultibufferInit(
282 ScreenPtr /* pScreen */,
283 Bool (* /* bufMultibufferInit */)(
284 ScreenPtr /* pScreen */,
285 struct _mbufScreen * /* pMBScreen */
289 struct xMbufBufferInfo; /* declared in multibufst.h */
291 extern void RegisterDoubleBufferHardware(
292 ScreenPtr /* pScreen */,
294 struct xMbufBufferInfo * /* pInfo */,
295 DevUnion * /* frameBuffer */,
296 DevUnion /* selectPlane */,
297 void (* /* CopyBufferBitsFunc */ )(),
298 void (* /* DrawSelectPlaneFunc */ )()
301 extern int CreateImageBuffers (
302 WindowPtr /* pWin */,
308 extern void DestroyImageBuffers (
311 extern int DisplayImageBuffers (
316 #endif /* _MULTIBUF_SERVER_ */
317 #endif /* _MULTIBUF_H_ */