XShmQueryExtension, XShmQueryVersion, XShmPixmapFormat, XShmAttach, XShmDetach XShmCreateImage, XShmPutImage, XShmGetImage, XShmCreatePixmap, XShmGetEventBase - X Shared Memory extension functions


#include <X11/Xlib.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h>



Display *display);

Bool XShmQueryVersion(

Display *display;

int *major, *minor;

Bool *pixmaps);

Status XShmPixmapFormat(

Display *display);

Status XShmAttach(

Display *display;

XShmSegmentInfo *shminfo);

Status XShmDetach(

Display *display;

XShmSegmentInfo *shminfo);

XImage *XShmCreateImage (

Display *display;

Visual *visual;

unsigned int depth;

int format;

char *data;

XShmSegmentInfo *shminfo;

unsigned int width, height);

Status 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);

Status 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);


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;

a structure of type XShmSegmentInfo :

typedef struct {
ShmSeg shmseg; /* resource id */
int shmid; /* kernel id */
char *shmaddr; /* address in client */
Bool readOnly; /* how the server should attach it */
} XShmSegmentInfo;


XShmQueryExtension checks to see if the shared memory extensions are available for the specified display.

XShmQueryVersion returns the version numbers of the extension implementation. Shared memory pixmaps are supported if the pixmaps argument returns true.

XShmAttach 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.

XShmDetach tells the server to detach from your shared memory segment.

XShmPutImage 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.

XShmGetImage 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.

XShmCreateImage allocates the memory needed for an XImage structure for the specified display but does not allocate space for the image itself.

XShmPixmapFormat 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.

XShmCreatePixmap 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.

XShmGetEventBase gets the completion event value.


MIT-SHM - The MIT Shared Memory Extension

More Linux Commands

gnutls_cipher_get(3) - API function - Linux manual page.....
Get currently used cipher. RETURNS the currently used cipher, a gnutls_cipher_algorithm_t type. REPORTING BUGS Report bugs to &lt;bug-gnutls@gnu.org&gt;. GnuTLS home

podofopdfinfo(1) provide information about a PDF file.......
podofopdfinfo is one of the command line tools from the PoDoFo library that provide several useful operations to work with PDF files. It can provide a number of

termattrs_sp(3ncurses) - curses screen-pointer extension....
This implementation can be configured to provide a set of functions which improve the ability to manage multiple screens. This feature can be added to any of th

Tcl_ServiceAll(3) - the event queue and notifier interfaces
The interfaces described here are used to customize the Tcl event loop. The two most common customizations are to add new sources of events and to merge Tcls ev

ungetmouse_sp(3ncurses) - curses screen-pointer extension...
This implementation can be configured to provide a set of functions which improve the ability to manage multiple screens. This feature can be added to any of th

gnutls_openpgp_crt_get_subkey_count(3) - API function.......
gnutls_openpgp_crt_get_subkey_count.3 - This function will return the number of subkeys present in the given OpenPGP certificate. RETURNS the number of subkeys,

delwin(3ncurses) - create curses windows - Linux man page...
Calling newwin creates and returns a pointer to a new window with the given number of lines and columns. The upper left-hand corner of the window is at line beg

glFrontFace(3gl) - define front- and back-facing polygons...
In a scene composed entirely of opaque closed surfaces, back-facing polygons are never visible. Eliminating these invisible polygons has the obvious benefit of

fadvise64(2) - predeclare an access pattern for file data...
Programs can use posix_fadvise() to announce an intention to access file data in a specific pattern in the future, thus allowing the kernel to perform appropria

is_pad(3ncurses) - curses window properties - Linux man page
This implementation provides functions which return properties set in the WINDOW structure, allowing it to be opaque if the symbol NCURSES_OPAQUE is defined: is

_traceattr(3ncurses) - curses debugging routines (Man Page)
The trace routines are used for debugging the ncurses libraries, as well as applications which use the ncurses libraries. These functions are normally available

XkbSetCompatMap(3) - Modify the server's compatibility map
To modify the servers compatibility map, first modify a local copy of the Xkb compatibility map, then call XkbSetCompatMap. You may allocate a new compatibility

We can't live, work or learn in freedom unless the software we use is free.