X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fverbs.cpp;h=00a82624bddac847137f697289181fa21b99f4f6;hb=c580a96092327174256078a5ca30582608e82be7;hp=10f4f3accf370965e18c16790e81bb495396da16;hpb=b45b3ca12c271745b18a142d10a6ac8efd9f79cc;p=inkscape.git diff --git a/src/verbs.cpp b/src/verbs.cpp index 10f4f3acc..00a82624b 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1,4 +1,3 @@ -#define __SP_VERBS_C__ /** * \file verbs.cpp * @@ -16,6 +15,8 @@ * MenTaLguY * David Turner * bulia byak + * Jon A. Cruz + * Abhishek Sharma * * Copyright (C) 2006 Johan Engelen * Copyright (C) (date unspecified) Authors @@ -39,7 +40,6 @@ #include "desktop-handles.h" #include "dialogs/clonetiler.h" #include "dialogs/find.h" -#include "dialogs/input.h" #include "dialogs/item-properties.h" #include "dialogs/spellcheck.h" #include "dialogs/text-edit.h" @@ -49,7 +49,6 @@ #include "draw-context.h" #include "extension/effect.h" #include "file.h" -#include "gradient-context.h" #include "gradient-drag.h" #include "helper/action.h" #include "help.h" @@ -58,13 +57,13 @@ #include "layer-fns.h" #include "layer-manager.h" #include "message-stack.h" -#include "node-context.h" #include "path-chemistry.h" #include "preferences.h" #include "select-context.h" #include "selection-chemistry.h" #include "seltrans.h" #include "shape-editor.h" +#include "shortcuts.h" #include "sp-flowtext.h" #include "sp-guide.h" #include "splivarot.h" @@ -74,16 +73,20 @@ #include "ui/dialog/dialog-manager.h" #include "ui/dialog/document-properties.h" #include "ui/dialog/extensions.h" +#include "ui/dialog/glyphs.h" #include "ui/dialog/icon-preview.h" #include "ui/dialog/inkscape-preferences.h" #include "ui/dialog/layer-properties.h" #include "ui/dialog/layers.h" #include "ui/dialog/swatches.h" #include "ui/icon-names.h" +#include "ui/tool/node-tool.h" -#ifdef WITH_INKBOARD -#include "jabber_whiteboard/session-manager.h" -#endif +using Inkscape::DocumentUndo; + +//#ifdef WITH_INKBOARD +//#include "jabber_whiteboard/session-manager.h" +//#endif /** * \brief Return the name without underscores and ellipsis, for use in dialog @@ -334,7 +337,15 @@ Verb::VerbIDTable Verb::_verb_ids; in the \c _verbs hashtable which is indexed by the \c code. */ Verb::Verb(gchar const *id, gchar const *name, gchar const *tip, gchar const *image) : - _actions(NULL), _id(id), _name(name), _tip(tip), _image(image) + _actions(0), + _id(id), + _name(name), + _tip(tip), + _full_tip(0), + _shortcut(0), + _image(image), + _code(0), + _default_sensitive(false) { static int count = SP_VERB_LAST; @@ -342,8 +353,6 @@ Verb::Verb(gchar const *id, gchar const *name, gchar const *tip, gchar const *im _code = count; _verbs.insert(VerbTable::value_type(count, this)); _verb_ids.insert(VerbIDTable::value_type(_id, this)); - - return; } /** \brief Destroy a verb. @@ -358,7 +367,10 @@ Verb::~Verb(void) delete _actions; } - return; + if (_full_tip) { + g_free(_full_tip); + _full_tip = 0; + } } /** \brief Verbs are no good without actions. This is a place holder @@ -607,7 +619,7 @@ Verb::get_action(Inkscape::UI::View::View *view) } void -Verb::sensitive(Document *in_doc, bool in_sensitive) +Verb::sensitive(SPDocument *in_doc, bool in_sensitive) { // printf("Setting sensitivity of \"%s\" to %d\n", _name, in_sensitive); if (_actions != NULL) { @@ -628,14 +640,34 @@ Verb::sensitive(Document *in_doc, bool in_sensitive) } /** \brief Accessor to get the tooltip for verb as localised string */ -gchar const * -Verb::get_tip (void) +gchar const *Verb::get_tip(void) { - return _(_tip); + gchar const *result = 0; + if (_tip) { + unsigned int shortcut = sp_shortcut_get_primary(this); + if ( (shortcut != _shortcut) || !_full_tip) { + if (_full_tip) { + g_free(_full_tip); + _full_tip = 0; + } + _shortcut = shortcut; + gchar* shortcutString = sp_shortcut_get_label(shortcut); + if (shortcutString) { + _full_tip = g_strdup_printf("%s (%s)", _(_tip), shortcutString); + g_free(shortcutString); + shortcutString = 0; + } else { + _full_tip = g_strdup(_(_tip)); + } + } + result = _full_tip; + } + + return result; } void -Verb::name(Document *in_doc, Glib::ustring in_name) +Verb::name(SPDocument *in_doc, Glib::ustring in_name) { if (_actions != NULL) { for (ActionTable::iterator cur_action = _actions->begin(); @@ -759,7 +791,7 @@ FileVerb::perform(SPAction *action, void *data, void */*pdata*/) /* These aren't used, but are here to remind people not to use the CURRENT_DOCUMENT macros unless they really have to. */ Inkscape::UI::View::View *current_view = sp_action_get_view(action); - Document *current_document = current_view->doc(); + SPDocument *current_document = current_view->doc(); #endif SPDesktop *desktop = dynamic_cast(sp_action_get_view(action)); @@ -767,7 +799,7 @@ FileVerb::perform(SPAction *action, void *data, void */*pdata*/) Gtk::Window *parent = desktop->getToplevel(); g_assert(parent != NULL); - switch ((long) data) { + switch (reinterpret_cast(data)) { case SP_VERB_FILE_NEW: sp_file_new_default(); break; @@ -799,14 +831,14 @@ FileVerb::perform(SPAction *action, void *data, void */*pdata*/) sp_file_import(*parent); break; case SP_VERB_FILE_EXPORT: - sp_file_export_dialog(NULL); + sp_file_export_dialog(*parent); break; case SP_VERB_FILE_IMPORT_FROM_OCAL: sp_file_import_from_ocal(*parent); break; - case SP_VERB_FILE_EXPORT_TO_OCAL: - sp_file_export_to_ocal(*parent); - break; +// case SP_VERB_FILE_EXPORT_TO_OCAL: +// sp_file_export_to_ocal(*parent); +// break; case SP_VERB_FILE_NEXT_DESKTOP: inkscape_switch_desktops_next(); break; @@ -833,7 +865,6 @@ EditVerb::perform(SPAction *action, void *data, void */*pdata*/) SPDesktop *dt = static_cast(sp_action_get_view(action)); if (!dt) return; - SPEventContext *ec = dt->event_context; switch (reinterpret_cast(data)) { case SP_VERB_EDIT_UNDO: @@ -846,7 +877,7 @@ EditVerb::perform(SPAction *action, void *data, void */*pdata*/) sp_selection_cut(dt); break; case SP_VERB_EDIT_COPY: - sp_selection_copy(); + sp_selection_copy(dt); break; case SP_VERB_EDIT_PASTE: sp_selection_paste(dt, false); @@ -918,63 +949,26 @@ EditVerb::perform(SPAction *action, void *data, void */*pdata*/) sp_edit_clear_all(dt); break; case SP_VERB_EDIT_SELECT_ALL: - if (tools_isactive(dt, TOOLS_NODES)) { - ec->shape_editor->select_all_from_subpath(false); - } else { - sp_edit_select_all(dt); - } + SelectionHelper::selectAll(dt); break; case SP_VERB_EDIT_INVERT: - if (tools_isactive(dt, TOOLS_NODES)) { - ec->shape_editor->select_all_from_subpath(true); - } else { - sp_edit_invert(dt); - } + SelectionHelper::invert(dt); break; case SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS: - if (tools_isactive(dt, TOOLS_NODES)) { - ec->shape_editor->select_all(false); - } else { - sp_edit_select_all_in_all_layers(dt); - } + SelectionHelper::selectAllInAll(dt); break; case SP_VERB_EDIT_INVERT_IN_ALL_LAYERS: - if (tools_isactive(dt, TOOLS_NODES)) { - ec->shape_editor->select_all(true); - } else { - sp_edit_invert_in_all_layers(dt); - } + SelectionHelper::invertAllInAll(dt); break; - case SP_VERB_EDIT_SELECT_NEXT: - if (tools_isactive(dt, TOOLS_NODES)) { - ec->shape_editor->select_next(); - } else if (tools_isactive(dt, TOOLS_GRADIENT) - && ec->_grdrag->isNonEmpty()) { - sp_gradient_context_select_next (ec); - } else { - sp_selection_item_next(dt); - } + SelectionHelper::selectNext(dt); break; case SP_VERB_EDIT_SELECT_PREV: - if (tools_isactive(dt, TOOLS_NODES)) { - ec->shape_editor->select_prev(); - } else if (tools_isactive(dt, TOOLS_GRADIENT) - && ec->_grdrag->isNonEmpty()) { - sp_gradient_context_select_prev (ec); - } else { - sp_selection_item_prev(dt); - } + SelectionHelper::selectPrev(dt); break; - case SP_VERB_EDIT_DESELECT: - if (tools_isactive(dt, TOOLS_NODES)) { - ec->shape_editor->deselect(); - } else { - sp_desktop_selection(dt)->clear(); - } + SelectionHelper::selectNone(dt); break; - case SP_VERB_EDIT_GUIDES_AROUND_PAGE: sp_guide_create_guides_around_page(dt); break; @@ -1086,7 +1080,7 @@ SelectionVerb::perform(SPAction *action, void *data, void */*pdata*/) sp_selected_path_simplify(dt); break; case SP_VERB_SELECTION_REVERSE: - sp_selected_path_reverse(dt); + SelectionHelper::reverse(dt); break; case SP_VERB_SELECTION_TRACE: inkscape_dialogs_unhide(); @@ -1117,7 +1111,7 @@ void LayerVerb::perform(SPAction *action, void *data, void */*pdata*/) { SPDesktop *dt = static_cast(sp_action_get_view(action)); - unsigned int verb = reinterpret_cast(data); + size_t verb = reinterpret_cast(data); if ( !dt || !dt->currentLayer() ) { return; @@ -1136,8 +1130,8 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/) SPObject *next=Inkscape::next_layer(dt->currentRoot(), dt->currentLayer()); if (next) { dt->setCurrentLayer(next); - sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_NEXT, - _("Switch to next layer")); + DocumentUndo::done(sp_desktop_document(dt), SP_VERB_LAYER_NEXT, + _("Switch to next layer")); dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Switched to next layer.")); } else { dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot go past last layer.")); @@ -1148,8 +1142,8 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/) SPObject *prev=Inkscape::previous_layer(dt->currentRoot(), dt->currentLayer()); if (prev) { dt->setCurrentLayer(prev); - sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_PREV, - _("Switch to previous layer")); + DocumentUndo::done(sp_desktop_document(dt), SP_VERB_LAYER_PREV, + _("Switch to previous layer")); dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Switched to previous layer.")); } else { dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot go before first layer.")); @@ -1176,7 +1170,7 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/) SPItem *layer=SP_ITEM(dt->currentLayer()); g_return_if_fail(layer != NULL); - SPObject *old_pos=SP_OBJECT_NEXT(layer); + SPObject *old_pos = layer->getNext(); switch (verb) { case SP_VERB_LAYER_TO_TOP: @@ -1193,7 +1187,7 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/) break; } - if ( SP_OBJECT_NEXT(layer) != old_pos ) { + if ( layer->getNext() != old_pos ) { char const *message = NULL; Glib::ustring description = ""; switch (verb) { @@ -1214,7 +1208,7 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/) description = _("Lower layer"); break; }; - sp_document_done(sp_desktop_document(dt), verb, description); + DocumentUndo::done(sp_desktop_document(dt), verb, description); if (message) { dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, message); g_free((void *) message); @@ -1245,7 +1239,8 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/) sp_edit_select_all(dt); #else // Copies everything, regardless of locks, visibility, sublayers. - Inkscape::XML::Node *selected = dt->currentLayer()->repr; + //XML Tree being directly used here while it shouldn't be. + Inkscape::XML::Node *selected = dt->currentLayer()->getRepr(); Inkscape::XML::Node *parent = sp_repr_parent(selected); Inkscape::XML::Node *dup = selected->duplicate(parent->document()); parent->addChild(dup, selected); @@ -1259,8 +1254,8 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/) dt->setCurrentLayer(new_layer); } #endif - sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_DUPLICATE, - _("Duplicate layer")); + DocumentUndo::done(sp_desktop_document(dt), SP_VERB_LAYER_DUPLICATE, + _("Duplicate layer")); // TRANSLATORS: this means "The layer has been duplicated." dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Duplicated layer.")); @@ -1291,8 +1286,8 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/) dt->setCurrentLayer(survivor); } - sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_DELETE, - _("Delete layer")); + DocumentUndo::done(sp_desktop_document(dt), SP_VERB_LAYER_DELETE, + _("Delete layer")); // TRANSLATORS: this means "The layer has been deleted." dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Deleted layer.")); @@ -1306,7 +1301,7 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/) dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer.")); } else { dt->toggleLayerSolo( dt->currentLayer() ); - sp_document_maybe_done(sp_desktop_document(dt), "layer:solo", SP_VERB_LAYER_SOLO, _("Toggle layer solo")); + DocumentUndo::maybeDone(sp_desktop_document(dt), "layer:solo", SP_VERB_LAYER_SOLO, _("Toggle layer solo")); } break; } @@ -1365,43 +1360,14 @@ ObjectVerb::perform( SPAction *action, void *data, void */*pdata*/ ) flowtext_to_text(); break; case SP_VERB_OBJECT_FLIP_HORIZONTAL: - // When working with the node tool ... - if (tools_isactive(dt, TOOLS_NODES)) { - Inkscape::NodePath::Node *active_node = Inkscape::NodePath::Path::active_node; - - // ... and one of the nodes is currently mouseovered ... - if (active_node) { - - // ... flip the selected nodes about that node - ec->shape_editor->flip(Geom::X, active_node->pos); - } else { - - // ... or else about the center of their bounding box. - ec->shape_editor->flip(Geom::X); - } - - // When working with the selector tool, flip the selection about its rotation center - // (if it is visible) or about the center of the bounding box. - } else { - sp_selection_scale_relative(sel, center, Geom::Scale(-1.0, 1.0)); - } - sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_HORIZONTAL, - _("Flip horizontally")); + sp_selection_scale_relative(sel, center, Geom::Scale(-1.0, 1.0)); + DocumentUndo::done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_HORIZONTAL, + _("Flip horizontally")); break; case SP_VERB_OBJECT_FLIP_VERTICAL: - // The behaviour is analogous to flipping horizontally - if (tools_isactive(dt, TOOLS_NODES)) { - Inkscape::NodePath::Node *active_node = Inkscape::NodePath::Path::active_node; - if (active_node) { - ec->shape_editor->flip(Geom::Y, active_node->pos); - } else { - ec->shape_editor->flip(Geom::Y); - } - } else { - sp_selection_scale_relative(sel, center, Geom::Scale(1.0, -1.0)); - } - sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_VERTICAL, - _("Flip vertically")); + sp_selection_scale_relative(sel, center, Geom::Scale(1.0, -1.0)); + DocumentUndo::done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_VERTICAL, + _("Flip vertically")); break; case SP_VERB_OBJECT_SET_MASK: sp_selection_set_mask(dt, false, false); @@ -1464,6 +1430,9 @@ ContextVerb::perform(SPAction *action, void *data, void */*pdata*/) case SP_VERB_CONTEXT_TWEAK: tools_switch(dt, TOOLS_TWEAK); break; + case SP_VERB_CONTEXT_SPRAY: + tools_switch(dt, TOOLS_SPRAY); + break; case SP_VERB_CONTEXT_RECT: tools_switch(dt, TOOLS_SHAPES_RECT); break; @@ -1525,6 +1494,10 @@ ContextVerb::perform(SPAction *action, void *data, void */*pdata*/) prefs->setInt("/dialogs/preferences/page", PREFS_PAGE_TOOLS_TWEAK); dt->_dlg_mgr->showDialog("InkscapePreferences"); break; + case SP_VERB_CONTEXT_SPRAY_PREFS: + prefs->setInt("/dialogs/preferences/page", PREFS_PAGE_TOOLS_SPRAY); + dt->_dlg_mgr->showDialog("InkscapePreferences"); + break; case SP_VERB_CONTEXT_RECT_PREFS: prefs->setInt("/dialogs/preferences/page", PREFS_PAGE_TOOLS_SHAPES_RECT); dt->_dlg_mgr->showDialog("InkscapePreferences"); @@ -1605,7 +1578,7 @@ TextVerb::perform(SPAction *action, void */*data*/, void */*pdata*/) if (!dt) return; - Document *doc = sp_desktop_document(dt); + SPDocument *doc = sp_desktop_document(dt); (void)doc; Inkscape::XML::Node *repr = SP_OBJECT_REPR(dt->namedview); (void)repr; @@ -1620,7 +1593,7 @@ ZoomVerb::perform(SPAction *action, void *data, void */*pdata*/) return; SPEventContext *ec = dt->event_context; - Document *doc = sp_desktop_document(dt); + SPDocument *doc = sp_desktop_document(dt); Inkscape::XML::Node *repr = SP_OBJECT_REPR(dt->namedview); @@ -1628,7 +1601,7 @@ ZoomVerb::perform(SPAction *action, void *data, void */*pdata*/) gdouble zoom_inc = prefs->getDoubleLimited( "/options/zoomincrement/value", 1.414213562, 1.01, 10 ); - switch (GPOINTER_TO_INT(data)) { + switch (reinterpret_cast(data)) { case SP_VERB_ZOOM_IN: { gint mul = 1 + gobble_key_events( @@ -1742,6 +1715,9 @@ ZoomVerb::perform(SPAction *action, void *data, void */*pdata*/) case SP_VERB_VIEW_MODE_OUTLINE: dt->setDisplayModeOutline(); break; +// case SP_VERB_VIEW_MODE_PRINT_COLORS_PREVIEW: +// dt->setDisplayModePrintColorsPreview(); +// break; case SP_VERB_VIEW_MODE_TOGGLE: dt->displayModeToggle(); break; @@ -1788,6 +1764,9 @@ DialogVerb::perform(SPAction *action, void *data, void */*pdata*/) case SP_VERB_DIALOG_FILL_STROKE: dt->_dlg_mgr->showDialog("FillAndStroke"); break; + case SP_VERB_DIALOG_GLYPHS: + dt->_dlg_mgr->showDialog("Glyphs"); + break; case SP_VERB_DIALOG_SWATCHES: dt->_dlg_mgr->showDialog("Swatches"); break; @@ -1797,6 +1776,9 @@ DialogVerb::perform(SPAction *action, void *data, void */*pdata*/) case SP_VERB_DIALOG_ALIGN_DISTRIBUTE: dt->_dlg_mgr->showDialog("AlignAndDistribute"); break; + case SP_VERB_DIALOG_SPRAY_OPTION: + dt->_dlg_mgr->showDialog("SprayOptionClass"); + break; case SP_VERB_DIALOG_TEXT: sp_text_edit_dialog(); break; @@ -1833,17 +1815,14 @@ DialogVerb::perform(SPAction *action, void *data, void */*pdata*/) case SP_VERB_DIALOG_ITEM: sp_item_dialog(); break; -#ifdef WITH_INKBOARD +/*#ifdef WITH_INKBOARD case SP_VERB_XMPP_CLIENT: { Inkscape::Whiteboard::SessionManager::showClient(); break; } -#endif +#endif*/ case SP_VERB_DIALOG_INPUT: - sp_input_dialog(); - break; - case SP_VERB_DIALOG_INPUT2: dt->_dlg_mgr->showDialog("InputDevices"); break; case SP_VERB_DIALOG_EXTENSIONEDITOR: @@ -1861,6 +1840,9 @@ DialogVerb::perform(SPAction *action, void *data, void */*pdata*/) case SP_VERB_DIALOG_SVG_FONTS: dt->_dlg_mgr->showDialog("SvgFontsDialog"); break; + case SP_VERB_DIALOG_PRINT_COLORS_PREVIEW: + dt->_dlg_mgr->showDialog("PrintColorsPreviewDialog"); + break; default: break; } @@ -1906,8 +1888,8 @@ TutorialVerb::perform(SPAction */*action*/, void *data, void */*pdata*/) { switch (reinterpret_cast(data)) { case SP_VERB_TUTORIAL_BASIC: - /* TRANSLATORS: If you have translated the tutorial-basic.svg file to your language, - then translate this string as "tutorial-basic.LANG.svg" (where LANG is your language + /* TRANSLATORS: If you have translated the tutorial-basic.en.svgz file to your language, + then translate this string as "tutorial-basic.LANG.svgz" (where LANG is your language code); otherwise leave as "tutorial-basic.svg". */ sp_help_open_tutorial(NULL, (gpointer)_("tutorial-basic.svg")); break; @@ -1927,6 +1909,10 @@ TutorialVerb::perform(SPAction */*action*/, void *data, void */*pdata*/) // TRANSLATORS: See "tutorial-basic.svg" comment. sp_help_open_tutorial(NULL, (gpointer)_("tutorial-calligraphy.svg")); break; + case SP_VERB_TUTORIAL_INTERPOLATE: + // TRANSLATORS: See "tutorial-basic.svg" comment. + sp_help_open_tutorial(NULL, (gpointer)_("tutorial-interpolate.svg")); + break; case SP_VERB_TUTORIAL_DESIGN: // TRANSLATORS: See "tutorial-basic.svg" comment. sp_help_open_tutorial(NULL, (gpointer)_("tutorial-elements.svg")); @@ -2066,13 +2052,13 @@ EffectLastVerb::perform(SPAction *action, void *data, void */*pdata*/) /* These aren't used, but are here to remind people not to use the CURRENT_DOCUMENT macros unless they really have to. */ Inkscape::UI::View::View *current_view = sp_action_get_view(action); - // Document *current_document = SP_VIEW_DOCUMENT(current_view); + // SPDocument *current_document = SP_VIEW_DOCUMENT(current_view); Inkscape::Extension::Effect *effect = Inkscape::Extension::Effect::get_last_effect(); if (effect == NULL) return; if (current_view == NULL) return; - switch ((long) data) { + switch (reinterpret_cast(data)) { case SP_VERB_EFFECT_LAST_PREF: effect->prefs(current_view); break; @@ -2134,10 +2120,10 @@ FitCanvasVerb::perform(SPAction *action, void *data, void */*pdata*/) { SPDesktop *dt = static_cast(sp_action_get_view(action)); if (!dt) return; - Document *doc = sp_desktop_document(dt); + SPDocument *doc = sp_desktop_document(dt); if (!doc) return; - switch ((long) data) { + switch (reinterpret_cast(data)) { case SP_VERB_FIT_CANVAS_TO_SELECTION: verb_fit_canvas_to_selection(dt); break; @@ -2203,25 +2189,25 @@ LockAndHideVerb::perform(SPAction *action, void *data, void */*pdata*/) { SPDesktop *dt = static_cast(sp_action_get_view(action)); if (!dt) return; - Document *doc = sp_desktop_document(dt); + SPDocument *doc = sp_desktop_document(dt); if (!doc) return; - switch ((long) data) { + switch (reinterpret_cast(data)) { case SP_VERB_UNLOCK_ALL: unlock_all(dt); - sp_document_done(doc, SP_VERB_UNLOCK_ALL, _("Unlock all objects in the current layer")); + DocumentUndo::done(doc, SP_VERB_UNLOCK_ALL, _("Unlock all objects in the current layer")); break; case SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS: unlock_all_in_all_layers(dt); - sp_document_done(doc, SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS, _("Unlock all objects in all layers")); + DocumentUndo::done(doc, SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS, _("Unlock all objects in all layers")); break; case SP_VERB_UNHIDE_ALL: unhide_all(dt); - sp_document_done(doc, SP_VERB_UNHIDE_ALL, _("Unhide all objects in the current layer")); + DocumentUndo::done(doc, SP_VERB_UNHIDE_ALL, _("Unhide all objects in the current layer")); break; case SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS: unhide_all_in_all_layers(dt); - sp_document_done(doc, SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS, _("Unhide all objects in all layers")); + DocumentUndo::done(doc, SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS, _("Unhide all objects in all layers")); break; default: return; @@ -2263,7 +2249,7 @@ Verb *Verb::_base_verbs[] = { new FileVerb(SP_VERB_FILE_EXPORT, "FileExport", N_("_Export Bitmap..."), N_("Export this document or a selection as a bitmap image"), INKSCAPE_ICON_DOCUMENT_EXPORT), new FileVerb(SP_VERB_FILE_IMPORT_FROM_OCAL, "FileImportFromOCAL", N_("Import From Open Clip Art Library"), N_("Import a document from Open Clip Art Library"), INKSCAPE_ICON_DOCUMENT_IMPORT_OCAL), - new FileVerb(SP_VERB_FILE_EXPORT_TO_OCAL, "FileExportToOCAL", N_("Export To Open Clip Art Library"), N_("Export this document to Open Clip Art Library"), INKSCAPE_ICON_DOCUMENT_EXPORT_OCAL), +// new FileVerb(SP_VERB_FILE_EXPORT_TO_OCAL, "FileExportToOCAL", N_("Export To Open Clip Art Library"), N_("Export this document to Open Clip Art Library"), INKSCAPE_ICON_DOCUMENT_EXPORT_OCAL), new FileVerb(SP_VERB_FILE_NEXT_DESKTOP, "NextWindow", N_("N_ext Window"), N_("Switch to the next document window"), INKSCAPE_ICON_WINDOW_NEXT), new FileVerb(SP_VERB_FILE_PREV_DESKTOP, "PrevWindow", N_("P_revious Window"), @@ -2328,7 +2314,7 @@ Verb *Verb::_base_verbs[] = { new EditVerb(SP_VERB_EDIT_CLEAR_ALL, "EditClearAll", N_("Clea_r All"), N_("Delete all objects from document"), NULL), new EditVerb(SP_VERB_EDIT_SELECT_ALL, "EditSelectAll", N_("Select Al_l"), - N_("Select all objects or all nodes"), GTK_STOCK_SELECT_ALL), + N_("Select all objects or all nodes"), "fooble"),//GTK_STOCK_SELECT_ALL), new EditVerb(SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, "EditSelectAllInAllLayers", N_("Select All in All La_yers"), N_("Select all objects in all visible and unlocked layers"), INKSCAPE_ICON_EDIT_SELECT_ALL_LAYERS), new EditVerb(SP_VERB_EDIT_INVERT, "EditInvert", N_("In_vert Selection"), @@ -2343,8 +2329,8 @@ Verb *Verb::_base_verbs[] = { N_("Deselect any selected objects or nodes"), INKSCAPE_ICON_EDIT_SELECT_NONE), new EditVerb(SP_VERB_EDIT_GUIDES_AROUND_PAGE, "EditGuidesAroundPage", N_("_Guides Around Page"), N_("Create four guides aligned with the page borders"), NULL), - new EditVerb(SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER, "EditNextPathEffectParameter", N_("Next Path Effect Parameter"), - N_("Show next Path Effect parameter for editing"), INKSCAPE_ICON_PATH_EFFECT_PARAMETER_NEXT), + new EditVerb(SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER, "EditNextPathEffectParameter", N_("Next path effect parameter"), + N_("Show next editable path effect parameter"), INKSCAPE_ICON_PATH_EFFECT_PARAMETER_NEXT), /* Selection */ new SelectionVerb(SP_VERB_SELECTION_TO_FRONT, "SelectionToFront", N_("Raise to _Top"), @@ -2451,7 +2437,7 @@ Verb *Verb::_base_verbs[] = { N_("Raise the current layer"), INKSCAPE_ICON_LAYER_RAISE), new LayerVerb(SP_VERB_LAYER_LOWER, "LayerLower", N_("_Lower Layer"), N_("Lower the current layer"), INKSCAPE_ICON_LAYER_LOWER), - new LayerVerb(SP_VERB_LAYER_DUPLICATE, "LayerDuplicate", N_("Duplicate Current Layer"), + new LayerVerb(SP_VERB_LAYER_DUPLICATE, "LayerDuplicate", N_("D_uplicate Current Layer"), N_("Duplicate an existing layer"), NULL), new LayerVerb(SP_VERB_LAYER_DELETE, "LayerDelete", N_("_Delete Current Layer"), N_("Delete the current layer"), INKSCAPE_ICON_LAYER_DELETE), @@ -2503,6 +2489,8 @@ Verb *Verb::_base_verbs[] = { N_("Edit paths by nodes"), INKSCAPE_ICON_TOOL_NODE_EDITOR), new ContextVerb(SP_VERB_CONTEXT_TWEAK, "ToolTweak", N_("Tweak"), N_("Tweak objects by sculpting or painting"), INKSCAPE_ICON_TOOL_TWEAK), + new ContextVerb(SP_VERB_CONTEXT_SPRAY, "ToolSpray", N_("Spray"), + N_("Spray objects by sculpting or painting"), INKSCAPE_ICON_TOOL_SPRAY), new ContextVerb(SP_VERB_CONTEXT_RECT, "ToolRect", N_("Rectangle"), N_("Create rectangles and squares"), INKSCAPE_ICON_DRAW_RECTANGLE), new ContextVerb(SP_VERB_CONTEXT_3DBOX, "Tool3DBox", N_("3D Box"), @@ -2544,6 +2532,8 @@ Verb *Verb::_base_verbs[] = { N_("Open Preferences for the Node tool"), NULL), new ContextVerb(SP_VERB_CONTEXT_TWEAK_PREFS, "TweakPrefs", N_("Tweak Tool Preferences"), N_("Open Preferences for the Tweak tool"), NULL), + new ContextVerb(SP_VERB_CONTEXT_SPRAY_PREFS, "SprayPrefs", N_("Spray Tool Preferences"), + N_("Open Preferences for the Spray tool"), NULL), new ContextVerb(SP_VERB_CONTEXT_RECT_PREFS, "RectPrefs", N_("Rectangle Preferences"), N_("Open Preferences for the Rectangle tool"), NULL), new ContextVerb(SP_VERB_CONTEXT_3DBOX_PREFS, "3DBoxPrefs", N_("3D Box Preferences"), @@ -2584,7 +2574,7 @@ Verb *Verb::_base_verbs[] = { new ZoomVerb(SP_VERB_TOGGLE_SCROLLBARS, "ToggleScrollbars", N_("Scroll_bars"), N_("Show or hide the canvas scrollbars"), NULL), new ZoomVerb(SP_VERB_TOGGLE_GRID, "ToggleGrid", N_("_Grid"), N_("Show or hide the grid"), INKSCAPE_ICON_SHOW_GRID), new ZoomVerb(SP_VERB_TOGGLE_GUIDES, "ToggleGuides", N_("G_uides"), N_("Show or hide guides (drag from a ruler to create a guide)"), INKSCAPE_ICON_SHOW_GUIDES), - new ZoomVerb(SP_VERB_TOGGLE_SNAPPING, "ToggleSnapGlobal", N_("Snap"), N_("Toggle snapping on or off"), INKSCAPE_ICON_SNAP), + new ZoomVerb(SP_VERB_TOGGLE_SNAPPING, "ToggleSnapGlobal", N_("Snap"), N_("Enable snapping"), INKSCAPE_ICON_SNAP), new ZoomVerb(SP_VERB_ZOOM_NEXT, "ZoomNext", N_("Nex_t Zoom"), N_("Next zoom (from the history of zooms)"), INKSCAPE_ICON_ZOOM_NEXT), new ZoomVerb(SP_VERB_ZOOM_PREV, "ZoomPrev", N_("Pre_vious Zoom"), N_("Previous zoom (from the history of zooms)"), @@ -2612,6 +2602,8 @@ Verb *Verb::_base_verbs[] = { N_("Switch to normal display without filters"), NULL), new ZoomVerb(SP_VERB_VIEW_MODE_OUTLINE, "ViewModeOutline", N_("_Outline"), N_("Switch to outline (wireframe) display mode"), NULL), +// new ZoomVerb(SP_VERB_VIEW_MODE_PRINT_COLORS_PREVIEW, "ViewModePrintColorsPreview", N_("_Print Colors Preview"), +// N_("Switch to print colors preview mode"), NULL), new ZoomVerb(SP_VERB_VIEW_MODE_TOGGLE, "ViewModeToggle", N_("_Toggle"), N_("Toggle between normal and outline display modes"), NULL), @@ -2637,7 +2629,9 @@ Verb *Verb::_base_verbs[] = { new DialogVerb(SP_VERB_DIALOG_METADATA, "DialogMetadata", N_("Document _Metadata..."), N_("Edit document metadata (to be saved with the document)"), INKSCAPE_ICON_DOCUMENT_METADATA ), new DialogVerb(SP_VERB_DIALOG_FILL_STROKE, "DialogFillStroke", N_("_Fill and Stroke..."), - N_("Edit objects' colors, gradients, stroke width, arrowheads, dash patterns..."), INKSCAPE_ICON_DIALOG_FILL_AND_STROKE), + N_("Edit objects' colors, gradients, arrowheads, and other fill and stroke properties..."), INKSCAPE_ICON_DIALOG_FILL_AND_STROKE), + new DialogVerb(SP_VERB_DIALOG_GLYPHS, "DialogGlyphs", N_("Glyphs..."), + N_("Select characters from a glyphs palette"), GTK_STOCK_SELECT_FONT), // TRANSLATORS: "Swatches" means: color samples new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches..."), N_("Select colors from a swatches palette"), GTK_STOCK_SELECT_COLOR), @@ -2645,6 +2639,8 @@ Verb *Verb::_base_verbs[] = { N_("Precisely control objects' transformations"), INKSCAPE_ICON_DIALOG_TRANSFORM), new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."), N_("Align and distribute objects"), INKSCAPE_ICON_DIALOG_ALIGN_AND_DISTRIBUTE), + new DialogVerb(SP_VERB_DIALOG_SPRAY_OPTION, "DialogSprayOption", N_("_Spray options..."), + N_("Some options for the spray"), INKSCAPE_ICON_DIALOG_SPRAY_OPTIONS), new DialogVerb(SP_VERB_DIALOG_UNDO_HISTORY, "DialogUndoHistory", N_("Undo _History..."), N_("Undo History"), INKSCAPE_ICON_EDIT_UNDO_HISTORY), new DialogVerb(SP_VERB_DIALOG_TEXT, "DialogText", N_("_Text and Font..."), @@ -2667,14 +2663,12 @@ Verb *Verb::_base_verbs[] = { N_("Create multiple clones of selected object, arranging them into a pattern or scattering"), INKSCAPE_ICON_DIALOG_TILE_CLONES), new DialogVerb(SP_VERB_DIALOG_ITEM, "DialogObjectProperties", N_("_Object Properties..."), N_("Edit the ID, locked and visible status, and other object properties"), INKSCAPE_ICON_DIALOG_OBJECT_PROPERTIES), -#ifdef WITH_INKBOARD +/*#ifdef WITH_INKBOARD new DialogVerb(SP_VERB_XMPP_CLIENT, "DialogXmppClient", N_("_Instant Messaging..."), N_("Jabber Instant Messaging Client"), NULL), -#endif +#endif*/ new DialogVerb(SP_VERB_DIALOG_INPUT, "DialogInput", N_("_Input Devices..."), N_("Configure extended input devices, such as a graphics tablet"), INKSCAPE_ICON_DIALOG_INPUT_DEVICES), - new DialogVerb(SP_VERB_DIALOG_INPUT2, "DialogInput2", N_("_Input Devices (new)..."), - N_("Configure extended input devices, such as a graphics tablet"), INKSCAPE_ICON_DIALOG_INPUT_DEVICES), new DialogVerb(SP_VERB_DIALOG_EXTENSIONEDITOR, "org.inkscape.dialogs.extensioneditor", N_("_Extensions..."), N_("Query information about extensions"), NULL), new DialogVerb(SP_VERB_DIALOG_LAYERS, "DialogLayers", N_("Layer_s..."), @@ -2685,6 +2679,8 @@ Verb *Verb::_base_verbs[] = { N_("Manage, edit, and apply SVG filters"), NULL), new DialogVerb(SP_VERB_DIALOG_SVG_FONTS, "DialogSVGFonts", N_("SVG Font Editor..."), N_("Edit SVG fonts"), NULL), + new DialogVerb(SP_VERB_DIALOG_PRINT_COLORS_PREVIEW, "DialogPrintColorsPreview", N_("Print Colors..."), + N_("Select which color separations to render in Print Colors Preview rendermode"), NULL), /* Help */ new HelpVerb(SP_VERB_HELP_ABOUT_EXTENSIONS, "HelpAboutExtensions", N_("About E_xtensions"), @@ -2708,6 +2704,8 @@ Verb *Verb::_base_verbs[] = { N_("Using bitmap tracing"), NULL/*"tutorial_tracing"*/), new TutorialVerb(SP_VERB_TUTORIAL_CALLIGRAPHY, "TutorialsCalligraphy", N_("Inkscape: _Calligraphy"), N_("Using the Calligraphy pen tool"), NULL), + new TutorialVerb(SP_VERB_TUTORIAL_INTERPOLATE, "TutorialsInterpolate", N_("Inkscape: _Interpolate"), + N_("Using the interpolate extension"), NULL/*"tutorial_interpolate"*/), new TutorialVerb(SP_VERB_TUTORIAL_DESIGN, "TutorialsDesign", N_("_Elements of Design"), N_("Principles of design in the tutorial form"), NULL/*"tutorial_design"*/), new TutorialVerb(SP_VERB_TUTORIAL_TIPS, "TutorialsTips", N_("_Tips and Tricks"), @@ -2773,4 +2771,4 @@ Verb::list (void) { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :