From 46bff7b31a99784086c5f5589956e647c862e944 Mon Sep 17 00:00:00 2001 From: kamalpreetgrewal Date: Sat, 4 Jun 2016 20:02:59 +0530 Subject: Register style dialog with support to add selector (bzr r14949.1.1) --- src/verbs.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 299cfe8e7..2908ae580 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2119,6 +2119,9 @@ void DialogVerb::perform(SPAction *action, void *data) case SP_VERB_DIALOG_PRINT_COLORS_PREVIEW: dt->_dlg_mgr->showDialog("PrintColorsPreviewDialog"); break; + case SP_VERB_DIALOG_STYLE: + dt->_dlg_mgr->showDialog("StyleDialog"); + break; default: break; @@ -2949,6 +2952,8 @@ Verb *Verb::_base_verbs[] = { N_("View Objects"), INKSCAPE_ICON("dialog-layers")), new DialogVerb(SP_VERB_DIALOG_TAGS, "DialogTags", N_("Selection se_ts..."), N_("View Tags"), INKSCAPE_ICON("edit-select-all-layers")), + new DialogVerb(SP_VERB_DIALOG_STYLE, "DialogStyle", N_("Style Dialog..."), + N_("View Style Dialog"), NULL), new DialogVerb(SP_VERB_DIALOG_LIVE_PATH_EFFECT, "DialogLivePathEffect", N_("Path E_ffects ..."), N_("Manage, edit, and apply path effects"), INKSCAPE_ICON("dialog-path-effects")), new DialogVerb(SP_VERB_DIALOG_FILTER_EFFECTS, "DialogFilterEffects", N_("Filter _Editor..."), -- cgit v1.2.3 From e0396836d3738f9b6d2182f310795fc6fe9d8857 Mon Sep 17 00:00:00 2001 From: kamalpreetgrewal Date: Mon, 18 Jul 2016 00:14:29 +0530 Subject: Add CSS panel with editing support (no changes reflected yet) (bzr r14949.1.52) --- src/verbs.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 2908ae580..d4c9c8945 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2122,6 +2122,9 @@ void DialogVerb::perform(SPAction *action, void *data) case SP_VERB_DIALOG_STYLE: dt->_dlg_mgr->showDialog("StyleDialog"); break; + case SP_VERB_DIALOG_CSS: + dt->_dlg_mgr->showDialog("CssDialog"); + break; default: break; @@ -2954,6 +2957,8 @@ Verb *Verb::_base_verbs[] = { N_("View Tags"), INKSCAPE_ICON("edit-select-all-layers")), new DialogVerb(SP_VERB_DIALOG_STYLE, "DialogStyle", N_("Style Dialog..."), N_("View Style Dialog"), NULL), + new DialogVerb(SP_VERB_DIALOG_CSS, "DialogCss", N_("Css Dialog..."), + N_("View Css Dialog"), NULL), new DialogVerb(SP_VERB_DIALOG_LIVE_PATH_EFFECT, "DialogLivePathEffect", N_("Path E_ffects ..."), N_("Manage, edit, and apply path effects"), INKSCAPE_ICON("dialog-path-effects")), new DialogVerb(SP_VERB_DIALOG_FILTER_EFFECTS, "DialogFilterEffects", N_("Filter _Editor..."), -- cgit v1.2.3 From 3c593bb8da3357514ff5b4f3154d08c4508ad47e Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 20 Jul 2016 11:01:17 +0200 Subject: Changed arguments and names of selection chemistry functions (bzr r14954.1.22) --- src/verbs.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 299cfe8e7..8255ea1ea 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1133,22 +1133,22 @@ void SelectionVerb::perform(SPAction *action, void *data) sp_selected_path_slice(selection, dt); break; case SP_VERB_SELECTION_TO_FRONT: - sp_selection_raise_to_top(selection, dt); + sp_selection_raise_to_top_ui(selection, dt); break; case SP_VERB_SELECTION_TO_BACK: - sp_selection_lower_to_bottom(selection, dt); + sp_selection_lower_to_bottom_ui(selection, dt); break; case SP_VERB_SELECTION_RAISE: - sp_selection_raise(selection, dt); + sp_selection_raise_ui(selection, dt); break; case SP_VERB_SELECTION_LOWER: - sp_selection_lower(selection, dt); + sp_selection_lower_ui(selection, dt); break; case SP_VERB_SELECTION_GROUP: - sp_selection_group(selection, dt); + sp_selection_group_ui(selection, dt); break; case SP_VERB_SELECTION_UNGROUP: - sp_selection_ungroup(selection, dt); + sp_selection_ungroup_ui(selection, dt); break; case SP_VERB_SELECTION_UNGROUP_POP_SELECTION: sp_selection_ungroup_pop_selection(selection, dt); -- cgit v1.2.3 From ff4fbbc93f67afd6cbf851691833a50d6c76b350 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Jul 2016 12:19:03 +0200 Subject: Renamed some functions, fixed tests (bzr r14954.1.28) --- src/verbs.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 8255ea1ea..d6c239e86 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1133,22 +1133,22 @@ void SelectionVerb::perform(SPAction *action, void *data) sp_selected_path_slice(selection, dt); break; case SP_VERB_SELECTION_TO_FRONT: - sp_selection_raise_to_top_ui(selection, dt); + sp_selection_raise_to_top(selection, dt); break; case SP_VERB_SELECTION_TO_BACK: - sp_selection_lower_to_bottom_ui(selection, dt); + sp_selection_lower_to_bottom(selection, dt); break; case SP_VERB_SELECTION_RAISE: - sp_selection_raise_ui(selection, dt); + sp_selection_raise(selection, dt); break; case SP_VERB_SELECTION_LOWER: - sp_selection_lower_ui(selection, dt); + sp_selection_lower(selection, dt); break; case SP_VERB_SELECTION_GROUP: - sp_selection_group_ui(selection, dt); + sp_selection_group(selection, dt); break; case SP_VERB_SELECTION_UNGROUP: - sp_selection_ungroup_ui(selection, dt); + sp_selection_ungroup(selection, dt); break; case SP_VERB_SELECTION_UNGROUP_POP_SELECTION: sp_selection_ungroup_pop_selection(selection, dt); @@ -1520,7 +1520,7 @@ void ObjectVerb::perform( SPAction *action, void *data) sp_selection_rotate_90(dt, true); break; case SP_VERB_OBJECT_FLATTEN: - sp_selection_remove_transform(dt); + sp_object_set_remove_transform(dt); break; case SP_VERB_OBJECT_FLOW_TEXT: text_flow_into_shape(); @@ -1532,12 +1532,12 @@ void ObjectVerb::perform( SPAction *action, void *data) flowtext_to_text(); break; case SP_VERB_OBJECT_FLIP_HORIZONTAL: - sp_selection_scale_relative(sel, center, Geom::Scale(-1.0, 1.0)); + sp_object_set_scale_relative(sel, center, Geom::Scale(-1.0, 1.0)); DocumentUndo::done(dt->getDocument(), SP_VERB_OBJECT_FLIP_HORIZONTAL, _("Flip horizontally")); break; case SP_VERB_OBJECT_FLIP_VERTICAL: - sp_selection_scale_relative(sel, center, Geom::Scale(1.0, -1.0)); + sp_object_set_scale_relative(sel, center, Geom::Scale(1.0, -1.0)); DocumentUndo::done(dt->getDocument(), SP_VERB_OBJECT_FLIP_VERTICAL, _("Flip vertically")); break; -- cgit v1.2.3 From f35bb1f74a0ffeb5c6477a25e3c4cde87a97bcf1 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 28 Jul 2016 12:06:06 +0200 Subject: Removed unused includes, decrease compilation time (bzr r15025) --- src/verbs.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 299cfe8e7..b6293b3a2 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -26,7 +26,7 @@ #ifdef HAVE_CONFIG_H -# include "config.h" +#include #endif #include @@ -45,11 +45,9 @@ #include "document.h" #include "ui/tools/freehand-base.h" #include "extension/effect.h" -#include "ui/tools/tool-base.h" #include "file.h" #include "gradient-drag.h" #include "helper/action.h" -#include "helper/action-context.h" #include "help.h" #include "inkscape.h" #include "ui/interface.h" @@ -57,7 +55,6 @@ #include "layer-manager.h" #include "message-stack.h" #include "path-chemistry.h" -#include "preferences.h" #include "ui/tools/select-tool.h" #include "selection-chemistry.h" #include "seltrans.h" @@ -87,9 +84,6 @@ #include "ui/dialog/spellcheck.h" #include "ui/icon-names.h" #include "ui/tools/node-tool.h" -#include "selection.h" - -#include using Inkscape::DocumentUndo; using Inkscape::UI::Dialog::ActionAlign; -- cgit v1.2.3 From 43b49e325db73cc19b1731db6c69545664ee8fbe Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 28 Jul 2016 13:26:17 +0200 Subject: Reverted changes to r15024 after many building problems (bzr r15027) --- src/verbs.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index b6293b3a2..299cfe8e7 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -26,7 +26,7 @@ #ifdef HAVE_CONFIG_H -#include +# include "config.h" #endif #include @@ -45,9 +45,11 @@ #include "document.h" #include "ui/tools/freehand-base.h" #include "extension/effect.h" +#include "ui/tools/tool-base.h" #include "file.h" #include "gradient-drag.h" #include "helper/action.h" +#include "helper/action-context.h" #include "help.h" #include "inkscape.h" #include "ui/interface.h" @@ -55,6 +57,7 @@ #include "layer-manager.h" #include "message-stack.h" #include "path-chemistry.h" +#include "preferences.h" #include "ui/tools/select-tool.h" #include "selection-chemistry.h" #include "seltrans.h" @@ -84,6 +87,9 @@ #include "ui/dialog/spellcheck.h" #include "ui/icon-names.h" #include "ui/tools/node-tool.h" +#include "selection.h" + +#include using Inkscape::DocumentUndo; using Inkscape::UI::Dialog::ActionAlign; -- cgit v1.2.3 From 35830f456cadaecf8b8e3944e3031a1a93f6cb41 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 3 Aug 2016 15:29:38 +0200 Subject: Removed unused includes, decreased compilation time. Once again (bzr r15034) --- src/verbs.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 299cfe8e7..b6293b3a2 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -26,7 +26,7 @@ #ifdef HAVE_CONFIG_H -# include "config.h" +#include #endif #include @@ -45,11 +45,9 @@ #include "document.h" #include "ui/tools/freehand-base.h" #include "extension/effect.h" -#include "ui/tools/tool-base.h" #include "file.h" #include "gradient-drag.h" #include "helper/action.h" -#include "helper/action-context.h" #include "help.h" #include "inkscape.h" #include "ui/interface.h" @@ -57,7 +55,6 @@ #include "layer-manager.h" #include "message-stack.h" #include "path-chemistry.h" -#include "preferences.h" #include "ui/tools/select-tool.h" #include "selection-chemistry.h" #include "seltrans.h" @@ -87,9 +84,6 @@ #include "ui/dialog/spellcheck.h" #include "ui/icon-names.h" #include "ui/tools/node-tool.h" -#include "selection.h" - -#include using Inkscape::DocumentUndo; using Inkscape::UI::Dialog::ActionAlign; -- cgit v1.2.3 From c95b03989b70f33ff3d54f2e644673ab518ac68b Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Wed, 3 Aug 2016 22:41:01 +0200 Subject: Add legacy verb SP_VERB_SELECTION_OUTLINE_LEGACY as pointed in bug 1556592#14 (bzr r15036) --- src/verbs.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index b6293b3a2..d781442eb 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1201,6 +1201,9 @@ void SelectionVerb::perform(SPAction *action, void *data) case SP_VERB_SELECTION_OUTLINE: sp_selected_path_outline(dt); break; + case SP_VERB_SELECTION_OUTLINE_LEGACY: + sp_selected_path_outline(dt, true); + break; case SP_VERB_SELECTION_SIMPLIFY: sp_selected_path_simplify(dt); break; @@ -2612,6 +2615,8 @@ Verb *Verb::_base_verbs[] = { INKSCAPE_ICON("path-offset-linked")), new SelectionVerb(SP_VERB_SELECTION_OUTLINE, "StrokeToPath", N_("_Stroke to Path"), N_("Convert selected object's stroke to paths"), INKSCAPE_ICON("stroke-to-path")), + new SelectionVerb(SP_VERB_SELECTION_OUTLINE_LEGACY, "StrokeToPathLegacy", N_("_Stroke to Path Legacy"), + N_("Convert selected object's stroke to paths legacy mode"), INKSCAPE_ICON("stroke-to-path")), new SelectionVerb(SP_VERB_SELECTION_SIMPLIFY, "SelectionSimplify", N_("Si_mplify"), N_("Simplify selected paths (remove extra nodes)"), INKSCAPE_ICON("path-simplify")), new SelectionVerb(SP_VERB_SELECTION_REVERSE, "SelectionReverse", N_("_Reverse"), -- cgit v1.2.3 From 7f779f28e67eac1653e0f7751bb3f224b67894c7 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Mon, 15 Aug 2016 22:55:21 +0200 Subject: Fix a bunch of errors as reported at http://www.viva64.com/en/b/0419/ (bzr r15059) --- src/verbs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 59ad06fa1..5130f1701 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1842,7 +1842,7 @@ void ZoomVerb::perform(SPAction *action, void *data) Inkscape::Preferences *prefs = Inkscape::Preferences::get(); gdouble zoom_inc = - prefs->getDoubleLimited( "/options/zoomincrement/value", 1.414213562, 1.01, 10 ); + prefs->getDoubleLimited( "/options/zoomincrement/value", M_SQRT2, 1.01, 10 ); double zcorr = 1.0; Glib::ustring abbr = prefs->getString("/options/zoomcorrection/unit"); -- cgit v1.2.3 From d9c220b750654b229096a9f62f24480e100c8aa8 Mon Sep 17 00:00:00 2001 From: Dmitry Zhulanov Date: Thu, 29 Sep 2016 21:47:23 +0700 Subject: allow optional args for xverbs (bzr r15136.1.7) --- src/verbs.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 5130f1701..72708a7c0 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -817,7 +817,7 @@ Verb *Verb::get_search(unsigned int code) * * @param id Which id to search for. */ -Verb *Verb::getbyid(gchar const *id) +Verb *Verb::getbyid(gchar const *id, bool verbose) { Verb *verb = NULL; VerbIDTable::iterator verb_found = _verb_ids.find(id); @@ -833,8 +833,10 @@ Verb *Verb::getbyid(gchar const *id) && strcmp(id, "SelectionTrace") != 0 && strcmp(id, "PaintBucketPrefs") != 0 #endif - ) - printf("Unable to find: %s\n", id); + ) { + if (verbose) + printf("Unable to find: %s\n", id); + } return verb; } -- cgit v1.2.3 From 7be3086bf70ba9bf28c5cfe06fd7a8e28e719bcc Mon Sep 17 00:00:00 2001 From: sandra-snan Date: Sat, 8 Oct 2016 08:16:53 +0200 Subject: [Bug #770681] KEY MAPPING: Comma and period hijacked by scaling. Fixed bugs: - https://launchpad.net/bugs/770681 (bzr r15155) --- src/verbs.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 72708a7c0..e061eaab6 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1101,6 +1101,7 @@ void SelectionVerb::perform(SPAction *action, void *data) { Inkscape::Selection *selection = sp_action_get_selection(action); SPDesktop *dt = sp_action_get_desktop(action); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); // Some of these operations have been modified so they work in command-line mode! // In this case, all we need is a selection @@ -1128,6 +1129,38 @@ void SelectionVerb::perform(SPAction *action, void *data) case SP_VERB_SELECTION_SLICE: sp_selected_path_slice(selection, dt); break; + case SP_VERB_SELECTION_GROW: + { + // FIXME these and the other grow/shrink they should use gobble_key_events. + // the problem is how to get access to which key, if any, to gobble. + sp_selection_scale(selection, prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000)); + break; + } + case SP_VERB_SELECTION_GROW_SCREEN: + { + sp_selection_scale_screen(selection, 2); + break; + } + case SP_VERB_SELECTION_GROW_DOUBLE: + { + sp_selection_scale_times(selection, 2); + break; + } + case SP_VERB_SELECTION_SHRINK: + { + sp_selection_scale(selection, -prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000)); + break; + } + case SP_VERB_SELECTION_SHRINK_SCREEN: + { + sp_selection_scale_screen(selection, -2); + break; + } + case SP_VERB_SELECTION_SHRINK_HALVE: + { + sp_selection_scale_times(selection, 0.5); + break; + } case SP_VERB_SELECTION_TO_FRONT: sp_selection_raise_to_top(selection, dt); break; @@ -1858,6 +1891,7 @@ void ZoomVerb::perform(SPAction *action, void *data) { gint mul = 1 + Inkscape::UI::Tools::gobble_key_events( GDK_KEY_KP_Add, 0); // with any mask + // FIXME what if zoom out is bound to something other than subtract? // While drawing with the pen/pencil tool, zoom towards the end of the unfinished path if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) { SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve; @@ -2587,6 +2621,18 @@ Verb *Verb::_base_verbs[] = { // Advanced tutorial for more info new SelectionVerb(SP_VERB_SELECTION_SLICE, "SelectionCutPath", N_("Cut _Path"), N_("Cut the bottom path's stroke into pieces, removing fill"), INKSCAPE_ICON("path-cut")), + new SelectionVerb(SP_VERB_SELECTION_GROW, "SelectionGrow", N_("_Grow"), + N_("Make selected objects bigger"), INKSCAPE_ICON("selection-grow")), + new SelectionVerb(SP_VERB_SELECTION_GROW_SCREEN, "SelectionGrowScreen", N_("_Grow on screen"), + N_("Make selected objects bigger relative to screen"), INKSCAPE_ICON("selection-grow-screen")), + new SelectionVerb(SP_VERB_SELECTION_GROW_DOUBLE, "SelectionGrowDouble", N_("_Double size"), + N_("Double the size of selected objects"), INKSCAPE_ICON("selection-grow-double")), + new SelectionVerb(SP_VERB_SELECTION_SHRINK, "SelectionShrink", N_("_Shrink"), + N_("Make selected objects smaller"), INKSCAPE_ICON("selection-shrink")), + new SelectionVerb(SP_VERB_SELECTION_SHRINK_SCREEN, "SelectionShrinkScreen", N_("_Shrink on screen"), + N_("Make selected objects smaller relative to screen"), INKSCAPE_ICON("selection-shrink-screen")), + new SelectionVerb(SP_VERB_SELECTION_SHRINK_HALVE, "SelectionShrinkHalve", N_("_Halve size"), + N_("Halve the size of selected objects"), INKSCAPE_ICON("selection-shrink-halve")), // TRANSLATORS: "outset": expand a shape by offsetting the object's path, // i.e. by displacing it perpendicular to the path in each point. // See also the Advanced Tutorial for explanation. -- cgit v1.2.3 From 532f77b14a76fc04e6bdeca3625f9a55b5f11bdf Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 25 Oct 2016 00:58:43 +0200 Subject: CPPification: almost all sp_object_set_whatever and sp_selection_whatever global functions are now methods of ObjectSet*, with these additional benefits: - They can now act on any SelectionSet, not just the current selection; - Whenever possible, they don't need a desktop anymore and can run if called from GUI. I hope I did not break too many things in the process. *: So instead of callink sp_selection_move(desktop,x,y), you call myobjectset->move(x,y) (bzr r15189) --- src/verbs.cpp | 114 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index e061eaab6..7a9875c69 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -956,85 +956,85 @@ void EditVerb::perform(SPAction *action, void *data) sp_redo(dt, dt->getDocument()); break; case SP_VERB_EDIT_CUT: - sp_selection_cut(dt); + dt->selection->cut(); break; case SP_VERB_EDIT_COPY: - sp_selection_copy(dt); + dt->selection->copy(); break; case SP_VERB_EDIT_PASTE: sp_selection_paste(dt, false); break; case SP_VERB_EDIT_PASTE_STYLE: - sp_selection_paste_style(dt); + dt->selection->pasteStyle(); break; case SP_VERB_EDIT_PASTE_SIZE: - sp_selection_paste_size(dt, true, true); + dt->selection->pasteSize(true,true); break; case SP_VERB_EDIT_PASTE_SIZE_X: - sp_selection_paste_size(dt, true, false); + dt->selection->pasteSize(true, false); break; case SP_VERB_EDIT_PASTE_SIZE_Y: - sp_selection_paste_size(dt, false, true); + dt->selection->pasteSize(false, true); break; case SP_VERB_EDIT_PASTE_SIZE_SEPARATELY: - sp_selection_paste_size_separately(dt, true, true); + dt->selection->pasteSizeSeparately(true, true); break; case SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_X: - sp_selection_paste_size_separately(dt, true, false); + dt->selection->pasteSizeSeparately(true, false); break; case SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_Y: - sp_selection_paste_size_separately(dt, false, true); + dt->selection->pasteSizeSeparately(false, true); break; case SP_VERB_EDIT_PASTE_IN_PLACE: sp_selection_paste(dt, true); break; case SP_VERB_EDIT_PASTE_LIVEPATHEFFECT: - sp_selection_paste_livepatheffect(dt); + dt->selection->pastePathEffect(); break; case SP_VERB_EDIT_REMOVE_LIVEPATHEFFECT: - sp_selection_remove_livepatheffect(dt); + dt->selection->removeLPE(); break; case SP_VERB_EDIT_REMOVE_FILTER: - sp_selection_remove_filter(dt); + dt->selection->removeFilter(); break; case SP_VERB_EDIT_DELETE: - sp_selection_delete(dt); + dt->selection->deleteItems(); break; case SP_VERB_EDIT_DUPLICATE: - sp_selection_duplicate(dt); + dt->selection->duplicate(); break; case SP_VERB_EDIT_CLONE: - sp_selection_clone(dt); + dt->selection->clone(); break; case SP_VERB_EDIT_UNLINK_CLONE: - sp_selection_unlink(dt); + dt->selection->unlink(); break; case SP_VERB_EDIT_RELINK_CLONE: - sp_selection_relink(dt); + dt->selection->relink(); break; case SP_VERB_EDIT_CLONE_SELECT_ORIGINAL: - sp_select_clone_original(dt); + dt->selection->cloneOriginal(); break; case SP_VERB_EDIT_CLONE_ORIGINAL_PATH_LPE: - sp_selection_clone_original_path_lpe(dt); + dt->selection->cloneOriginalPathLPE(); break; case SP_VERB_EDIT_SELECTION_2_MARKER: - sp_selection_to_marker(dt); + dt->selection->toMarker(); break; case SP_VERB_EDIT_SELECTION_2_GUIDES: - sp_selection_to_guides(dt); + dt->selection->toGuides(); break; case SP_VERB_EDIT_TILE: - sp_selection_tile(dt); + dt->selection->tile(); break; case SP_VERB_EDIT_UNTILE: - sp_selection_untile(dt); + dt->selection->untile(); break; case SP_VERB_EDIT_SYMBOL: - sp_selection_symbol(dt); + dt->selection->toSymbol(); break; case SP_VERB_EDIT_UNSYMBOL: - sp_selection_unsymbol(dt); + dt->selection->unSymbol(); break; case SP_VERB_EDIT_SELECT_ALL: SelectionHelper::selectAll(dt); @@ -1133,54 +1133,54 @@ void SelectionVerb::perform(SPAction *action, void *data) { // FIXME these and the other grow/shrink they should use gobble_key_events. // the problem is how to get access to which key, if any, to gobble. - sp_selection_scale(selection, prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000)); + selection->scale(prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000)); break; } case SP_VERB_SELECTION_GROW_SCREEN: { - sp_selection_scale_screen(selection, 2); + selection->scaleScreen(2); break; } case SP_VERB_SELECTION_GROW_DOUBLE: { - sp_selection_scale_times(selection, 2); + selection->scaleTimes(2); break; } case SP_VERB_SELECTION_SHRINK: { - sp_selection_scale(selection, -prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000)); + selection->scale(-prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000)); break; } case SP_VERB_SELECTION_SHRINK_SCREEN: { - sp_selection_scale_screen(selection, -2); + selection->scaleScreen(-2); break; } case SP_VERB_SELECTION_SHRINK_HALVE: { - sp_selection_scale_times(selection, 0.5); + selection->scaleTimes(0.5); break; } case SP_VERB_SELECTION_TO_FRONT: - sp_selection_raise_to_top(selection, dt); + selection->raiseToTop(); break; case SP_VERB_SELECTION_TO_BACK: - sp_selection_lower_to_bottom(selection, dt); + selection->lowerToBottom(); break; case SP_VERB_SELECTION_RAISE: - sp_selection_raise(selection, dt); + selection->raise(); break; case SP_VERB_SELECTION_LOWER: - sp_selection_lower(selection, dt); + selection->lower(); break; case SP_VERB_SELECTION_GROUP: - sp_selection_group(selection, dt); + selection->group(); break; case SP_VERB_SELECTION_UNGROUP: - sp_selection_ungroup(selection, dt); + selection->ungroup(); break; case SP_VERB_SELECTION_UNGROUP_POP_SELECTION: - sp_selection_ungroup_pop_selection(selection, dt); + selection->popFromGroup(); break; default: handled = false; @@ -1258,14 +1258,14 @@ void SelectionVerb::perform(SPAction *action, void *data) dt->_dlg_mgr->showDialog("PixelArt"); break; case SP_VERB_SELECTION_CREATE_BITMAP: - sp_selection_create_bitmap_copy(dt); + dt->selection->createBitmapCopy(); break; case SP_VERB_SELECTION_COMBINE: - sp_selected_path_combine(dt); + selection->combine(); break; case SP_VERB_SELECTION_BREAK_APART: - sp_selected_path_break_apart(dt); + selection->breakApart(); break; case SP_VERB_SELECTION_ARRANGE: INKSCAPE.dialogs_unhide(); @@ -1324,11 +1324,11 @@ void LayerVerb::perform(SPAction *action, void *data) break; } case SP_VERB_LAYER_MOVE_TO_NEXT: { - sp_selection_to_next_layer(dt); + dt->selection->toNextLayer(); break; } case SP_VERB_LAYER_MOVE_TO_PREV: { - sp_selection_to_prev_layer(dt); + dt->selection->toPrevLayer(); break; } case SP_VERB_LAYER_MOVE_TO: { @@ -1399,7 +1399,7 @@ void LayerVerb::perform(SPAction *action, void *data) case SP_VERB_LAYER_DUPLICATE: { if ( dt->currentLayer() != dt->currentRoot() ) { - sp_selection_duplicate(dt, true, true); + dt->selection->duplicate(true,true); DocumentUndo::done(dt->getDocument(), SP_VERB_LAYER_DUPLICATE, _("Duplicate layer")); @@ -1515,7 +1515,7 @@ void ObjectVerb::perform( SPAction *action, void *data) bool handled = true; switch (reinterpret_cast(data)) { case SP_VERB_OBJECT_TO_CURVE: - sp_selected_path_to_curves(sel, dt); + sel->toCurves(); break; default: handled = false; @@ -1546,13 +1546,13 @@ void ObjectVerb::perform( SPAction *action, void *data) switch (reinterpret_cast(data)) { case SP_VERB_OBJECT_ROTATE_90_CW: - sp_selection_rotate_90(dt, false); + sel->rotate90(false); break; case SP_VERB_OBJECT_ROTATE_90_CCW: - sp_selection_rotate_90(dt, true); + sel->rotate90(true); break; case SP_VERB_OBJECT_FLATTEN: - sp_object_set_remove_transform(dt); + sel->removeTransform(); break; case SP_VERB_OBJECT_FLOW_TEXT: text_flow_into_shape(); @@ -1564,35 +1564,35 @@ void ObjectVerb::perform( SPAction *action, void *data) flowtext_to_text(); break; case SP_VERB_OBJECT_FLIP_HORIZONTAL: - sp_object_set_scale_relative(sel, center, Geom::Scale(-1.0, 1.0)); + sel->setScaleRelative(center, Geom::Scale(-1.0, 1.0)); DocumentUndo::done(dt->getDocument(), SP_VERB_OBJECT_FLIP_HORIZONTAL, _("Flip horizontally")); break; case SP_VERB_OBJECT_FLIP_VERTICAL: - sp_object_set_scale_relative(sel, center, Geom::Scale(1.0, -1.0)); + sel->setScaleRelative(center, Geom::Scale(1.0, -1.0)); DocumentUndo::done(dt->getDocument(), SP_VERB_OBJECT_FLIP_VERTICAL, _("Flip vertically")); break; case SP_VERB_OBJECT_SET_MASK: - sp_selection_set_mask(dt, false, false); + sel->setMask(false, false); break; case SP_VERB_OBJECT_EDIT_MASK: - sp_selection_edit_clip_or_mask(dt, false); + sel->editMask(false); break; case SP_VERB_OBJECT_UNSET_MASK: - sp_selection_unset_mask(dt, false); + sel->unsetMask(false); break; case SP_VERB_OBJECT_SET_CLIPPATH: - sp_selection_set_mask(dt, true, false); + sel->setMask(true, false); break; case SP_VERB_OBJECT_CREATE_CLIP_GROUP: - sp_selection_set_clipgroup(dt); + sel->setClipGroup(); break; case SP_VERB_OBJECT_EDIT_CLIPPATH: - sp_selection_edit_clip_or_mask(dt, true); + sel->editMask(true); break; case SP_VERB_OBJECT_UNSET_CLIPPATH: - sp_selection_unset_mask(dt, true); + sel->unsetMask(true); break; default: break; -- cgit v1.2.3 From 3649ef4c620b9eae5132d89a39ebd280d9dc50a8 Mon Sep 17 00:00:00 2001 From: Alexander Brock Date: Thu, 27 Oct 2016 19:13:05 +0200 Subject: Add recursive clone unlink feature (bzr r15191.1.1) --- src/verbs.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 7a9875c69..5e3fea677 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1009,6 +1009,9 @@ void EditVerb::perform(SPAction *action, void *data) case SP_VERB_EDIT_UNLINK_CLONE: dt->selection->unlink(); break; + case SP_VERB_EDIT_UNLINK_CLONE_RECURSIVE: + dt->selection->unlinkRecursive(); + break; case SP_VERB_EDIT_RELINK_CLONE: dt->selection->relink(); break; @@ -2530,6 +2533,8 @@ Verb *Verb::_base_verbs[] = { N_("Create a clone (a copy linked to the original) of selected object"), INKSCAPE_ICON("edit-clone")), new EditVerb(SP_VERB_EDIT_UNLINK_CLONE, "EditUnlinkClone", N_("Unlin_k Clone"), N_("Cut the selected clones' links to the originals, turning them into standalone objects"), INKSCAPE_ICON("edit-clone-unlink")), + new EditVerb(SP_VERB_EDIT_UNLINK_CLONE_RECURSIVE, "EditUnlinkCloneRecursive", N_("Unlink Clones _recursively"), + N_("Unlink all clones in the selection, even if they are in groups."), INKSCAPE_ICON("edit-clone-unlink")), new EditVerb(SP_VERB_EDIT_RELINK_CLONE, "EditRelinkClone", N_("Relink to Copied"), N_("Relink the selected clones to the object currently on the clipboard"), NULL), new EditVerb(SP_VERB_EDIT_CLONE_SELECT_ORIGINAL, "EditCloneSelectOriginal", N_("Select _Original"), -- cgit v1.2.3 From a5ea253b4b4d94659e0e0992b51853ffd4debbf9 Mon Sep 17 00:00:00 2001 From: Tobias Ellinghaus Date: Wed, 2 Nov 2016 23:42:43 +0100 Subject: fix prefs icon Fixed bugs: - https://launchpad.net/bugs/1638353 (bzr r15202) --- src/verbs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 7a9875c69..dc92545e2 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2942,7 +2942,7 @@ Verb *Verb::_base_verbs[] = { // Dialogs new DialogVerb(SP_VERB_DIALOG_DISPLAY, "DialogPreferences", N_("P_references..."), - N_("Edit global Inkscape preferences"), INKSCAPE_ICON("preferences-system")), + N_("Edit global Inkscape preferences"), INKSCAPE_ICON("gtk-preferences")), new DialogVerb(SP_VERB_DIALOG_NAMEDVIEW, "DialogDocumentProperties", N_("_Document Properties..."), N_("Edit properties of this document (to be saved with the document)"), INKSCAPE_ICON("document-properties")), new DialogVerb(SP_VERB_DIALOG_METADATA, "DialogMetadata", N_("Document _Metadata..."), -- cgit v1.2.3 From 68c305f169dfe9a273e29dd2aa587f0d59071483 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sun, 6 Nov 2016 16:33:01 +0100 Subject: further cppification Fixed bugs: - https://launchpad.net/bugs/1306662 (bzr r15218) --- src/verbs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index dc92545e2..c2167f67c 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2359,7 +2359,7 @@ void FitCanvasVerb::perform(SPAction *action, void *data) switch (reinterpret_cast(data)) { case SP_VERB_FIT_CANVAS_TO_SELECTION: - verb_fit_canvas_to_selection(dt); + dt->selection->fitCanvas(true); break; case SP_VERB_FIT_CANVAS_TO_DRAWING: verb_fit_canvas_to_drawing(dt); -- cgit v1.2.3 From 07a86951a15301ccb7eb1446cc1e6d3ca7a68f9b Mon Sep 17 00:00:00 2001 From: Alexander Brock Date: Wed, 9 Nov 2016 01:23:41 +0100 Subject: Move boolop functions from sp_selected_path_ to ObjectSet::path (bzr r15223.1.1) --- src/verbs.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index a5426f324..32aee4161 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1115,22 +1115,22 @@ void SelectionVerb::perform(SPAction *action, void *data) bool handled = true; switch (reinterpret_cast(data)) { case SP_VERB_SELECTION_UNION: - sp_selected_path_union(selection, dt); + selection->pathUnion(); break; case SP_VERB_SELECTION_INTERSECT: - sp_selected_path_intersect(selection, dt); + selection->pathIntersect(); break; case SP_VERB_SELECTION_DIFF: - sp_selected_path_diff(selection, dt); + selection->pathDiff(); break; case SP_VERB_SELECTION_SYMDIFF: - sp_selected_path_symdiff(selection, dt); + selection->pathSymDiff(); break; case SP_VERB_SELECTION_CUT: - sp_selected_path_cut(selection, dt); + selection->pathCut(); break; case SP_VERB_SELECTION_SLICE: - sp_selected_path_slice(selection, dt); + selection->pathSlice(); break; case SP_VERB_SELECTION_GROW: { -- cgit v1.2.3 From 2e8438d76a5f26719d381843cd3ce3fa694809fb Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Tue, 27 Dec 2016 15:49:22 +0000 Subject: Rm remaining Gtk::Stock usage (bzr r15368) --- src/verbs.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 32aee4161..975a3679e 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -37,7 +37,6 @@ // If this is not done, then errors will be generate relating to Glib::Threads being undefined #include #include -#include #include "desktop.h" -- cgit v1.2.3 From e8dcb5062f6114a9fb06d496ab5d906aec405c78 Mon Sep 17 00:00:00 2001 From: "alexandru.roman" Date: Sat, 21 Jan 2017 23:28:05 +0100 Subject: Fix "swap fill and stroke" for multiple objects in selection Add verb and shortcut possibility Fixed bugs: - https://launchpad.net/bugs/367360 - https://launchpad.net/bugs/675690 (bzr r15428) --- src/verbs.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 975a3679e..aeb742105 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1086,6 +1086,9 @@ void EditVerb::perform(SPAction *action, void *data) case SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER: sp_selection_next_patheffect_param(dt); break; + case SP_VERB_EDIT_SWAP_FILL_STROKE: + dt->selection->swapFillStroke(); + break; case SP_VERB_EDIT_LINK_COLOR_PROFILE: break; case SP_VERB_EDIT_REMOVE_COLOR_PROFILE: @@ -2585,6 +2588,8 @@ Verb *Verb::_base_verbs[] = { 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 editable path effect parameter"), INKSCAPE_ICON("path-effect-parameter-next")), + new EditVerb(SP_VERB_EDIT_SWAP_FILL_STROKE, "EditSwapFillStroke", N_("Swap fill and stroke"), + N_("Swap fill and stroke of an object"), NULL), // Selection new SelectionVerb(SP_VERB_SELECTION_TO_FRONT, "SelectionToFront", N_("Raise to _Top"), -- cgit v1.2.3 From c6ec9680ac0320a038c0eb1d3776faad9dfc2af5 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Mon, 27 Feb 2017 14:55:09 +0100 Subject: Add a very simple prototype dialog as an example and test of deriving from Panel. To be disabled for releases. (bzr r15551) --- src/verbs.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index fce823408..d67e68392 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2058,6 +2058,9 @@ void DialogVerb::perform(SPAction *action, void *data) g_assert(dt->_dlg_mgr != NULL); switch (reinterpret_cast(data)) { + case SP_VERB_DIALOG_PROTOTYPE: + dt->_dlg_mgr->showDialog("Prototype"); + break; case SP_VERB_DIALOG_DISPLAY: //sp_display_dialog(); dt->_dlg_mgr->showDialog("InkscapePreferences"); @@ -2956,6 +2959,8 @@ Verb *Verb::_base_verbs[] = { N_("Zoom to fit selection in window"), INKSCAPE_ICON("zoom-fit-selection")), // Dialogs + new DialogVerb(SP_VERB_DIALOG_PROTOTYPE, "DialogPrototype", N_("Prototype..."), + N_("Prototype Dialog"), INKSCAPE_ICON("gtk-preferences")), new DialogVerb(SP_VERB_DIALOG_DISPLAY, "DialogPreferences", N_("P_references..."), N_("Edit global Inkscape preferences"), INKSCAPE_ICON("gtk-preferences")), new DialogVerb(SP_VERB_DIALOG_NAMEDVIEW, "DialogDocumentProperties", N_("_Document Properties..."), -- cgit v1.2.3 From 014489163050d8abe9e5c4949fb80f3c21b1c17b Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Mon, 13 Mar 2017 15:22:22 +0100 Subject: Replace rectangle based zooming by affine based zooming. This allows a rotation to be included in the drawing to window mapping. General code cleanup. Added documentation. Any change to zooming behavior is probably a bug. (bzr r15592) --- src/verbs.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index d67e68392..8b3d7a5a2 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1890,7 +1890,10 @@ void ZoomVerb::perform(SPAction *action, void *data) zcorr = prefs->getDouble("/options/zoomcorrection/value", 1.0); Geom::Rect const d = dt->get_display_area(); - + + Geom::Rect const d_canvas = dt->getCanvas()->getViewbox(); // Not SVG 'viewBox' + Geom::Point midpoint = dt->w2d(d_canvas.midpoint()); // Midpoint of drawing on canvas. + switch (reinterpret_cast(data)) { case SP_VERB_ZOOM_IN: { @@ -1907,7 +1910,7 @@ void ZoomVerb::perform(SPAction *action, void *data) } } - dt->zoom_relative( d.midpoint()[Geom::X], d.midpoint()[Geom::Y], mul*zoom_inc); + dt->zoom_relative_center_point( midpoint, mul*zoom_inc); break; } case SP_VERB_ZOOM_OUT: @@ -1924,17 +1927,17 @@ void ZoomVerb::perform(SPAction *action, void *data) } } - dt->zoom_relative( d.midpoint()[Geom::X], d.midpoint()[Geom::Y], 1 / (mul*zoom_inc) ); + dt->zoom_relative_center_point( midpoint, 1 / (mul*zoom_inc) ); break; } case SP_VERB_ZOOM_1_1: - dt->zoom_absolute( d.midpoint()[Geom::X], d.midpoint()[Geom::Y], 1.0 * zcorr ); + dt->zoom_absolute_center_point( midpoint, 1.0 * zcorr ); break; case SP_VERB_ZOOM_1_2: - dt->zoom_absolute( d.midpoint()[Geom::X], d.midpoint()[Geom::Y], 0.5 * zcorr ); + dt->zoom_absolute_center_point( midpoint, 0.5 * zcorr ); break; case SP_VERB_ZOOM_2_1: - dt->zoom_absolute( d.midpoint()[Geom::X], d.midpoint()[Geom::Y], 2.0 * zcorr ); + dt->zoom_absolute_center_point( midpoint, 2.0 * zcorr ); break; case SP_VERB_ZOOM_PAGE: dt->zoom_page(); @@ -1949,10 +1952,10 @@ void ZoomVerb::perform(SPAction *action, void *data) dt->zoom_selection(); break; case SP_VERB_ZOOM_NEXT: - dt->next_zoom(); + dt->next_transform(); break; case SP_VERB_ZOOM_PREV: - dt->prev_zoom(); + dt->prev_transform(); break; case SP_VERB_TOGGLE_RULERS: dt->toggleRulers(); @@ -2895,6 +2898,7 @@ Verb *Verb::_base_verbs[] = { // Zoom/View new ZoomVerb(SP_VERB_ZOOM_IN, "ZoomIn", N_("Zoom In"), N_("Zoom in"), INKSCAPE_ICON("zoom-in")), new ZoomVerb(SP_VERB_ZOOM_OUT, "ZoomOut", N_("Zoom Out"), N_("Zoom out"), INKSCAPE_ICON("zoom-out")), + // WHY ARE THE FOLLOWING ZoomVerbs??? new ZoomVerb(SP_VERB_TOGGLE_RULERS, "ToggleRulers", N_("_Rulers"), N_("Show or hide the canvas rulers"), NULL), new ZoomVerb(SP_VERB_TOGGLE_SCROLLBARS, "ToggleScrollbars", N_("Scroll_bars"), N_("Show or hide the canvas scrollbars"), NULL), new ZoomVerb(SP_VERB_TOGGLE_GRID, "ToggleGrid", N_("Page _Grid"), N_("Show or hide the page grid"), INKSCAPE_ICON("show-grid")), -- cgit v1.2.3 From f47466c701b2256b2ce232f6d311d2be47136eab Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Mon, 20 Mar 2017 21:12:31 +0100 Subject: Implement rotation via desktop to window affine. Remove rotation via viewbox. Still some work to do... (bzr r15603) --- src/verbs.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 8b3d7a5a2..55e332fe2 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -41,6 +41,7 @@ #include "desktop.h" #include "display/curve.h" +#include "display/sp-canvas.h" #include "document.h" #include "ui/tools/freehand-base.h" #include "extension/effect.h" -- cgit v1.2.3 From 79c31e9b54e6a47502edb61d590cd50ab0536269 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 21 Mar 2017 10:14:44 +0100 Subject: Add verbs for canvas rotation. (bzr r15604) --- src/verbs.cpp | 91 ++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 69 insertions(+), 22 deletions(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 55e332fe2..d0f2f2614 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1882,8 +1882,10 @@ void ZoomVerb::perform(SPAction *action, void *data) Inkscape::XML::Node *repr = dt->namedview->getRepr(); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - gdouble zoom_inc = - prefs->getDoubleLimited( "/options/zoomincrement/value", M_SQRT2, 1.01, 10 ); + gdouble zoom_inc = + prefs->getDoubleLimited( "/options/zoomincrement/value", M_SQRT2, 1.01, 10 ); + gdouble rotate_inc = + prefs->getDoubleLimited( "/options/rotateincrement/value", M_PI/90, M_PI/180, M_PI/4, "°" ); double zcorr = 1.0; Glib::ustring abbr = prefs->getString("/options/zoomcorrection/unit"); @@ -1958,6 +1960,41 @@ void ZoomVerb::perform(SPAction *action, void *data) case SP_VERB_ZOOM_PREV: dt->prev_transform(); break; + case SP_VERB_ROTATE_CW: + { + gint mul = 1 + Inkscape::UI::Tools::gobble_key_events( GDK_KEY_parenleft, 0); + // While drawing with the pen/pencil tool, rotate towards the end of the unfinished path + if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) { + SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve; + if (!rc->is_empty()) { + Geom::Point const rotate_to (*rc->last_point()); + dt->rotate_relative_keep_point(rotate_to, -mul*rotate_inc); + break; + } + } + + dt->rotate_relative_center_point( midpoint, -mul*rotate_inc); + break; + } + case SP_VERB_ROTATE_CCW: + { + gint mul = 1 + Inkscape::UI::Tools::gobble_key_events( GDK_KEY_parenright, 0); + // While drawing with the pen/pencil tool, rotate towards the end of the unfinished path + if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) { + SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve; + if (!rc->is_empty()) { + Geom::Point const rotate_to (*rc->last_point()); + dt->rotate_relative_keep_point(rotate_to, mul*rotate_inc); + break; + } + } + + dt->rotate_relative_center_point( midpoint, mul*rotate_inc); + break; + } + case SP_VERB_ROTATE_ZERO: + dt->rotate_absolute_center_point( midpoint, 0.0 ); + break; case SP_VERB_TOGGLE_RULERS: dt->toggleRulers(); break; @@ -2896,10 +2933,37 @@ Verb *Verb::_base_verbs[] = { N_("Open Preferences for the Eraser tool"), NULL), new ContextVerb(SP_VERB_CONTEXT_LPETOOL_PREFS, "LPEToolPrefs", N_("LPE Tool Preferences"), N_("Open Preferences for the LPETool tool"), NULL), - // Zoom/View + + // Zoom new ZoomVerb(SP_VERB_ZOOM_IN, "ZoomIn", N_("Zoom In"), N_("Zoom in"), INKSCAPE_ICON("zoom-in")), new ZoomVerb(SP_VERB_ZOOM_OUT, "ZoomOut", N_("Zoom Out"), N_("Zoom out"), INKSCAPE_ICON("zoom-out")), - // WHY ARE THE FOLLOWING ZoomVerbs??? + new ZoomVerb(SP_VERB_ZOOM_NEXT, "ZoomNext", N_("Nex_t Zoom"), N_("Next zoom (from the history of zooms)"), + INKSCAPE_ICON("zoom-next")), + new ZoomVerb(SP_VERB_ZOOM_PREV, "ZoomPrev", N_("Pre_vious Zoom"), N_("Previous zoom (from the history of zooms)"), + INKSCAPE_ICON("zoom-previous")), + new ZoomVerb(SP_VERB_ZOOM_1_1, "Zoom1:0", N_("Zoom 1:_1"), N_("Zoom to 1:1"), + INKSCAPE_ICON("zoom-original")), + new ZoomVerb(SP_VERB_ZOOM_1_2, "Zoom1:2", N_("Zoom 1:_2"), N_("Zoom to 1:2"), + INKSCAPE_ICON("zoom-half-size")), + new ZoomVerb(SP_VERB_ZOOM_2_1, "Zoom2:1", N_("_Zoom 2:1"), N_("Zoom to 2:1"), + INKSCAPE_ICON("zoom-double-size")), + new ZoomVerb(SP_VERB_ZOOM_PAGE, "ZoomPage", N_("_Page"), + N_("Zoom to fit page in window"), INKSCAPE_ICON("zoom-fit-page")), + new ZoomVerb(SP_VERB_ZOOM_PAGE_WIDTH, "ZoomPageWidth", N_("Page _Width"), + N_("Zoom to fit page width in window"), INKSCAPE_ICON("zoom-fit-width")), + new ZoomVerb(SP_VERB_ZOOM_DRAWING, "ZoomDrawing", N_("_Drawing"), + N_("Zoom to fit drawing in window"), INKSCAPE_ICON("zoom-fit-drawing")), + new ZoomVerb(SP_VERB_ZOOM_SELECTION, "ZoomSelection", N_("_Selection"), + N_("Zoom to fit selection in window"), INKSCAPE_ICON("zoom-fit-selection")), + + new ZoomVerb(SP_VERB_ROTATE_CW, "RotateClockwise", N_("Rotate Clockwise"), N_("Rotate canvas clockwise"), NULL), + new ZoomVerb(SP_VERB_ROTATE_CCW, "RotateCounterClockwise", N_("Rotate Counter-Clockwise"), N_("Rotate canvas counter-clockwise"), NULL), + new ZoomVerb(SP_VERB_ROTATE_ZERO, "RotateZero", N_("Rotate Zero"), N_("Reset canvas rotation to zero"), NULL), + + +// WHY ARE THE FOLLOWING ZoomVerbs??? + + // View new ZoomVerb(SP_VERB_TOGGLE_RULERS, "ToggleRulers", N_("_Rulers"), N_("Show or hide the canvas rulers"), NULL), new ZoomVerb(SP_VERB_TOGGLE_SCROLLBARS, "ToggleScrollbars", N_("Scroll_bars"), N_("Show or hide the canvas scrollbars"), NULL), new ZoomVerb(SP_VERB_TOGGLE_GRID, "ToggleGrid", N_("Page _Grid"), N_("Show or hide the page grid"), INKSCAPE_ICON("show-grid")), @@ -2911,16 +2975,7 @@ Verb *Verb::_base_verbs[] = { new ZoomVerb(SP_VERB_TOGGLE_TOOLBOX, "ToggleToolbox", N_("_Toolbox"), N_("Show or hide the main toolbox (on the left)"), NULL), new ZoomVerb(SP_VERB_TOGGLE_PALETTE, "TogglePalette", N_("_Palette"), N_("Show or hide the color palette"), NULL), new ZoomVerb(SP_VERB_TOGGLE_STATUSBAR, "ToggleStatusbar", N_("_Statusbar"), N_("Show or hide the statusbar (at the bottom of the window)"), NULL), - new ZoomVerb(SP_VERB_ZOOM_NEXT, "ZoomNext", N_("Nex_t Zoom"), N_("Next zoom (from the history of zooms)"), - INKSCAPE_ICON("zoom-next")), - new ZoomVerb(SP_VERB_ZOOM_PREV, "ZoomPrev", N_("Pre_vious Zoom"), N_("Previous zoom (from the history of zooms)"), - INKSCAPE_ICON("zoom-previous")), - new ZoomVerb(SP_VERB_ZOOM_1_1, "Zoom1:0", N_("Zoom 1:_1"), N_("Zoom to 1:1"), - INKSCAPE_ICON("zoom-original")), - new ZoomVerb(SP_VERB_ZOOM_1_2, "Zoom1:2", N_("Zoom 1:_2"), N_("Zoom to 1:2"), - INKSCAPE_ICON("zoom-half-size")), - new ZoomVerb(SP_VERB_ZOOM_2_1, "Zoom2:1", N_("_Zoom 2:1"), N_("Zoom to 2:1"), - INKSCAPE_ICON("zoom-double-size")), + new ZoomVerb(SP_VERB_FULLSCREEN, "FullScreen", N_("_Fullscreen"), N_("Stretch this document window to full screen"), INKSCAPE_ICON("view-fullscreen")), new ZoomVerb(SP_VERB_FULLSCREENFOCUS, "FullScreenFocus", N_("Fullscreen & Focus Mode"), N_("Stretch this document window to full screen"), @@ -2954,14 +3009,6 @@ Verb *Verb::_base_verbs[] = { new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview..."), N_("Open a window to preview objects at different icon resolutions"), INKSCAPE_ICON("dialog-icon-preview")), - new ZoomVerb(SP_VERB_ZOOM_PAGE, "ZoomPage", N_("_Page"), - N_("Zoom to fit page in window"), INKSCAPE_ICON("zoom-fit-page")), - new ZoomVerb(SP_VERB_ZOOM_PAGE_WIDTH, "ZoomPageWidth", N_("Page _Width"), - N_("Zoom to fit page width in window"), INKSCAPE_ICON("zoom-fit-width")), - new ZoomVerb(SP_VERB_ZOOM_DRAWING, "ZoomDrawing", N_("_Drawing"), - N_("Zoom to fit drawing in window"), INKSCAPE_ICON("zoom-fit-drawing")), - new ZoomVerb(SP_VERB_ZOOM_SELECTION, "ZoomSelection", N_("_Selection"), - N_("Zoom to fit selection in window"), INKSCAPE_ICON("zoom-fit-selection")), // Dialogs new DialogVerb(SP_VERB_DIALOG_PROTOTYPE, "DialogPrototype", N_("Prototype..."), -- cgit v1.2.3 From a6c82507f599a302e85f1a2faae0c6a27d672d9e Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 21 Mar 2017 21:41:59 +0100 Subject: Add entry for canvas rotate step in Inkscape Preferences dialog. Change default rotation step to 15 degrees. (bzr r15605) --- src/verbs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index d0f2f2614..78967e89b 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1885,7 +1885,8 @@ void ZoomVerb::perform(SPAction *action, void *data) gdouble zoom_inc = prefs->getDoubleLimited( "/options/zoomincrement/value", M_SQRT2, 1.01, 10 ); gdouble rotate_inc = - prefs->getDoubleLimited( "/options/rotateincrement/value", M_PI/90, M_PI/180, M_PI/4, "°" ); + prefs->getDoubleLimited( "/options/rotateincrement/value", 15, 1, 90, "°" ); + rotate_inc *= M_PI/180.0; double zcorr = 1.0; Glib::ustring abbr = prefs->getString("/options/zoomcorrection/unit"); -- cgit v1.2.3 From a184a53752fb8027c22e4a5d68819fd7b78a15d8 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 22 Mar 2017 20:03:41 +0100 Subject: Add canvas flip. No GUI. Can be bound to keys via preferences. (bzr r15606) --- src/verbs.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 78967e89b..b7b6da340 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1996,6 +1996,40 @@ void ZoomVerb::perform(SPAction *action, void *data) case SP_VERB_ROTATE_ZERO: dt->rotate_absolute_center_point( midpoint, 0.0 ); break; + case SP_VERB_FLIP_HORIZONTAL: + { + // While drawing with the pen/pencil tool, flip towards the end of the unfinished path + if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) { + SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve; + if (!rc->is_empty()) { + Geom::Point const flip_to (*rc->last_point()); + dt->flip_relative_keep_point(flip_to, SPDesktop::FLIP_HORIZONTAL); + break; + } + } + + dt->flip_relative_center_point( midpoint, SPDesktop::FLIP_HORIZONTAL); + break; + } + case SP_VERB_FLIP_VERTICAL: + { + gint mul = 1 + Inkscape::UI::Tools::gobble_key_events( GDK_KEY_parenright, 0); + // While drawing with the pen/pencil tool, flip towards the end of the unfinished path + if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) { + SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve; + if (!rc->is_empty()) { + Geom::Point const flip_to (*rc->last_point()); + dt->flip_relative_keep_point(flip_to, SPDesktop::FLIP_VERTICAL); + break; + } + } + + dt->flip_relative_center_point( midpoint, SPDesktop::FLIP_VERTICAL); + break; + } + case SP_VERB_FLIP_NONE: + dt->flip_absolute_center_point( midpoint, SPDesktop::FLIP_NONE); + break; case SP_VERB_TOGGLE_RULERS: dt->toggleRulers(); break; @@ -2961,6 +2995,10 @@ Verb *Verb::_base_verbs[] = { new ZoomVerb(SP_VERB_ROTATE_CCW, "RotateCounterClockwise", N_("Rotate Counter-Clockwise"), N_("Rotate canvas counter-clockwise"), NULL), new ZoomVerb(SP_VERB_ROTATE_ZERO, "RotateZero", N_("Rotate Zero"), N_("Reset canvas rotation to zero"), NULL), + new ZoomVerb(SP_VERB_FLIP_HORIZONTAL, "FlipHorizontal", N_("Flip Horizontal"), N_("Flip canvas horizontally"), INKSCAPE_ICON("object-flip-horizontal")), + new ZoomVerb(SP_VERB_FLIP_VERTICAL, "FlipVertical", N_("Flip Vertical"), N_("Flip canvas vertically"), INKSCAPE_ICON("object-flip-vertical")), + new ZoomVerb(SP_VERB_FLIP_NONE, "FlipNone", N_("Flip None"), N_("Undo any flip"), NULL), + // WHY ARE THE FOLLOWING ZoomVerbs??? -- cgit v1.2.3 From dc80e5d0bf82f005628881134b929aa4838308d5 Mon Sep 17 00:00:00 2001 From: chr Date: Tue, 23 May 2017 21:48:22 +0200 Subject: selection chemistry: implement z-stack order Bug #1395452 "raise and lower objects" used to stack objects above/below the next overlapping object, which makes it impossible to change the z-order of objects that don't overlap. Fixes also the object manager panel Conflicts: src/selection-chemistry.cpp src/selection-chemistry.h src/sp-item.cpp (bzr r15698.1.7) --- src/verbs.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index b7b6da340..22ded60b3 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1179,6 +1179,12 @@ void SelectionVerb::perform(SPAction *action, void *data) case SP_VERB_SELECTION_LOWER: selection->lower(); break; + case SP_VERB_SELECTION_STACK_UP: + selection->stackUp(); + break; + case SP_VERB_SELECTION_STACK_DOWN: + selection->stackDown(); + break; case SP_VERB_SELECTION_GROUP: selection->group(); break; @@ -2685,6 +2691,14 @@ Verb *Verb::_base_verbs[] = { N_("Raise selection one step"), INKSCAPE_ICON("selection-raise")), new SelectionVerb(SP_VERB_SELECTION_LOWER, "SelectionLower", N_("_Lower"), N_("Lower selection one step"), INKSCAPE_ICON("selection-lower")), + + + new SelectionVerb(SP_VERB_SELECTION_STACK_UP, "SelectionStackUp", N_("_Stack up"), + N_("Stack selection one step up"), INKSCAPE_ICON("layer-raise")), + new SelectionVerb(SP_VERB_SELECTION_STACK_DOWN, "SelectionStackDown", N_("_Stack down"), + N_("Stack selection one step down"), INKSCAPE_ICON("layer-lower")), + + new SelectionVerb(SP_VERB_SELECTION_GROUP, "SelectionGroup", N_("_Group"), N_("Group selected objects"), INKSCAPE_ICON("object-group")), new SelectionVerb(SP_VERB_SELECTION_UNGROUP, "SelectionUnGroup", N_("_Ungroup"), -- cgit v1.2.3