Page 24 | Table of Contents | Index | Page 26 |
Chapters | |||
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30 A, B, C, D, E |
The Rectangle Protocol
The following generic functions comprise the rectangle API. Only rectangle-edges* is in the
rectangle protocol, that is, all classes that are subclasses of rectangle must implement methods
for rectangle-edges*, but need not implement methods for the remaining functions.
=> rectangle-edges* rectangle [Generic Function]
Returns the coordinates of the minimum x and y and maximum x and y of the rectangle rectangle
as four values, min-x, min-y, max-x, and max-y.
=> rectangle-min-point rectangle [Generic Function]
=> rectangle-max-point rectangle [Generic Function]
Returns the min point and max point of the rectangle rectangle, respectively. The position of a
rectangle is specified by its min point.
CLIM will supply default methods for rectangle-min-point and rectangle-max-point on the
protocol class rectangle that are implemented by calling rectangle-edges*.
=> rectangle-min-x rectangle [Generic Function]
=> rectangle-min-y rectangle [Generic Function]
=> rectangle-max-x rectangle [Generic Function]
=> rectangle-max-y rectangle [Generic Function]
Returns (respectively) the minimum x and y coordinate and maximum x and y coordinate of
the rectangle rectangle.
CLIM will supply default methods for these four generic functions on the protocol class rectangle
that are implemented by calling rectangle-edges*.
=> rectangle-width rectangle [Generic Function]
=> rectangle-height rectangle [Generic Function]
=> rectangle-size rectangle [Generic Function]
rectangle-width returns the width of the rectangle rectangle, which is the difference between the
maximum x and its minimum x. rectangle-height returns the height, which is the difference
between the maximum y and its minimum y. rectangle-size returns two values, the width
and the height.
CLIM will supply default methods for these four generic functions on the protocol class rectangle
that are implemented by calling rectangle-edges*.
Page 24 | Table of Contents | Index | Page 26 |
Chapters | |||
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30 A, B, C, D, E |