225 lines
5.3 KiB
HTML
225 lines
5.3 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of XShm</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>XShm</H1>
|
|
Section: X FUNCTIONS (3)<BR>Updated: libXext 1.3.4<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
XShmQueryExtension, XShmQueryVersion, XShmPixmapFormat, XShmAttach, XShmDetach
|
|
XShmCreateImage, XShmPutImage, XShmGetImage, XShmCreatePixmap, XShmGetEventBase - X Shared Memory extension functions
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNTAX</H2>
|
|
|
|
<PRE>
|
|
|
|
#include <<A HREF="file:///usr/include/X11/Xlib.h">X11/Xlib.h</A>>
|
|
#include <<A HREF="file:///usr/include/sys/ipc.h">sys/ipc.h</A>>
|
|
#include <<A HREF="file:///usr/include/sys/shm.h">sys/shm.h</A>>
|
|
#include <<A HREF="file:///usr/include/X11/extensions/XShm.h">X11/extensions/XShm.h</A>>
|
|
|
|
Bool XShmQueryExtension(
|
|
Display *display);
|
|
|
|
Bool XShmQueryVersion(
|
|
Display *display;
|
|
int *major, *minor;
|
|
Bool *pixmaps);
|
|
|
|
int XShmPixmapFormat(
|
|
Display *display);
|
|
|
|
Bool XShmAttach(
|
|
Display *display;
|
|
XShmSegmentInfo *shminfo);
|
|
|
|
Bool XShmDetach(
|
|
Display *display;
|
|
XShmSegmentInfo *shminfo);
|
|
|
|
|
|
XImage *XShmCreateImage (
|
|
Display *display;
|
|
Visual *visual;
|
|
unsigned int depth;
|
|
int format;
|
|
char *data;
|
|
XShmSegmentInfo *shminfo;
|
|
unsigned int width, height);
|
|
|
|
Bool XShmPutImage(
|
|
Display *display;
|
|
Drawable d;
|
|
GC gc;
|
|
XImage *image;
|
|
int src_x, src_y, dest_x, dest_y;
|
|
unsigned int width, height;
|
|
bool send_event);
|
|
|
|
Bool XShmGetImage (
|
|
Display *display;
|
|
Drawable d;
|
|
XImage *image;
|
|
int x, y;
|
|
unsigned long plane_mask);
|
|
|
|
Pixmap XShmCreatePixmap(
|
|
Display *display;
|
|
Drawable d;
|
|
char *data;
|
|
XShmSegmentInfo *shminfo;
|
|
unsigned int width, height, depth);
|
|
|
|
Status XShmGetEventBase(
|
|
Display *display);
|
|
|
|
|
|
</PRE>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>STRUCTURES</H2>
|
|
|
|
<PRE>
|
|
|
|
<I>Events:</I>
|
|
typedef struct {
|
|
int type; /* of event */
|
|
unsigned long serial; /* # of last request processed by server*/
|
|
Bool send_event; /* true if this came from a SendEvent request*/
|
|
Display *display; /* Display the event was read from */
|
|
Drawable drawable; /* drawable of request */
|
|
int major_code; /* ShmReqCode */
|
|
int minor_code; /* X_ShmPutImage */
|
|
ShmSeg shmseg; /* the ShmSeg used in the request*/
|
|
unsigned long offset; /* the offset into ShmSeg used in the request*/
|
|
} XShmCompletionEvent;
|
|
|
|
<I>a structure of type XShmSegmentInfo :</I>
|
|
|
|
typedef struct {
|
|
ShmSeg shmseg; /* resource id */
|
|
int shmid; /* kernel id */
|
|
char *shmaddr; /* address in client */
|
|
Bool readOnly; /* how the server should attach it */
|
|
} XShmSegmentInfo;
|
|
|
|
</PRE><A NAME="lbAE"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
<P>
|
|
|
|
|
|
|
|
<I>XShmQueryExtension</I>
|
|
|
|
checks to see if the shared memory extensions are available for the
|
|
specified display.
|
|
<P>
|
|
|
|
|
|
|
|
<I>XShmQueryVersion</I>
|
|
|
|
returns the version numbers of the extension implementation. Shared
|
|
memory pixmaps are supported if the pixmaps argument returns true.
|
|
<P>
|
|
|
|
|
|
|
|
<I>XShmAttach</I>
|
|
|
|
tells the server to attach to your shared memory segment. If all goes
|
|
well, you will get a non-zero status, back and your XImage is ready
|
|
for use.
|
|
<P>
|
|
|
|
|
|
|
|
<I>XShmDetach</I>
|
|
|
|
tells the server to detach from your shared memory segment.
|
|
<P>
|
|
|
|
|
|
|
|
<I>XShmPutImage</I>
|
|
|
|
combines an image in memory with a shape of the specified drawable. If
|
|
XYBitmap format is used, the depth must be one, or a ``BadMatch''
|
|
error results. The foreground pixel in the GC defines the source for
|
|
the one bits in the image, and the background pixel defines the source
|
|
for the zero bits. For XYPixmap and ZPixmap, the depth must match the
|
|
depth of the drawable, or a ``BadMatch'' error results.
|
|
<P>
|
|
|
|
|
|
|
|
<I>XShmGetImage</I>
|
|
|
|
reads image data into a shared memory XImage where display is the
|
|
display of interest, drawable is the source drawable, image is the
|
|
destination XImage, x and y are offsets within the drawable, and
|
|
plane_mask defines which planes are to be read.
|
|
<P>
|
|
|
|
|
|
|
|
<I>XShmCreateImage</I>
|
|
|
|
allocates the memory needed for an XImage structure for the specified
|
|
display but does not allocate space for the image itself.
|
|
<P>
|
|
|
|
|
|
|
|
<I>XShmPixmapFormat</I>
|
|
|
|
gets the format for the server. If your application can deal with the
|
|
server pixmap data format, a shared memory segment and shminfo
|
|
structure are created.
|
|
<P>
|
|
|
|
|
|
|
|
<I>XShmCreatePixmap</I>
|
|
|
|
points to a pixmap which you can manipulate in all of the usual ways,
|
|
with the added bonus of being able to edit its contents directly
|
|
through the shared memory segment.
|
|
<P>
|
|
|
|
|
|
|
|
<I>XShmGetEventBase</I>
|
|
|
|
gets the completion event value.
|
|
<P>
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<I>MIT-SHM - The MIT Shared Memory Extension </I>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">SYNTAX</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">STRUCTURES</A><DD>
|
|
<DT id="4"><A HREF="#lbAE">DESCRIPTION</A><DD>
|
|
<DT id="5"><A HREF="#lbAF">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:01 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|