
1.1 Basic elements and data structures
1.1.10 Positions and regions
The Window Tool Kit has two basic data structures: positions and regions. The unit of measurement for these structures is a bit.- A position is a data structure that describes a point in space. A position has two nonnegative fixnum components, x and y. These components are Cartesian coordinates relative to the origin; the origin of any object is its upper-left corner. The x-component is the distance to the right of the origin, and the y-component is the distance below the origin.
- Positions usually refer to a point relative to the root viewport or to the viewport upon which a particular operation is to be performed. Some window constructs allow keyword options for specifying positions relative to other objects, such as bitmaps.
- Data structures that describe rectangular areas at particular positions are known as regions. A region has four nonnegative fixnum components, x, y, width, and height. The origin of a region is its top-left point. The corner of a region is the position that is diagonally opposite from the origin.
- The width, height, x, and y locations of viewports and windows can be described or specified as a region. Bitmaps do not have a location on the screen by themselves; thus, they cannot be described as a region.
- The Window Tool Kit includes functions for accessing the dimensions of a region, for testing containment and equality of regions, for testing whether a position is inside a region, and for making active regions.
The Window Tool Kit - 9 SEP 1996

Generated with Harlequin WebMaker