Code

now that selection description includes style (filtered, clipped), we need to update...
[inkscape.git] / src / verbs.cpp
index 37961ab15669ffde18c02ac0d06b613d74ebc31a..78c4423f51efb1603199602dff2402360456c583 100644 (file)
@@ -69,6 +69,7 @@
 #include "path-chemistry.h"
 #include "text-chemistry.h"
 #include "ui/dialog/dialog-manager.h"
+#include "ui/dialog/document-properties.h"
 #include "ui/dialog/inkscape-preferences.h"
 #include "interface.h"
 #include "preferences.h"
@@ -628,11 +629,11 @@ Verb::sensitive(SPDocument *in_doc, bool in_sensitive)
     return;
 }
 
-/** \brief Accessor to get the tooltip for verb as localised string */ 
+/** \brief Accessor to get the tooltip for verb as localised string */
 gchar const *
-Verb::get_tip (void) 
+Verb::get_tip (void)
 {
-       return _(_tip); 
+       return _(_tip);
 }
 
 void
@@ -920,28 +921,28 @@ EditVerb::perform(SPAction *action, void *data, void */*pdata*/)
             break;
         case SP_VERB_EDIT_SELECT_ALL:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                SP_NODE_CONTEXT(ec)->shape_editor->select_all_from_subpath(false);
+                ec->shape_editor->select_all_from_subpath(false);
             } else {
                 sp_edit_select_all(dt);
             }
             break;
         case SP_VERB_EDIT_INVERT:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                SP_NODE_CONTEXT(ec)->shape_editor->select_all_from_subpath(true);
+                ec->shape_editor->select_all_from_subpath(true);
             } else {
                 sp_edit_invert(dt);
             }
             break;
         case SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                SP_NODE_CONTEXT(ec)->shape_editor->select_all(false);
+                ec->shape_editor->select_all(false);
             } else {
                 sp_edit_select_all_in_all_layers(dt);
             }
             break;
         case SP_VERB_EDIT_INVERT_IN_ALL_LAYERS:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                SP_NODE_CONTEXT(ec)->shape_editor->select_all(true);
+                ec->shape_editor->select_all(true);
             } else {
                 sp_edit_invert_in_all_layers(dt);
             }
@@ -949,7 +950,7 @@ EditVerb::perform(SPAction *action, void *data, void */*pdata*/)
 
         case SP_VERB_EDIT_SELECT_NEXT:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                SP_NODE_CONTEXT(ec)->shape_editor->select_next();
+                ec->shape_editor->select_next();
             } else if (tools_isactive(dt, TOOLS_GRADIENT)
                        && ec->_grdrag->isNonEmpty()) {
                 sp_gradient_context_select_next (ec);
@@ -959,7 +960,7 @@ EditVerb::perform(SPAction *action, void *data, void */*pdata*/)
             break;
         case SP_VERB_EDIT_SELECT_PREV:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                SP_NODE_CONTEXT(ec)->shape_editor->select_prev();
+                ec->shape_editor->select_prev();
             } else if (tools_isactive(dt, TOOLS_GRADIENT)
                        && ec->_grdrag->isNonEmpty()) {
                 sp_gradient_context_select_prev (ec);
@@ -970,7 +971,7 @@ EditVerb::perform(SPAction *action, void *data, void */*pdata*/)
 
         case SP_VERB_EDIT_DESELECT:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                SP_NODE_CONTEXT(ec)->shape_editor->deselect();
+                ec->shape_editor->deselect();
             } else {
                 sp_desktop_selection(dt)->clear();
             }
@@ -983,6 +984,10 @@ EditVerb::perform(SPAction *action, void *data, void */*pdata*/)
         case SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER:
             sp_selection_next_patheffect_param(dt);
             break;
+        case SP_VERB_EDIT_LINK_COLOR_PROFILE:
+            break;
+        case SP_VERB_EDIT_REMOVE_COLOR_PROFILE:
+            break;
         default:
             break;
     }
