2.5.7 Bounding Rectangles

# 2.5.7.2 Bounding Rectangle Convenience Functions

The following functions are part of the bounding rectangle Application Programmer Interface, but are not part of the bounding rectangle protocol. They are provided as a convenience to programmers who wish to specialize classes that participate in the bounding rectangle protocol, but they will not complicate the task of those programmers who define their own types (such as sheet classes) that participate in this protocol.

CLIM supplies default methods for all of these generic functions on the protocol class bounding-rectangle that are implemented by calling bounding-rectangle*.

with-bounding-rectangle* [Macro]

Arguments:
(min-x min-y max-x max-y) region`&body` body
Summary:
Binds min-x, min-y, max-x, and max-y to the edges of the bounding rectangle of region, and then executes body in that context. The argument region must be either a bounded region (such as a line or an ellipse) or some other object that obeys the bounding rectangle protocol, such as a sheet or an output record.

The arguments min-x, min-y, max-x, and max-y are not evaluated. body may have zero or more declarations as its first forms.

with-bounding-rectangle* calls bounding-rectangle*.

bounding-rectangle-position [Generic Function]
Arguments:
region
Summary:
Returns the position of the bounding rectangle of region. The position of a bounding rectangle is specified by its min point.

bounding-rectangle-min-x [Generic Function]
Arguments:
region
bounding-rectangle-min-y [Generic Function]
Arguments:
region
bounding-rectangle-max-x [Generic Function]
Arguments:
region
bounding-rectangle-max-y [Generic Function]
Arguments:
region
Summary:
Returns (respectively) the x and y coordinates of the min point and the x and y coordinates of the max point of the bounding rectangle of region. The argument region must be either a bounded region or some other object that obeys the bounding rectangle protocol.

bounding-rectangle-width [Generic Function]
Arguments:
region
bounding-rectangle-height [Generic Function]
Arguments:
region
bounding-rectangle-size [Generic Function]
Arguments:
region
Summary:
Returns the width, height, or size (as two values, the width and height) of the bounding rectangle of region, respectively. region must be either a bounded region or some other object that obeys the bounding rectangle protocol.

The width of a bounding rectangle is the difference between its maximum x coordinate and its minimum x coordinate. The height is the difference between the maximum y coordinate and its minimum y coordinate.

CLIM 2.0 User's Guide - OCT 1998

Generated with Harlequin WebMaker