Lines Matching refs:text
37 #include "pixmaps/cursor-text-insert.xpm"
38 #include "pixmaps/cursor-text.xpm"
46 #include "sp-text.h"
48 #include "ui/tools/text-tool.h"
49 #include "text-editing.h"
77 const std::string TextTool::prefsPath = "/tools/text";
83 , text(NULL)
190 if (prefs->getBool("/tools/text/selcue")) {
193 if (prefs->getBool("/tools/text/gradientdrag")) {
263 if (this->text) {
269 this->text_sel_end = sp_te_get_position_by_coords(this->text, p);
271 this->text_sel_start = this->text_sel_end = sp_te_get_position_by_coords(this->text, p);
283 if (event->button.button == 1 && this->text) {
284 Inkscape::Text::Layout const *layout = te_get_layout(this->text);
298 if (event->button.button == 1 && this->text) {
316 Inkscape::Text::Layout const *layout = te_get_layout(this->text);
321 Inkscape::Text::Layout::iterator new_end = sp_te_get_position_by_coords(this->text, p);
370 desktop->event_context->defaultMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("<b>Click</b> to edit the text, <b>drag</b> to select part of the text."));
372 desktop->event_context->defaultMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("<b>Click</b> to edit the flowed text, <b>drag</b> to select part of the text."));
395 /* Create <text> */
397 Inkscape::XML::Node *rtext = xml_doc->createElement("svg:text");
398 rtext->setAttribute("xml:space", "preserve"); // we preserve spaces in the text objects we create
401 sp_desktop_apply_style_tool(ec->desktop, rtext, "/tools/text", true);
426 _("Create text"));
453 if (!tc->text) { // printable key; create text if none (i.e. if nascent_object)
455 tc->nascent_object = 0; // we don't need it anymore, having created a real <text>
462 tc->text_sel_start = tc->text_sel_end = sp_te_replace(tc->text, tc->text_sel_start, tc->text_sel_end, u);
551 // update cursor and statusbar: we are not over a text object now
581 // status text
586 this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("<b>Flowed text frame</b>: %s × %s"), xs->str, ys->str);
629 // Cursor height is defined by the new text object's font size; it needs to be set
630 // artificially here, for the text object does not exist yet:
644 this->message_context->set(Inkscape::NORMAL_MESSAGE, _("Type text; <b>Enter</b> to start new line.")); // FIXME:: this is a copy of a string from _update_cursor below, do not desync
653 sp_desktop_apply_style_tool(desktop, ft->getRepr(), "/tools/text", true);
655 desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Flowed text is created."));
656 DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Create flowed text"));
658 desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("The frame is <b>too small</b> for the current font size. Flowed text not created."));
674 if ((this->text) || (this->nascent_object)) {
675 // there is an active text object in this context, or a new object was just created
767 if (this->text) {
768 double spacing = sp_te_get_average_linespacing(this->text);
775 /* Neither unimode nor IM consumed key; process text tool shortcuts */
780 desktop->setToolboxFocusTo ("altx-text");
787 if (!this->text) { // printable key; create text if none (i.e. if nascent_object)
789 this->nascent_object = 0; // we don't need it anymore, having created a real <text>
791 this->text_sel_start = this->text_sel_end = sp_te_replace(this->text, this->text_sel_start, this->text_sel_end, "\302\240");
818 if (MOD__CTRL_ONLY(event) && this->text) {
819 SPStyle const *style = sp_te_style_at_position(this->text, std::min(this->text_sel_start, this->text_sel_end));
829 sp_te_apply_style(this->text, this->text_sel_start, this->text_sel_end, css);
839 if (MOD__CTRL_ONLY(event) && this->text) {
840 SPStyle const *style = sp_te_style_at_position(this->text, std::min(this->text_sel_start, this->text_sel_end));
846 sp_te_apply_style(this->text, this->text_sel_start, this->text_sel_end, css);
857 if (MOD__CTRL_ONLY(event) && this->text) {
858 Inkscape::Text::Layout const *layout = te_get_layout(this->text);
872 if (!this->text) { // printable key; create text if none (i.e. if nascent_object)
874 this->nascent_object = 0; // we don't need it anymore, having created a real <text>
878 bool success = sp_te_delete(this->text, this->text_sel_start, this->text_sel_end, enter_pair);
882 this->text_sel_start = this->text_sel_end = sp_te_insert_line(this->text, this->text_sel_start);
890 if (this->text) { // if nascent_object, do nothing, but return TRUE; same for all other delete and move keys
908 bool success = sp_te_delete(this->text, this->text_sel_start, this->text_sel_end, bspace_pair);
932 if (this->text) {
949 bool success = sp_te_delete(this->text, this->text_sel_start, this->text_sel_end, del_pair);
971 if (this->text) {
976 sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(mul*-10, 0));
978 sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(mul*-1, 0));
995 if (this->text) {
1000 sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(mul*10, 0));
1002 sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(mul*1, 0));
1019 if (this->text) {
1024 sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(0, mul*-10));
1026 sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(0, mul*-1));
1043 if (this->text) {
1048 sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(0, mul*10));
1050 sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(0, mul*1));
1066 if (this->text) {
1077 if (this->text) {
1088 if (this->text) {
1096 if (this->text) {
1116 if (this->text) {
1121 sp_te_adjust_rotation_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -10);
1123 sp_te_adjust_rotation_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -1);
1126 sp_te_adjust_rotation(this->text, this->text_sel_start, this->text_sel_end, desktop, -90);
1136 if (this->text) {
1141 sp_te_adjust_rotation_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 10);
1143 sp_te_adjust_rotation_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 1);
1146 sp_te_adjust_rotation(this->text, this->text_sel_start, this->text_sel_end, desktop, 90);
1157 if (this->text) {
1161 sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -10);
1163 sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -1);
1167 sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -10);
1169 sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -1);
1180 if (this->text) {
1184 sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 10);
1186 sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 1);
1190 sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 10);
1192 sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 1);
1234 desktop->setToolboxFocusTo ("altx-text");
1261 Attempts to paste system clipboard into the currently edited text, returns true on success
1270 if ((tc->text) || (tc->nascent_object)) {
1271 // there is an active text object in this context, or a new object was just created
1282 // the text here.
1283 Glib::ustring text(clip_text);
1284 Glib::ustring::iterator itr = text.begin();
1287 while(itr != text.end())
1300 itr = text.erase(itr);
1304 if (!tc->text) { // create text if none (i.e. if nascent_object)
1306 tc->nascent_object = 0; // we don't need it anymore, having created a real <text>
1312 Glib::ustring::size_type end = text.find('\n', begin);
1314 if (begin != text.length())
1315 tc->text_sel_start = tc->text_sel_end = sp_te_replace(tc->text, tc->text_sel_start, tc->text_sel_end, text.substr(begin).c_str());
1318 tc->text_sel_start = tc->text_sel_end = sp_te_replace(tc->text, tc->text_sel_start, tc->text_sel_end, text.substr(begin, end - begin).c_str());
1319 tc->text_sel_start = tc->text_sel_end = sp_te_insert_line(tc->text, tc->text_sel_start);
1323 _("Paste text"));
1333 Gets the raw characters that comprise the currently selected text, converting line
1341 if (tc->text == NULL)
1344 return sp_te_get_string_multiline(tc->text, tc->text_sel_start, tc->text_sel_end);
1352 if (tc->text == NULL)
1355 SPObject const *obj = sp_te_object_at_position(tc->text, tc->text_sel_end);
1366 text selection currently.
1373 if (tc->text == NULL)
1380 bool success = sp_te_delete(tc->text, tc->text_sel_start, tc->text_sel_end, pair);
1411 if (this->text && (item != this->text)) {
1414 this->text = NULL;
1417 this->text = item;
1418 Inkscape::Text::Layout const *layout = te_get_layout(this->text);
1422 this->text = NULL;
1439 if (this->text == NULL)
1442 return false; // will get picked up by the parent and applied to the whole text object
1444 sp_te_apply_style(this->text, this->text_sel_start, this->text_sel_end, css);
1446 _("Set text style"));
1455 if (this->text == NULL) {
1458 const Inkscape::Text::Layout *layout = te_get_layout(this->text);
1500 if (tc->text == NULL)
1502 Inkscape::Text::Layout const *layout = te_get_layout(tc->text);
1503 if (layout) { // undo can change the text length without us knowing it
1515 if (tc->text) {
1517 sp_te_get_cursor_coords(tc->text, tc->text_sel_end, p0, p1);
1518 Geom::Point const d0 = p0 * tc->text->i2dt_affine();
1519 Geom::Point const d1 = p1 * tc->text->i2dt_affine();
1550 Inkscape::Text::Layout const *layout = te_get_layout(tc->text);
1558 if (SP_IS_FLOWTEXT(tc->text)) {
1559 SPItem *frame = SP_FLOWTEXT(tc->text)->get_frame (NULL); // first frame only
1573 SP_EVENT_CONTEXT(tc)->message_context->setF(Inkscape::NORMAL_MESSAGE, ngettext("Type or edit flowed text (%d character%s); <b>Enter</b> to start new paragraph.", "Type or edit flowed text (%d characters%s); <b>Enter</b> to start new paragraph.", nChars), nChars, trunc);
1575 SP_EVENT_CONTEXT(tc)->message_context->setF(Inkscape::NORMAL_MESSAGE, ngettext("Type or edit text (%d character%s); <b>Enter</b> to start new line.", "Type or edit text (%d characters%s); <b>Enter</b> to start new line.", nChars), nChars, trunc);
1583 SP_EVENT_CONTEXT(tc)->message_context->set(Inkscape::NORMAL_MESSAGE, _("<b>Click</b> to select or create text, <b>drag</b> to create flowed text; then type.")); // FIXME: this is a copy of string from tools-switch, do not desync
1603 if (tc->text != NULL)
1604 quads = sp_te_create_selection_quads(tc->text, tc->text_sel_start, tc->text_sel_end, (tc->text)->i2dt_affine());
1635 if (! tc->text) return;
1636 SPItem *ti = tc->text;
1640 tc->text = NULL;
1655 _("Remove empty text"));
1675 if (!tc->text) {
1677 tc->nascent_object = 0; // we don't need it anymore, having created a real <text>
1680 tc->text_sel_start = tc->text_sel_end = sp_te_replace(tc->text, tc->text_sel_start, tc->text_sel_end, string);
1684 DocumentUndo::done(tc->text->document, SP_VERB_CONTEXT_TEXT,
1685 _("Type text"));
1688 void sp_text_context_place_cursor (TextTool *tc, SPObject *text, Inkscape::Text::Layout::iterator where)
1690 tc->desktop->selection->set (text);
1696 void sp_text_context_place_cursor_at (TextTool *tc, SPObject *text, Geom::Point const p)
1698 tc->desktop->selection->set (text);
1699 sp_text_context_place_cursor (tc, text, sp_te_get_position_by_coords(tc->text, p));
1702 Inkscape::Text::Layout::iterator *sp_text_context_get_cursor_position(TextTool *tc, SPObject *text)
1704 if (text != tc->text)