Code

restore rendering markers in outline mode
[inkscape.git] / src / verbs.cpp
index 2a8120aed357b55d6edb43627c5868c073b9f3bd..25c805c3c30a62490d16c10183170dafbf77def0 100644 (file)
@@ -77,6 +77,7 @@
 #include "layer-fns.h"
 #include "node-context.h"
 #include "gradient-context.h"
+#include "shape-editor.h"
 
 
 /**
@@ -915,28 +916,28 @@ 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();
             }
@@ -944,7 +945,7 @@ EditVerb::perform(SPAction *action, void *data, void *pdata)
 
         case SP_VERB_EDIT_SELECT_NEXT: 
             if (tools_isactive(dt, TOOLS_NODES)) {
-                sp_nodepath_select_next(SP_NODE_CONTEXT(ec)->nodepath);
+                SP_NODE_CONTEXT(ec)->shape_editor->select_next();
             } else if (tools_isactive(dt, TOOLS_GRADIENT)) {
                 sp_gradient_context_select_next (ec);
             } else {
@@ -953,7 +954,7 @@ EditVerb::perform(SPAction *action, void *data, void *pdata)
             break;
         case SP_VERB_EDIT_SELECT_PREV: 
             if (tools_isactive(dt, TOOLS_NODES)) {
-                sp_nodepath_select_prev(SP_NODE_CONTEXT(ec)->nodepath);
+                SP_NODE_CONTEXT(ec)->shape_editor->select_prev();
             } else if (tools_isactive(dt, TOOLS_GRADIENT)) {
                 sp_gradient_context_select_prev (ec);
             } else {
@@ -963,7 +964,7 @@ EditVerb::perform(SPAction *action, void *data, void *pdata)
 
         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();
             }
@@ -1282,7 +1283,7 @@ ObjectVerb::perform( SPAction *action, void *data, void *pdata )
             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));
             }
@@ -1291,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));
             }
@@ -1334,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) {
@@ -1385,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);
@@ -1442,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;
@@ -2222,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"),
@@ -2255,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"),
@@ -2308,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),
@@ -2392,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 */
 
 /*