Code

restore rendering markers in outline mode
[inkscape.git] / src / verbs.cpp
index da843bbe841b35e5a1eb01c4ae7c3d944c3d5f55..25c805c3c30a62490d16c10183170dafbf77def0 100644 (file)
@@ -76,6 +76,8 @@
 #include "sp-flowtext.h"
 #include "layer-fns.h"
 #include "node-context.h"
+#include "gradient-context.h"
+#include "shape-editor.h"
 
 
 /**
@@ -846,7 +848,6 @@ EditVerb::perform(SPAction *action, void *data, void *pdata)
     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
     if (!dt)
         return;
-
     SPEventContext *ec = dt->event_context;
 
     switch (reinterpret_cast<std::size_t>(data)) {
@@ -915,35 +916,55 @@ EditVerb::perform(SPAction *action, void *data, void *pdata)
             break;
         case SP_VERB_EDIT_SELECT_ALL:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                sp_nodepath_select_all_from_subpath(SP_NODE_CONTEXT(ec)->nodepath, false);
+                SP_NODE_CONTEXT(ec)->shape_editor->select_all_from_subpath(false);
             } else {
                 sp_edit_select_all();
             }
             break;
         case SP_VERB_EDIT_INVERT:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                sp_nodepath_select_all_from_subpath(SP_NODE_CONTEXT(ec)->nodepath, true);
+                SP_NODE_CONTEXT(ec)->shape_editor->select_all_from_subpath(true);
             } else {
                 sp_edit_invert();
             }
             break;
         case SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                sp_nodepath_select_all(SP_NODE_CONTEXT(ec)->nodepath, false);
+                SP_NODE_CONTEXT(ec)->shape_editor->select_all(false);
             } else {
                 sp_edit_select_all_in_all_layers();
             }
             break;
         case SP_VERB_EDIT_INVERT_IN_ALL_LAYERS:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                sp_nodepath_select_all(SP_NODE_CONTEXT(ec)->nodepath, true);
+                SP_NODE_CONTEXT(ec)->shape_editor->select_all(true);
             } else {
                 sp_edit_invert_in_all_layers();
             }
             break;
+
+        case SP_VERB_EDIT_SELECT_NEXT: 
+            if (tools_isactive(dt, TOOLS_NODES)) {
+                SP_NODE_CONTEXT(ec)->shape_editor->select_next();
+            } else if (tools_isactive(dt, TOOLS_GRADIENT)) {
+                sp_gradient_context_select_next (ec);
+            } else {
+                sp_selection_item_next();
+            }
+            break;
+        case SP_VERB_EDIT_SELECT_PREV: 
+            if (tools_isactive(dt, TOOLS_NODES)) {
+                SP_NODE_CONTEXT(ec)->shape_editor->select_prev();
+            } else if (tools_isactive(dt, TOOLS_GRADIENT)) {
+                sp_gradient_context_select_prev (ec);
+            } else {
+                sp_selection_item_prev();
+            }
+            break;
+
         case SP_VERB_EDIT_DESELECT:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                sp_nodepath_deselect(SP_NODE_CONTEXT(ec)->nodepath);
+                SP_NODE_CONTEXT(ec)->shape_editor->deselect();
             } else {
                 sp_desktop_selection(dt)->clear();
             }
@@ -1033,9 +1054,11 @@ SelectionVerb::perform(SPAction *action, void *data, void *pdata)
             break;
         case SP_VERB_SELECTION_DYNAMIC_OFFSET:
             sp_selected_path_create_offset_object_zero();
+            tools_switch_current(TOOLS_NODES);
             break;
         case SP_VERB_SELECTION_LINKED_OFFSET:
             sp_selected_path_create_updating_offset_object_zero();
+            tools_switch_current(TOOLS_NODES);
             break;
 
         case SP_VERB_SELECTION_OUTLINE:
@@ -1256,11 +1279,11 @@ ObjectVerb::perform( SPAction *action, void *data, void *pdata )
             text_unflow();
             break;
         case SP_VERB_OBJECT_FLOWTEXT_TO_TEXT:
-            SPFlowtext::convert_to_text();
+            flowtext_to_text();
             break;
         case SP_VERB_OBJECT_FLIP_HORIZONTAL:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                sp_nodepath_flip(SP_NODE_CONTEXT(ec)->nodepath, NR::X);
+                SP_NODE_CONTEXT(ec)->shape_editor->flip(NR::X);
             } else {
                 sp_selection_scale_relative(sel, center, NR::scale(-1.0, 1.0));
             }
@@ -1269,7 +1292,7 @@ ObjectVerb::perform( SPAction *action, void *data, void *pdata )
             break;
         case SP_VERB_OBJECT_FLIP_VERTICAL:
             if (tools_isactive(dt, TOOLS_NODES)) {
-                sp_nodepath_flip(SP_NODE_CONTEXT(ec)->nodepath, NR::Y);
+                SP_NODE_CONTEXT(ec)->shape_editor->flip(NR::Y);
             } else {
                 sp_selection_scale_relative(sel, center, NR::scale(1.0, -1.0));
             }
@@ -1312,7 +1335,7 @@ ContextVerb::perform(SPAction *action, void *data, void *pdata)
     /** \todo !!! hopefully this can go away soon and actions can look after
      * themselves
      */
