Home | History | Annotate | Download | only in extensions
      1 /************************************************************
      2 
      3 Copyright 1989, 1998  The Open Group
      4 
      5 Permission to use, copy, modify, distribute, and sell this software and its
      6 documentation for any purpose is hereby granted without fee, provided that
      7 the above copyright notice appear in all copies and that both that
      8 copyright notice and this permission notice appear in supporting
      9 documentation.
     10 
     11 The above copyright notice and this permission notice shall be included in
     12 all copies or substantial portions of the Software.
     13 
     14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
     17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
     18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
     19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     20 
     21 Except as contained in this notice, the name of The Open Group shall not be
     22 used in advertising or otherwise to promote the sale, use or other dealings
     23 in this Software without prior written authorization from The Open Group.
     24 
     25 ********************************************************/
     26 
     27 /* $Xorg: shapestr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
     28 
     29 #ifndef _SHAPESTR_H_
     30 #define _SHAPESTR_H_
     31 
     32 /*
     33  * Protocol requests constants and alignment values
     34  * These would really be in SHAPE's X.h and Xproto.h equivalents
     35  */
     36 
     37 #include "shape.h"
     38 
     39 #define Window CARD32
     40 #define Time CARD32
     41 
     42 #define SHAPENAME "SHAPE"
     43 
     44 #define SHAPE_MAJOR_VERSION	1	/* current version numbers */
     45 #define SHAPE_MINOR_VERSION	1
     46 
     47 typedef struct _ShapeQueryVersion {
     48 	CARD8	reqType;		/* always ShapeReqCode */
     49 	CARD8	shapeReqType;		/* always X_ShapeQueryVersion */
     50 	CARD16	length B16;
     51 } xShapeQueryVersionReq;
     52 #define sz_xShapeQueryVersionReq	4
     53 
     54 typedef struct {
     55 	BYTE	type;			/* X_Reply */
     56 	CARD8	unused;			/* not used */
     57 	CARD16	sequenceNumber B16;
     58 	CARD32	length B32;
     59 	CARD16	majorVersion B16;	/* major version of SHAPE protocol */
     60 	CARD16	minorVersion B16;	/* minor version of SHAPE protocol */
     61 	CARD32	pad0 B32;
     62 	CARD32	pad1 B32;
     63 	CARD32	pad2 B32;
     64 	CARD32	pad3 B32;
     65 	CARD32	pad4 B32;
     66 } xShapeQueryVersionReply;
     67 #define sz_xShapeQueryVersionReply	32
     68 
     69 typedef struct _ShapeRectangles {
     70 	CARD8	reqType;	/* always ShapeReqCode */
     71 	CARD8	shapeReqType;	/* always X_ShapeRectangles */
     72 	CARD16	length B16;
     73 	CARD8	op;		/* Set, ... */
     74 	CARD8	destKind;	/* ShapeBounding or ShapeClip */
     75 	CARD8	ordering;	/* UnSorted, YSorted, YXSorted, YXBanded */
     76 	CARD8	pad0;		/* not used */
     77 	Window	dest B32;
     78 	INT16	xOff B16;
     79 	INT16	yOff B16;
     80 } xShapeRectanglesReq;		/* followed by xRects */
     81 #define sz_xShapeRectanglesReq	16
     82 
     83 typedef struct _ShapeMask {
     84 	CARD8	reqType;	/* always ShapeReqCode */
     85 	CARD8	shapeReqType;	/* always X_ShapeMask */
     86 	CARD16	length B16;
     87 
     88 	CARD8	op;		/* Set, ... */
     89 	CARD8	destKind;	/* ShapeBounding or ShapeClip */
     90 	CARD16	junk B16;	/* not used */
     91 
     92 	Window	dest B32;
     93 	INT16	xOff B16;
     94 	INT16	yOff B16;
     95 	CARD32	src B32;	/* 1 bit pixmap */
     96 } xShapeMaskReq;
     97 #define sz_xShapeMaskReq	20
     98 
     99 typedef struct _ShapeCombine {
    100 	CARD8	reqType;	/* always ShapeReqCode */
    101 	CARD8	shapeReqType;	/* always X_ShapeCombine */
    102 	CARD16	length B16;
    103 	CARD8	op;		/* Set, ... */
    104 	CARD8	destKind;	/* ShapeBounding or ShapeClip */
    105 	CARD8	srcKind;	/* ShapeBounding or ShapeClip */
    106 	CARD8	junk;		/* not used */
    107 	Window	dest B32;
    108 	INT16	xOff B16;
    109 	INT16	yOff B16;
    110 	Window	src B32;
    111 } xShapeCombineReq;
    112 #define sz_xShapeCombineReq	20
    113 
    114 typedef struct _ShapeOffset {
    115 	CARD8	reqType;	/* always ShapeReqCode */
    116 	CARD8	shapeReqType;	/* always X_ShapeOffset */
    117 	CARD16	length B16;
    118 	CARD8	destKind;	/* ShapeBounding or ShapeClip */
    119 	CARD8	junk1;		/* not used */
    120 	CARD16	junk2 B16;	/* not used */
    121 	Window	dest B32;
    122 	INT16	xOff B16;
    123 	INT16	yOff B16;
    124 } xShapeOffsetReq;
    125 #define sz_xShapeOffsetReq	16
    126 
    127 typedef struct _ShapeQueryExtents {
    128 	CARD8	reqType;	/* always ShapeReqCode */
    129 	CARD8	shapeReqType;	/* always X_ShapeQueryExtents */
    130 	CARD16	length B16;
    131 	Window	window B32;
    132 } xShapeQueryExtentsReq;
    133 #define sz_xShapeQueryExtentsReq	8
    134 
    135 typedef struct {
    136 	BYTE	type;			/* X_Reply */
    137 	CARD8	unused;			/* not used */
    138 	CARD16	sequenceNumber B16;
    139 	CARD32	length B32;		/* 0 */
    140 	CARD8	boundingShaped;		/* window has bounding shape */
    141 	CARD8	clipShaped;		/* window has clip shape */
    142 	CARD16	unused1 B16;
    143 	INT16	xBoundingShape B16;	/* extents of bounding shape */
    144 	INT16	yBoundingShape B16;
    145 	CARD16	widthBoundingShape B16;
    146 	CARD16	heightBoundingShape B16;
    147 	INT16	xClipShape B16;		/* extents of clip shape */
    148 	INT16	yClipShape B16;
    149 	CARD16	widthClipShape B16;
    150 	CARD16	heightClipShape B16;
    151 	CARD32	pad1 B32;
    152 } xShapeQueryExtentsReply;
    153 #define sz_xShapeQueryExtentsReply	32
    154 
    155 typedef struct _ShapeSelectInput {
    156 	CARD8	reqType;	/* always ShapeReqCode */
    157 	CARD8	shapeReqType;	/* always X_ShapeSelectInput */
    158 	CARD16	length B16;
    159 	Window	window B32;
    160 	BYTE	enable;		/* xTrue -> send events */
    161 	BYTE	pad1;
    162 	CARD16	pad2 B16;
    163 } xShapeSelectInputReq;
    164 #define sz_xShapeSelectInputReq	12
    165 
    166 typedef struct _ShapeNotify {
    167 	BYTE	type;		/* always eventBase + ShapeNotify */
    168 	BYTE	kind;		/* either ShapeBounding or ShapeClip */
    169 	CARD16	sequenceNumber B16;
    170 	Window	window B32;
    171 	INT16	x B16;
    172 	INT16	y B16;		/* extents of new shape */
    173 	CARD16	width B16;
    174 	CARD16	height B16;
    175 	Time	time B32;	/* time of change */
    176 	BYTE	shaped;		/* set when a shape actual exists */
    177 	BYTE	pad0;
    178 	CARD16	pad1 B16;
    179 	CARD32	pad2 B32;
    180 	CARD32	pad3 B32;
    181 } xShapeNotifyEvent;
    182 #define sz_xShapeNotifyEvent	32
    183 
    184 typedef struct _ShapeInputSelected {
    185 	CARD8	reqType;	/* always ShapeReqCode */
    186 	CARD8	shapeReqType;	/* always X_ShapeInputSelected */
    187 	CARD16	length B16;
    188 	Window	window B32;
    189 } xShapeInputSelectedReq;
    190 #define sz_xShapeInputSelectedReq 8
    191 
    192 typedef struct {
    193 	BYTE	type;			/* X_Reply */
    194 	CARD8	enabled;		/* current status */
    195 	CARD16	sequenceNumber B16;
    196 	CARD32	length B32;		/* 0 */
    197 	CARD32	pad1 B32;		/* unused */
    198 	CARD32	pad2 B32;
    199 	CARD32	pad3 B32;
    200 	CARD32	pad4 B32;
    201 	CARD32	pad5 B32;
    202 	CARD32	pad6 B32;
    203 } xShapeInputSelectedReply;
    204 #define sz_xShapeInputSelectedReply	32
    205 
    206 typedef struct _ShapeGetRectangles {
    207     CARD8   reqType;		/* always ShapeReqCode */
    208     CARD8   shapeReqType;	/* always X_ShapeGetRectangles */
    209     CARD16  length B16;
    210     Window  window B32;
    211     CARD8   kind;		/* ShapeBounding or ShapeClip */
    212     CARD8   junk1;
    213     CARD16  junk2 B16;
    214 } xShapeGetRectanglesReq;
    215 #define sz_xShapeGetRectanglesReq	12
    216 
    217 typedef struct {
    218 	BYTE	type;			/* X_Reply */
    219 	CARD8	ordering;	/* UnSorted, YSorted, YXSorted, YXBanded */
    220 	CARD16	sequenceNumber B16;
    221 	CARD32	length B32;		/* not zero */
    222 	CARD32	nrects B32;		/* number of rectangles */
    223 	CARD32 pad1 B32;
    224 	CARD32 pad2 B32;
    225 	CARD32 pad3 B32;
    226 	CARD32 pad4 B32;
    227 	CARD32 pad5 B32;
    228 } xShapeGetRectanglesReply;		/* followed by xRectangles */
    229 #define sz_xShapeGetRectanglesReply 32
    230 
    231 #undef Window
    232 #undef Time
    233 
    234 #endif /* _SHAPESTR_H_ */
    235