Home | History | Annotate | Download | only in extensions
      1 /* $XFree86: xc/include/extensions/XShm.h,v 1.11 2003/04/03 15:11:07 dawes Exp $ */
      2 /************************************************************
      3 
      4 Copyright 1989, 1998  The Open Group
      5 
      6 Permission to use, copy, modify, distribute, and sell this software and its
      7 documentation for any purpose is hereby granted without fee, provided that
      8 the above copyright notice appear in all copies and that both that
      9 copyright notice and this permission notice appear in supporting
     10 documentation.
     11 
     12 The above copyright notice and this permission notice shall be included in
     13 all copies or substantial portions of the Software.
     14 
     15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
     18 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
     19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
     20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     21 
     22 Except as contained in this notice, the name of The Open Group shall not be
     23 used in advertising or otherwise to promote the sale, use or other dealings
     24 in this Software without prior written authorization from The Open Group.
     25 
     26 ********************************************************/
     27 
     28 /* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
     29 
     30 /* $Xorg: XShm.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
     31 
     32 #ifndef _XSHM_H_
     33 #define _XSHM_H_
     34 
     35 #include <X11/Xfuncproto.h>
     36 
     37 #define X_ShmQueryVersion		0
     38 #define X_ShmAttach			1
     39 #define X_ShmDetach			2
     40 #define X_ShmPutImage			3
     41 #define X_ShmGetImage			4
     42 #define X_ShmCreatePixmap		5
     43 
     44 #define ShmCompletion			0
     45 #define ShmNumberEvents			(ShmCompletion + 1)
     46 
     47 #define BadShmSeg			0
     48 #define ShmNumberErrors			(BadShmSeg + 1)
     49 
     50 typedef unsigned long ShmSeg;
     51 
     52 #ifndef _XSHM_SERVER_
     53 typedef struct {
     54     int	type;		    /* of event */
     55     unsigned long serial;   /* # of last request processed by server */
     56     Bool send_event;	    /* true if this came frome a SendEvent request */
     57     Display *display;	    /* Display the event was read from */
     58     Drawable drawable;	    /* drawable of request */
     59     int major_code;	    /* ShmReqCode */
     60     int minor_code;	    /* X_ShmPutImage */
     61     ShmSeg shmseg;	    /* the ShmSeg used in the request */
     62     unsigned long offset;   /* the offset into ShmSeg used in the request */
     63 } XShmCompletionEvent;
     64 
     65 typedef struct {
     66     ShmSeg shmseg;	/* resource id */
     67     int shmid;		/* kernel id */
     68     char *shmaddr;	/* address in client */
     69     Bool readOnly;	/* how the server should attach it */
     70 } XShmSegmentInfo;
     71 
     72 _XFUNCPROTOBEGIN
     73 
     74 Bool XShmQueryExtension(
     75     Display*		/* dpy */
     76 );
     77 
     78 int XShmGetEventBase(
     79     Display* 		/* dpy */
     80 );
     81 
     82 Bool XShmQueryVersion(
     83     Display*		/* dpy */,
     84     int*		/* majorVersion */,
     85     int*		/* minorVersion */,
     86     Bool*		/* sharedPixmaps */
     87 );
     88 
     89 int XShmPixmapFormat(
     90     Display*		/* dpy */
     91 );
     92 
     93 Status XShmAttach(
     94     Display*		/* dpy */,
     95     XShmSegmentInfo*	/* shminfo */
     96 );
     97 
     98 Status XShmDetach(
     99     Display*		/* dpy */,
    100     XShmSegmentInfo*	/* shminfo */
    101 );
    102 
    103 Status XShmPutImage(
    104     Display*		/* dpy */,
    105     Drawable		/* d */,
    106     GC			/* gc */,
    107     XImage*		/* image */,
    108     int			/* src_x */,
    109     int			/* src_y */,
    110     int			/* dst_x */,
    111     int			/* dst_y */,
    112     unsigned int	/* src_width */,
    113     unsigned int	/* src_height */,
    114     Bool		/* send_event */
    115 );
    116 
    117 Status XShmGetImage(
    118     Display*		/* dpy */,
    119     Drawable		/* d */,
    120     XImage*		/* image */,
    121     int			/* x */,
    122     int			/* y */,
    123     unsigned long	/* plane_mask */
    124 );
    125 
    126 XImage *XShmCreateImage(
    127     Display*		/* dpy */,
    128     Visual*		/* visual */,
    129     unsigned int	/* depth */,
    130     int			/* format */,
    131     char*		/* data */,
    132     XShmSegmentInfo*	/* shminfo */,
    133     unsigned int	/* width */,
    134     unsigned int	/* height */
    135 );
    136 
    137 Pixmap XShmCreatePixmap(
    138     Display*		/* dpy */,
    139     Drawable		/* d */,
    140     char*		/* data */,
    141     XShmSegmentInfo*	/* shminfo */,
    142     unsigned int	/* width */,
    143     unsigned int	/* height */,
    144     unsigned int	/* depth */
    145 );
    146 
    147 _XFUNCPROTOEND
    148 
    149 #else /* _XSHM_SERVER_ */
    150 
    151 #include "screenint.h"
    152 #include "pixmap.h"
    153 #include "gc.h"
    154 
    155 extern void ShmRegisterFbFuncs(
    156     ScreenPtr /* pScreen */
    157 );
    158 
    159 #endif
    160 
    161 #endif
    162