#include
Bool XShmQueryExtension(
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, width, height;
int format;
char *data;
XShmSegmentInfo *shminfo);
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);
_a _s_t_r_u_c_t_u_r_e _o_f _t_y_p_e _X_S_h_m_S_e_g_m_e_n_t_I_n_f_o _:
typedef struct {
ShmSeg shmseg; /* resource id */
int shmid; /* kernel id */
char *shmaddr; /* address in client */
Bool readOnly; /* how the server should attach it */
} XShmSegmentInfo;
_X_S_h_m_Q_u_e_r_y_E_x_t_e_n_s_i_o_n
checks to see if the shared memory extensions are available for the
specified display.
_X_S_h_m_Q_u_e_r_y_V_e_r_s_i_o_n
returns the version numbers of the extension implementation. Shared
memory pixmaps are supported if the pixmaps argument returns true.
_X_S_h_m_A_t_t_a_c_h
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.
_X_S_h_m_D_e_t_a_c_h
tells the server to detach from your shared memory segment.
_X_S_h_m_P_u_t_I_m_a_g_e
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.
_X_S_h_m_G_e_t_I_m_a_g_e
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.
_X_S_h_m_C_r_e_a_t_e_I_m_a_g_e
allocates the memory needed for an XImage structure for the specified
display but does not allocate space for the image itself.
_X_S_h_m_P_i_x_m_a_p_F_o_r_m_a_t
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.
_X_S_h_m_C_r_e_a_t_e_P_i_x_m_a_p
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.
_X_S_h_m_G_e_t_E_v_e_n_t_B_a_s_e
gets the completion event value.
STRUCTURES
_E_v_e_n_t_s_:
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;
DESCRIPTION
SEE ALSO
_M_I_T_-_S_H_M _- _T_h_e _M_I_T _S_h_a_r_e_d _M_e_m_o_r_y _E_x_t_e_n_s_i_o_n