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 /* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
     28 
     29 #ifndef _SHMPROTO_H_
     30 #define _SHMPROTO_H_
     31 
     32 #include <X11/extensions/shm.h>
     33 
     34 #define ShmSeg CARD32
     35 #define Drawable CARD32
     36 #define VisualID CARD32
     37 #define GContext CARD32
     38 #define Pixmap CARD32
     39 
     40 #define X_ShmQueryVersion		0
     41 #define X_ShmAttach			1
     42 #define X_ShmDetach			2
     43 #define X_ShmPutImage			3
     44 #define X_ShmGetImage			4
     45 #define X_ShmCreatePixmap		5
     46 
     47 typedef struct _ShmQueryVersion {
     48     CARD8	reqType;		/* always ShmReqCode */
     49     CARD8	shmReqType;		/* always X_ShmQueryVersion */
     50     CARD16	length B16;
     51 } xShmQueryVersionReq;
     52 #define sz_xShmQueryVersionReq	4
     53 
     54 typedef struct {
     55     BYTE	type;			/* X_Reply */
     56     BOOL	sharedPixmaps;
     57     CARD16	sequenceNumber B16;
     58     CARD32	length B32;
     59     CARD16	majorVersion B16;	/* major version of SHM protocol */
     60     CARD16	minorVersion B16;	/* minor version of SHM protocol */
     61     CARD16	uid B16;
     62     CARD16	gid B16;
     63     CARD8	pixmapFormat;
     64     CARD8	pad0;
     65     CARD16	pad1 B16;
     66     CARD32	pad2 B32;
     67     CARD32	pad3 B32;
     68     CARD32	pad4 B32;
     69 } xShmQueryVersionReply;
     70 #define sz_xShmQueryVersionReply	32
     71 
     72 typedef struct _ShmAttach {
     73     CARD8	reqType;	/* always ShmReqCode */
     74     CARD8	shmReqType;	/* always X_ShmAttach */
     75     CARD16	length B16;
     76     ShmSeg	shmseg B32;
     77     CARD32	shmid B32;
     78     BOOL	readOnly;
     79     BYTE	pad0;
     80     CARD16	pad1 B16;
     81 } xShmAttachReq;
     82 #define sz_xShmAttachReq	16
     83 
     84 typedef struct _ShmDetach {
     85     CARD8	reqType;	/* always ShmReqCode */
     86     CARD8	shmReqType;	/* always X_ShmDetach */
     87     CARD16	length B16;
     88     ShmSeg	shmseg B32;
     89 } xShmDetachReq;
     90 #define sz_xShmDetachReq	8
     91 
     92 typedef struct _ShmPutImage {
     93     CARD8	reqType;	/* always ShmReqCode */
     94     CARD8	shmReqType;	/* always X_ShmPutImage */
     95     CARD16	length B16;
     96     Drawable	drawable B32;
     97     GContext	gc B32;
     98     CARD16	totalWidth B16;
     99     CARD16	totalHeight B16;
    100     CARD16	srcX B16;
    101     CARD16	srcY B16;
    102     CARD16	srcWidth B16;
    103     CARD16	srcHeight B16;
    104     INT16	dstX B16;
    105     INT16	dstY B16;
    106     CARD8	depth;
    107     CARD8	format;
    108     CARD8	sendEvent;
    109     CARD8	bpad;
    110     ShmSeg	shmseg B32;
    111     CARD32	offset B32;
    112 } xShmPutImageReq;
    113 #define sz_xShmPutImageReq	40
    114 
    115 typedef struct _ShmGetImage {
    116     CARD8	reqType;	/* always ShmReqCode */
    117     CARD8	shmReqType;	/* always X_ShmGetImage */
    118     CARD16	length B16;
    119     Drawable	drawable B32;
    120     INT16	x B16;
    121     INT16	y B16;
    122     CARD16	width B16;
    123     CARD16	height B16;
    124     CARD32	planeMask B32;
    125     CARD8	format;
    126     CARD8	pad0;
    127     CARD8	pad1;
    128     CARD8	pad2;
    129     ShmSeg	shmseg B32;
    130     CARD32	offset B32;
    131 } xShmGetImageReq;
    132 #define sz_xShmGetImageReq	32
    133 
    134 typedef struct _ShmGetImageReply {
    135     BYTE	type;  /* X_Reply */
    136     CARD8	depth;
    137     CARD16	sequenceNumber B16;
    138     CARD32	length B32;
    139     VisualID	visual B32;
    140     CARD32	size B32;
    141     CARD32	pad0 B32;
    142     CARD32	pad1 B32;
    143     CARD32	pad2 B32;
    144     CARD32	pad3 B32;
    145 } xShmGetImageReply;
    146 #define sz_xShmGetImageReply	32
    147 
    148 typedef struct _ShmCreatePixmap {
    149     CARD8	reqType;	/* always ShmReqCode */
    150     CARD8	shmReqType;	/* always X_ShmCreatePixmap */
    151     CARD16	length B16;
    152     Pixmap	pid B32;
    153     Drawable	drawable B32;
    154     CARD16	width B16;
    155     CARD16	height B16;
    156     CARD8	depth;
    157     CARD8	pad0;
    158     CARD8	pad1;
    159     CARD8	pad2;
    160     ShmSeg	shmseg B32;
    161     CARD32	offset B32;
    162 } xShmCreatePixmapReq;
    163 #define sz_xShmCreatePixmapReq 28
    164 
    165 typedef struct _ShmCompletion {
    166     BYTE	type;		/* always eventBase + ShmCompletion */
    167     BYTE	bpad0;
    168     CARD16	sequenceNumber B16;
    169     Drawable	drawable B32;
    170     CARD16	minorEvent B16;
    171     BYTE	majorEvent;
    172     BYTE	bpad1;
    173     ShmSeg	shmseg B32;
    174     CARD32	offset B32;
    175     CARD32	pad0 B32;
    176     CARD32	pad1 B32;
    177     CARD32	pad2 B32;
    178 } xShmCompletionEvent;
    179 #define sz_xShmCompletionEvent	32
    180 
    181 #undef ShmSeg
    182 #undef Drawable
    183 #undef VisualID
    184 #undef GContext
    185 #undef Pixmap
    186 
    187 #endif /* _SHMPROTO_H_ */
    188