-    for (vidx = SP_VERB_CONTEXT_SELECT; vidx <= SP_VERB_CONTEXT_DROPPER_PREFS; vidx++)
+    for (vidx = SP_VERB_CONTEXT_SELECT; vidx <= SP_VERB_CONTEXT_PAINTBUCKET_PREFS; vidx++)
     {
         SPAction *tool_action= get((sp_verb_t)vidx)->get_action(dt);
         if (tool_action) {
@@ -1363,6 +1386,9 @@ ContextVerb::perform(SPAction *action, void *data, void *pdata)
         case SP_VERB_CONTEXT_CONNECTOR:
             tools_switch_current (TOOLS_CONNECTOR);
             break;
+        case SP_VERB_CONTEXT_PAINTBUCKET:
+            tools_switch_current(TOOLS_PAINTBUCKET);
+            break;
 
         case SP_VERB_CONTEXT_SELECT_PREFS:
             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SELECTOR);
@@ -1420,6 +1446,10 @@ ContextVerb::perform(SPAction *action, void *data, void *pdata)
             prefs_set_int_attribute ("dialogs.preferences", "page", PREFS_PAGE_TOOLS_CONNECTOR);
             dt->_dlg_mgr->showDialog("InkscapePreferences");
             break;
+        case SP_VERB_CONTEXT_PAINTBUCKET_PREFS:
+            prefs_set_int_attribute ("dialogs.preferences", "page", PREFS_PAGE_TOOLS_PAINTBUCKET);
+            dt->_dlg_mgr->showDialog("InkscapePreferences");
+            break;
 
         default:
             break;
@@ -1594,6 +1624,8 @@ DialogVerb::perform(SPAction *action, void *data, void *pdata)
             break;
         case SP_VERB_DIALOG_FIND:
             sp_find_dialog();
+//              Please test the new find dialog if you have time:
+//            dt->_dlg_mgr->showDialog("Find");
             break;
         case SP_VERB_DIALOG_DEBUG:
             dt->_dlg_mgr->showDialog("Messages");
@@ -2027,6 +2059,10 @@ Verb *Verb::_base_verbs[] = {
                  N_("Invert selection (unselect what is selected and select everything else)"), "selection_invert"),
     new EditVerb(SP_VERB_EDIT_INVERT_IN_ALL_LAYERS, "EditInvertInAllLayers", N_("Invert in All Layers"),
                  N_("Invert selection in all visible and unlocked layers"), NULL),
+    new EditVerb(SP_VERB_EDIT_SELECT_NEXT, "EditSelectNext", N_("Select Next"),
+                 N_("Select next object or node"), NULL),
+    new EditVerb(SP_VERB_EDIT_SELECT_PREV, "EditSelectPrev", N_("Select Previous"),
+                 N_("Select previous object or node"), NULL),
     new EditVerb(SP_VERB_EDIT_DESELECT, "EditDeselect", N_("D_eselect"),
                  N_("Deselect any selected objects or nodes"), "selection_deselect"),
 
@@ -2194,9 +2230,11 @@ Verb *Verb::_base_verbs[] = {
     new ContextVerb(SP_VERB_CONTEXT_ZOOM, "ToolZoom", N_("Zoom"),
                     N_("Zoom in or out"), "draw_zoom"),
     new ContextVerb(SP_VERB_CONTEXT_DROPPER, "ToolDropper", N_("Dropper"),
-                    N_("Pick averaged colors from image"), "draw_dropper"),
+                    N_("Pick colors from image"), "draw_dropper"),
     new ContextVerb(SP_VERB_CONTEXT_CONNECTOR, "ToolConnector", N_("Connector"),
                     N_("Create connectors"), "draw_connector"),
+    new ContextVerb(SP_VERB_CONTEXT_PAINTBUCKET, "ToolPaintBucket", N_("Paint Bucket"),
+                    N_("Fill bounded areas"), "draw_paintbucket"),
 
     /* Tool prefs */
     new ContextVerb(SP_VERB_CONTEXT_SELECT_PREFS, "SelectPrefs", N_("Selector Preferences"),
@@ -2227,6 +2265,8 @@ Verb *Verb::_base_verbs[] = {
                     N_("Open Preferences for the Dropper tool"), NULL),
     new ContextVerb(SP_VERB_CONTEXT_CONNECTOR_PREFS, "ConnectorPrefs", N_("Connector Preferences"),
                     N_("Open Preferences for the Connector tool"), NULL),
+    new ContextVerb(SP_VERB_CONTEXT_PAINTBUCKET_PREFS, "PaintBucketPrefs", N_("Paint Bucket Preferences"),
+                    N_("Open Preferences for the Paint Bucket tool"), NULL),
 
     /* Zoom/View */
     new ZoomVerb(SP_VERB_ZOOM_IN, "ZoomIn", N_("Zoom In"), N_("Zoom in"), "zoom_in"),
@@ -2280,7 +2320,7 @@ Verb *Verb::_base_verbs[] = {
     new DialogVerb(SP_VERB_DIALOG_METADATA, "DialogMetadata", N_("Document _Metadata..."),
                    N_("Edit document metadata (to be saved with the document)"), "document_metadata" ),
     new DialogVerb(SP_VERB_DIALOG_FILL_STROKE, "DialogFillStroke", N_("_Fill and Stroke..."),
-                   N_("Edit objects' style, such as color or stroke width"), "fill_and_stroke"),
+                   N_("Edit objects' colors, gradients, stroke width, arrowheads, dash patterns..."), "fill_and_stroke"),
     // 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),
@@ -2302,7 +2342,6 @@ Verb *Verb::_base_verbs[] = {
                    N_("Run scripts"), "scripts"),
     new DialogVerb(SP_VERB_DIALOG_TOGGLE, "DialogsToggle", N_("Show/Hide D_ialogs"),
                    N_("Show or hide all open dialogs"), "dialog_toggle"),
-    // TRANSLATORS: "Tile Clones" means: "Create tiled clones"
     new DialogVerb(SP_VERB_DIALOG_CLONETILER, "DialogClonetiler", N_("Create Tiled Clones..."),
                    N_("Create multiple clones of selected object, arranging them into a pattern or scattering"), "edit_create_tiled_clones"),
     new DialogVerb(SP_VERB_DIALOG_ITEM, "DialogObjectProperties", N_("_Object Properties..."),
@@ -2365,6 +2404,23 @@ Verb *Verb::_base_verbs[] = {
 };
 
 
+void
+Verb::list (void) {
+    // Go through the dynamic verb table
+    for (VerbTable::iterator iter = _verbs.begin(); iter != _verbs.end(); iter++) {
+        Verb * verb = iter->second;
+        if (verb->get_code() == SP_VERB_INVALID ||
+                verb->get_code() == SP_VERB_NONE ||
+                verb->get_code() == SP_VERB_LAST) {
+            continue;
+        }
+
+        printf("%s: %s\n", verb->get_id(), verb->get_tip()? verb->get_tip() : verb->get_name());
+    }
+
+    return;
+};
+
 }  /* namespace Inkscape */
 
 /*