Led 3.0 Class Library Documentation

Module MultiRowTextImager

Classes and Global Functions Index

Module Description:

MultiRowTextImager is a TextImager which supports having partition elements made up of multirow text.

Class: MultiRowTextImager [public]

Base Classes: PartitioningTextImager

A PartitioningTextImager which supports the notion of having multiple rows of text per line.

NB: Although this class properly supports the APIs for PartitioningTextImager, it has a limitation, based on its historical implementation. It assumes that there is a one-to-one correspondance between its Partition and the TextImager, and that this Partition is (or subclasses from MultiRowTextImager::MultiRowPartition).

This limitation is partly (largely) based on the fact that we use the trick of piggybacking row-wrap information on the partition markers themselves. A future version of this class might keep the per-row information in a MarkerCover, or some such other data structure.

Member Details

MultiRowTextImager::ContainsMappedDisplayCharacters [public]

bool MultiRowTextImager::ContainsMappedDisplayCharacters (const Led_tChar* text, size_t nTChars) const

Override TextImager::ContainsMappedDisplayCharacters to hide '\n' characters. See qDefaultLedSoftLineBreakChar.

MultiRowTextImager::CountRowDifference [public]

size_t MultiRowTextImager::CountRowDifference (RowReference lhs, RowReference rhs) const

Count the # of rows from one rowreference to the other (order doesn't matter)

See also MultiRowTextImager::CountRowDifferenceLimited

MultiRowTextImager::CountRowDifferenceLimited [public]

size_t MultiRowTextImager::CountRowDifferenceLimited (RowReference lhs, RowReference rhs, size_t limit) const

Count the # of rows from one rowreference to the other (order doesn't matter), but never count a number of rows exceeding 'limit'. Just return 'limit' if there are 'limit' rows or more.

The reason you would use this intead of MultiRowTextImager::CountRowDifference is if you are only checking to see the rowcount is 'at least' something, and you dont wnat to count all the rows. That CAN be a pig performance dog - since it tends to force a word-wrap.

See also MultiRowTextImager::CountRowDifference

MultiRowTextImager::DrawInterLineSpace [public]

void MultiRowTextImager::DrawInterLineSpace (MultiRowPartitionMarker* pm, Led_Tablet tablet, Led_Coordinate vPosOfTopOfInterlineSpace, bool segmentHilighted, bool printing)

Called by MultiRowTextImager::DrawRow to draw space between paragraphs (lines). Typically this is nothing. But this hook can be used to draw various sorts of annotations on paragraphs (as in LECs LVEJ side-by-side mode).

MultiRowTextImager::DrawRow [public]

