Shape_MoveShape(3)

NAME
Shape_CombineBitmap, Shape_CombineRectangles, Shape_CombineRectanglesOrdered, Shape_CombineRegion, Shape_CombineWindow, Shape_MoveShape - apply a shaping to a window

SYNOPSIS
#include <tkint.h>
#include <shape.h>

int
Shape_CombineBitmap(interp, tkwin, kind, op, x, y, bitmap)

int
Shape_CombineRectangles(interp, tkwin, kind, op, rectc, rectv)

int
Shape_CombineRectanglesOrdered(interp, tkwin, kind, op, rectc, rectv)

int
Shape_CombineRegion(interp, tkwin, kind, op, x, y, region)

int
Shape_CombineWindow(interp, tkwin, kind, op, x, y, srcwin)

int
Shape_MoveShape(interp, tkwin, kind, x, y)

ARGUMENTS
Interpreter to use for error reporting. Token for window to apply the shaping operation to. Which shape should the operation be applied to; must be a boolean combination of SHAPE_BOUNDING, SHAPE_CLIP, and SHAPE_TOPLEVEL. What kind of operation to apply; should be SHAPE_OP_SET, SHAPE_OP_UNION, SHAPE_OP_INTERSECT, SHAPE_OP_SUBTRACT, or SHAPE_OP_INVERT. Offset (along X axis) to apply to shape. Offset (along Y axis) to apply to shape. Identifier for a bitmap that defines a shape to apply. Number of rectangles in array. Array of rectangles that define a shape to apply. Token for region defining the shape to apply. Token for window whose shape is to be used to apply.

DESCRIPTION

These functions let you set and modify the shape of a given window, tkwin. Each Shape_Combine* function operates almost the same, supporting the same options as to what parts of the window to apply the shaping operation to (kind,) and the same kinds of ways of applying a shape (op.) Most also support the application of an offset (x,y) to the shape to be applied before application to the window, making it easier to support resizing windows. Each function returns TCL_OK on success, and TCL_ERROR on failure (when it leaves a description of the problem in interp suitable for passing back to calling code.)

Shape_CombineBitmap applies the shape defined by the given bitmap, bitmap, to the window.

Shape_CombineRegion applies the shape defined by the given region, region, to the window.

Shape_CombineWindow applies the shape already defined on another window, srcwin, to a window (useful for propagating shapes up window hierarchies.)

Shape_CombineRectangles applies the shape defined by an array of rectc rectangles, rectv, to the window. No overall transformation for the rectangles is supported, since that is easily applied in the calling code.

Shape_CombineRectanglesOrdered applies the shape defined by an array of rectc rectangles, rectv, to the window. The rectangles must be arranged so that they are non-overlapping and proceed in strict scanline order. Not all platforms make use of this extra information. No overall transformation for the rectangles is supported, since that is easily applied in the calling code.

Shape_MoveShape applies a translation (defined by (x,y) in the coordinate system of the root window) to the specified shape of the window.

OPERATIONS
Five operations are supported:

SHAPE_OP_SET
    This sets the shape of the window to be that specified by the source.

SHAPE_OP_UNION
    This updates the shape of the window to include that specified by the source.

SHAPE_OP_INTERSECT
    This updates the shape of the window to be the overlap between the current shape of the window and the shape of the source.

SHAPE_OP_SUBTRACT
    This updates the shape of the window to exclude the shape of the source.

SHAPE_OP_INVERT
    This sets the shape of the window to be wherever was not previously in the shape of the window. The source is ignored.

MODIFICATION TARGETS
Under X, each window has two different shapes; the bounding shape and the clipping shape. The bounding shape specifies which parts of the window obscure things which are in underlying windows, and the clipping shape specifies which parts of the window are actually drawn upon by the application. The space between is the border of the window. Note that parts of windows that can be drawn upon but which do not obscure the underlying matter cannot actually be seen anyway. Tk manages its own borders, so these two shapes should normally be made identical (by passing KIND_BOTH to the kind parameter.) These functions support individual modification though. To make things more complex (i.e. to help the implementation of menubars and embedded windows,) Tk implements toplevel windows using several X windows. This means that to alter the shape of a toplevel, it is also necessary to modify the shape of the containing window. This operation is performed automatically if the KIND_TOPLEVEL flag is set in the kind parameter.

AUTHOR
Donal K. Fellows <fellowsd@cs.man.ac.uk>

SEE ALSO
shape(n), Shape_GetBbox(3), Shape_RenderTextAsRectangles(3)