The SimpleTextImager module provides a very fast, lightweight text imaging implementation. This implementation does not support wordwrapping (or multiple rows per line (Partition element)
SimpleTextImager [public]
PartitioningTextImager
SimpleTextImager is a simple subclass of PartitioningTextImager
. NB: this is a change
from Led 2.2, when as an implementation detail, it subclassed from MultiRowTextImager.
SimpleTextImager assumes that all rows have the same height (specified by ReCalcRowHeight) and that all lines (paragraphs) are displayed in a single row. It is these assumptions that allow this class to display text with much less runtime overhead (both memory and time).
You should be able to assign an arbitrary partition object to a SimpleTextImager
via
the SimpleTextImager::SetPartition
function. And these partition objects should be sharable among
multiple SimpleTextImager's.
NB: Much of this class is subject to change (mostly simplication). This code was originally based on the code for MultiRowTextImager, and as such, it has alot of generality built in which isn't appropriate (like assuming rows all same height allows alot to be simplfied in computations etc).
Unless you must, avoid counting too much on the internals and details of this class.
Member Details |
---|
If you override the virtual, one-arg version of See the one-arg |
Override |
Called by |
Draw the given row of text. Erase the background (by calling NB: This bit about flicker changed in Led 2.2. Earlier Led versions tried to elminate flicker at all levels and avoid offscreen bitmaps. But problems with kerning made this difficult. |
Called by |
Called by |
Get the interline space associated with a SimpleTextImager. Set the per-buffer value with
NB: There is also a one-arg version of |
Get the interline space associated with a particular partition element. This method
is virtual so that subclassers can provide a different interline space for each partition element.
But the default behavior is to simply use the global - buffer value - specified by
|
Get the It calls |
Adjust See also |
Returns the last row-reference in the window (end of window). |
Advance the given row reference argument to the next row. Return true if there
is a valid next row. And false if |
Retreat the given row reference argument to the previous row. Return true if there
is a valid previous row. And false if See also |
Gets the row height for all rows in the Imager. Note that for SimpleTextImager, all rows have
the same height. This function caches the value (computed by |
Gets the length of the given row (in See also SimpleTextImager::GetStartOfRow and SimpleTextImager::GetEndOfRow. |
Override/implement |
Note that the rowHeight associated with this TextImager is invalid. Next time the value is
requested (via |
Called by |
Override |
Implement |
Set the interline space associated for the entire text buffer. Call the
no-arg version of |
See |
SimpleTextImager::RowReference [public]
A utility class to represent a row. It is a struct with a parition marker, and a row number. These things are NOT long-lived. And shouldn't be saved anyplace, as no attempt is made to keep them automaticlly up to date as the text is modified. They are just a convenient, short-hand way to navigate through rows of text.
NOTE - this RowReference stuff is just a design vestige from an earlier implementation. At some point, this module should be rewritten/cleaned up to eliminate this (LGP - 2001-10-20).