From b95b098b2415091fcff97c9cf7d49457e3b2c9fe Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Mon, 1 Oct 2012 11:33:25 +0200 Subject: Translations. Adding new LPE to the translation template, UI consistency fixes and unstable tag removed. (bzr r11720) --- src/live_effects/effect.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 44e57addf..3b57de25c 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -120,9 +120,9 @@ const Util::EnumData LPETypeData[] = { {ROUGH_HATCHES, N_("Hatches (rough)"), "rough_hatches"}, {SKETCH, N_("Sketch"), "sketch"}, {RULER, N_("Ruler"), "ruler"}, -/* 0.49 ?*/ - {POWERSTROKE, N_("[Unstable!] Power stroke"), "powerstroke"}, - {CLONE_ORIGINAL, N_("[Unstable!] Clone original path"), "clone_original"}, +/* 0.49 */ + {POWERSTROKE, N_("Power stroke"), "powerstroke"}, + {CLONE_ORIGINAL, N_("Clone original path"), "clone_original"}, }; const Util::EnumDataConverter LPETypeConverter(LPETypeData, sizeof(LPETypeData)/sizeof(*LPETypeData)); -- cgit v1.2.3 From ef59716bfab870d3193fa9670f2cacc3cca39595 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 17 Jan 2013 19:23:15 +0100 Subject: const methods (bzr r12037) --- src/live_effects/effect.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 3b57de25c..4d6fb0979 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -309,7 +309,7 @@ Effect::getName() } EffectType -Effect::effectType() { +Effect::effectType() const { return lpeobj->effecttype; } @@ -663,7 +663,7 @@ Effect::transform_multiply(Geom::Affine const& postmul, bool set) } bool -Effect::providesKnotholder() +Effect::providesKnotholder() const { // does the effect actively provide any knotholder entities of its own? if (_provides_knotholder_entities) { @@ -671,7 +671,7 @@ Effect::providesKnotholder() } // otherwise: are there any parameters that have knotholderentities? - for (std::vector::iterator p = param_vector.begin(); p != param_vector.end(); ++p) { + for (std::vector::const_iterator p = param_vector.begin(); p != param_vector.end(); ++p) { if ((*p)->providesKnotHolderEntities()) { return true; } -- cgit v1.2.3 From a70c7514a9dd5fc8d5eabe486141dfd259d2ed55 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 17 Jan 2013 20:00:40 +0100 Subject: more const happiness (and removal of duplicate code in sp-object.h) (bzr r12038) --- src/live_effects/effect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 4d6fb0979..26095d84b 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -317,7 +317,7 @@ Effect::effectType() const { * Is performed a single time when the effect is freshly applied to a path */ void -Effect::doOnApply (SPLPEItem */*lpeitem*/) +Effect::doOnApply (SPLPEItem const*/*lpeitem*/) { } @@ -643,7 +643,7 @@ Effect::editNextParamOncanvas(SPItem * item, SPDesktop * desktop) * The nice thing about this is that this function can use knowledge of the original path and set things accordingly for example to the size or origin of the original path! */ void -Effect::resetDefaults(SPItem * /*item*/) +Effect::resetDefaults(SPItem const* /*item*/) { std::vector::iterator p; for (p = param_vector.begin(); p != param_vector.end(); ++p) { -- cgit v1.2.3 From bf58d4cb9c86682d1416c64378d1cfc8a95554e8 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 17 Jan 2013 21:02:50 +0100 Subject: const .... (bzr r12039) --- src/live_effects/effect.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 26095d84b..b0be02b95 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -300,7 +300,7 @@ Effect::~Effect() } Glib::ustring -Effect::getName() +Effect::getName() const { if (lpeobj->effecttype_set && LPETypeConverter.is_valid_id(lpeobj->effecttype) ) return Glib::ustring( _(LPETypeConverter.get_label(lpeobj->effecttype).c_str()) ); @@ -325,7 +325,7 @@ Effect::doOnApply (SPLPEItem const*/*lpeitem*/) * Is performed each time before the effect is updated. */ void -Effect::doBeforeEffect (SPLPEItem */*lpeitem*/) +Effect::doBeforeEffect (SPLPEItem const*/*lpeitem*/) { //Do nothing for simple effects } @@ -370,7 +370,7 @@ Effect::writeParamsToSVG() { * your LPE. But don't forget to call the parent method so that is_ready is set to true! */ void -Effect::acceptParamPath (SPPath */*param_path*/) { +Effect::acceptParamPath (SPPath const*/*param_path*/) { setReady(); } @@ -424,7 +424,7 @@ Effect::doEffect_pwd2 (Geom::Piecewise > const & pwd2_in) } void -Effect::readallParameters(Inkscape::XML::Node * repr) +Effect::readallParameters(Inkscape::XML::Node const* repr) { std::vector::iterator it = param_vector.begin(); while (it != param_vector.end()) { @@ -491,7 +491,7 @@ Effect::addHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) { * This is the function called by external code like SPLPEItem. */ std::vector -Effect::getHelperPaths(SPLPEItem *lpeitem) +Effect::getHelperPaths(SPLPEItem const* lpeitem) { std::vector hp_vec; @@ -524,7 +524,7 @@ Effect::getHelperPaths(SPLPEItem *lpeitem) * This function should be overwritten by derived effects if they want to provide their own helperpaths. */ void -Effect::addCanvasIndicators(SPLPEItem */*lpeitem*/, std::vector &/*hp_vec*/) +Effect::addCanvasIndicators(SPLPEItem const*/*lpeitem*/, std::vector &/*hp_vec*/) { } -- cgit v1.2.3 From 0cdd007ebf8dcfbd39c1d36ab53f43617eb692df Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Mon, 25 Mar 2013 17:42:31 +0000 Subject: Workaround usage of deprecated glib symbols in 3rd party libraries Fixed bugs: - https://launchpad.net/bugs/1122774 (bzr r12243) --- src/live_effects/effect.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index b0be02b95..105fdea32 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -7,14 +7,13 @@ //#define LPE_ENABLE_TEST_EFFECTS -#include "live_effects/effect.h" - #ifdef HAVE_CONFIG_H # include "config.h" #endif // include effects: #include "live_effects/lpe-patternalongpath.h" +#include "live_effects/effect.h" #include "live_effects/lpe-bendpath.h" #include "live_effects/lpe-sketch.h" #include "live_effects/lpe-vonkoch.h" -- cgit v1.2.3 From 4f857ae84089672e9c7378d327e54889f64c62fb Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 4 Oct 2013 23:57:28 +0200 Subject: C++ (bzr r12660) --- src/live_effects/effect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 105fdea32..623879ac5 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -270,7 +270,7 @@ void Effect::createAndApply(const char* name, SPDocument *doc, SPItem *item) Inkscape::GC::release(repr); gchar *href = g_strdup_printf("#%s", repr_id); - sp_lpe_item_add_path_effect(SP_LPE_ITEM(item), href, true); + SP_LPE_ITEM(item)->addPathEffect(href, true); g_free(href); } -- cgit v1.2.3 From 55b451bf382e0c3d5ed8728e42fbb535acfa8a33 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Thu, 7 Nov 2013 21:44:00 +0100 Subject: First step of moving tools into appropriate namespaces. (bzr r12782) --- src/live_effects/effect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 623879ac5..21ef02359 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -343,8 +343,8 @@ Effect::doAcceptPathPreparations(SPLPEItem *lpeitem) tools_switch(desktop, TOOLS_FREEHAND_PEN); } - SPEventContext *ec = desktop->event_context; - SPPenContext *pc = SP_PEN_CONTEXT(ec); + Inkscape::UI::Tools::ToolBase *ec = desktop->event_context; + Inkscape::UI::Tools::PenTool *pc = SP_PEN_CONTEXT(ec); pc->expecting_clicks_for_LPE = this->acceptsNumClicks(); pc->waiting_LPE = this; pc->waiting_item = lpeitem; -- cgit v1.2.3 From c04e30df241a3ee039077425bab9b9c37abe2854 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 9 Nov 2013 23:36:13 +0100 Subject: Moved and renamed some tool-related files. (bzr r12785) --- src/live_effects/effect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 21ef02359..70ce1e89d 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -58,7 +58,7 @@ #include "document-private.h" #include "xml/document.h" #include -#include "pen-context.h" +#include "ui/tools/pen-tool.h" #include "tools-switch.h" #include "message-stack.h" #include "desktop.h" -- cgit v1.2.3 From 64e60300f6690bdf1482fa67d368ef98889b7817 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 12 Jan 2014 23:12:14 +0100 Subject: LPE: rename function getHelperPaths --> getCanvasIndicators (the function is not yet called by anyone, but the naming was confusing) (bzr r12920) --- src/live_effects/effect.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 70ce1e89d..12990ee24 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -486,11 +486,13 @@ Effect::addHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) { } /** - * Return a vector of PathVectors which contain all helperpaths that should be drawn by the effect. - * This is the function called by external code like SPLPEItem. + * Return a vector of PathVectors which contain all canvas indicators for this effect. + * This is the function called by external code to get all canvas indicators (effect and its parameters) + * lpeitem = the item onto which this effect is applied + * @todo change return type to one pathvector, add all paths to one pathvector instead of maintaining a vector of pathvectors */ std::vector -Effect::getHelperPaths(SPLPEItem const* lpeitem) +Effect::getCanvasIndicators(SPLPEItem const* lpeitem) { std::vector hp_vec; @@ -499,18 +501,10 @@ Effect::getHelperPaths(SPLPEItem const* lpeitem) return hp_vec; } - // TODO: we can probably optimize this by using a lot more references - // rather than copying PathVectors all over the place - if (show_orig_path) { - // add original path to helperpaths - SPCurve* curve = SP_SHAPE(lpeitem)->getCurve (); - hp_vec.push_back(curve->get_pathvector()); - } - - // add other helperpaths provided by the effect itself + // add indicators provided by the effect itself addCanvasIndicators(lpeitem, hp_vec); - // add helperpaths provided by the effect's parameters + // add indicators provided by the effect's parameters for (std::vector::iterator p = param_vector.begin(); p != param_vector.end(); ++p) { (*p)->addCanvasIndicators(lpeitem, hp_vec); } -- cgit v1.2.3