Inkscape
Vector Graphics Editor
|
Go to the source code of this file.
Typedefs | |
typedef std::pair< Inkscape::Text::Layout::iterator, Inkscape::Text::Layout::iterator > | iterator_pair |
typedef std::pair<Inkscape::Text::Layout::iterator, Inkscape::Text::Layout::iterator> iterator_pair |
Definition at line 27 of file text-editing.h.
bool has_visible_text | ( | SPObject const * | obj | ) |
Definition at line 2166 of file text-editing.cpp.
References child, SPObject::children, has_visible_text(), and is_part_of_text_subtree().
Referenced by has_visible_text().
bool is_part_of_text_subtree | ( | SPObject const * | obj | ) |
Definition at line 2148 of file text-editing.cpp.
Referenced by has_visible_text(), and sp_te_get_ustring_multiline().
bool is_top_level_text_object | ( | SPObject const * | obj | ) |
Definition at line 2160 of file text-editing.cpp.
void sp_te_adjust_dx | ( | SPItem * | item, |
Inkscape::Text::Layout::iterator const & | start, | ||
Inkscape::Text::Layout::iterator const & | end, | ||
SPDesktop * | desktop, | ||
double | delta | ||
) |
Definition at line 1094 of file text-editing.cpp.
References TextTagAttributes::addToDx(), delta, end, item, SPObject::requestDisplayUpdate(), start, text_tag_attributes_at_position(), and SPObject::updateRepr().
Referenced by Inkscape::UI::Toolbar::TextToolbar::dx_value_changed().
void sp_te_adjust_dy | ( | SPItem * | item, |
Inkscape::Text::Layout::iterator const & | start, | ||
Inkscape::Text::Layout::iterator const & | end, | ||
SPDesktop * | desktop, | ||
double | delta | ||
) |
Definition at line 1112 of file text-editing.cpp.
References TextTagAttributes::addToDy(), delta, end, item, SPObject::requestDisplayUpdate(), start, text_tag_attributes_at_position(), and SPObject::updateRepr().
Referenced by Inkscape::UI::Toolbar::TextToolbar::dy_value_changed().
void sp_te_adjust_kerning_screen | ( | SPItem * | text, |
Inkscape::Text::Layout::iterator const & | start, | ||
Inkscape::Text::Layout::iterator const & | end, | ||
SPDesktop * | desktop, | ||
Geom::Point | by | ||
) |
Definition at line 1073 of file text-editing.cpp.
References TextTagAttributes::addToDxDy(), SPDesktop::current_zoom(), Geom::Affine::descrim(), desktop, end, SPItem::i2doc_affine(), item, SPObject::requestDisplayUpdate(), start, text_tag_attributes_at_position(), and SPObject::updateRepr().
Referenced by Inkscape::UI::Tools::TextTool::root_handler().
void sp_te_adjust_linespacing_screen | ( | SPItem * | text, |
Inkscape::Text::Layout::iterator const & | start, | ||
Inkscape::Text::Layout::iterator const & | end, | ||
SPDesktop * | desktop, | ||
double | by | ||
) |
void sp_te_adjust_rotation | ( | SPItem * | text, |
Inkscape::Text::Layout::iterator const & | start, | ||
Inkscape::Text::Layout::iterator const & | end, | ||
SPDesktop * | desktop, | ||
double | degrees | ||
) |
void sp_te_adjust_rotation_screen | ( | SPItem * | text, |
Inkscape::Text::Layout::iterator const & | start, | ||
Inkscape::Text::Layout::iterator const & | end, | ||
SPDesktop * | desktop, | ||
double | pixels | ||
) |
void sp_te_adjust_tspan_letterspacing_screen | ( | SPItem * | text, |
Inkscape::Text::Layout::iterator const & | start, | ||
Inkscape::Text::Layout::iterator const & | end, | ||
SPDesktop * | desktop, | ||
double | by | ||
) |
void sp_te_apply_style | ( | SPItem * | text, |
Inkscape::Text::Layout::iterator const & | start, | ||
Inkscape::Text::Layout::iterator const & | end, | ||
SPCSSAttr const * | css | ||
) |
Applies the given CSS fragment to the characters of the given text or flowtext object between start and end, creating or removing span elements as necessary and optimal.
Definition at line 2052 of file text-editing.cpp.
References ascend_while_first(), css, Geom::Affine::descrim(), end, get_common_ancestor(), SPObject::getNext(), Inkscape::Text::Layout::getSourceOfCharacter(), is_line_break_object(), recursively_apply_style(), SPObject::requestDisplayUpdate(), sp_css_attr_scale(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_merge(), sp_tref_fully_contained(), span_name_for_text_object(), start, te_get_layout(), te_update_layout_now_recursive(), and tidy_xml_tree_recursively().
Referenced by Inkscape::UI::Tools::TextTool::_styleSet(), Inkscape::UI::Tools::TextTool::root_handler(), and sp_te_adjust_tspan_letterspacing_screen().
std::vector< Geom::Point > sp_te_create_selection_quads | ( | SPItem const * | item, |
Inkscape::Text::Layout::iterator const & | start, | ||
Inkscape::Text::Layout::iterator const & | end, | ||
Geom::Affine const & | transform | ||
) |
Definition at line 114 of file text-editing.cpp.
References Inkscape::Text::Layout::createSelectionShape(), end, item, start, and te_get_layout().
Referenced by Inkscape::UI::Tools::TextTool::_updateTextSelection().
bool sp_te_delete | ( | SPItem * | item, |
Inkscape::Text::Layout::iterator const & | start, | ||
Inkscape::Text::Layout::iterator const & | end, | ||
iterator_pair & | iter_pair | ||
) |
Definition at line 789 of file text-editing.cpp.
References delete_line_break(), desktop, end, erase_from_spstring(), Inkscape::ERROR_MESSAGE, SPObject::firstChild(), Inkscape::MessageStack::flash(), get_common_ancestor(), SPObject::getNext(), Inkscape::Text::Layout::getSourceOfCharacter(), SPObject::hasChildren(), is_line_break_object(), item, SPObject::lastChild(), SPDesktop::messageStack(), move_to_end_of_paragraph(), next_item(), SPObject::parent, SPObject::requestDisplayUpdate(), start, te_get_layout(), te_update_layout_now(), tidy_xml_tree_recursively(), tref_edit_message, and Inkscape::Text::Layout::validateIterator().
Referenced by Inkscape::UI::Tools::TextTool::deleteSelection(), SPText::newline_to_sodipodi(), Inkscape::UI::Tools::TextTool::root_handler(), and sp_te_replace().
double sp_te_get_average_linespacing | ( | SPItem * | text | ) |
Definition at line 1274 of file text-editing.cpp.
References Inkscape::Text::Layout::begin(), Inkscape::Text::Layout::characterAnchorPoint(), Inkscape::Text::Layout::end(), index, Inkscape::Text::Layout::lineIndex(), mode, SP_CSS_WRITING_MODE_LR_TB, SP_CSS_WRITING_MODE_RL_TB, SP_CSS_WRITING_MODE_TB_RL, SPObject::style, te_get_layout(), SPStyle::writing_mode, Geom::X, and Geom::Y.
Referenced by Inkscape::UI::Tools::TextTool::root_handler(), and sp_te_adjust_linespacing_screen().
void sp_te_get_cursor_coords | ( | SPItem const * | item, |
Inkscape::Text::Layout::iterator const & | position, | ||
Geom::Point & | p0, | ||
Geom::Point & | p1 | ||
) |
Definition at line 126 of file text-editing.cpp.
References height, item, Inkscape::Text::Layout::queryCursorShape(), te_get_layout(), Geom::X, and Geom::Y.
Referenced by Inkscape::UI::Tools::TextTool::_updateCursor().
Inkscape::Text::Layout::iterator sp_te_get_position_by_coords | ( | SPItem const * | item, |
Geom::Point const & | i_p | ||
) |
Definition at line 104 of file text-editing.cpp.
References Inkscape::Text::Layout::getNearestCursorPositionTo(), SPItem::i2dt_affine(), Geom::Affine::inverse(), item, and te_get_layout().
Referenced by Inkscape::UI::Tools::TextTool::item_handler(), Inkscape::UI::Tools::TextTool::placeCursorAt(), and Inkscape::UI::Tools::TextTool::root_handler().
Glib::ustring sp_te_get_string_multiline | ( | SPItem const * | text | ) |
Gets a text-only representation of the given text or flowroot object, replacing line break elements with '
'.
The return value must be free()d.
Definition at line 926 of file text-editing.cpp.
References sp_te_get_ustring_multiline().
Referenced by Inkscape::UI::Dialog::Find::desktopReplaced(), Inkscape::UI::Tools::get_selected_text(), Inkscape::UI::Dialog::GlyphsPanel::insertText(), Inkscape::UI::Dialog::Find::item_text_match(), Inkscape::UI::Dialog::SpellCheck::nextWord(), Inkscape::UI::Dialog::SpellCheck::onObjModified(), Inkscape::UI::Dialog::TextEdit::onReadSelection(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_flowtext_render(), sp_selected_item_to_curved_repr(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_text_render(), text_flow_into_shape(), and text_unflow().
Glib::ustring sp_te_get_string_multiline | ( | SPItem const * | text, |
Inkscape::Text::Layout::iterator const & | start, | ||
Inkscape::Text::Layout::iterator const & | end | ||
) |
Gets a text-only representation of the characters in a text or flowroot object from start to end only.
Line break elements are replaced with '
'.
Definition at line 941 of file text-editing.cpp.
References end, Inkscape::Text::Layout::getSourceOfCharacter(), Inkscape::Text::Layout::iterator::nextCharacter(), result, start, and te_get_layout().
bool sp_te_input_is_empty | ( | SPObject const * | item | ) |
Returns true if the user has typed nothing in the text box.
Definition at line 87 of file text-editing.cpp.
References child, SPObject::children, item, and sp_te_input_is_empty().
Referenced by sp_te_input_is_empty().
Inkscape::Text::Layout::iterator sp_te_insert | ( | SPItem * | item, |
Inkscape::Text::Layout::iterator const & | position, | ||
char const * | utf8 | ||
) |
Inkscape::Text::Layout::iterator sp_te_insert_line | ( | SPItem * | item, |
Inkscape::Text::Layout::iterator & | position | ||
) |
inserts a new line break at the given position in a text or flowtext object.
If the position is in the middle of a span, the XML tree must be chopped in two such that the line can be created at the root of the text element. Returns an iterator pointing just after the inserted break.
Definition at line 399 of file text-editing.cpp.
References Inkscape::XML::Node::addChild(), Inkscape::XML::Node::appendChild(), Inkscape::Text::Layout::charIndexToIterator(), child, SPObject::childList(), Inkscape::XML::Document::createElement(), desktop, SPObject::document, Inkscape::XML::Node::document(), duplicate_node_without_children(), Inkscape::Text::Layout::end(), Inkscape::ERROR_MESSAGE, Inkscape::MessageStack::flash(), SPObject::getRepr(), SPDocument::getReprDoc(), Inkscape::Text::Layout::getSourceOfCharacter(), is_line_break_object(), item, Inkscape::Text::Layout::iteratorToCharIndex(), SPObject::lastChild(), SPDesktop::messageStack(), move_child_nodes(), SPObject::parent, Inkscape::GC::release(), SPObject::requestDisplayUpdate(), Inkscape::XML::Node::setAttribute(), Inkscape::XML::Node::setContent(), SP_IS_TEXT_TEXTPATH(), SP_TSPAN_ROLE_LINE, split_text_object_tree_at(), te_get_layout(), te_update_layout_now(), and tref_edit_message.
Referenced by SPText::newline_to_sodipodi(), Inkscape::UI::Tools::TextTool::pasteInline(), and Inkscape::UI::Tools::TextTool::root_handler().
SPObject const * sp_te_object_at_position | ( | SPItem const * | text, |
Inkscape::Text::Layout::iterator const & | position | ||
) |
Definition at line 141 of file text-editing.cpp.
References Inkscape::Text::Layout::getSourceOfCharacter(), SPObject::parent, SPObject::style, and te_get_layout().
Referenced by Inkscape::UI::Tools::get_style_at_cursor(), and sp_te_style_at_position().
bool sp_te_output_is_empty | ( | SPItem const * | item | ) |
Returns true if there are no visible characters on the canvas.
Definition at line 81 of file text-editing.cpp.
References Inkscape::Text::Layout::begin(), Inkscape::Text::Layout::end(), item, and te_get_layout().
Inkscape::Text::Layout::iterator sp_te_replace | ( | SPItem * | item, |
Inkscape::Text::Layout::iterator const & | start, | ||
Inkscape::Text::Layout::iterator const & | end, | ||
char const * | utf8 | ||
) |
void sp_te_set_repr_text_multiline | ( | SPItem * | text, |
char const * | str | ||
) |
void sp_te_set_rotation | ( | SPItem * | text, |
Inkscape::Text::Layout::iterator const & | start, | ||
Inkscape::Text::Layout::iterator const & | end, | ||
SPDesktop * | desktop, | ||
double | degrees | ||
) |
SPStyle const * sp_te_style_at_position | ( | SPItem const * | text, |
Inkscape::Text::Layout::iterator const & | position | ||
) |
Definition at line 134 of file text-editing.cpp.
References result, sp_te_object_at_position(), and SPObject::style.
Referenced by Inkscape::UI::Tools::TextTool::root_handler(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_flowtext_render(), and Inkscape::Extension::Internal::LaTeXTextRenderer::sp_text_render().
unsigned sp_text_get_length | ( | SPObject const * | item | ) |
Recursively gets the length of all the SPStrings at or below the given item.
Also adds 1 for each line break encountered.
Definition at line 227 of file text-editing.cpp.
References child, SPObject::children, is_line_break_object(), item, and sp_text_get_length().
Referenced by delete_line_break(), fix_blank_line(), sp_te_adjust_tspan_letterspacing_screen(), sp_text_get_length(), sum_sibling_text_lengths_before(), and tidy_operator_repeated_spans().
Recursively gets the length of all the SPStrings at or below the given item, before and not including upto.
Also adds 1 for each line break encountered.
Definition at line 250 of file text-editing.cpp.
References child, SPObject::children, SPObject::firstChild(), is_line_break_object(), SPObject::isAncestorOf(), item, SPObject::parent, and sp_text_get_length_upto().
Referenced by SPTRef::bbox(), SPTSpan::bbox(), fix_blank_line(), and sp_text_get_length_upto().
Inkscape::Text::Layout const * te_get_layout | ( | SPItem const * | item | ) |
Definition at line 48 of file text-editing.cpp.
References item.
Referenced by Inkscape::ObjectSnapper::_collectPaths(), Inkscape::UI::Toolbar::TextToolbar::_cursorMoved(), Inkscape::UI::Tools::TextTool::_selectionChanged(), Inkscape::UI::Tools::TextTool::_styleQueried(), Inkscape::UI::Tools::TextTool::_updateCursor(), Inkscape::UI::Tools::TextTool::_validateCursorIterators(), curve_for_item(), curve_for_item_before_LPE(), SPText::description(), fix_blank_line(), Inkscape::LivePathEffect::getNodes(), Inkscape::UI::Tools::TextTool::item_handler(), Inkscape::UI::Dialog::Find::item_text_match(), Inkscape::UI::Dialog::SpellCheck::nextText(), object_align_text(), object_distribute_text(), Inkscape::UI::Dialog::SpellCheck::onObjModified(), Inkscape::UI::Toolbar::TextToolbar::prepare_inner(), Inkscape::UI::Tools::TextTool::root_handler(), Inkscape::UI::Tools::MeasureTool::showCanvasItems(), SPFlowtext::snappoints(), SPText::snappoints(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_flowtext_render(), sp_selected_item_to_curved_repr(), sp_te_adjust_linespacing_screen(), sp_te_adjust_rotation_screen(), sp_te_adjust_tspan_letterspacing_screen(), sp_te_apply_style(), sp_te_create_selection_quads(), sp_te_delete(), sp_te_get_average_linespacing(), sp_te_get_cursor_coords(), sp_te_get_position_by_coords(), sp_te_get_string_multiline(), sp_te_insert(), sp_te_insert_line(), sp_te_object_at_position(), sp_te_output_is_empty(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_text_render(), Inkscape::UI::Toolbar::TextToolbar::subselection_wrap_toggle(), text_flow_into_shape(), text_put_on_path(), and Inkscape::Extension::Internal::OdfOutput::writeTree().
void te_update_layout_now_recursive | ( | SPItem * | item | ) |
Definition at line 67 of file text-editing.cpp.
References item, te_update_layout_now_recursive(), and SPObject::updateRepr().
Referenced by Inkscape::convert_text_to_curves(), sp_te_apply_style(), and te_update_layout_now_recursive().
TextTagAttributes * text_tag_attributes_at_position | ( | SPItem * | item, |
Inkscape::Text::Layout::iterator const & | position, | ||
unsigned * | char_index | ||
) |
Returns the attributes block and the character index within that block which represents the iterator position.
Definition at line 1049 of file text-editing.cpp.
References attributes_for_object(), item, SPObject::parent, and sum_sibling_text_lengths_before().
Referenced by Inkscape::UI::Toolbar::TextToolbar::_selectionChanged(), Inkscape::UI::Toolbar::TextToolbar::dx_value_changed(), Inkscape::UI::Toolbar::TextToolbar::dy_value_changed(), Inkscape::UI::Toolbar::TextToolbar::rotation_value_changed(), sp_te_adjust_dx(), sp_te_adjust_dy(), sp_te_adjust_kerning_screen(), sp_te_adjust_rotation(), and sp_te_set_rotation().