Qt 4.8
|
#include <qtextengine_p.h>
Classes | |
struct | FontEngineCache |
struct | LayoutData |
struct | SpecialData |
Public Types | |
enum | LayoutState { LayoutEmpty, InLayout, LayoutFailed } |
enum | Mode { WidthOnly = 0x07 } |
enum | ShaperFlag { RightToLeft = 0x0001, DesignMetrics = 0x0002, GlyphIndicesOnly = 0x0004 } |
Public Functions | |
QFixed | alignLine (const QScriptLine &line) |
bool | atSpace (int position) const |
const HB_CharAttributes * | attributes () const |
bool | atWordSeparator (int position) const |
QGlyphLayout | availableGlyphs (const QScriptItem *si) const |
glyph_metrics_t | boundingBox (int from, int len) const |
QFixed | calculateTabWidth (int index, QFixed x) const |
returns the width of tab at index (in the tabs array) with the tab-start at position x More... | |
void | clearLineData () |
QAbstractTextDocumentLayout * | docLayout () const |
QString | elidedText (Qt::TextElideMode mode, const QFixed &width, int flags=0) const |
bool | ensureSpace (int nGlyphs) const |
int | findItem (int strPos) const |
QFont | font (const QScriptItem &si) const |
QFont | font () const |
QFontEngine * | fontEngine (const QScriptItem &si, QFixed *ascent=0, QFixed *descent=0, QFixed *leading=0) const |
QTextCharFormat | format (const QScriptItem *si) const |
int | formatIndex (const QScriptItem *si) const |
QTextFormatCollection * | formats () const |
void | freeMemory () |
bool | hasFormats () const |
void | indexAdditionalFormats () |
void | insertionPointsForLine (int lineNum, QVector< int > &insertionPoints) |
void | invalidate () |
bool | isRightToLeft () const |
void | itemize () const |
void | justify (const QScriptLine &si) |
QFixed | leadingSpaceWidth (const QScriptLine &line) |
int | length (int item) const |
int | length (const QScriptItem *si) const |
int | lineNumberForTextPosition (int pos) |
unsigned short * | logClusters (const QScriptItem *si) const |
int | nextLogicalPosition (int oldPos) const |
QFixed | offsetInLigature (const QScriptItem *si, int pos, int max, int glyph_pos) |
int | positionAfterVisualMovement (int oldPos, QTextCursor::MoveOperation op) |
int | positionInLigature (const QScriptItem *si, int end, QFixed x, QFixed edge, int glyph_pos, bool cursorOnCharacter) |
int | previousLogicalPosition (int oldPos) const |
QTextEngine (LayoutData *data) | |
QTextEngine () | |
QTextEngine (const QString &str, const QFont &f) | |
void | resetFontEngineCache () |
void | shape (int item) const |
QGlyphLayout | shapedGlyphs (const QScriptItem *si) const |
void | shapeLine (const QScriptLine &line) |
glyph_metrics_t | tightBoundingBox (int from, int len) const |
void | validate () const |
bool | visualCursorMovement () const |
QFixed | width (int charFrom, int numChars) const |
~QTextEngine () | |
Static Public Functions | |
static void | bidiReorder (int numRuns, const quint8 *levels, int *visualOrder) |
Public Variables | |
QTextBlock | block |
uint | cacheGlyphs: 1 |
FontEngineCache | feCache |
QFont | fnt |
uint | forceJustification: 1 |
uint | ignoreBidi: 1 |
LayoutData * | layoutData |
QScriptLineArray | lines |
QFixed | maxWidth |
QFixed | minWidth |
QTextOption | option |
QPointF | position |
SpecialData * | specialData |
uint | stackEngine: 1 |
QString | text |
int * | underlinePositions |
uint | visualMovement: 1 |
Private Functions | |
void | addRequiredBoundaries () const |
int | beginningOfLine (int lineNum) |
int | endOfLine (int lineNum) |
int | getClusterLength (unsigned short *logClusters, const HB_CharAttributes *attributes, int from, int to, int glyph_pos, int *start) |
void | resolveAdditionalFormats () const |
void | setBoundary (int strPos) const |
void | shapeText (int item) const |
void | shapeTextMac (int item) const |
void | shapeTextWithCE (int item) const |
void | shapeTextWithHarfbuzz (int item) const |
take the item from layoutData->items and More... | |
void | splitItem (int item, int pos) const |
Definition at line 421 of file qtextengine_p.h.
Enumerator | |
---|---|
LayoutEmpty | |
InLayout | |
LayoutFailed |
Definition at line 423 of file qtextengine_p.h.
enum QTextEngine::Mode |
Enumerator | |
---|---|
WidthOnly |
Definition at line 452 of file qtextengine_p.h.
Enumerator | |
---|---|
RightToLeft | |
DesignMetrics | |
GlyphIndicesOnly |
Definition at line 457 of file qtextengine_p.h.
QTextEngine::QTextEngine | ( | LayoutData * | data | ) |
QTextEngine::QTextEngine | ( | ) |
Definition at line 1385 of file qtextengine.cpp.
Definition at line 1390 of file qtextengine.cpp.
QTextEngine::~QTextEngine | ( | ) |
Definition at line 1397 of file qtextengine.cpp.
|
private |
Definition at line 2385 of file qtextengine.cpp.
Referenced by itemize().
QFixed QTextEngine::alignLine | ( | const QScriptLine & | line | ) |
Definition at line 2832 of file qtextengine.cpp.
Referenced by QTextLine::cursorToX(), QTextLine::naturalTextRect(), QTextLineItemIterator::QTextLineItemIterator(), and QTextLine::xToCursor().
bool QTextEngine::atSpace | ( | int | position | ) | const |
Definition at line 2437 of file qtextengine.cpp.
Referenced by QTextCursorPrivate::movePosition().
const HB_CharAttributes * QTextEngine::attributes | ( | ) | const |
Definition at line 1405 of file qtextengine.cpp.
Referenced by QTextLine::cursorToX(), elidedText(), justify(), QTextLine::layout_helper(), QTextCursorPrivate::movePosition(), nextLogicalPosition(), positionInLigature(), and previousLogicalPosition().
bool QTextEngine::atWordSeparator | ( | int | position | ) | const |
Definition at line 2397 of file qtextengine.cpp.
Referenced by QTextCursorPrivate::movePosition().
|
inline |
Returns an array of QGlyphLayout items, offset at the script item. Each item in the array matches one glyph in the text, storing the advance, position etc. The returned item's length equals to the number of available glyphs. This may be more than what was actually shaped.
Definition at line 520 of file qtextengine_p.h.
|
private |
Definition at line 3029 of file qtextengine.cpp.
Referenced by positionAfterVisualMovement().
|
static |
Definition at line 774 of file qtextengine.cpp.
Referenced by QPainterPath::addText(), QTextLine::cursorToX(), QPainter::drawText(), QTextLineItemIterator::QTextLineItemIterator(), and QTextLine::xToCursor().
glyph_metrics_t QTextEngine::boundingBox | ( | int | from, |
int | len | ||
) | const |
Definition at line 1736 of file qtextengine.cpp.
returns the width of tab at index (in the tabs array) with the tab-start at position x
Definition at line 2710 of file qtextengine.cpp.
Referenced by boundingBox(), QTextLine::layout_helper(), and width().
void QTextEngine::clearLineData | ( | ) |
Definition at line 1481 of file qtextengine.cpp.
|
inline |
Definition at line 550 of file qtextengine_p.h.
Referenced by QTextLine::draw(), QTextLine::layout_helper(), and shape().
QString QTextEngine::elidedText | ( | Qt::TextElideMode | mode, |
const QFixed & | width, | ||
int | flags = 0 |
||
) | const |
Definition at line 2486 of file qtextengine.cpp.
Referenced by QFontMetrics::elidedText(), QFontMetricsF::elidedText(), and QCommonStylePrivate::viewItemDrawText().
|
private |
Definition at line 3019 of file qtextengine.cpp.
Referenced by positionAfterVisualMovement().
|
inline |
int QTextEngine::findItem | ( | int | strPos | ) | const |
Definition at line 1655 of file qtextengine.cpp.
Referenced by QTextLine::cursorToX(), justify(), QTextLine::layout_helper(), and QTextLine::xToCursor().
QFont QTextEngine::font | ( | const QScriptItem & | si | ) | const |
Definition at line 1848 of file qtextengine.cpp.
Referenced by QTextLine::draw(), QPainter::drawText(), and QTextLine::glyphs().
|
inline |
QFontEngine * QTextEngine::fontEngine | ( | const QScriptItem & | si, |
QFixed * | ascent = 0 , |
||
QFixed * | descent = 0 , |
||
QFixed * | leading = 0 |
||
) | const |
Definition at line 1885 of file qtextengine.cpp.
Referenced by boundingBox(), QTextLine::draw(), justify(), QTextLine::layout_helper(), releaseCachedFontEngine(), shape(), and tightBoundingBox().
QTextCharFormat QTextEngine::format | ( | const QScriptItem * | si | ) | const |
Definition at line 2362 of file qtextengine.cpp.
Referenced by QTextLine::draw(), font(), fontEngine(), resolveAdditionalFormats(), and shape().
int QTextEngine::formatIndex | ( | const QScriptItem * | si | ) | const |
Definition at line 2343 of file qtextengine.cpp.
Referenced by QTextInlineObject::format(), format(), QTextInlineObject::formatIndex(), QTextLine::layout_helper(), and shape().
|
inline |
Definition at line 542 of file qtextengine_p.h.
Referenced by QTextInlineObject::format(), format(), indexAdditionalFormats(), itemize(), QTextLine::layout_helper(), resolveAdditionalFormats(), and shape().
void QTextEngine::freeMemory | ( | ) |
Definition at line 2326 of file qtextengine.cpp.
Referenced by invalidate().
|
private |
Definition at line 2880 of file qtextengine.cpp.
Referenced by positionInLigature().
|
inline |
Definition at line 600 of file qtextengine_p.h.
Referenced by QTextLine::draw(), font(), and fontEngine().
void QTextEngine::indexAdditionalFormats | ( | ) |
Definition at line 2449 of file qtextengine.cpp.
void QTextEngine::insertionPointsForLine | ( | int | lineNum, |
QVector< int > & | insertionPoints | ||
) |
Definition at line 2994 of file qtextengine.cpp.
Referenced by beginningOfLine(), endOfLine(), positionAfterVisualMovement(), and QTextLine::xToCursor().
void QTextEngine::invalidate | ( | ) |
Definition at line 1470 of file qtextengine.cpp.
Referenced by QTextBlockData::invalidate().
bool QTextEngine::isRightToLeft | ( | ) | const |
Definition at line 1636 of file qtextengine.cpp.
Referenced by alignLine(), calculateTabWidth(), QTextLine::cursorToX(), insertionPointsForLine(), itemize(), leadingSpaceWidth(), positionAfterVisualMovement(), and QTextLine::xToCursor().
void QTextEngine::itemize | ( | ) | const |
Definition at line 1502 of file qtextengine.cpp.
Referenced by attributes(), boundingBox(), QTextLine::cursorToX(), QPainter::drawText(), elidedText(), findItem(), isRightToLeft(), justify(), lineNumberForTextPosition(), positionAfterVisualMovement(), tightBoundingBox(), width(), and QTextLine::xToCursor().
void QTextEngine::justify | ( | const QScriptLine & | si | ) |
Definition at line 1995 of file qtextengine.cpp.
Referenced by alignLine(), and QPainter::drawText().
QFixed QTextEngine::leadingSpaceWidth | ( | const QScriptLine & | line | ) |
Definition at line 2822 of file qtextengine.cpp.
Referenced by QTextLine::cursorToX(), justify(), and qt_format_text().
|
inline |
Definition at line 484 of file qtextengine_p.h.
Referenced by attributes(), boundingBox(), calculateTabWidth(), QTextLine::cursorToX(), QPainter::drawText(), elidedText(), fontEngine(), format(), QTextLineItemIterator::getSelectionBounds(), QTextLine::glyphs(), itemize(), justify(), QTextLine::layout_helper(), QTextEngine::LayoutData::LayoutData(), QTextLineItemIterator::next(), nextCharJoins(), nextLogicalPosition(), QTextEngine::LayoutData::reallocate(), tightBoundingBox(), width(), and QTextLine::xToCursor().
|
inline |
Definition at line 490 of file qtextengine_p.h.
int QTextEngine::lineNumberForTextPosition | ( | int | pos | ) |
Definition at line 2980 of file qtextengine.cpp.
Referenced by positionAfterVisualMovement().
|
inline |
Returns a pointer to an array of log clusters, offset at the script item. Each item in the array is a unsigned short. For each character in the original string there is an entry in the table so there is a one to one correlation in indexes between the original text and the index in the logcluster. The value of each item is the position in the glyphs array. Multiple similar pointers in the logclusters array imply that one glyph is used for more than one character.
Definition at line 511 of file qtextengine_p.h.
Referenced by boundingBox(), QTextLine::cursorToX(), QTextLine::draw(), drawMenuText(), QPainter::drawText(), elidedText(), QTextLineItemIterator::getSelectionBounds(), justify(), QTextLineItemIterator::next(), offsetInLigature(), positionInLigature(), splitItem(), tightBoundingBox(), width(), and QTextLine::xToCursor().
int QTextEngine::nextLogicalPosition | ( | int | oldPos | ) | const |
Definition at line 2965 of file qtextengine.cpp.
Referenced by positionAfterVisualMovement().
QFixed QTextEngine::offsetInLigature | ( | const QScriptItem * | si, |
int | pos, | ||
int | max, | ||
int | glyph_pos | ||
) |
Definition at line 2849 of file qtextengine.cpp.
Referenced by QTextLine::cursorToX(), and QTextLineItemIterator::getSelectionBounds().
int QTextEngine::positionAfterVisualMovement | ( | int | oldPos, |
QTextCursor::MoveOperation | op | ||
) |
Definition at line 3039 of file qtextengine.cpp.
int QTextEngine::positionInLigature | ( | const QScriptItem * | si, |
int | end, | ||
QFixed | x, | ||
QFixed | edge, | ||
int | glyph_pos, | ||
bool | cursorOnCharacter | ||
) |
Definition at line 2897 of file qtextengine.cpp.
Referenced by QTextLine::xToCursor().
int QTextEngine::previousLogicalPosition | ( | int | oldPos | ) | const |
void QTextEngine::resetFontEngineCache | ( | ) |
Definition at line 1463 of file qtextengine.cpp.
Referenced by invalidate(), and ~QTextEngine().
|
private |
Definition at line 2804 of file qtextengine.cpp.
Referenced by itemize().
|
private |
Definition at line 2661 of file qtextengine.cpp.
Referenced by addRequiredBoundaries().
void QTextEngine::shape | ( | int | item | ) | const |
Definition at line 1434 of file qtextengine.cpp.
Referenced by boundingBox(), calculateTabWidth(), QTextLine::cursorToX(), elidedText(), justify(), QTextLine::layout_helper(), QTextLineItemIterator::next(), tightBoundingBox(), width(), and QTextLine::xToCursor().
|
inline |
Returns an array of QGlyphLayout items, offset at the script item. Each item in the array matches one glyph in the text, storing the advance, position etc. The returned item's length equals to the number of shaped glyphs.
Definition at line 529 of file qtextengine_p.h.
Referenced by QPainterPath::addText(), boundingBox(), calculateTabWidth(), QTextLine::cursorToX(), QTextLine::draw(), drawMenuText(), QPainter::drawText(), elidedText(), QTextLineItemIterator::getSelectionBounds(), QTextLine::glyphs(), justify(), QTextLine::layout_helper(), QTextLineItemIterator::next(), offsetInLigature(), positionInLigature(), splitItem(), tightBoundingBox(), width(), and QTextLine::xToCursor().
void QTextEngine::shapeLine | ( | const QScriptLine & | line | ) |
Definition at line 861 of file qtextengine.cpp.
Referenced by QTextLine::cursorToX(), QPainter::drawText(), QTextLineItemIterator::QTextLineItemIterator(), and QTextLine::xToCursor().
|
private |
Definition at line 905 of file qtextengine.cpp.
Referenced by shape().
|
private |
Definition at line 557 of file qtextengine_mac.cpp.
|
private |
Definition at line 1107 of file qtextengine.cpp.
|
private |
take the item from layoutData->items and
Definition at line 1186 of file qtextengine.cpp.
|
private |
Definition at line 2677 of file qtextengine.cpp.
Referenced by setBoundary().
glyph_metrics_t QTextEngine::tightBoundingBox | ( | int | from, |
int | len | ||
) | const |
Definition at line 1797 of file qtextengine.cpp.
void QTextEngine::validate | ( | ) | const |
Definition at line 1486 of file qtextengine.cpp.
Referenced by elidedText(), and itemize().
|
inline |
Definition at line 601 of file qtextengine_p.h.
Referenced by QTextLine::cursorToX(), and QTextLine::xToCursor().
QFixed QTextEngine::width | ( | int | charFrom, |
int | numChars | ||
) | const |
Definition at line 1674 of file qtextengine.cpp.
Referenced by elidedText(), and leadingSpaceWidth().
QTextBlock QTextEngine::block |
Definition at line 583 of file qtextengine_p.h.
Referenced by calculateTabWidth(), QTextLine::draw(), font(), fontEngine(), QTextInlineObject::format(), format(), formatIndex(), indexAdditionalFormats(), itemize(), QTextLine::layout_helper(), nextLogicalPosition(), resolveAdditionalFormats(), QScriptLine::setDefaultHeight(), shape(), QTextLine::textLength(), and validate().
uint QTextEngine::cacheGlyphs |
Definition at line 591 of file qtextengine_p.h.
Referenced by init().
|
mutable |
Definition at line 579 of file qtextengine_p.h.
Referenced by fontEngine(), and resetFontEngineCache().
QFont QTextEngine::fnt |
Definition at line 582 of file qtextengine_p.h.
Referenced by calculateTabWidth(), elidedText(), font(), fontEngine(), itemize(), and QScriptLine::setDefaultHeight().
uint QTextEngine::forceJustification |
Definition at line 593 of file qtextengine_p.h.
Referenced by QPainter::drawText(), init(), justify(), and qt_format_text().
uint QTextEngine::ignoreBidi |
Definition at line 590 of file qtextengine_p.h.
Referenced by QPainter::drawText(), init(), itemize(), and qt_format_text().
|
mutable |
Definition at line 598 of file qtextengine_p.h.
Referenced by QPainterPath::addText(), QTextInlineObject::ascent(), atSpace(), attributes(), atWordSeparator(), bidiItemize(), boundingBox(), calculateTabWidth(), QTextLine::cursorToX(), QTextInlineObject::descent(), QTextLine::draw(), drawMenuText(), QPainter::drawText(), elidedText(), findItem(), QTextInlineObject::format(), QTextInlineObject::formatIndex(), formatIndex(), freeMemory(), QTextInlineObject::height(), init(), insertionPointsForLine(), isRightToLeft(), itemize(), justify(), QTextLine::layout_helper(), lineNumberForTextPosition(), QTextLineItemIterator::next(), nextLogicalPosition(), positionAfterVisualMovement(), QStackTextEngine::QStackTextEngine(), QTextLineItemIterator::QTextLineItemIterator(), QTextInlineObject::rect(), resolveAdditionalFormats(), QTextInlineObject::setAscent(), setBoundary(), QTextInlineObject::setDescent(), QTextLine::setLineWidth(), QTextInlineObject::setWidth(), shape(), splitItem(), QTextInlineObject::textDirection(), QTextInlineObject::textPosition(), tightBoundingBox(), validate(), QTextInlineObject::width(), width(), QTextLine::xToCursor(), and ~QTextEngine().
|
mutable |
Definition at line 562 of file qtextengine_p.h.
Referenced by addSelectedRegionsToPath(), QPainterPath::addText(), QTextLine::ascent(), clearLineData(), QTextLine::cursorToX(), QTextLine::descent(), QTextLine::draw(), freeMemory(), QTextLine::glyphs(), QTextLine::height(), QTextLine::horizontalAdvance(), insertionPointsForLine(), QTextLine::layout_helper(), QTextLine::leading(), QTextLine::leadingIncluded(), lineNumberForTextPosition(), QTextLine::naturalTextRect(), QTextLine::naturalTextWidth(), QTextLine::position(), positionAfterVisualMovement(), qt_format_text(), QTextLine::rect(), QTextLine::setLeadingIncluded(), QTextLine::setLineWidth(), QTextLine::setNumColumns(), QTextLine::setPosition(), QTextLine::textLength(), QTextLine::textStart(), QTextLine::width(), QTextLine::x(), QTextLine::xToCursor(), and QTextLine::y().
QFixed QTextEngine::maxWidth |
Definition at line 588 of file qtextengine_p.h.
Referenced by init(), invalidate(), and QTextLine::layout_helper().
QFixed QTextEngine::minWidth |
Definition at line 587 of file qtextengine_p.h.
Referenced by init(), invalidate(), and QTextLine::layout_helper().
QTextOption QTextEngine::option |
Definition at line 585 of file qtextengine_p.h.
Referenced by alignLine(), calculateTabWidth(), QTextLine::cursorToX(), QTextLine::draw(), QPainter::drawText(), isRightToLeft(), itemize(), justify(), QTextLine::layout_helper(), leadingSpaceWidth(), qt_format_text(), QTextLine::textLength(), and validate().
QPointF QTextEngine::position |
Definition at line 589 of file qtextengine_p.h.
Referenced by calculateTabWidth(), findItem(), and itemize().
SpecialData* QTextEngine::specialData |
Definition at line 614 of file qtextengine_p.h.
Referenced by addRequiredBoundaries(), format(), formatIndex(), indexAdditionalFormats(), init(), invalidate(), itemize(), resolveAdditionalFormats(), validate(), and ~QTextEngine().
uint QTextEngine::stackEngine |
Definition at line 592 of file qtextengine_p.h.
Referenced by freeMemory(), init(), QStackTextEngine::QStackTextEngine(), and ~QTextEngine().
QString QTextEngine::text |
Definition at line 581 of file qtextengine_p.h.
Referenced by validate().
int* QTextEngine::underlinePositions |
Definition at line 596 of file qtextengine_p.h.
Referenced by QTextLine::draw(), drawMenuText(), init(), and qt_format_text().
uint QTextEngine::visualMovement |
Definition at line 594 of file qtextengine_p.h.
Referenced by init().