Xdbe.h revision 4f45da70
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#ifndef XDBE_H
34#define XDBE_H
35
36#include <X11/Xfuncproto.h>
37#include <X11/extensions/dpms.h>	/* XXXMRG makes Display available */
38#include <X11/extensions/dbe.h>
39
40typedef struct
41{
42    VisualID    visual;    /* one visual ID that supports double-buffering */
43    int         depth;     /* depth of visual in bits                      */
44    int         perflevel; /* performance level of visual                  */
45}
46XdbeVisualInfo;
47
48typedef struct
49{
50    int                 count;          /* number of items in visual_depth   */
51    XdbeVisualInfo      *visinfo;       /* list of visuals & depths for scrn */
52}
53XdbeScreenVisualInfo;
54
55
56typedef Drawable XdbeBackBuffer;
57
58typedef unsigned char XdbeSwapAction;
59
60typedef struct
61{
62    Window		swap_window;    /* window for which to swap buffers   */
63    XdbeSwapAction	swap_action;    /* swap action to use for swap_window */
64}
65XdbeSwapInfo;
66
67typedef struct
68{
69    Window	window;			/* window that buffer belongs to */
70}
71XdbeBackBufferAttributes;
72
73typedef struct
74{
75    int			type;
76    Display		*display;	/* display the event was read from */
77    XdbeBackBuffer	buffer;		/* resource id                     */
78    unsigned long	serial;		/* serial number of failed request */
79    unsigned char	error_code;	/* error base + XdbeBadBuffer      */
80    unsigned char	request_code;	/* major opcode of failed request  */
81    unsigned char	minor_code;	/* minor opcode of failed request  */
82}
83XdbeBufferError;
84
85/* _XFUNCPROTOBEGIN and _XFUNCPROTOEND are defined as noops
86 * (for non-C++ builds) in X11/Xfuncproto.h.
87 */
88_XFUNCPROTOBEGIN
89
90extern Status XdbeQueryExtension(
91    Display*		/* dpy                  */,
92    int*		/* major_version_return */,
93    int*		/* minor_version_return */
94);
95
96extern XdbeBackBuffer XdbeAllocateBackBufferName(
97    Display*		/* dpy         */,
98    Window		/* window      */,
99    XdbeSwapAction	/* swap_action */
100);
101
102extern Status XdbeDeallocateBackBufferName(
103    Display*		/* dpy    */,
104    XdbeBackBuffer	/* buffer */
105);
106
107extern Status XdbeSwapBuffers(
108    Display*		/* dpy         */,
109    XdbeSwapInfo*	/* swap_info   */,
110    int			/* num_windows */
111);
112
113extern Status XdbeBeginIdiom(
114    Display*		/* dpy */
115);
116
117extern Status XdbeEndIdiom(
118    Display*		/* dpy */
119);
120
121extern XdbeScreenVisualInfo *XdbeGetVisualInfo(
122    Display*		/* dpy               */,
123    Drawable*		/* screen_specifiers */,
124    int*		/* num_screens       */
125);
126
127extern void XdbeFreeVisualInfo(
128    XdbeScreenVisualInfo*	/* visual_info */
129);
130
131extern XdbeBackBufferAttributes *XdbeGetBackBufferAttributes(
132    Display*		/* dpy    */,
133    XdbeBackBuffer	/* buffer */
134);
135
136_XFUNCPROTOEND
137
138#endif /* XDBE_H */
139
140