1485f0483Smrg/******************************************************************************
22d7aecc9Smrg *
3485f0483Smrg * Copyright (c) 1994, 1995  Hewlett-Packard Company
4485f0483Smrg *
5485f0483Smrg * Permission is hereby granted, free of charge, to any person obtaining
6485f0483Smrg * a copy of this software and associated documentation files (the
7485f0483Smrg * "Software"), to deal in the Software without restriction, including
8485f0483Smrg * without limitation the rights to use, copy, modify, merge, publish,
9485f0483Smrg * distribute, sublicense, and/or sell copies of the Software, and to
10485f0483Smrg * permit persons to whom the Software is furnished to do so, subject to
11485f0483Smrg * the following conditions:
122d7aecc9Smrg *
13485f0483Smrg * The above copyright notice and this permission notice shall be included
14485f0483Smrg * in all copies or substantial portions of the Software.
152d7aecc9Smrg *
16485f0483Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17485f0483Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18485f0483Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19485f0483Smrg * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
20485f0483Smrg * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21485f0483Smrg * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
22485f0483Smrg * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
232d7aecc9Smrg *
24485f0483Smrg * Except as contained in this notice, the name of the Hewlett-Packard
25485f0483Smrg * Company shall not be used in advertising or otherwise to promote the
26485f0483Smrg * sale, use or other dealings in this Software without prior written
27485f0483Smrg * authorization from the Hewlett-Packard Company.
282d7aecc9Smrg *
29485f0483Smrg *     Header file for Xlib-related DBE
30485f0483Smrg *
31485f0483Smrg *****************************************************************************/
32485f0483Smrg
33485f0483Smrg#ifndef XDBE_H
34485f0483Smrg#define XDBE_H
35485f0483Smrg
36485f0483Smrg#include <X11/Xfuncproto.h>
37485f0483Smrg#include <X11/extensions/dbe.h>
38485f0483Smrg
39485f0483Smrgtypedef struct
40485f0483Smrg{
41485f0483Smrg    VisualID    visual;    /* one visual ID that supports double-buffering */
42485f0483Smrg    int         depth;     /* depth of visual in bits                      */
43485f0483Smrg    int         perflevel; /* performance level of visual                  */
44485f0483Smrg}
45485f0483SmrgXdbeVisualInfo;
46485f0483Smrg
47485f0483Smrgtypedef struct
48485f0483Smrg{
49485f0483Smrg    int                 count;          /* number of items in visual_depth   */
50485f0483Smrg    XdbeVisualInfo      *visinfo;       /* list of visuals & depths for scrn */
51485f0483Smrg}
52485f0483SmrgXdbeScreenVisualInfo;
53485f0483Smrg
54485f0483Smrg
55485f0483Smrgtypedef Drawable XdbeBackBuffer;
56485f0483Smrg
57485f0483Smrgtypedef unsigned char XdbeSwapAction;
58485f0483Smrg
59485f0483Smrgtypedef struct
60485f0483Smrg{
61485f0483Smrg    Window		swap_window;    /* window for which to swap buffers   */
62485f0483Smrg    XdbeSwapAction	swap_action;    /* swap action to use for swap_window */
63485f0483Smrg}
64485f0483SmrgXdbeSwapInfo;
65485f0483Smrg
66485f0483Smrgtypedef struct
67485f0483Smrg{
68485f0483Smrg    Window	window;			/* window that buffer belongs to */
69485f0483Smrg}
70485f0483SmrgXdbeBackBufferAttributes;
71485f0483Smrg
72485f0483Smrgtypedef struct
73485f0483Smrg{
74485f0483Smrg    int			type;
75485f0483Smrg    Display		*display;	/* display the event was read from */
76485f0483Smrg    XdbeBackBuffer	buffer;		/* resource id                     */
77485f0483Smrg    unsigned long	serial;		/* serial number of failed request */
78485f0483Smrg    unsigned char	error_code;	/* error base + XdbeBadBuffer      */
79485f0483Smrg    unsigned char	request_code;	/* major opcode of failed request  */
80485f0483Smrg    unsigned char	minor_code;	/* minor opcode of failed request  */
81485f0483Smrg}
82485f0483SmrgXdbeBufferError;
83485f0483Smrg
84485f0483Smrg/* _XFUNCPROTOBEGIN and _XFUNCPROTOEND are defined as noops
85485f0483Smrg * (for non-C++ builds) in X11/Xfuncproto.h.
86485f0483Smrg */
87485f0483Smrg_XFUNCPROTOBEGIN
88485f0483Smrg
89485f0483Smrgextern Status XdbeQueryExtension(
90485f0483Smrg    Display*		/* dpy                  */,
91485f0483Smrg    int*		/* major_version_return */,
92485f0483Smrg    int*		/* minor_version_return */
93485f0483Smrg);
94485f0483Smrg
95485f0483Smrgextern XdbeBackBuffer XdbeAllocateBackBufferName(
96485f0483Smrg    Display*		/* dpy         */,
97485f0483Smrg    Window		/* window      */,
98485f0483Smrg    XdbeSwapAction	/* swap_action */
99485f0483Smrg);
100485f0483Smrg
101485f0483Smrgextern Status XdbeDeallocateBackBufferName(
102485f0483Smrg    Display*		/* dpy    */,
103485f0483Smrg    XdbeBackBuffer	/* buffer */
104485f0483Smrg);
105485f0483Smrg
106485f0483Smrgextern Status XdbeSwapBuffers(
107485f0483Smrg    Display*		/* dpy         */,
108485f0483Smrg    XdbeSwapInfo*	/* swap_info   */,
109485f0483Smrg    int			/* num_windows */
110485f0483Smrg);
111485f0483Smrg
112485f0483Smrgextern Status XdbeBeginIdiom(
113485f0483Smrg    Display*		/* dpy */
114485f0483Smrg);
115485f0483Smrg
116485f0483Smrgextern Status XdbeEndIdiom(
117485f0483Smrg    Display*		/* dpy */
118485f0483Smrg);
119485f0483Smrg
120485f0483Smrgextern XdbeScreenVisualInfo *XdbeGetVisualInfo(
121485f0483Smrg    Display*		/* dpy               */,
122485f0483Smrg    Drawable*		/* screen_specifiers */,
123485f0483Smrg    int*		/* num_screens       */
124485f0483Smrg);
125485f0483Smrg
126485f0483Smrgextern void XdbeFreeVisualInfo(
127485f0483Smrg    XdbeScreenVisualInfo*	/* visual_info */
128485f0483Smrg);
129485f0483Smrg
130485f0483Smrgextern XdbeBackBufferAttributes *XdbeGetBackBufferAttributes(
131485f0483Smrg    Display*		/* dpy    */,
132485f0483Smrg    XdbeBackBuffer	/* buffer */
133485f0483Smrg);
134485f0483Smrg
135485f0483Smrg_XFUNCPROTOEND
136485f0483Smrg
137485f0483Smrg#endif /* XDBE_H */
138485f0483Smrg
139