Home | History | Annotate | Line # | 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 #ifndef _SHAPEPROTO_H_
     28 #define _SHAPEPROTO_H_
     29 
     30 #include <X11/extensions/shapeconst.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 #define Window CARD32
     38 #define Time CARD32
     39 
     40 #define X_ShapeQueryVersion		0
     41 #define X_ShapeRectangles		1
     42 #define X_ShapeMask			2
     43 #define X_ShapeCombine			3
     44 #define X_ShapeOffset			4
     45 #define X_ShapeQueryExtents		5
     46 #define X_ShapeSelectInput		6
     47 #define X_ShapeInputSelected		7
     48 #define X_ShapeGetRectangles		8
     49 
     50 typedef struct _ShapeQueryVersion {
     51 	CARD8	reqType;		/* always ShapeReqCode */
     52 	CARD8	shapeReqType;		/* always X_ShapeQueryVersion */
     53 	CARD16	length;
     54 } xShapeQueryVersionReq;
     55 #define sz_xShapeQueryVersionReq	4
     56 
     57 typedef struct {
     58 	BYTE	type;			/* X_Reply */
     59 	CARD8	unused;			/* not used */
     60 	CARD16	sequenceNumber;
     61 	CARD32	length;
     62 	CARD16	majorVersion;		/* major version of SHAPE protocol */
     63 	CARD16	minorVersion;		/* minor version of SHAPE protocol */
     64 	CARD32	pad0;
     65 	CARD32	pad1;
     66 	CARD32	pad2;
     67 	CARD32	pad3;
     68 	CARD32	pad4;
     69 } xShapeQueryVersionReply;
     70 #define sz_xShapeQueryVersionReply	32
     71 
     72 typedef struct _ShapeRectangles {
     73 	CARD8	reqType;	/* always ShapeReqCode */
     74 	CARD8	shapeReqType;	/* always X_ShapeRectangles */
     75 	CARD16	length;
     76 	CARD8	op;		/* Set, ... */
     77 	CARD8	destKind;	/* ShapeBounding or ShapeClip */
     78 	CARD8	ordering;	/* UnSorted, YSorted, YXSorted, YXBanded */
     79 	CARD8	pad0;		/* not used */
     80 	Window	dest;
     81 	INT16	xOff;
     82 	INT16	yOff;
     83 } xShapeRectanglesReq;		/* followed by xRects */
     84 #define sz_xShapeRectanglesReq	16
     85 
     86 typedef struct _ShapeMask {
     87 	CARD8	reqType;	/* always ShapeReqCode */
     88 	CARD8	shapeReqType;	/* always X_ShapeMask */
     89 	CARD16	length;
     90 
     91 	CARD8	op;		/* Set, ... */
     92 	CARD8	destKind;	/* ShapeBounding or ShapeClip */
     93 	CARD16	junk;		/* not used */
     94 
     95 	Window	dest;
     96 	INT16	xOff;
     97 	INT16	yOff;
     98 	CARD32	src;		/* 1 bit pixmap */
     99 } xShapeMaskReq;
    100 #define sz_xShapeMaskReq	20
    101 
    102 typedef struct _ShapeCombine {
    103 	CARD8	reqType;	/* always ShapeReqCode */
    104 	CARD8	shapeReqType;	/* always X_ShapeCombine */
    105 	CARD16	length;
    106 	CARD8	op;		/* Set, ... */
    107 	CARD8	destKind;	/* ShapeBounding or ShapeClip */
    108 	CARD8	srcKind;	/* ShapeBounding or ShapeClip */
    109 	CARD8	junk;		/* not used */
    110 	Window	dest;
    111 	INT16	xOff;
    112 	INT16	yOff;
    113 	Window	src;
    114 } xShapeCombineReq;
    115 #define sz_xShapeCombineReq	20
    116 
    117 typedef struct _ShapeOffset {
    118 	CARD8	reqType;	/* always ShapeReqCode */
    119 	CARD8	shapeReqType;	/* always X_ShapeOffset */
    120 	CARD16	length;
    121 	CARD8	destKind;	/* ShapeBounding or ShapeClip */
    122 	CARD8	junk1;		/* not used */
    123 	CARD16	junk2;		/* not used */
    124 	Window	dest;
    125 	INT16	xOff;
    126 	INT16	yOff;
    127 } xShapeOffsetReq;
    128 #define sz_xShapeOffsetReq	16
    129 
    130 typedef struct _ShapeQueryExtents {
    131 	CARD8	reqType;	/* always ShapeReqCode */
    132 	CARD8	shapeReqType;	/* always X_ShapeQueryExtents */
    133 	CARD16	length;
    134 	Window	window;
    135 } xShapeQueryExtentsReq;
    136 #define sz_xShapeQueryExtentsReq	8
    137 
    138 typedef struct {
    139 	BYTE	type;			/* X_Reply */
    140 	CARD8	unused;			/* not used */
    141 	CARD16	sequenceNumber;
    142 	CARD32	length;			/* 0 */
    143 	CARD8	boundingShaped;		/* window has bounding shape */
    144 	CARD8	clipShaped;		/* window has clip shape */
    145 	CARD16	unused1;
    146 	INT16	xBoundingShape;		/* extents of bounding shape */
    147 	INT16	yBoundingShape;
    148 	CARD16	widthBoundingShape;
    149 	CARD16	heightBoundingShape;
    150 	INT16	xClipShape;		/* extents of clip shape */
    151 	INT16	yClipShape;
    152 	CARD16	widthClipShape;
    153 	CARD16	heightClipShape;
    154 	CARD32	pad1;
    155 } xShapeQueryExtentsReply;
    156 #define sz_xShapeQueryExtentsReply	32
    157 
    158 typedef struct _ShapeSelectInput {
    159 	CARD8	reqType;	/* always ShapeReqCode */
    160 	CARD8	shapeReqType;	/* always X_ShapeSelectInput */
    161 	CARD16	length;
    162 	Window	window;
    163 	BYTE	enable;		/* xTrue -> send events */
    164 	BYTE	pad1;
    165 	CARD16	pad2;
    166 } xShapeSelectInputReq;
    167 #define sz_xShapeSelectInputReq	12
    168 
    169 typedef struct _ShapeNotify {
    170 	BYTE	type;		/* always eventBase + ShapeNotify */
    171 	BYTE	kind;		/* either ShapeBounding or ShapeClip */
    172 	CARD16	sequenceNumber;
    173 	Window	window;
    174 	INT16	x;
    175 	INT16	y;		/* extents of new shape */
    176 	CARD16	width;
    177 	CARD16	height;
    178 	Time	time;		/* time of change */
    179 	BYTE	shaped;		/* set when a shape actual exists */
    180 	BYTE	pad0;
    181 	CARD16	pad1;
    182 	CARD32	pad2;
    183 	CARD32	pad3;
    184 } xShapeNotifyEvent;
    185 #define sz_xShapeNotifyEvent	32
    186 
    187 typedef struct _ShapeInputSelected {
    188 	CARD8	reqType;	/* always ShapeReqCode */
    189 	CARD8	shapeReqType;	/* always X_ShapeInputSelected */
    190 	CARD16	length;
    191 	Window	window;
    192 } xShapeInputSelectedReq;
    193 #define sz_xShapeInputSelectedReq 8
    194 
    195 typedef struct {
    196 	BYTE	type;			/* X_Reply */
    197 	CARD8	enabled;		/* current status */
    198 	CARD16	sequenceNumber;
    199 	CARD32	length;		/* 0 */
    200 	CARD32	pad1;		/* unused */
    201 	CARD32	pad2;
    202 	CARD32	pad3;
    203 	CARD32	pad4;
    204 	CARD32	pad5;
    205 	CARD32	pad6;
    206 } xShapeInputSelectedReply;
    207 #define sz_xShapeInputSelectedReply	32
    208 
    209 typedef struct _ShapeGetRectangles {
    210     CARD8   reqType;		/* always ShapeReqCode */
    211     CARD8   shapeReqType;	/* always X_ShapeGetRectangles */
    212     CARD16  length;
    213     Window  window;
    214     CARD8   kind;		/* ShapeBounding or ShapeClip */
    215     CARD8   junk1;
    216     CARD16  junk2;
    217 } xShapeGetRectanglesReq;
    218 #define sz_xShapeGetRectanglesReq	12
    219 
    220 typedef struct {
    221 	BYTE	type;			/* X_Reply */
    222 	CARD8	ordering;	/* UnSorted, YSorted, YXSorted, YXBanded */
    223 	CARD16	sequenceNumber;
    224 	CARD32	length;		/* not zero */
    225 	CARD32	nrects;		/* number of rectangles */
    226 	CARD32	pad1;
    227 	CARD32	pad2;
    228 	CARD32	pad3;
    229 	CARD32	pad4;
    230 	CARD32	pad5;
    231 } xShapeGetRectanglesReply;		/* followed by xRectangles */
    232 #define sz_xShapeGetRectanglesReply 32
    233 
    234 #undef Window
    235 #undef Time
    236 
    237 #endif /* _SHAPEPROTO_H_ */
    238