All Manuals > CLIM 2.0 User Guide > 18 Sheets

18.4 Sheet Geometry

Every sheet has a region and a coordinate system. The region refers to its position and extent on the display device. It is represented by a region object, frequently a rectangle. A sheet's coordinate system is represented by a coordinate transformation that converts coordinates in its coordinate system to coordinates in its parent's coordinate system.

18.4.1 Sheet Geometry Functions

sheet-transformation Generic Function

sheet-transformation sheet

(setf sheet-transformation) Generic Function

(setf sheet-transformation) transformation sheet

Summary: Returns a transformation that converts coordinates in the sheet sheet's coordinate system into coordinates in its parent's coordinate system. Using setf on this accessor will modify the sheet's coordinate system, including moving its region in its parent's coordinate system. When the the transformation is changed, note-sheet-region-changed is called to notify the sheet of the change.

sheet-region Generic Function

sheet-region sheet

(setf sheet-region) Generic Function

(setf sheet-region) region sheet

Summary: Returns a region object that represents the set of points to which the sheet sheet refers. The region is in the sheet's coordinate system. Using setf on this accessor modifies the sheet's region. When the region is changed, note-sheet-region-region is called to notify the sheet of the change.

move-sheet Generic Function

move-sheet sheet x y

Summary: Moves the sheet sheet to the new position (x, y). x and y are expressed in the coordinate system of sheet's parent.

resize-sheet Generic Function

resize-sheet sheet width height

Summary: Resizes the sheet sheet to have a new width width and height height. width and height are real numbers.

move-and-resize-sheet Generic Function

move-and-resize-sheet sheet x y width height

Summary: Moves the sheet sheet to the new position (x, y) and changes its size to the new width width and height height. x and y are expressed in the coordinate system of sheet's parent. width and height are real numbers.

map-sheet-position-to-parent Generic Function

map-sheet-position-to-parent sheet x y

Summary: Applies the sheet sheet's transformation to the point (x, y), returning the coordinates of that point in sheet's parent's coordinate system.

map-sheet-position-to-child Generic Function

map-sheet-position-to-child sheet x y

Summary: Inverts sheet's transformation of the point (x, y) in sheet's parent's coordinate system. It returns the coordinates of the point in sheet's coordinate system.

map-sheet-rectangle*-to-parent Generic Function

map-sheet-rectangle*-to-parent sheet x1 y1 x2 y2

Summary: Applies sheet's transformation to the bounding rectangle specified by the corner points (x1, y1) and (x2, y2), returning the bounding rectangle of the transformed region as four values, min-x, min-y, max-x, and max-y. The arguments x1, y1, x2, and y2 are canonicalized in the same way as for make-bounding-rectangle.

map-sheet-rectangle*-to-child Generic Function

map-sheet-rectangle*-to-child sheet x1 y1 x2 y2

Summary: Applies the inverse of the sheet sheet's transformation to the bounding rectangle delimited by the corner points (x1, y1) and (x2, y2) (represented in sheet's parent's coordinate system), returning the bounding rectangle of the transformed region as four values, min-x, min-y, max-x, and max-y. The arguments x1, y1, x2, and y2 are canonicalized in the same way as for make-bounding-rectangle.

child-containing-position Generic Function

child-containing-position sheet x y

Summary: Returns the topmost enabled direct child of the sheet sheet whose region contains the position (x, y). The position is expressed in sheet's coordinate system.

children-overlapping-region Generic Function

children-overlapping-region sheet region

children-overlapping-rectangle* Generic Function

children-overlapping-rectangle* sheet x1 y1 x2 y2

Summary: Returns the list of enabled direct children of the sheet sheet whose region overlaps the region region. children-overlapping-rectangle* is a special case of children-overlapping-region in which the region is a bounding rectangle whose corner points are (x1, y1) and (x2, y2). The region is expressed in sheet's coordinate system. This function returns fresh objects that may be modified.

sheet-delta-transformation Generic Function

sheet-delta-transformation sheet ancestor

Summary: Returns a transformation that is the composition of all the sheet transformations between the sheets sheet and ancestor. If ancestor is nil, this returns the transformation to the root of the sheet hierarchy. If ancestor is not an ancestor of sheet, the sheet-is-not-ancestor error will be signaled.

The computation of the delta transformation is likely to be cached.

sheet-allocated-region Generic Function

sheet-allocated-region sheet child

Summary: Returns the visible region of the sheet child in the sheet sheet's coordinate system. If child is occluded by any of its siblings, those siblings' regions are subtracted (using region-difference) from child's actual region.

18.4.2 Sheet Geometry Classes

Each of the following implements the sheet geometry protocol in a different manner, according to the sheet's requirements.

sheet-identity-transformation-mixin Class

Summary: This class is mixed into sheet classes whose coordinate systems are identical to that of their parent.

sheet-translation-mixin Class

Summary: This class is mixed into sheet classes whose coordinate systems are related to that of their parent by a simple translation.

sheet-y-inverting-transformation-mixin Class

Summary: This class is mixed into sheet classes whose coordinate systems are related to that of their parent by inverting the y coordinate system, and optionally translating by some amount in x and y.

sheet-transformation-mixin Class

Summary: This class is mixed into sheet classes whose coordinate systems are related to that of their parent by an arbitrary affine transformation.


CLIM 2.0 User Guide - 01 Dec 2021 19:39:01