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