VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/4.3/include/extensions/multibuf.h@ 25452

Last change on this file since 25452 was 25452, checked in by vboxsync, 15 years ago

Additions/x11: added include files needed for building vboxmouse with XFree86 4.3 and equivalent X.Org versions

  • Property svn:eol-style set to native
File size: 9.0 KB
Line 
1/*
2 * $Xorg: multibuf.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $
3 *
4Copyright 1989, 1998 The Open Group
5
6Permission to use, copy, modify, distribute, and sell this software and its
7documentation for any purpose is hereby granted without fee, provided that
8the above copyright notice appear in all copies and that both that
9copyright notice and this permission notice appear in supporting
10documentation.
11
12The above copyright notice and this permission notice shall be included in
13all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22Except as contained in this notice, the name of The Open Group shall not be
23used in advertising or otherwise to promote the sale, use or other dealings
24in this Software without prior written authorization from The Open Group.
25 */
26
27/* $XFree86: xc/include/extensions/multibuf.h,v 3.4 2001/12/14 19:53:28 dawes Exp $ */
28
29#ifndef _MULTIBUF_H_
30#define _MULTIBUF_H_
31
32#include <X11/Xfuncproto.h>
33
34#define MULTIBUFFER_PROTOCOL_NAME "Multi-Buffering"
35
36#define MULTIBUFFER_MAJOR_VERSION 1 /* current version numbers */
37#define MULTIBUFFER_MINOR_VERSION 1 /* has ClearImageBufferArea */
38
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
50
51/*
52 * update_action field
53 */
54#define MultibufferUpdateActionUndefined 0
55#define MultibufferUpdateActionBackground 1
56#define MultibufferUpdateActionUntouched 2
57#define MultibufferUpdateActionCopied 3
58
59/*
60 * update_hint field
61 */
62#define MultibufferUpdateHintFrequent 0
63#define MultibufferUpdateHintIntermittent 1
64#define MultibufferUpdateHintStatic 2
65
66/*
67 * valuemask fields
68 */
69#define MultibufferWindowUpdateHint (1L << 0)
70#define MultibufferBufferEventMask (1L << 0)
71
72/*
73 * mono vs. stereo and left vs. right
74 */
75#define MultibufferModeMono 0
76#define MultibufferModeStereo 1
77#define MultibufferSideMono 0
78#define MultibufferSideLeft 1
79#define MultibufferSideRight 2
80
81/*
82 * clobber state
83 */
84#define MultibufferUnclobbered 0
85#define MultibufferPartiallyClobbered 1
86#define MultibufferFullyClobbered 2
87
88/*
89 * event stuff
90 */
91#define MultibufferClobberNotifyMask 0x02000000
92#define MultibufferUpdateNotifyMask 0x04000000
93
94#define MultibufferClobberNotify 0
95#define MultibufferUpdateNotify 1
96#define MultibufferNumberEvents (MultibufferUpdateNotify + 1)
97
98#define MultibufferBadBuffer 0
99#define MultibufferNumberErrors (MultibufferBadBuffer + 1)
100
101
102#ifndef _MULTIBUF_SERVER_
103/*
104 * Extra definitions that will only be needed in the client
105 */
106typedef XID Multibuffer;
107
108typedef struct {
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;
116
117typedef struct {
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;
124
125
126/*
127 * per-window attributes that can be got
128 */
129typedef struct {
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;
137
138/*
139 * per-window attributes that can be set
140 */
141typedef struct {
142 int update_hint; /* Frequent, Intermittent, Static */
143} XmbufSetWindowAttributes;
144
145
146/*
147 * per-buffer attributes that can be got
148 */
149typedef struct {
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;
155
156/*
157 * per-buffer attributes that can be set
158 */
159typedef struct {
160 unsigned long event_mask; /* events that have been selected */
161} XmbufSetBufferAttributes;
162
163
164/*
165 * per-screen buffer info (there will be lists of them)
166 */
167typedef struct {
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 */
171} XmbufBufferInfo;
172
173_XFUNCPROTOBEGIN
174
175extern Bool XmbufQueryExtension(
176#if NeedFunctionPrototypes
177 Display* /* dpy */,
178 int* /* event_base_return */,
179 int* /* error_base_return */
180#endif
181);
182
183extern Status XmbufGetVersion(
184#if NeedFunctionPrototypes
185 Display* /* dpy */,
186 int* /* major_version_return */,
187 int* /* minor_version_return */
188#endif
189);
190
191extern int XmbufCreateBuffers(
192#if NeedFunctionPrototypes
193 Display* /* dpy */,
194 Window /* w */,
195 int /* count */,
196 int /* update_action */,
197 int /* update_hint */,
198 Multibuffer* /* buffers */
199#endif
200);
201
202extern void XmbufDestroyBuffers(
203#if NeedFunctionPrototypes
204 Display* /* dpy */,
205 Window /* window */
206#endif
207);
208
209extern void XmbufDisplayBuffers(
210#if NeedFunctionPrototypes
211 Display* /* dpy */,
212 int /* count */,
213 Multibuffer* /* buffers */,
214 int /* min_delay */,
215 int /* max_delay */
216#endif
217);
218
219extern Status XmbufGetWindowAttributes(
220#if NeedFunctionPrototypes
221 Display* /* dpy */,
222 Window /* w */,
223 XmbufWindowAttributes* /* attr */
224#endif
225);
226
227extern void XmbufChangeWindowAttributes(
228#if NeedFunctionPrototypes
229 Display* /* dpy */,
230 Window /* w */,
231 unsigned long /* valuemask */,
232 XmbufSetWindowAttributes* /* attr */
233#endif
234);
235
236extern Status XmbufGetBufferAttributes(
237#if NeedFunctionPrototypes
238 Display* /* dpy */,
239 Multibuffer /* b */,
240 XmbufBufferAttributes* /* attr */
241#endif
242);
243
244extern void XmbufChangeBufferAttributes(
245#if NeedFunctionPrototypes
246 Display* /* dpy */,
247 Multibuffer /* b */,
248 unsigned long /* valuemask */,
249 XmbufSetBufferAttributes* /* attr */
250#endif
251);
252
253extern Status XmbufGetScreenInfo(
254#if NeedFunctionPrototypes
255 Display* /* dpy */,
256 Drawable /* d */,
257 int* /* nmono_return */,
258 XmbufBufferInfo** /* mono_info_return */,
259 int* /* nstereo_return */,
260 XmbufBufferInfo** /* stereo_info_return */
261#endif
262);
263
264extern Window XmbufCreateStereoWindow(
265#if NeedFunctionPrototypes
266 Display* /* dpy */,
267 Window /* parent */,
268 int /* x */,
269 int /* y */,
270 unsigned int /* width */,
271 unsigned int /* height */,
272 unsigned int /* border_width */,
273 int /* depth */,
274 unsigned int /* class */,
275 Visual* /* visual */,
276 unsigned long /* valuemask */,
277 XSetWindowAttributes* /* attr */,
278 Multibuffer* /* leftp */,
279 Multibuffer* /* rightp */
280#endif
281);
282
283extern void XmbufClearBufferArea(
284#if NeedFunctionPrototypes
285 Display* /* dpy */,
286 Multibuffer /* buffer */,
287 int /* x */,
288 int /* y */,
289 unsigned int /* width */,
290 unsigned int /* height */,
291 Bool /* exposures */
292#endif
293);
294
295_XFUNCPROTOEND
296
297#else
298
299#include "scrnintstr.h"
300
301typedef Bool (* mbInitFunc)();
302
303struct _mbufScreen; /* declared in multibufst.h */
304
305extern void RegisterMultibufferInit(
306#if NeedFunctionPrototypes
307 ScreenPtr /* pScreen */,
308 Bool (* /* bufMultibufferInit */)(
309#if NeedNestedPrototypes
310 ScreenPtr /* pScreen */,
311 struct _mbufScreen * /* pMBScreen */
312#endif
313 )
314#endif
315);
316
317struct xMbufBufferInfo; /* declared in multibufst.h */
318
319extern void RegisterDoubleBufferHardware(
320#if NeedFunctionPrototypes
321 ScreenPtr /* pScreen */,
322 int /* nInfo */,
323 struct xMbufBufferInfo * /* pInfo */,
324 DevUnion * /* frameBuffer */,
325 DevUnion /* selectPlane */,
326 void (* /* CopyBufferBitsFunc */ )(),
327 void (* /* DrawSelectPlaneFunc */ )()
328#endif
329);
330
331extern int CreateImageBuffers (
332#if NeedFunctionPrototypes
333 WindowPtr /* pWin */,
334 int /* nbuf */,
335 XID * /* ids */,
336 int /* action */,
337 int /* hint */
338#endif
339);
340extern void DestroyImageBuffers (
341#if NeedFunctionPrototypes
342 WindowPtr /* pWin */
343#endif
344);
345extern int DisplayImageBuffers (
346#if NeedFunctionPrototypes
347 XID * /* ids */,
348 int /* nbuf */
349#endif
350);
351
352#endif /* _MULTIBUF_SERVER_ */
353#endif /* _MULTIBUF_H_ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette