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