void MultiRowTextImager::DrawRow (const RowReference& row, Led_Tablet tablet, const Led_Rect& currentRowRect, const Led_Rect& invalidRowRect,

Draw the given row of text. Erase the background (by calling TextImager::EraseBackground), and then draw the segments of the row by calling MultiRowTextImager::DrawRowSegments. Then draw any hilighting. This routine CAN cause flicker. Flicker is eliminated at a higher level (caller) by using offscreen bitmaps.

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.

MultiRowTextImager::DrawRowHilight [public]

void MultiRowTextImager::DrawRowHilight (const RowReference& row, Led_Tablet tablet, const Led_Rect& currentRowRect, const Led_Rect& /*invalidRowRect*/,

Called by MultiRowTextImager::DrawRow to draw any necessary hilighting for the current selection for the given row.

MultiRowTextImager::DrawRowSegments [public]

void MultiRowTextImager::DrawRowSegments (const RowReference& row, Led_Tablet tablet, const Led_Rect& currentRowRect, const Led_Rect& invalidRowRect,

Called by MultiRowTextImager::DrawRow to draw (in or mode - don't worry about erasing) all the segments which make up the row of text. Here, we take care of any sort of justification, or indending (in subclasses which override this method). Its rowRect its called with represents the entire row. Subclasses can call DrawSegment () with adjusted row-rects taking into account indents, etc.

MultiRowTextImager::GetIthRowReference [public]

MultiRowTextImager::RowReference MultiRowTextImager::GetIthRowReference (size_t ith) const

Get the ith row reference in the document. Asserts value ith refers to a valid row number.

It calls MultiRowTextImager::GetIthRowReferenceFromHere todo its work (which returns a bool rather than asserting).

MultiRowTextImager::GetIthRowReferenceFromHere [public]

MultiRowTextImager::RowReference MultiRowTextImager::GetIthRowReferenceFromHere (RowReference fromHere, long ith) const

Adjust fromHere by ith rows. If ith is zero, then this returns fromHere. It asserts there are at least ith rows from the given one to retrieve. It calls MultiRowTextImager::GetIthRowReferenceFromHere todo its work (which returns a bool rather than asserting).

See also MultiRowTextImager::GetNextRowReference, MultiRowTextImager::GetPreviousRowReference.

MultiRowTextImager::GetLastRowReferenceInWindow [public]

MultiRowTextImager::RowReference MultiRowTextImager::GetLastRowReferenceInWindow () const

Returns the last row-reference in the window (end of window).

MultiRowTextImager::GetMarkerPositionOfEndOfWindow [public]

size_t MultiRowTextImager::GetMarkerPositionOfEndOfWindow () const

Efficient implemenation of TextImager::GetMarkerPositionOfEndOfWindow

MultiRowTextImager::GetMarkerPositionOfStartOfWindow [public]

size_t MultiRowTextImager::GetMarkerPositionOfStartOfWindow () const

Efficient implemenation of TextImager::GetMarkerPositionOfStartOfWindow

MultiRowTextImager::GetNextRowReference [public]

bool MultiRowTextImager::GetNextRowReference (RowReference* adjustMeInPlace) const

Advance the given row reference argument to the next row. Return true if there is a valid next row. And false if adjustMeInPlace was already on the last row.

See also MultiRowTextImager::GetPreviousRowReference.

MultiRowTextImager::GetPreviousRowReference [public]

bool MultiRowTextImager::GetPreviousRowReference (RowReference* adjustMeInPlace) const

Retreat the given row reference argument to the previous row. Return true if there is a valid previous row. And false if adjustMeInPlace was already on the first row.

See also MultiRowTextImager::GetNextRowReference.

MultiRowTextImager::GetRowHeight [public]

Led_Distance MultiRowTextImager::GetRowHeight (RowReference row) const

Returns the height (in standard GDI units, usually pixels) of the given row reference.

MultiRowTextImager::GetRowLength [public]

size_t MultiRowTextImager::GetRowLength (RowReference row) const

Gets the length of the given row (in Led_tChars).

See also MultiRowTextImager::GetStartOfRow and MultiRowTextImager::GetEndOfRow.

MultiRowTextImager::GetRowRelativeBaselineOfRowContainingPosition [public]

Led_Distance MultiRowTextImager::GetRowRelativeBaselineOfRowContainingPosition (size_t charPosition) const

Override/implement TextImager::GetRowRelativeBaselineOfRowContainingPosition.

MultiRowTextImager::InvalidateAllCaches [public]

void MultiRowTextImager::InvalidateAllCaches ()

Invalidate cached row-height/etc information for the entire imager. Invalidate rows in a window cached values, etc. Called automatically from MultiRowTextImager::TabletChangedMetrics ()

MultiRowTextImager::RemoveMappedDisplayCharacters [public]

size_t MultiRowTextImager::RemoveMappedDisplayCharacters (Led_tChar* copyText, size_t nTChars) const

Override TextImager::RemoveMappedDisplayCharacters to hide '\n' characters.

MultiRowTextImager::ScrollSoShowing [public]

void MultiRowTextImager::ScrollSoShowing (size_t markerPos, size_t andTryToShowMarkerPos)

Implement TextImager::ScrollSoShowing API.

MultiRowTextImager::TabletChangedMetrics [public]

void MultiRowTextImager::TabletChangedMetrics ()

Hook TextImager::TabletChangedMetrics () to call MultiRowTextImager::InvalidateAllCaches ()

Class: MultiRowTextImager::MultiRowPartition [protected]

Base Classes: LineBasedPartition

Class: MultiRowTextImager::MultiRowPartitionMarker [public]

Base Classes: Partition::PartitionMarker

A partition marker which keeps track of extra information to support having multiple rows per line. This information includes a pixel height of the partition element. A RowHeight array (GetRowHeight()). And a RowStart array (GetLineRelativeRowStartPosition). Also, each of these partition markers has an interline space field.

Note that the RowHeight is in the standard GDI-defined units of height (typically pixels). And that the rowStart array specifies Led_tChar offsets into the partition marker.

NB: that these numbers are zero-based offsets, and from the start of the PM. They are kept relative to the start of the PM, because otherwise they would need to be real markers in their own right to get updated when text before the given PM is added or deleted. Making them relative to the PM start is the only way to assure they don't need to be updated (except when the PM itself has its contents changed, and in that case, it gets a MarkerOwner::DidUpdate call, and can invalidat the rowstarts array.

Member Details

MultiRowTextImager::MultiRowPartitionMarker::GetInterLineSpace [public]

Led_Distance MultiRowTextImager::MultiRowPartitionMarker::GetInterLineSpace () const

Get the interline space associated with a partition. Each partition can have a unique interline space. These are computed by overriding the MultiRowPartitionMarker::CalculateInterLineSpace () method. They are not set directly. Though you CAN mark as invalid the interline space which has already been computed for a given partition element via MultiRowTextImager::MultiRowPartitionMarker::InvalidateInterLineSpace ().

MultiRowTextImager::MultiRowPartitionMarker::GetLastRow [public]

size_t MultiRowTextImager::MultiRowPartitionMarker::GetLastRow () const

Return the last valid row index (may invoke FillCache if cached result not already available).

MultiRowTextImager::MultiRowPartitionMarker::GetPixelHeight [public]

Led_Distance MultiRowTextImager::MultiRowPartitionMarker::GetPixelHeight () const

Return the cached height of the given partition element. This is the sum of the pixel height computed in FillCache () for the actual text, and the interline space (see GetInterLineSpace ()).

MultiRowTextImager::MultiRowPartitionMarker::GetRowCount [public]

size_t MultiRowTextImager::MultiRowPartitionMarker::GetRowCount () const

Return the cached number of rows in this partition element. This is computed in MultiRowTextImager::FillCache (), and specified indirectly via calls (from inside FillCache) to MultiRowTextImager::MultiRowPartitionMarker::IncrementRowCountAndFixCacheBuffers ().

MultiRowTextImager::MultiRowPartitionMarker::InvalidateInterLineSpace [public]

void MultiRowTextImager::MultiRowPartitionMarker::InvalidateInterLineSpace ()

See MultiRowTextImager::MultiRowPartitionMarker::GetInterLineSpace ().

MultiRowTextImager::MultiRowPartitionMarker::PeekAtRowHeight [public]

Led_Distance MultiRowTextImager::MultiRowPartitionMarker::PeekAtRowHeight (size_t i) const

Return the height - (in whatever unit the GDI is using, but typically pixels) of the given row. The internal representation of these things is somewhat obscure for data size reasons, so there is some unpacking to be done.

MultiRowTextImager::MultiRowPartitionMarker::PeekAtRowStart [public]

size_t MultiRowTextImager::MultiRowPartitionMarker::PeekAtRowStart (size_t i) const

Return the partition element relative offset of the start of a given row. So for the first row, this is always zero.

MultiRowTextImager::MultiRowPartitionMarker::SetRowHeight [public]

void MultiRowTextImager::MultiRowPartitionMarker::SetRowHeight (size_t i, Led_Distance rowHeight)

Set the height of a given row. This is typically just done within FillCache().

MultiRowTextImager::MultiRowPartitionMarker::SetRowStart [public]

void MultiRowTextImager::MultiRowPartitionMarker::SetRowStart (size_t i, size_t rowStart)

Set the partition element relative offset of the start of a given row. So for the first row, this is MUST BE zero. This is typically just called during FillCache ().

Class: MultiRowTextImager::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.

Return to Led Page Return to Led ClassLib Documentation Index Return to Led Reference Manual Index
Last Updated 2001-10-20