@@ -1239,7 +1244,7 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/)
 
                 sp_document_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."));
             } else {
@@ -1308,7 +1313,7 @@ ObjectVerb::perform( SPAction *action, void *data, void */*pdata*/ )
     if (sel->isEmpty())
         return;
 
-    boost::optional<Geom::Rect> bbox = sel->bounds();
+    Geom::OptRect bbox = sel->bounds();
     if (!bbox) {
         return;
     }
@@ -1351,11 +1356,11 @@ ObjectVerb::perform( SPAction *action, void *data, void */*pdata*/ )
                 if (active_node) {
 
                     // ... flip the selected nodes about that node
-                    SP_NODE_CONTEXT(ec)->shape_editor->flip(Geom::X, active_node->pos);
+                    ec->shape_editor->flip(Geom::X, active_node->pos);
                 } else {
 
                     // ... or else about the center of their bounding box.
-                    SP_NODE_CONTEXT(ec)->shape_editor->flip(Geom::X);
+                    ec->shape_editor->flip(Geom::X);
                 }
 
             // When working with the selector tool, flip the selection about its rotation center
@@ -1371,9 +1376,9 @@ ObjectVerb::perform( SPAction *action, void *data, void */*pdata*/ )
             if (tools_isactive(dt, TOOLS_NODES)) {
                 Inkscape::NodePath::Node *active_node = Inkscape::NodePath::Path::active_node;
                 if (active_node) {
-                    SP_NODE_CONTEXT(ec)->shape_editor->flip(Geom::Y, active_node->pos);
+                    ec->shape_editor->flip(Geom::Y, active_node->pos);
                 } else {
-                    SP_NODE_CONTEXT(ec)->shape_editor->flip(Geom::Y);
+                    ec->shape_editor->flip(Geom::Y);
                 }
             } else {
                 sp_selection_scale_relative(sel, center, Geom::Scale(1.0, -1.0));
@@ -1692,8 +1697,8 @@ ZoomVerb::perform(SPAction *action, void *data, void */*pdata*/)
             sp_namedview_toggle_guides(doc, repr);
             break;
         case SP_VERB_TOGGLE_SNAPPING:
-            dt->toggleSnapping();
-            break;        
+            dt->toggleSnapGlobal();
+            break;
         case SP_VERB_TOGGLE_GRID:
             dt->toggleGrids();
             break;
@@ -2275,7 +2280,7 @@ Verb *Verb::_base_verbs[] = {
                  N_("Apply the path effect of the copied object to selection"), NULL),
     new EditVerb(SP_VERB_EDIT_REMOVE_LIVEPATHEFFECT, "RemoveLivePathEffect", N_("Remove Path _Effect"),
                  N_("Remove any path effects from selected objects"), NULL),
-    new EditVerb(SP_VERB_EDIT_REMOVE_FILTER, "RemoveFilter", N_("Remove Filter"),
+    new EditVerb(SP_VERB_EDIT_REMOVE_FILTER, "RemoveFilter", N_("Remove Filters"),
                  N_("Remove any filters from selected objects"), NULL),
     new EditVerb(SP_VERB_EDIT_DELETE, "EditDelete", N_("_Delete"),
                  N_("Delete selection"), GTK_STOCK_DELETE),
@@ -2304,7 +2309,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"), "edit-select-all"),
+                 N_("Select all objects or all nodes"), "selection_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"), "selection_select_all_in_all_layers"),
     new EditVerb(SP_VERB_EDIT_INVERT, "EditInvert", N_("In_vert Selection"),
@@ -2508,7 +2513,7 @@ Verb *Verb::_base_verbs[] = {
     new ContextVerb(SP_VERB_CONTEXT_PAINTBUCKET, "ToolPaintBucket", N_("Paint Bucket"),
                     N_("Fill bounded areas"), "draw_paintbucket"),
     new ContextVerb(SP_VERB_CONTEXT_LPE, "ToolLPE", N_("LPE Edit"),
-                    N_("Edit Live Path Effect parameters"), "draw_lpe"),
+                    N_("Edit Path Effect parameters"), "draw_lpe"),
     new ContextVerb(SP_VERB_CONTEXT_ERASER, "ToolEraser", N_("Eraser"),
                     N_("Erase existing paths"), "draw_erase"),
     new ContextVerb(SP_VERB_CONTEXT_LPETOOL, "ToolLPETool", N_("LPE Tool"),
@@ -2560,7 +2565,7 @@ Verb *Verb::_base_verbs[] = {
     new ZoomVerb(SP_VERB_TOGGLE_SCROLLBARS, "ToggleScrollbars", N_("Scroll_bars"), N_("Show or hide the canvas scrollbars"), "scrollbars"),
     new ZoomVerb(SP_VERB_TOGGLE_GRID, "ToggleGrid", N_("_Grid"), N_("Show or hide the grid"), "grid"),
     new ZoomVerb(SP_VERB_TOGGLE_GUIDES, "ToggleGuides", N_("G_uides"), N_("Show or hide guides (drag from a ruler to create a guide)"), "guides"),
-    new ZoomVerb(SP_VERB_TOGGLE_SNAPPING, "ToggleSnapping", N_("Snap"), N_("Toggle snapping on or off"), NULL),
+    new ZoomVerb(SP_VERB_TOGGLE_SNAPPING, "ToggleSnapGlobal", N_("Snap"), N_("Toggle snapping on or off"), NULL),
     new ZoomVerb(SP_VERB_ZOOM_NEXT, "ZoomNext", N_("Nex_t Zoom"), N_("Next zoom (from the history of zooms)"),
                  "zoom_next"),
     new ZoomVerb(SP_VERB_ZOOM_PREV, "ZoomPrev", N_("Pre_vious Zoom"), N_("Previous zoom (from the history of zooms)"),
@@ -2651,12 +2656,12 @@ Verb *Verb::_base_verbs[] = {
                    N_("Query information about extensions"), NULL),
     new DialogVerb(SP_VERB_DIALOG_LAYERS, "DialogLayers", N_("Layer_s..."),
                    N_("View Layers"), "layers"),
-    new DialogVerb(SP_VERB_DIALOG_LIVE_PATH_EFFECT, "DialogLivePathEffect", N_("Path Effects..."),
-                   N_("Manage path effects"), NULL),
-    new DialogVerb(SP_VERB_DIALOG_FILTER_EFFECTS, "DialogFilterEffects", N_("Filter Effects..."),
-                   N_("Manage SVG filter effects"), NULL),
-    new DialogVerb(SP_VERB_DIALOG_SVG_FONTS, "DialogSVGFonts", N_("SVG Fonts..."),
-                   N_("Manage SVG fonts"), NULL),
+    new DialogVerb(SP_VERB_DIALOG_LIVE_PATH_EFFECT, "DialogLivePathEffect", N_("Path Effect Editor..."),
+                   N_("Manage, edit, and apply path effects"), NULL),
+    new DialogVerb(SP_VERB_DIALOG_FILTER_EFFECTS, "DialogFilterEffects", N_("Filter Editor..."),
+                   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),
 
     /* Help */
     new HelpVerb(SP_VERB_HELP_ABOUT_EXTENSIONS, "HelpAboutExtensions", N_("About E_xtensions"),
@@ -2707,6 +2712,11 @@ Verb *Verb::_base_verbs[] = {
                        N_("Unhide all objects in the current layer"), NULL),
     new LockAndHideVerb(SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS, "UnhideAllInAllLayers", N_("Unhide All in All Layers"),
                        N_("Unhide all objects in all layers"), NULL),
+    /*Color Management*/
+    new EditVerb(SP_VERB_EDIT_LINK_COLOR_PROFILE, "LinkColorProfile", N_("Link Color Profile"),
+                 N_("Link an ICC color profile"), NULL),
+    new EditVerb(SP_VERB_EDIT_REMOVE_COLOR_PROFILE, "RemoveColorProfile", N_("Remove Color Profile"),
+                 N_("Remove a linked ICC color profile"), NULL),
     /* Footer */
     new Verb(SP_VERB_LAST, " '\"invalid id", NULL, NULL, NULL)
 };