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 #include <X11/extensions/shm.h>
     37 
     38 typedef unsigned long ShmSeg;
     39 
     40 typedef struct {
     41     int	type;		    /* of event */
     42     unsigned long serial;   /* # of last request processed by server */
     43     Bool send_event;	    /* true if this came frome a SendEvent request */
     44     Display *display;	    /* Display the event was read from */
     45     Drawable drawable;	    /* drawable of request */
     46     int major_code;	    /* ShmReqCode */
     47     int minor_code;	    /* X_ShmPutImage */
     48     ShmSeg shmseg;	    /* the ShmSeg used in the request */
     49     unsigned long offset;   /* the offset into ShmSeg used in the request */
     50 } XShmCompletionEvent;
     51 
     52 typedef struct {
     53     ShmSeg shmseg;	/* resource id */
     54     int shmid;		/* kernel id */
     55     char *shmaddr;	/* address in client */
     56     Bool readOnly;	/* how the server should attach it */
     57 } XShmSegmentInfo;
     58 
     59 _XFUNCPROTOBEGIN
     60 
     61 Bool XShmQueryExtension(
     62     Display*		/* dpy */
     63 );
     64 
     65 int XShmGetEventBase(
     66     Display* 		/* dpy */
     67 );
     68 
     69 Bool XShmQueryVersion(
     70     Display*		/* dpy */,
     71     int*		/* majorVersion */,
     72     int*		/* minorVersion */,
     73     Bool*		/* sharedPixmaps */
     74 );
     75 
     76 int XShmPixmapFormat(
     77     Display*		/* dpy */
     78 );
     79 
     80 Status XShmAttach(
     81     Display*		/* dpy */,
     82     XShmSegmentInfo*	/* shminfo */
     83 );
     84 
     85 Status XShmDetach(
     86     Display*		/* dpy */,
     87     XShmSegmentInfo*	/* shminfo */
     88 );
     89 
     90 Status XShmPutImage(
     91     Display*		/* dpy */,
     92     Drawable		/* d */,
     93     GC			/* gc */,
     94     XImage*		/* image */,
     95     int			/* src_x */,
     96     int			/* src_y */,
     97     int			/* dst_x */,
     98     int			/* dst_y */,
     99     unsigned int	/* src_width */,
    100     unsigned int	/* src_height */,
    101     Bool		/* send_event */
    102 );
    103 
    104 Status XShmGetImage(
    105     Display*		/* dpy */,
    106     Drawable		/* d */,
    107     XImage*		/* image */,
    108     int			/* x */,
    109     int			/* y */,
    110     unsigned long	/* plane_mask */
    111 );
    112 
    113 XImage *XShmCreateImage(
    114     Display*		/* dpy */,
    115     Visual*		/* visual */,
    116     unsigned int	/* depth */,
    117     int			/* format */,
    118     char*		/* data */,
    119     XShmSegmentInfo*	/* shminfo */,
    120     unsigned int	/* width */,
    121     unsigned int	/* height */
    122 );
    123 
    124 Pixmap XShmCreatePixmap(
    125     Display*		/* dpy */,
    126     Drawable		/* d */,
    127     char*		/* data */,
    128     XShmSegmentInfo*	/* shminfo */,
    129     unsigned int	/* width */,
    130     unsigned int	/* height */,
    131     unsigned int	/* depth */
    132 );
    133 
    134 _XFUNCPROTOEND
    135 
    136 #endif
    137