Inkscape
Vector Graphics Editor
|
Holds a position within the glyph output of Layout. More...
#include <Layout-TNG.h>
Private Member Functions | |
iterator (Layout const *p, unsigned c, int g) | |
iterator (Layout const *p, unsigned c) | |
void | beginCursorUpDown () |
bool | _cursorLeftOrRightLocalX (Direction direction) |
stores the current x coordinate so that the cursor won't drift. See _x_coordinate | |
bool | _cursorLeftOrRightLocalXByWord (Direction direction) |
moves forward or backwards by until the next character with is_word_start according to the directionality of the current paragraph, but ignoring block progression. | |
Private Attributes | |
Layout const * | _parent_layout |
int | _glyph_index |
unsigned | _char_index |
index into Layout::glyphs, or -1 | |
bool | _cursor_moving_vertically |
index into Layout::character | |
double | _x_coordinate |
for cursor up/down movement we must maintain the x position where we started so the cursor doesn't 'drift' left or right with the repeated quantization to character boundaries. | |
Friends | |
class | Layout |
Holds a position within the glyph output of Layout.
Used to access the output of a Layout, query information and generally move around in it. See Layout for a glossary of the names of functions.
I'm not going to document all the methods because most of their names make their function self-evident.
A lot of the functions would do the same thing in a naive implementation for latin-only text, for example nextCharacter(), nextCursorPosition() and cursorRight(). Generally it's fairly obvious which one you should use in a given situation, but sometimes you might need to put some thought in to it.
All the methods return false if the requested action would have caused the current position to move out of bounds. In this case the position is moved to either begin() or end(), depending on which direction you were going.
Note that some characters do not have a glyph representation (eg line breaks), so if you try using prev/nextGlyph() from one of these you're heading for a crash.
Definition at line 981 of file Layout-TNG.h.
|
inline |
Definition at line 985 of file Layout-TNG.h.
|
inlineprivate |
Definition at line 1093 of file Layout-TNG.h.
|
inlineprivate |
Definition at line 1095 of file Layout-TNG.h.
|
private |
stores the current x coordinate so that the cursor won't drift. See _x_coordinate
moves forward or backwards one cursor position according to the directionality of the current paragraph, but ignoring block progression. Helper for the cursor*() functions.
Definition at line 989 of file Layout-TNG-OutIter.cpp.
|
private |
moves forward or backwards by until the next character with is_word_start according to the directionality of the current paragraph, but ignoring block progression.
Helper for the cursor*WithControl() functions.
Definition at line 1090 of file Layout-TNG-OutIter.cpp.
|
private |
Definition at line 870 of file Layout-TNG-OutIter.cpp.
References _char_index, Inkscape::Text::Layout::_characters, Inkscape::Text::Layout::_chunks, _cursor_moving_vertically, _parent_layout, Inkscape::Text::Layout::_spans, and _x_coordinate.
bool Inkscape::Text::Layout::iterator::cursorDown | ( | int | n = 1 | ) |
Definition at line 1109 of file Layout-TNG-OutIter.cpp.
References Inkscape::Text::Layout::BOTTOM_TO_TOP, Inkscape::Text::Layout::LEFT_TO_RIGHT, and Inkscape::Text::Layout::TOP_TO_BOTTOM.
Referenced by Inkscape::UI::Tools::TextTool::root_handler().
bool Inkscape::Text::Layout::iterator::cursorDownWithControl | ( | ) |
Definition at line 1153 of file Layout-TNG-OutIter.cpp.
References Inkscape::Text::Layout::BOTTOM_TO_TOP, Inkscape::Text::Layout::LEFT_TO_RIGHT, and Inkscape::Text::Layout::TOP_TO_BOTTOM.
Referenced by Inkscape::UI::Tools::TextTool::root_handler().
bool Inkscape::Text::Layout::iterator::cursorLeft | ( | ) |
Definition at line 1120 of file Layout-TNG-OutIter.cpp.
References Inkscape::Text::Layout::LEFT_TO_RIGHT, and Inkscape::Text::Layout::RIGHT_TO_LEFT.
Referenced by Inkscape::UI::Tools::TextTool::root_handler().
bool Inkscape::Text::Layout::iterator::cursorLeftWithControl | ( | ) |
Definition at line 1164 of file Layout-TNG-OutIter.cpp.
References Inkscape::Text::Layout::LEFT_TO_RIGHT, and Inkscape::Text::Layout::RIGHT_TO_LEFT.
Referenced by Inkscape::UI::Tools::TextTool::root_handler().
bool Inkscape::Text::Layout::iterator::cursorRight | ( | ) |
Definition at line 1131 of file Layout-TNG-OutIter.cpp.
References Inkscape::Text::Layout::LEFT_TO_RIGHT, and Inkscape::Text::Layout::RIGHT_TO_LEFT.
Referenced by Inkscape::UI::Tools::TextTool::root_handler().
bool Inkscape::Text::Layout::iterator::cursorRightWithControl | ( | ) |
Definition at line 1175 of file Layout-TNG-OutIter.cpp.
References Inkscape::Text::Layout::LEFT_TO_RIGHT, and Inkscape::Text::Layout::RIGHT_TO_LEFT.
Referenced by Inkscape::UI::Tools::TextTool::root_handler().
bool Inkscape::Text::Layout::iterator::cursorUp | ( | int | n = 1 | ) |
Definition at line 1098 of file Layout-TNG-OutIter.cpp.
References Inkscape::Text::Layout::BOTTOM_TO_TOP, Inkscape::Text::Layout::RIGHT_TO_LEFT, and Inkscape::Text::Layout::TOP_TO_BOTTOM.
Referenced by Inkscape::UI::Tools::TextTool::root_handler().
bool Inkscape::Text::Layout::iterator::cursorUpWithControl | ( | ) |
Definition at line 1142 of file Layout-TNG-OutIter.cpp.
References Inkscape::Text::Layout::BOTTOM_TO_TOP, Inkscape::Text::Layout::RIGHT_TO_LEFT, and Inkscape::Text::Layout::TOP_TO_BOTTOM.
Referenced by Inkscape::UI::Tools::TextTool::root_handler().
|
inline |
Definition at line 1201 of file Layout-TNG.h.
Referenced by Inkscape::UI::Tools::TextTool::_styleQueried(), SPText::newline_to_sodipodi(), Inkscape::UI::Dialog::SpellCheck::nextWord(), and sp_te_get_string_multiline().
bool Inkscape::Text::Layout::iterator::nextCursorPosition | ( | ) |
Referenced by Inkscape::UI::Tools::TextTool::root_handler().
bool Inkscape::Text::Layout::iterator::nextEndOfSentence | ( | ) |
bool Inkscape::Text::Layout::iterator::nextEndOfWord | ( | ) |
|
inline |
Definition at line 1181 of file Layout-TNG.h.
References _char_index, Inkscape::Text::Layout::_characters, _cursor_moving_vertically, _glyph_index, Inkscape::Text::Layout::_glyphs, and _parent_layout.
Referenced by Inkscape::LivePathEffect::getNodes(), Inkscape::UI::Tools::MeasureTool::showCanvasItems(), and sp_selected_item_to_curved_repr().
bool Inkscape::Text::Layout::iterator::nextLineCursor | ( | int | n = 1 | ) |
Definition at line 879 of file Layout-TNG-OutIter.cpp.
References MIN.
bool Inkscape::Text::Layout::iterator::nextStartOfChunk | ( | ) |
bool Inkscape::Text::Layout::iterator::nextStartOfLine | ( | ) |
Referenced by SPFlowtext::getAsText(), and insert_text_fallback().
bool Inkscape::Text::Layout::iterator::nextStartOfParagraph | ( | ) |
bool Inkscape::Text::Layout::iterator::nextStartOfSentence | ( | ) |
bool Inkscape::Text::Layout::iterator::nextStartOfShape | ( | ) |
Referenced by Inkscape::UI::Tools::TextTool::root_handler().
bool Inkscape::Text::Layout::iterator::nextStartOfSource | ( | ) |
bool Inkscape::Text::Layout::iterator::nextStartOfSpan | ( | ) |
bool Inkscape::Text::Layout::iterator::nextStartOfWord | ( | ) |
Referenced by Inkscape::UI::Dialog::SpellCheck::nextWord().
|
inline |
Definition at line 994 of file Layout-TNG.h.
References _char_index, and _glyph_index.
|
inline |
Definition at line 1001 of file Layout-TNG.h.
References _char_index.
|
inline |
Definition at line 1003 of file Layout-TNG.h.
References _char_index.
|
inline |
Definition at line 992 of file Layout-TNG.h.
References _char_index, and _glyph_index.
|
inline |
Definition at line 1005 of file Layout-TNG.h.
References _char_index.
|
inline |
Definition at line 1007 of file Layout-TNG.h.
References _char_index.
|
inline |
Definition at line 1213 of file Layout-TNG.h.
Referenced by Inkscape::UI::Tools::TextTool::_styleQueried(), and sp_te_insert().
bool Inkscape::Text::Layout::iterator::prevCursorPosition | ( | ) |
Referenced by Inkscape::UI::Tools::TextTool::root_handler().
bool Inkscape::Text::Layout::iterator::prevEndOfSentence | ( | ) |
bool Inkscape::Text::Layout::iterator::prevEndOfWord | ( | ) |
|
inline |
Definition at line 1193 of file Layout-TNG.h.
bool Inkscape::Text::Layout::iterator::prevLineCursor | ( | int | n = 1 | ) |
Definition at line 903 of file Layout-TNG-OutIter.cpp.
References MIN.
bool Inkscape::Text::Layout::iterator::prevStartOfChunk | ( | ) |
bool Inkscape::Text::Layout::iterator::prevStartOfLine | ( | ) |
bool Inkscape::Text::Layout::iterator::prevStartOfParagraph | ( | ) |
bool Inkscape::Text::Layout::iterator::prevStartOfSentence | ( | ) |
bool Inkscape::Text::Layout::iterator::prevStartOfShape | ( | ) |
bool Inkscape::Text::Layout::iterator::prevStartOfSource | ( | ) |
bool Inkscape::Text::Layout::iterator::prevStartOfSpan | ( | ) |
Referenced by insert_text_fallback().
bool Inkscape::Text::Layout::iterator::prevStartOfWord | ( | ) |
bool Inkscape::Text::Layout::iterator::thisEndOfLine | ( | ) |
Definition at line 856 of file Layout-TNG-OutIter.cpp.
Referenced by Inkscape::UI::Toolbar::TextToolbar::_cursorMoved(), Inkscape::Text::Layout::baseline(), Inkscape::Text::Layout::baselineAnchorPoint(), Inkscape::UI::Tools::TextTool::item_handler(), and Inkscape::UI::Tools::TextTool::root_handler().
bool Inkscape::Text::Layout::iterator::thisStartOfChunk | ( | ) |
Referenced by SPFlowtext::getAsText().
bool Inkscape::Text::Layout::iterator::thisStartOfLine | ( | ) |
bool Inkscape::Text::Layout::iterator::thisStartOfParagraph | ( | ) |
bool Inkscape::Text::Layout::iterator::thisStartOfShape | ( | ) |
Referenced by SPFlowtext::getAsText(), and Inkscape::UI::Tools::TextTool::root_handler().
bool Inkscape::Text::Layout::iterator::thisStartOfSource | ( | ) |
bool Inkscape::Text::Layout::iterator::thisStartOfSpan | ( | ) |
|
friend |
Definition at line 983 of file Layout-TNG.h.
|
private |
index into Layout::glyphs, or -1
Definition at line 1086 of file Layout-TNG.h.
Referenced by beginCursorUpDown(), Inkscape::Text::Layout::characterAnchorPoint(), Inkscape::Text::Layout::characterAt(), Inkscape::Text::Layout::characterBoundingBox(), Inkscape::Text::Layout::chunkAnchorPoint(), Inkscape::Text::Layout::createSelectionShape(), Inkscape::Text::Layout::getSourceOfCharacter(), Inkscape::Text::Layout::isCursorPosition(), Inkscape::Text::Layout::isEndOfSentence(), Inkscape::Text::Layout::isEndOfWord(), Inkscape::Text::Layout::isHidden(), Inkscape::Text::Layout::isStartOfSentence(), Inkscape::Text::Layout::isStartOfWord(), Inkscape::Text::Layout::isWhitespace(), Inkscape::Text::Layout::iteratorToCharIndex(), Inkscape::Text::Layout::lineIndex(), nextGlyph(), operator!=(), operator<(), operator<=(), operator==(), operator>(), operator>=(), Inkscape::Text::Layout::paragraphIndex(), Inkscape::Text::Layout::queryCursorShape(), Inkscape::Text::Layout::shapeIndex(), Inkscape::Text::Layout::simulateLayoutUsingKerning(), and Inkscape::Text::Layout::validateIterator().
|
private |
index into Layout::character
Definition at line 1087 of file Layout-TNG.h.
Referenced by beginCursorUpDown(), and nextGlyph().
|
private |
Definition at line 1085 of file Layout-TNG.h.
Referenced by Inkscape::Text::Layout::characterBoundingBox(), Inkscape::Text::Layout::convertToCurves(), Inkscape::Text::Layout::glyphBoundingBox(), nextGlyph(), operator!=(), operator==(), Inkscape::Text::Layout::queryCursorShape(), and Inkscape::Text::Layout::validateIterator().
|
private |
Definition at line 1084 of file Layout-TNG.h.
Referenced by beginCursorUpDown(), nextGlyph(), and Inkscape::Text::Layout::validateIterator().
|
private |
for cursor up/down movement we must maintain the x position where we started so the cursor doesn't 'drift' left or right with the repeated quantization to character boundaries.
Definition at line 1091 of file Layout-TNG.h.
Referenced by beginCursorUpDown().