diff --git a/src/text-context.cpp b/src/text-context.cpp
index 26c6b42d753f3a99cb901725c8a642fab9666548..b65bcf19fa55a3cba768f4a977a5e83e532a536c 100644 (file)
--- a/src/text-context.cpp
+++ b/src/text-context.cpp
#include "message-stack.h"
#include "message-context.h"
#include "pixmaps/cursor-text.xpm"
#include "message-stack.h"
#include "message-context.h"
#include "pixmaps/cursor-text.xpm"
-#include "pixmaps/cursor-text.pixbuf"
#include "pixmaps/cursor-text-insert.xpm"
#include "pixmaps/cursor-text-insert.xpm"
-#include "pixmaps/cursor-text-insert.pixbuf"
#include <glibmm/i18n.h>
#include "object-edit.h"
#include "xml/repr.h"
#include <glibmm/i18n.h>
#include "object-edit.h"
#include "xml/repr.h"
SPEventContext *event_context = SP_EVENT_CONTEXT(tc);
event_context->cursor_shape = cursor_text_xpm;
SPEventContext *event_context = SP_EVENT_CONTEXT(tc);
event_context->cursor_shape = cursor_text_xpm;
- event_context->cursor_pixbuf = gdk_pixbuf_new_from_inline(
- -1,
- cursor_text_pixbuf,
- FALSE,
- NULL);
event_context->hot_x = 7;
event_context->hot_y = 7;
event_context->hot_x = 7;
event_context->hot_y = 7;
@@ -446,11 +439,6 @@ sp_text_context_item_handler(SPEventContext *ec, SPItem *item, GdkEvent *event)
SP_CTRLRECT(tc->indicator)->setRectangle(sp_item_bbox_desktop(item_ungrouped));
ec->cursor_shape = cursor_text_insert_xpm;
SP_CTRLRECT(tc->indicator)->setRectangle(sp_item_bbox_desktop(item_ungrouped));
ec->cursor_shape = cursor_text_insert_xpm;
- ec->cursor_pixbuf = gdk_pixbuf_new_from_inline(
- -1,
- cursor_text_insert_pixbuf,
- FALSE,
- NULL);
ec->hot_x = 7;
ec->hot_y = 10;
sp_event_context_update_cursor(ec);
ec->hot_x = 7;
ec->hot_y = 10;
sp_event_context_update_cursor(ec);
SPEventContext *ec = SP_EVENT_CONTEXT(tc);
/* Create <text> */
SPEventContext *ec = SP_EVENT_CONTEXT(tc);
/* Create <text> */
- Inkscape::XML::Node *rtext = sp_repr_new("svg:text");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_EVENT_CONTEXT_DESKTOP(ec)->doc());
+ Inkscape::XML::Node *rtext = xml_doc->createElement("svg:text");
rtext->setAttribute("xml:space", "preserve"); // we preserve spaces in the text objects we create
/* Set style */
rtext->setAttribute("xml:space", "preserve"); // we preserve spaces in the text objects we create
/* Set style */
sp_repr_set_svg_double(rtext, "y", tc->pdoc[NR::Y]);
/* Create <tspan> */
sp_repr_set_svg_double(rtext, "y", tc->pdoc[NR::Y]);
/* Create <tspan> */
- Inkscape::XML::Node *rtspan = sp_repr_new("svg:tspan");
+ Inkscape::XML::Node *rtspan = xml_doc->createElement("svg:tspan");
rtspan->setAttribute("sodipodi:role", "line"); // otherwise, why bother creating the tspan?
rtext->addChild(rtspan, NULL);
Inkscape::GC::release(rtspan);
/* Create TEXT */
rtspan->setAttribute("sodipodi:role", "line"); // otherwise, why bother creating the tspan?
rtext->addChild(rtspan, NULL);
Inkscape::GC::release(rtspan);
/* Create TEXT */
- Inkscape::XML::Node *rstring = sp_repr_new_text("");
+ Inkscape::XML::Node *rstring = xml_doc->createTextNode("");
rtspan->addChild(rstring, NULL);
Inkscape::GC::release(rstring);
SPItem *text_item = SP_ITEM(ec->desktop->currentLayer()->appendChildRepr(rtext));
rtspan->addChild(rstring, NULL);
Inkscape::GC::release(rstring);
SPItem *text_item = SP_ITEM(ec->desktop->currentLayer()->appendChildRepr(rtext));
text_item->transform = SP_ITEM(ec->desktop->currentRoot())->getRelativeTransform(ec->desktop->currentLayer());
text_item->updateRepr();
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
text_item->transform = SP_ITEM(ec->desktop->currentRoot())->getRelativeTransform(ec->desktop->currentLayer());
text_item->updateRepr();
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:515");
+ _("Create text"));
}
/**
}
/**
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_done(sp_desktop_document(tc->desktop), SP_VERB_DIALOG_TRANSFORM,
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_done(sp_desktop_document(tc->desktop), SP_VERB_DIALOG_TRANSFORM,
- /* TODO: annotate */ "text-context.cpp:554");
+ _("Insert Unicode character"));
}
}
}
}
}
}
tc->defaultMessageContext()->setF(Inkscape::NORMAL_MESSAGE,
}
}
tc->defaultMessageContext()->setF(Inkscape::NORMAL_MESSAGE,
- _("Unicode: %s: %s"), tc->uni, utf8);
+ _("Unicode (<b>Enter</b> to finish): %s: %s"), tc->uni, utf8);
} else {
} else {
- tc->defaultMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Unicode: "));
+ tc->defaultMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Unicode (<b>Enter</b> to finish): "));
}
}
}
}
tc->over_text = 0;
// update cursor and statusbar: we are not over a text object now
ec->cursor_shape = cursor_text_xpm;
tc->over_text = 0;
// update cursor and statusbar: we are not over a text object now
ec->cursor_shape = cursor_text_xpm;
- ec->cursor_pixbuf = gdk_pixbuf_new_from_inline(
- -1,
- cursor_text_pixbuf,
- FALSE,
- NULL);
ec->hot_x = 7;
ec->hot_y = 7;
sp_event_context_update_cursor(ec);
ec->hot_x = 7;
ec->hot_y = 7;
sp_event_context_update_cursor(ec);
sp_desktop_selection(desktop)->set(ft);
ec->desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Flowed text is created."));
sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
sp_desktop_selection(desktop)->set(ft);
ec->desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Flowed text is created."));
sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:718");
+ _("Create flowed text"));
} else {
ec->desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("The frame is <b>too small</b> for the current font size. Flowed text not created."));
}
} else {
ec->desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("The frame is <b>too small</b> for the current font size. Flowed text not created."));
}
sp_text_context_update_text_selection(tc);
ec->desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("No-break space"));
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
sp_text_context_update_text_selection(tc);
ec->desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("No-break space"));
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:848");
+ _("Insert no-break space"));
return TRUE;
}
break;
case GDK_U:
case GDK_u:
return TRUE;
}
break;
case GDK_U:
case GDK_u:
- if (MOD__CTRL_ONLY) {
+ if (MOD__CTRL_ONLY || (MOD__CTRL && MOD__SHIFT)) {
if (tc->unimode) {
tc->unimode = false;
ec->defaultMessageContext()->clear();
} else {
tc->unimode = true;
tc->unipos = 0;
if (tc->unimode) {
tc->unimode = false;
ec->defaultMessageContext()->clear();
} else {
tc->unimode = true;
tc->unipos = 0;
- ec->defaultMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Unicode: "));
+ ec->defaultMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("Unicode (<b>Enter</b> to finish): "));
}
if (tc->imc) {
gtk_im_context_reset(tc->imc);
}
if (tc->imc) {
gtk_im_context_reset(tc->imc);
sp_te_apply_style(tc->text, tc->text_sel_start, tc->text_sel_end, css);
sp_repr_css_attr_unref(css);
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
sp_te_apply_style(tc->text, tc->text_sel_start, tc->text_sel_end, css);
sp_repr_css_attr_unref(css);
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:885");
+ _("Make bold"));
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
return TRUE;
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
return TRUE;
sp_te_apply_style(tc->text, tc->text_sel_start, tc->text_sel_end, css);
sp_repr_css_attr_unref(css);
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
sp_te_apply_style(tc->text, tc->text_sel_start, tc->text_sel_end, css);
sp_repr_css_attr_unref(css);
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:903");
+ _("Make italic"));
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
return TRUE;
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
return TRUE;
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:935");
+ _("New line"));
return TRUE;
case GDK_BackSpace:
if (tc->text) { // if nascent_object, do nothing, but return TRUE; same for all other delete and move keys
return TRUE;
case GDK_BackSpace:
if (tc->text) { // if nascent_object, do nothing, but return TRUE; same for all other delete and move keys
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:945");
+ _("Backspace"));
}
return TRUE;
case GDK_Delete:
}
return TRUE;
case GDK_Delete:
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:957");
+ _("Delete"));
}
return TRUE;
case GDK_Left:
}
return TRUE;
case GDK_Left:
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:left", SP_VERB_CONTEXT_TEXT,
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:left", SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:972");
+ _("Kern to the left"));
} else {
cursor_movement_operator = MOD__CTRL ? &Inkscape::Text::Layout::iterator::cursorLeftWithControl
: &Inkscape::Text::Layout::iterator::cursorLeft;
} else {
cursor_movement_operator = MOD__CTRL ? &Inkscape::Text::Layout::iterator::cursorLeftWithControl
: &Inkscape::Text::Layout::iterator::cursorLeft;
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:right", SP_VERB_CONTEXT_TEXT,
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:right", SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:992");
+ _("Kern to the right"));
} else {
cursor_movement_operator = MOD__CTRL ? &Inkscape::Text::Layout::iterator::cursorRightWithControl
: &Inkscape::Text::Layout::iterator::cursorRight;
} else {
cursor_movement_operator = MOD__CTRL ? &Inkscape::Text::Layout::iterator::cursorRightWithControl
: &Inkscape::Text::Layout::iterator::cursorRight;
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:up", SP_VERB_CONTEXT_TEXT,
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:up", SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:1012");
+ _("Kern up"));
} else {
cursor_movement_operator = MOD__CTRL ? &Inkscape::Text::Layout::iterator::cursorUpWithControl
} else {
cursor_movement_operator = MOD__CTRL ? &Inkscape::Text::Layout::iterator::cursorUpWithControl
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:down", SP_VERB_CONTEXT_TEXT,
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:down", SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:1033");
+ _("Kern down"));
} else {
cursor_movement_operator = MOD__CTRL ? &Inkscape::Text::Layout::iterator::cursorDownWithControl
} else {
cursor_movement_operator = MOD__CTRL ? &Inkscape::Text::Layout::iterator::cursorDownWithControl
sp_te_adjust_rotation(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -90);
}
sp_document_maybe_done(sp_desktop_document(ec->desktop), "textrot:ccw", SP_VERB_CONTEXT_TEXT,
sp_te_adjust_rotation(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -90);
}
sp_document_maybe_done(sp_desktop_document(ec->desktop), "textrot:ccw", SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:1089");
+ _("Rotate counterclockwise"));
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
return TRUE;
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
return TRUE;
sp_te_adjust_rotation(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 90);
}
sp_document_maybe_done(sp_desktop_document(ec->desktop), "textrot:cw", SP_VERB_CONTEXT_TEXT,
sp_te_adjust_rotation(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 90);
}
sp_document_maybe_done(sp_desktop_document(ec->desktop), "textrot:cw", SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:1110");
+ _("Rotate clockwise"));
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
return TRUE;
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
return TRUE;
else
sp_te_adjust_linespacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -1);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "linespacing:dec", SP_VERB_CONTEXT_TEXT,
else
sp_te_adjust_linespacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -1);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "linespacing:dec", SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:1127");
+ _("Contract line spacing"));
} else {
if (MOD__SHIFT)
} else {
if (MOD__SHIFT)
else
sp_te_adjust_tspan_letterspacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -1);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "letterspacing:dec", SP_VERB_CONTEXT_TEXT,
else
sp_te_adjust_tspan_letterspacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -1);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "letterspacing:dec", SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:1135");
+ _("Contract letter spacing"));
}
sp_text_context_update_cursor(tc);
}
sp_text_context_update_cursor(tc);
else
sp_te_adjust_linespacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 1);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "linespacing:inc", SP_VERB_CONTEXT_TEXT,
else
sp_te_adjust_linespacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 1);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "linespacing:inc", SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:1154");
+ _("Expand line spacing"));
} else {
if (MOD__SHIFT)
} else {
if (MOD__SHIFT)
else
sp_te_adjust_tspan_letterspacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 1);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "letterspacing:inc", SP_VERB_CONTEXT_TEXT,
else
sp_te_adjust_tspan_letterspacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 1);
sp_document_maybe_done(sp_desktop_document(ec->desktop), "letterspacing:inc", SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:1162");
+ _("Expand letter spacing"));
}
sp_text_context_update_cursor(tc);
}
sp_text_context_update_cursor(tc);
begin = end + 1;
}
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
begin = end + 1;
}
sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:1266");
+ _("Paste text"));
return true;
}
return true;
}
sp_te_apply_style(tc->text, tc->text_sel_start, tc->text_sel_end, css);
sp_document_done(sp_desktop_document(tc->desktop), SP_VERB_CONTEXT_TEXT,
sp_te_apply_style(tc->text, tc->text_sel_start, tc->text_sel_end, css);
sp_document_done(sp_desktop_document(tc->desktop), SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:1380");
+ _("Set text style"));
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_text_context_update_text_selection(tc);
sp_document_done(SP_OBJECT_DOCUMENT(tc->text), SP_VERB_CONTEXT_TEXT,
sp_text_context_update_text_selection(tc);
sp_document_done(SP_OBJECT_DOCUMENT(tc->text), SP_VERB_CONTEXT_TEXT,
- /* TODO: annotate */ "text-context.cpp:1579");
+ _("Type text"));
}
}