41 lines
2.3 KiB
Plaintext
41 lines
2.3 KiB
Plaintext
IN: gadgets
|
|
USING: help generic ;
|
|
|
|
HELP: clip
|
|
{ $var-description "The current clipping rectangle." } ;
|
|
|
|
HELP: draw-gadget*
|
|
{ $values { "gadget" gadget } }
|
|
{ $contract "Draws the gadget by making OpenGL calls. The top-left corner of the gadget should be drawn at the location stored in the " { $link origin } " variable." }
|
|
{ $notes "This word should not be called directly. To force a gadget to redraw, call " { $link relayout-1 } "." } ;
|
|
|
|
HELP: draw-interior
|
|
{ $values { "interior" object } { "gadget" gadget } }
|
|
{ $contract "Draws the interior of a gadget by making OpenGL calls. The " { $link gadget-interior } " slot may be set to objects implementing this generic word." } ;
|
|
|
|
HELP: draw-boundary
|
|
{ $values { "boundary" object } { "gadget" gadget } }
|
|
{ $contract "Draws the boundary of a gadget by making OpenGL calls. The " { $link gadget-boundary } " slot may be set to objects implementing this generic word." } ;
|
|
|
|
HELP: solid
|
|
{ $class-description "A class implementing the " { $link draw-boundary } " and " { $link draw-interior } " generic words to draw a solid outline or a solid fill, respectively. The " { $link solid-color } " slot stores a color specifier." } ;
|
|
|
|
HELP: gradient
|
|
{ $class-description "A class implementing the " { $link draw-interior } " generic word to draw a smoothly shaded transition between colors. The " { $link gradient-colors } " slot stores a sequence of color specifiers and the gradient is drawn in the direction given by the " { $link gadget-orientation } " slot of the gadget." } ;
|
|
|
|
HELP: polygon
|
|
{ $class-description "A class implementing the " { $link draw-boundary } " and " { $link draw-interior } " generic words to draw a solid outline or a solid filled polygon, respectively. Instances of " { $link polygon } " have two slots:"
|
|
{ $list
|
|
{ { $link polygon-color } " - a color specifier" }
|
|
{ { $link polygon-points } " - a sequence of points" }
|
|
}
|
|
} ;
|
|
|
|
HELP: <polygon>
|
|
{ $values { "color" "a color specifier" } { "points" "a sequence of points" } }
|
|
{ $description "Creates a new instance of " { $link polygon } "." } ;
|
|
|
|
HELP: <polygon-gadget>
|
|
{ $values { "color" "a color specifier" } { "points" "a sequence of points" } { "gadget" "a new " { $link gadget } } }
|
|
{ $description "Creates a gadget which is drawn as a solid filled polygon. The gadget's size is the minimum bounding box containing all the points of the polygon." } ;
|