diff --git a/src/verbs.cpp b/src/verbs.cpp
index 2a8120aed357b55d6edb43627c5868c073b9f3bd..25c805c3c30a62490d16c10183170dafbf77def0 100644 (file)
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
#include "layer-fns.h"
#include "node-context.h"
#include "gradient-context.h"
+#include "shape-editor.h"
/**
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();
}
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 {
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 {
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();
}
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));
}
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));
}
/** \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) {
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);
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;
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"),
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"),
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),
};
+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 */
/*