diff --git a/src/verbs.cpp b/src/verbs.cpp
index dd4de682de2c178e4025c31902a50e65d9b621bd..f03be681a631d68ae11ffb88df3ae7f27a3a2bbc 100644 (file)
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
#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 "ui/dialog/layers.h"
#include "ui/dialog/swatches.h"
#include "ui/icon-names.h"
+#include "ui/tool/control-point-selection.h"
+#include "ui/tool/multi-path-manipulator.h"
+#include "ui/tool/node-tool.h"
-#ifdef WITH_INKBOARD
-#include "jabber_whiteboard/session-manager.h"
-#endif
+//#ifdef WITH_INKBOARD
+//#include "jabber_whiteboard/session-manager.h"
+//#endif
/**
* \brief Return the name without underscores and ellipsis, for use in dialog
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;
break;
case SP_VERB_EDIT_SELECT_ALL:
if (tools_isactive(dt, TOOLS_NODES)) {
- ec->shape_editor->select_all_from_subpath(false);
+ InkNodeTool *nt = static_cast<InkNodeTool*>(dt->event_context);
+ nt->_multipath->selectSubpaths();
} else {
sp_edit_select_all(dt);
}
break;
case SP_VERB_EDIT_INVERT:
if (tools_isactive(dt, TOOLS_NODES)) {
- ec->shape_editor->select_all_from_subpath(true);
+ InkNodeTool *nt = static_cast<InkNodeTool*>(dt->event_context);
+ nt->_multipath->invertSelectionInSubpaths();
} else {
sp_edit_invert(dt);
}
break;
case SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS:
if (tools_isactive(dt, TOOLS_NODES)) {
- ec->shape_editor->select_all(false);
+ InkNodeTool *nt = static_cast<InkNodeTool*>(dt->event_context);
+ nt->_selected_nodes->selectAll();
} else {
sp_edit_select_all_in_all_layers(dt);
}
break;
case SP_VERB_EDIT_INVERT_IN_ALL_LAYERS:
if (tools_isactive(dt, TOOLS_NODES)) {
- ec->shape_editor->select_all(true);
+ InkNodeTool *nt = static_cast<InkNodeTool*>(dt->event_context);
+ nt->_selected_nodes->invertSelection();
} else {
sp_edit_invert_in_all_layers(dt);
}
case SP_VERB_EDIT_SELECT_NEXT:
if (tools_isactive(dt, TOOLS_NODES)) {
- ec->shape_editor->select_next();
+ InkNodeTool *nt = static_cast<InkNodeTool*>(dt->event_context);
+ nt->_multipath->shiftSelection(1);
} else if (tools_isactive(dt, TOOLS_GRADIENT)
&& ec->_grdrag->isNonEmpty()) {
sp_gradient_context_select_next (ec);
break;
case SP_VERB_EDIT_SELECT_PREV:
if (tools_isactive(dt, TOOLS_NODES)) {
- ec->shape_editor->select_prev();
+ InkNodeTool *nt = static_cast<InkNodeTool*>(dt->event_context);
+ nt->_multipath->shiftSelection(-1);
} else if (tools_isactive(dt, TOOLS_GRADIENT)
&& ec->_grdrag->isNonEmpty()) {
sp_gradient_context_select_prev (ec);
case SP_VERB_EDIT_DESELECT:
if (tools_isactive(dt, TOOLS_NODES)) {
- ec->shape_editor->deselect();
+ InkNodeTool *nt = static_cast<InkNodeTool*>(dt->event_context);
+ nt->_selected_nodes->clear();
} else {
sp_desktop_selection(dt)->clear();
}
sp_selected_path_simplify(dt);
break;
case SP_VERB_SELECTION_REVERSE:
- sp_selected_path_reverse(dt);
+ // TODO make this a virtual method of event context!
+ if (tools_isactive(dt, TOOLS_NODES)) {
+ InkNodeTool *nt = static_cast<InkNodeTool*>(dt->event_context);
+ nt->_multipath->reverseSubpaths();
+ } else {
+ sp_selected_path_reverse(dt);
+ }
break;
case SP_VERB_SELECTION_TRACE:
inkscape_dialogs_unhide();
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_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"));
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_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"));
break;
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;
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"),
N_("Select previous object or node"), NULL),
new EditVerb(SP_VERB_EDIT_DESELECT, "EditDeselect", N_("D_eselect"),
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"),
+ 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),
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_("Duplicate 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),
new ContextVerb(SP_VERB_CONTEXT_ERASER, "ToolEraser", N_("Eraser"),
N_("Erase existing paths"), INKSCAPE_ICON_DRAW_ERASER),
new ContextVerb(SP_VERB_CONTEXT_LPETOOL, "ToolLPETool", N_("LPE Tool"),
- N_("Do geometric constructions"), NULL),
+ N_("Do geometric constructions"), "draw-geometry"),
/* Tool prefs */
new ContextVerb(SP_VERB_CONTEXT_SELECT_PREFS, "SelectPrefs", N_("Selector Preferences"),
N_("Open Preferences for the Selector tool"), NULL),
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)..."),
new TutorialVerb(SP_VERB_TUTORIAL_TIPS, "TutorialsTips", N_("_Tips and Tricks"),
N_("Miscellaneous tips and tricks"), NULL/*"tutorial_tips"*/),
- /* Effect */
- new EffectLastVerb(SP_VERB_EFFECT_LAST, "EffectLast", N_("Previous Effect"),
- N_("Repeat the last effect with the same settings"), NULL),
- new EffectLastVerb(SP_VERB_EFFECT_LAST_PREF, "EffectLastPref", N_("Previous Effect Settings..."),
- N_("Repeat the last effect with new settings"), NULL),
+ /* Effect -- renamed Extension */
+ new EffectLastVerb(SP_VERB_EFFECT_LAST, "EffectLast", N_("Previous Extension"),
+ N_("Repeat the last extension with the same settings"), NULL),
+ new EffectLastVerb(SP_VERB_EFFECT_LAST_PREF, "EffectLastPref", N_("Previous Extension Settings..."),
+ N_("Repeat the last extension with new settings"), NULL),
/* Fit Page */
new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_SELECTION, "FitCanvasToSelection", N_("Fit Page to Selection"),