|(require unstable/gui/ppict)||package: unstable-lib|
A progressive pict or “ppict” is a kind of pict that has an associated “pict placer,” which generally represents a position and alignment. New picts can be placed on the progressive pict by calling ppict-add, and the placer can be updated by calling ppict-go. The ppict-do form provides a compact notation for sequences of those two operations.
A #:go fragment changes the current placer. A #:set fragment replaces the current pict state altogether with a new computed pict. A #:next fragment saves a pict including only the contents emitted so far (but whose alignment takes into account picts yet to come). A #:alt fragment saves the current pict state, executes the sub-sequence that follows, saves the result (as if the sub-sequence ended with #:next), then restores the saved pict state before continuing.
The elem-exprs are interpreted by the current placer. A numeric elem-expr usually represents a spacing change, but some placers do not support them. A spacing change only affects added picts up until the next placer is installed; when a new placer is installed, the spacing is reset, usually to 0.
The ppict-do-state form tracks the current state of the pict. It is updated before a #:go or #:set fragment or before a sequence of elem-exprs. It is not updated in the middle of a chain of elem-exprs, however.
More examples of ppict-do are scattered throughout this section.
An elem that is a real number changes the spacing for subsequent additions. A elem that is #f is discarded; it is permitted as a convenience for conditionally including sub-picts. Note that #f is not equivalent to (blank 0), since the latter will cause spacing to be added around it.
(coord rel-x rel-y [ align #:abs-x abs-x #:abs-y abs-y #:compose composer]) → refpoint-placer? rel-x : real? rel-y : real? align : (or/c 'lt 'ct 'rt 'lc 'cc 'rc 'lb 'cb 'rb) = 'cc abs-x : real? = 0 abs-y : real? = 0 composer : procedure? = computed from align
Additions are aligned according to align, a symbol whose name consists of a horizontal alignment character followed by a vertical alignment character. For example, if align is 'lt, the pict is placed so that its left-top corner is at the reference point; if align is 'rc, the pict is placed so that the center of its bounding box’s right edge coincides with the reference point.
By default, if there are multiple picts to be placed, they are vertically appended, aligned according to the horizontal component of align. For example, if align is 'cc, the default composer is vc-append; for 'lt, the default composer is vl-append. The spacing is initially 0.
(grid cols rows col row [ align #:abs-x abs-x #:abs-y abs-y #:compose composer]) → refpoint-placer? cols : exact-positive-integer? rows : exact-positive-integer? col : exact-integer? row : exact-integer? align : (or/c 'lt 'ct 'rt 'lc 'cc 'rc 'lb 'cb 'rb) = 'cc abs-x : real? = 0 abs-y : real? = 0 composer : procedure? = computed from align
Uses of grid can be translated into uses of coord, but the translation depends on the alignment. For example, (grid 2 2 1 1 'lt) is equivalent to (coord 0 0 'lt), but (grid 2 2 1 1 'rt) is equivalent to (coord 1/2 0 'rt).
When a list picts is to be placed, their bounding boxes are normalized to the maximum width and height of all picts in the list; each pict is centered in its new bounding box. The picts are then cascaded so there is step-x space between each of the picts’ left edges; there is also step-x space between the base pict’s left edge and the first pict’s left edge. Similarly for step-y and the vertical spacing.
If step-x or step-y is 'auto, the spacing between the centers of the picts to be placed is determined automatically so that the inter-pict spacing is the same as the spacing between the last pict and the base.
(at-find-pict find-path [ finder align #:abs-x abs-x #:abs-y abs-y #:compose composer]) → refpoint-placer? find-path : (or/c tag-path? pict-path?) finder : procedure? = cc-find align : (or/c 'lt 'ct 'rt 'lc 'cc 'rc 'lb 'cb 'rb) = 'cc abs-x : real? = 0 abs-y : real? = 0 composer : procedure? = computed from align
x-placer : refpoint-placer? y-placer : refpoint-placer?
|(require unstable/gui/pslide)||package: unstable-lib|
(pslide ppict-do-fragment ...)
Note that the text is not flush against the sides of the slide, because pslide uses a base pict the size of the client area, excluding the margins.
(pslide-base-pict make-base-pict) → void? make-base-pict : (-> pict)
(coord 1/2 1/2 'cc)