Home | History | Annotate | Download | only in extensions
      1 /* $Xorg: Xdbeproto.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 
     34 
     35 #ifndef XDBE_PROTO_H
     36 #define XDBE_PROTO_H
     37 
     38 /* INCLUDES */
     39 
     40 
     41 /* DEFINES */
     42 
     43 /* Values for swap_action field of XdbeSwapInfo structure */
     44 #define XdbeUndefined    0
     45 #define XdbeBackground   1
     46 #define XdbeUntouched    2
     47 #define XdbeCopied       3
     48 
     49 #ifdef NEED_DBE_PROTOCOL
     50 
     51 #define DBE_PROTOCOL_NAME "DOUBLE-BUFFER"
     52 
     53 /* Current version numbers */
     54 #define DBE_MAJOR_VERSION       1
     55 #define DBE_MINOR_VERSION       0
     56 
     57 /* Used when adding extension; also used in Xdbe macros */
     58 #define DbeNumberEvents			0
     59 #define DbeBadBuffer			0
     60 #define DbeNumberErrors			(DbeBadBuffer + 1)
     61 
     62 /* Request values used in (S)ProcDbeDispatch() */
     63 #define X_DbeGetVersion                 0
     64 #define X_DbeAllocateBackBufferName     1
     65 #define X_DbeDeallocateBackBufferName   2
     66 #define X_DbeSwapBuffers                3
     67 #define X_DbeBeginIdiom                 4
     68 #define X_DbeEndIdiom                   5
     69 #define X_DbeGetVisualInfo              6
     70 #define X_DbeGetBackBufferAttributes    7
     71 
     72 typedef CARD8  xDbeSwapAction;
     73 typedef CARD32 xDbeBackBuffer;
     74 
     75 #endif /* NEED_DBE_PROTOCOL */
     76 
     77 
     78 /* TYPEDEFS */
     79 
     80 /* Client data types */
     81 
     82 /* XdbeVisualInfo and XdbeScreenVisualInfo are defined in this file,
     83  * "Xdbeproto.h", rather than "Xdbe.h" because the server uses these data
     84  * types.
     85  */
     86 
     87 typedef struct
     88 {
     89     VisualID    visual;    /* one visual ID that supports double-buffering */
     90     int         depth;     /* depth of visual in bits                      */
     91     int         perflevel; /* performance level of visual                  */
     92 }
     93 XdbeVisualInfo;
     94 
     95 typedef struct
     96 {
     97     int                 count;          /* number of items in visual_depth   */
     98     XdbeVisualInfo      *visinfo;       /* list of visuals & depths for scrn */
     99 }
    100 XdbeScreenVisualInfo;
    101 
    102 /* Protocol data types */
    103 
    104 #ifdef NEED_DBE_PROTOCOL
    105 
    106 typedef struct
    107 {
    108     CARD32		window B32;	/* window      */
    109     xDbeSwapAction	swapAction;	/* swap action */
    110     CARD8		pad1;		/* unused      */
    111     CARD16		pad2 B16;
    112 
    113 } xDbeSwapInfo;
    114 
    115 typedef struct
    116 {
    117     CARD32	visualID B32;	/* associated visual      */
    118     CARD8	depth;		/* depth of visual        */
    119     CARD8	perfLevel;	/* performance level hint */
    120     CARD16	pad1 B16;
    121 
    122 } xDbeVisInfo;
    123 #define sz_xDbeVisInfo	8
    124 
    125 typedef struct
    126 {
    127     CARD32	n B32;	/* number of visual info items in list  */
    128 
    129 } xDbeScreenVisInfo;	/* followed by n xDbeVisInfo items */
    130 
    131 typedef struct
    132 {
    133     CARD32	window B32;	/* window */
    134 
    135 } xDbeBufferAttributes;
    136 
    137 
    138 /* Requests and replies */
    139 
    140 typedef struct
    141 {
    142     CARD8	reqType;	/* major-opcode: always codes->major_opcode */
    143     CARD8	dbeReqType;	/* minor-opcode: always X_DbeGetVersion (0) */
    144     CARD16	length B16;	/* request length: (2)                      */
    145     CARD8	majorVersion;	/* client-major-version                     */
    146     CARD8	minorVersion;	/* client-minor-version                     */
    147     CARD16	unused B16;	/* unused                                   */
    148 
    149 } xDbeGetVersionReq;
    150 #define sz_xDbeGetVersionReq	8
    151 
    152 typedef struct
    153 {
    154     BYTE	type;			/* Reply: X_Reply (1)   */
    155     CARD8	unused;			/* unused               */
    156     CARD16	sequenceNumber B16;	/* sequence number      */
    157     CARD32	length B32;		/* reply length: (0)    */
    158     CARD8	majorVersion;		/* server-major-version */
    159     CARD8	minorVersion;		/* server-minor-version */
    160     CARD16	pad1 B16;		/* unused               */
    161     CARD32	pad2 B32;
    162     CARD32	pad3 B32;
    163     CARD32	pad4 B32;
    164     CARD32	pad5 B32;
    165     CARD32	pad6 B32;
    166 
    167 } xDbeGetVersionReply;
    168 #define sz_xDbeGetVersionReply	32
    169 
    170 typedef struct
    171 {
    172     CARD8		reqType;	/* major-opcode: codes->major_opcode */
    173     CARD8		dbeReqType;	/* X_DbeAllocateBackBufferName (1)   */
    174     CARD16		length B16;	/* request length: (4)               */
    175     CARD32		window B32;	/* window                            */
    176     xDbeBackBuffer	buffer B32;	/* back buffer name                  */
    177     xDbeSwapAction	swapAction;	/* swap action hint                  */
    178     CARD8		pad1;		/* unused                            */
    179     CARD16		pad2 B16;
    180 
    181 } xDbeAllocateBackBufferNameReq;
    182 #define sz_xDbeAllocateBackBufferNameReq	16
    183 
    184 typedef struct
    185 {
    186     CARD8		reqType;	/* major-opcode: codes->major_opcode */
    187     CARD8		dbeReqType;	/* X_DbeDeallocateBackBufferName (2) */
    188     CARD16		length B16;	/* request length: (2)               */
    189     xDbeBackBuffer	buffer B32;	/* back buffer name                  */
    190 
    191 } xDbeDeallocateBackBufferNameReq;
    192 #define sz_xDbeDeallocateBackBufferNameReq	8
    193 
    194 typedef struct
    195 {
    196     CARD8	reqType;	/* major-opcode: always codes->major_opcode  */
    197     CARD8	dbeReqType;	/* minor-opcode: always X_DbeSwapBuffers (3) */
    198     CARD16	length B16;	/* request length: (2+2n)                    */
    199     CARD32	n B32;		/* n, number of window/swap action pairs     */
    200 
    201 } xDbeSwapBuffersReq;		/* followed by n window/swap action pairs    */
    202 #define sz_xDbeSwapBuffersReq	8
    203 
    204 typedef struct
    205 {
    206     CARD8	reqType;	/* major-opcode: always codes->major_opcode */
    207     CARD8	dbeReqType;	/* minor-opcode: always X_DbeBeginIdom (4)  */
    208     CARD16	length B16;	/* request length: (1)                      */
    209 
    210 } xDbeBeginIdiomReq;
    211 #define sz_xDbeBeginIdiomReq	4
    212 
    213 typedef struct
    214 {
    215     CARD8	reqType;	/* major-opcode: always codes->major_opcode */
    216     CARD8	dbeReqType;	/* minor-opcode: always X_DbeEndIdom (5)    */
    217     CARD16	length B16;	/* request length: (1)                      */
    218 
    219 } xDbeEndIdiomReq;
    220 #define sz_xDbeEndIdiomReq	4
    221 
    222 typedef struct
    223 {
    224     CARD8	reqType;	/* always codes->major_opcode     */
    225     CARD8	dbeReqType;	/* always X_DbeGetVisualInfo (6)  */
    226     CARD16	length B16;	/* request length: (2+n)          */
    227     CARD32	n B32;		/* n, number of drawables in list */
    228 
    229 } xDbeGetVisualInfoReq;		/* followed by n drawables        */
    230 #define sz_xDbeGetVisualInfoReq	8
    231 
    232 typedef struct
    233 {
    234     BYTE	type;			/* Reply: X_Reply (1)                */
    235     CARD8	unused;			/* unused                            */
    236     CARD16	sequenceNumber B16;	/* sequence number                   */
    237     CARD32	length B32;		/* reply length                      */
    238     CARD32	m;			/* m, number of visual infos in list */
    239     CARD32	pad1 B32;		/* unused                            */
    240     CARD32	pad2 B32;
    241     CARD32	pad3 B32;
    242     CARD32	pad4 B32;
    243     CARD32	pad5 B32;
    244 
    245 } xDbeGetVisualInfoReply;		/* followed by m visual infos        */
    246 #define sz_xDbeGetVisualInfoReply	32
    247 
    248 typedef struct
    249 {
    250     CARD8		reqType;	/* always codes->major_opcode       */
    251     CARD8		dbeReqType;	/* X_DbeGetBackBufferAttributes (7) */
    252     CARD16		length B16;	/* request length: (2)              */
    253     xDbeBackBuffer	buffer B32;	/* back buffer name                 */
    254 
    255 } xDbeGetBackBufferAttributesReq;
    256 #define sz_xDbeGetBackBufferAttributesReq	8
    257 
    258 typedef struct
    259 {
    260     BYTE	type;			/* Reply: X_Reply (1) */
    261     CARD8	unused;			/* unused             */
    262     CARD16	sequenceNumber B16;	/* sequence number    */
    263     CARD32	length B32;		/* reply length: (0)  */
    264     CARD32	attributes;		/* attributes         */
    265     CARD32	pad1 B32;		/* unused             */
    266     CARD32	pad2 B32;
    267     CARD32	pad3 B32;
    268     CARD32	pad4 B32;
    269     CARD32	pad5 B32;
    270 
    271 } xDbeGetBackBufferAttributesReply;
    272 #define sz_xDbeGetBackBufferAttributesReply	32
    273 
    274 #endif /* NEED_DBE_PROTOCOL */
    275 
    276 #endif /* XDBE_PROTO_H */
    277 
    278