7. C language Binding


The C routines provide direct access to the protocol and add no additional semantics.

The include file for this extension is <X11/extensions/shape.h>. The defined shape kinds are ShapeBounding and ShapeClip. The defined region operations are ShapeSet, ShapeUnion, ShapeIntersect, ShapeSubtract, and ShapeInvert.

Bool

XShapeQueryExtension (display, event_base, error_base)
Display *display;
int *event_base; /* RETURN */
int *error_base; /* RETURN */
Returns True if the specified display supports the SHAPE extension else False. If the extension is supported, *event_base is set to the event number for ShapeNotify events and *error_base would be set to the error number for the first error for this extension. As no errors are defined for this version of the extension, the value returned here is not defined (nor useful).

Status

XShapeQueryVersion (display, major_version, minor_version)
Display *display;
int *major_version, *minor_version; /* RETURN */
If the extension is supported, the major and minor version numbers of the extension supported by the display are set and a non-zero value is returned. Otherwise the arguments are not set and 0 is returned.
XShapeCombineRegion (display, dest, dest_kind, x_off, y_off, region, op)
Display *display;
Window dest;
int dest_kind, op, x_off, y_off;
REGION *region;
Converts the specified region into a list of rectangles and calls XShapeCombineRectangles.
XShapeCombineRectangles (display, dest, dest_kind, x_off, y_off, rectangles, n_rects, op, ordering)
Display *display;
Window dest;
int dest_kind, n_rects, op, x_off, y_off, ordering;
XRectangle *rectangles;
If the extension is supported, performs a CombineRectangles operation, otherwise the request is ignored.
XShapeCombineMask (display, dest, dest_kind, x_off, y_off, src, op)
Display *display;
Window dest;
int dest_kind, op, x_off, y_off;
Pixmap src;
If the extension is supported, performs a CombineMask operation, otherwise the request is ignored.
XShapeCombineShape (display, dest, dest_kind, x_off, y_off, src, src_kind, op)
Display *display;
Window dest, src;
int dest_kind, src_kind, op, x_off, y_off;
If the extension is supported, performs a CombineShape operation, otherwise the request is ignored.
XShapeOffsetShape (display, dest, dest_kind, x_off, y_off)
Display *display;
Window dest;
int dest_kind, x_off, y_off;
If the extension is supported, performs an OffsetShape operation, otherwise the request is ignored.
Status XShapeQueryExtents (display, window, bounding_shaped, x_bounding, y_bounding, w_bounding,
h_bounding, clip_shaped, x_clip, y_clip, w_clip, h_clip)
Display *display;
Window window;
Bool *bounding_shaped, *clip_shaped; /* RETURN */
int *x_bounding, *y_bounding, *x_clip, *y_clip; /* RETURN */
unsigned int *w_bounding, *h_bounding, *w_clip, *h_clip; /* RETURN */
If the extension is supported, x_bounding, y_bounding, w_bounding, h_bounding are set to the extents of the bounding shape, and x_clip, y_clip, w_clip, h_clip are set to the extents of the clip shape. For unspecified client regions, the extents of the corresponding default region are used.
If the extension is supported a non-zero value is returned, otherwise 0 is returned.
XShapeSelectInput (display, window, mask)
Display *display;
Window window;
unsigned long mask;
To make this extension more compatible with other interfaces, although only one event type can be selected via the extension, this C interface provides a general mechanism similar to the standard Xlib binding for window events. A mask value has been defined, ShapeNotifyMask, which is the only valid bit in mask which may be specified. The structure for this event is defined as follows:

typedef struct {
int type;
unsigned long serial;
Bool send_event;
Display *display;
Window window;
int kind;
int x,y;
unsigned width, height;
Time time;
Bool shaped;
/* of event */
/* # of last request processed by server */
/* true if this came from a SendEvent request */
/* Display the event was read from */
/* window of event */
/* ShapeBounding or ShapeClip */
/* extents of new region */

/* server timestamp when region changed */
/* true if the region exists */
} XShapeEvent;

unsigned long

XShapeInputSelected (display, window)
Display *display
Window window;
This returns the current input mask for extension events on the specified window; the value returned if ShapeNotify is selected for is ShapeNotifyMask, otherwise it returns zero. If the extension is not supported, 0 is returned.

XRectangle *

XShapeGetRectangles (display, window, kind, count, ordering)
Display *display;
Window window;
int kind;
int *count; /* RETURN */
int *ordering; /* RETURN */
If the extension is not supported, NULL is returned. Otherwise, a list of rectangles describing the region specified by kind is returned.

Home

Contents Previous Chapter Next Chapter