Xdbe.h revision bd80bcac
1/* $Xorg: Xdbe.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
2/******************************************************************************
3 *
4 * Copyright (c) 1994, 1995  Hewlett-Packard Company
5 *
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:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
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.
24 *
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.
29 *
30 *     Header file for Xlib-related DBE
31 *
32 *****************************************************************************/
33/* $XFree86: xc/include/extensions/Xdbe.h,v 3.2 2001/08/01 00:44:35 tsi Exp $ */
34
35#ifndef XDBE_H
36#define XDBE_H
37
38#include <X11/Xfuncproto.h>
39#include <X11/extensions/dpms.h>	/* XXXMRG makes Display available */
40#include <X11/extensions/dbe.h>
41
42typedef struct
43{
44    VisualID    visual;    /* one visual ID that supports double-buffering */
45    int         depth;     /* depth of visual in bits                      */
46    int         perflevel; /* performance level of visual                  */
47}
48XdbeVisualInfo;
49
50typedef struct
51{
52    int                 count;          /* number of items in visual_depth   */
53    XdbeVisualInfo      *visinfo;       /* list of visuals & depths for scrn */
54}
55XdbeScreenVisualInfo;
56
57
58typedef Drawable XdbeBackBuffer;
59
60typedef unsigned char XdbeSwapAction;
61
62typedef struct
63{
64    Window		swap_window;    /* window for which to swap buffers   */
65    XdbeSwapAction	swap_action;    /* swap action to use for swap_window */
66}
67XdbeSwapInfo;
68
69typedef struct
70{
71    Window	window;			/* window that buffer belongs to */
72}
73XdbeBackBufferAttributes;
74
75typedef struct
76{
77    int			type;
78    Display		*display;	/* display the event was read from */
79    XdbeBackBuffer	buffer;		/* resource id                     */
80    unsigned long	serial;		/* serial number of failed request */
81    unsigned char	error_code;	/* error base + XdbeBadBuffer      */
82    unsigned char	request_code;	/* major opcode of failed request  */
83    unsigned char	minor_code;	/* minor opcode of failed request  */
84}
85XdbeBufferError;
86
87/* _XFUNCPROTOBEGIN and _XFUNCPROTOEND are defined as noops
88 * (for non-C++ builds) in X11/Xfuncproto.h.
89 */
90_XFUNCPROTOBEGIN
91
92extern Status XdbeQueryExtension(
93    Display*		/* dpy                  */,
94    int*		/* major_version_return */,
95    int*		/* minor_version_return */
96);
97
98extern XdbeBackBuffer XdbeAllocateBackBufferName(
99    Display*		/* dpy         */,
100    Window		/* window      */,
101    XdbeSwapAction	/* swap_action */
102);
103
104extern Status XdbeDeallocateBackBufferName(
105    Display*		/* dpy    */,
106    XdbeBackBuffer	/* buffer */
107);
108
109extern Status XdbeSwapBuffers(
110    Display*		/* dpy         */,
111    XdbeSwapInfo*	/* swap_info   */,
112    int			/* num_windows */
113);
114
115extern Status XdbeBeginIdiom(
116    Display*		/* dpy */
117);
118
119extern Status XdbeEndIdiom(
120    Display*		/* dpy */
121);
122
123extern XdbeScreenVisualInfo *XdbeGetVisualInfo(
124    Display*		/* dpy               */,
125    Drawable*		/* screen_specifiers */,
126    int*		/* num_screens       */
127);
128
129extern void XdbeFreeVisualInfo(
130    XdbeScreenVisualInfo*	/* visual_info */
131);
132
133extern XdbeBackBufferAttributes *XdbeGetBackBufferAttributes(
134    Display*		/* dpy    */,
135    XdbeBackBuffer	/* buffer */
136);
137
138_XFUNCPROTOEND
139
140#endif /* XDBE_H */
141
142