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 +++--- src/live_effects/effect.h | 14 +++++++------- src/live_effects/lpe-spiro.h | 2 +- src/live_effects/parameter/bool.h | 5 ++--- src/live_effects/parameter/enum.h | 5 +++-- src/live_effects/parameter/parameter.h | 5 ++--- src/live_effects/parameter/path.cpp | 2 +- src/live_effects/parameter/path.h | 2 +- src/live_effects/parameter/point.h | 2 +- src/live_effects/parameter/powerstrokepointarray.h | 6 +++--- src/live_effects/parameter/random.h | 3 +-- src/live_effects/parameter/text.h | 2 +- src/live_effects/parameter/unit.cpp | 2 +- src/live_effects/parameter/unit.h | 4 ++-- src/live_effects/parameter/vector.h | 2 +- 15 files changed, 30 insertions(+), 32 deletions(-) (limited to 'src/live_effects') 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; } diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index 008de5ea8..8725129b5 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -51,7 +51,7 @@ public: virtual ~Effect(); - EffectType effectType (); + EffectType effectType() const; virtual void doOnApply (SPLPEItem *lpeitem); virtual void doBeforeEffect (SPLPEItem *lpeitem); @@ -68,7 +68,7 @@ public: * e.g., waiting for a parameter path either before the effect is created or when it needs a * path as argument. This is set in sp_lpe_item_add_path_effect(). */ - inline bool isReady() { return is_ready; } + inline bool isReady() const { return is_ready; } inline void setReady(bool ready = true) { is_ready = ready; } virtual void doEffect (SPCurve * curve); @@ -85,17 +85,17 @@ public: // /TODO: providesKnotholder() is currently used as an indicator of whether a nodepath is // created for an item or not. When we allow both at the same time, this needs rethinking! - bool providesKnotholder(); + bool providesKnotholder() const; // /TODO: in view of providesOwnFlashPaths() below, this is somewhat redundant // (but spiro lpe still needs it!) - virtual LPEPathFlashType pathFlashType() { return DEFAULT; } + virtual LPEPathFlashType pathFlashType() const { return DEFAULT; } void addHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item); std::vector getHelperPaths(SPLPEItem *lpeitem); - inline bool providesOwnFlashPaths() { + inline bool providesOwnFlashPaths() const { return provides_own_flash_paths || show_orig_path; } - inline bool showOrigPath() { return show_orig_path; } + inline bool showOrigPath() const { return show_orig_path; } Glib::ustring getName(); Inkscape::XML::Node * getRepr(); @@ -106,7 +106,7 @@ public: void readallParameters(Inkscape::XML::Node * repr); void setParameter(const gchar * key, const gchar * new_value); - inline bool isVisible() { return is_visible; } + inline bool isVisible() const { return is_visible; } void editNextParamOncanvas(SPItem * item, SPDesktop * desktop); diff --git a/src/live_effects/lpe-spiro.h b/src/live_effects/lpe-spiro.h index f3cdbda79..edce42280 100644 --- a/src/live_effects/lpe-spiro.h +++ b/src/live_effects/lpe-spiro.h @@ -18,7 +18,7 @@ public: LPESpiro(LivePathEffectObject *lpeobject); virtual ~LPESpiro(); - virtual LPEPathFlashType pathFlashType() { return SUPPRESS_FLASH; } + virtual LPEPathFlashType pathFlashType() const { return SUPPRESS_FLASH; } virtual void doEffect(SPCurve * curve); diff --git a/src/live_effects/parameter/bool.h b/src/live_effects/parameter/bool.h index d7aa299aa..fafb1beca 100644 --- a/src/live_effects/parameter/bool.h +++ b/src/live_effects/parameter/bool.h @@ -36,10 +36,9 @@ public: void param_setValue(bool newvalue); virtual void param_set_default(); - bool get_value() { return value; }; + bool get_value() const { return value; }; - inline operator bool() - { return value; }; + inline operator bool() const { return value; }; private: BoolParam(const BoolParam&); diff --git a/src/live_effects/parameter/enum.h b/src/live_effects/parameter/enum.h index 2a1b07b47..2340663c3 100644 --- a/src/live_effects/parameter/enum.h +++ b/src/live_effects/parameter/enum.h @@ -68,8 +68,9 @@ public: return value; } - inline operator E() - { return value; }; + inline operator E() const { + return value; + }; void param_set_default() { param_set_value(defvalue); diff --git a/src/live_effects/parameter/parameter.h b/src/live_effects/parameter/parameter.h index 4785d5455..526708ed7 100644 --- a/src/live_effects/parameter/parameter.h +++ b/src/live_effects/parameter/parameter.h @@ -59,7 +59,7 @@ public: virtual Glib::ustring * param_getTooltip() { return ¶m_tooltip; }; // overload these for your particular parameter to make it provide knotholder handles or canvas helperpaths - virtual bool providesKnotHolderEntities() { return false; } + virtual bool providesKnotHolderEntities() const { return false; } virtual void addKnotHolderEntities(KnotHolder */*knotholder*/, SPDesktop */*desktop*/, SPItem */*item*/) {}; virtual void addCanvasIndicators(SPLPEItem */*lpeitem*/, std::vector &/*hp_vec*/) {}; @@ -112,8 +112,7 @@ public: virtual Gtk::Widget * param_newWidget(); - inline operator gdouble() - { return value; }; + inline operator gdouble() const { return value; }; protected: gdouble value; diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 1b3d7417d..d076cc5d0 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -77,7 +77,7 @@ PathParam::~PathParam() } std::vector const & -PathParam::get_pathvector() +PathParam::get_pathvector() const { return _pathvector; } diff --git a/src/live_effects/parameter/path.h b/src/live_effects/parameter/path.h index a4f46f11f..d48b5422d 100644 --- a/src/live_effects/parameter/path.h +++ b/src/live_effects/parameter/path.h @@ -31,7 +31,7 @@ public: const gchar * default_value = "M0,0 L1,1"); virtual ~PathParam(); - std::vector const & get_pathvector(); + std::vector const & get_pathvector() const; Geom::Piecewise > const & get_pwd2(); virtual Gtk::Widget * param_newWidget(); diff --git a/src/live_effects/parameter/point.h b/src/live_effects/parameter/point.h index f2397753e..319835bb3 100644 --- a/src/live_effects/parameter/point.h +++ b/src/live_effects/parameter/point.h @@ -47,7 +47,7 @@ public: void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); - virtual bool providesKnotHolderEntities() { return true; } + virtual bool providesKnotHolderEntities() const { return true; } virtual void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item); private: diff --git a/src/live_effects/parameter/powerstrokepointarray.h b/src/live_effects/parameter/powerstrokepointarray.h index 0e08d78fe..e1fa440f2 100644 --- a/src/live_effects/parameter/powerstrokepointarray.h +++ b/src/live_effects/parameter/powerstrokepointarray.h @@ -37,12 +37,12 @@ public: void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); - virtual bool providesKnotHolderEntities() { return true; } + virtual bool providesKnotHolderEntities() const { return true; } virtual void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item); void set_pwd2(Geom::Piecewise > const & pwd2_in, Geom::Piecewise > const & pwd2_normal_in); - Geom::Piecewise > const & get_pwd2() { return last_pwd2; } - Geom::Piecewise > const & get_pwd2_normal() { return last_pwd2_normal; } + Geom::Piecewise > const & get_pwd2() const { return last_pwd2; } + Geom::Piecewise > const & get_pwd2_normal() const { return last_pwd2_normal; } void recalculate_controlpoints_for_new_pwd2(Geom::Piecewise > const & pwd2_in); diff --git a/src/live_effects/parameter/random.h b/src/live_effects/parameter/random.h index b72f6f976..ca4440336 100644 --- a/src/live_effects/parameter/random.h +++ b/src/live_effects/parameter/random.h @@ -42,8 +42,7 @@ public: void resetRandomizer(); operator gdouble(); - inline gdouble get_value() - { return value; } ; + inline gdouble get_value() { return value; } ; protected: long startseed; diff --git a/src/live_effects/parameter/text.h b/src/live_effects/parameter/text.h index 85833885e..62de70eec 100644 --- a/src/live_effects/parameter/text.h +++ b/src/live_effects/parameter/text.h @@ -46,7 +46,7 @@ public: const double t, const double length, bool use_curvature = false); void setAnchor(double x_value, double y_value); - const Glib::ustring get_value() { return defvalue; }; + const Glib::ustring get_value() const { return defvalue; }; private: TextParam(const TextParam&); diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp index 36b6efacc..7a2ce6f65 100644 --- a/src/live_effects/parameter/unit.cpp +++ b/src/live_effects/parameter/unit.cpp @@ -59,7 +59,7 @@ UnitParam::param_set_value(SPUnit const *val) } const gchar * -UnitParam::get_abbreviation() +UnitParam::get_abbreviation() const { return sp_unit_get_abbreviation(unit); } diff --git a/src/live_effects/parameter/unit.h b/src/live_effects/parameter/unit.h index 3d417fcd6..ea7a0112a 100644 --- a/src/live_effects/parameter/unit.h +++ b/src/live_effects/parameter/unit.h @@ -30,11 +30,11 @@ public: virtual gchar * param_getSVGValue() const; virtual void param_set_default(); void param_set_value(SPUnit const *val); - const gchar *get_abbreviation(); + const gchar *get_abbreviation() const; virtual Gtk::Widget * param_newWidget(); - operator SPUnit const *() { return unit; } + operator SPUnit const *() const { return unit; } private: SPUnit const *unit; diff --git a/src/live_effects/parameter/vector.h b/src/live_effects/parameter/vector.h index f82affe16..35ca04437 100644 --- a/src/live_effects/parameter/vector.h +++ b/src/live_effects/parameter/vector.h @@ -52,7 +52,7 @@ public: void set_origin_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); void set_oncanvas_color(guint32 color); - virtual bool providesKnotHolderEntities() { return true; } + virtual bool providesKnotHolderEntities() const { return true; } virtual void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item); private: -- 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 ++-- src/live_effects/effect.h | 4 ++-- src/live_effects/lpe-bendpath.cpp | 2 +- src/live_effects/lpe-bendpath.h | 2 +- src/live_effects/lpe-copy_rotate.cpp | 4 ++-- src/live_effects/lpe-copy_rotate.h | 2 +- src/live_effects/lpe-curvestitch.cpp | 2 +- src/live_effects/lpe-curvestitch.h | 2 +- src/live_effects/lpe-envelope.cpp | 2 +- src/live_effects/lpe-envelope.h | 2 +- src/live_effects/lpe-extrude.cpp | 2 +- src/live_effects/lpe-extrude.h | 2 +- src/live_effects/lpe-interpolate.cpp | 2 +- src/live_effects/lpe-interpolate.h | 2 +- src/live_effects/lpe-lattice.cpp | 2 +- src/live_effects/lpe-lattice.h | 2 +- src/live_effects/lpe-mirror_symmetry.cpp | 2 +- src/live_effects/lpe-mirror_symmetry.h | 2 +- src/live_effects/lpe-offset.cpp | 2 +- src/live_effects/lpe-offset.h | 2 +- src/live_effects/lpe-parallel.cpp | 2 +- src/live_effects/lpe-parallel.h | 2 +- src/live_effects/lpe-perp_bisector.cpp | 2 +- src/live_effects/lpe-perp_bisector.h | 2 +- src/live_effects/lpe-powerstroke.cpp | 2 +- src/live_effects/lpe-powerstroke.h | 2 +- src/live_effects/lpe-rough-hatches.cpp | 2 +- src/live_effects/lpe-rough-hatches.h | 2 +- src/live_effects/lpe-vonkoch.cpp | 2 +- src/live_effects/lpe-vonkoch.h | 2 +- 30 files changed, 33 insertions(+), 33 deletions(-) (limited to 'src/live_effects') 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) { diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index 8725129b5..5862a24ba 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -53,7 +53,7 @@ public: EffectType effectType() const; - virtual void doOnApply (SPLPEItem *lpeitem); + virtual void doOnApply (SPLPEItem const* lpeitem); virtual void doBeforeEffect (SPLPEItem *lpeitem); void writeParamsToSVG(); @@ -78,7 +78,7 @@ public: /** * Sets all parameters to their default values and writes them to SVG. */ - virtual void resetDefaults(SPItem * item); + virtual void resetDefaults(SPItem const* item); /// /todo: is this method really necessary? it causes UI inconsistensies... (johan) virtual void transform_multiply(Geom::Affine const& postmul, bool set); diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp index 3732ae3ef..59fd145d1 100644 --- a/src/live_effects/lpe-bendpath.cpp +++ b/src/live_effects/lpe-bendpath.cpp @@ -123,7 +123,7 @@ LPEBendPath::doEffect_pwd2 (Geom::Piecewise > const & pwd } void -LPEBendPath::resetDefaults(SPItem * item) +LPEBendPath::resetDefaults(SPItem const* item) { Effect::resetDefaults(item); diff --git a/src/live_effects/lpe-bendpath.h b/src/live_effects/lpe-bendpath.h index 98421df88..0e4b3f726 100644 --- a/src/live_effects/lpe-bendpath.h +++ b/src/live_effects/lpe-bendpath.h @@ -37,7 +37,7 @@ public: virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); - virtual void resetDefaults(SPItem * item); + virtual void resetDefaults(SPItem const* item); private: diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp index 9ac553ed5..f946f0568 100644 --- a/src/live_effects/lpe-copy_rotate.cpp +++ b/src/live_effects/lpe-copy_rotate.cpp @@ -73,9 +73,9 @@ LPECopyRotate::~LPECopyRotate() } void -LPECopyRotate::doOnApply(SPLPEItem *lpeitem) +LPECopyRotate::doOnApply(SPLPEItem const* lpeitem) { - SPCurve *curve = SP_SHAPE(lpeitem)->_curve; + SPCurve const *curve = SP_SHAPE(lpeitem)->_curve; A = *(curve->first_point()); B = *(curve->last_point()); diff --git a/src/live_effects/lpe-copy_rotate.h b/src/live_effects/lpe-copy_rotate.h index b14bc4128..1354b980a 100644 --- a/src/live_effects/lpe-copy_rotate.h +++ b/src/live_effects/lpe-copy_rotate.h @@ -31,7 +31,7 @@ public: LPECopyRotate(LivePathEffectObject *lpeobject); virtual ~LPECopyRotate(); - virtual void doOnApply (SPLPEItem *lpeitem); + virtual void doOnApply (SPLPEItem const* lpeitem); virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); diff --git a/src/live_effects/lpe-curvestitch.cpp b/src/live_effects/lpe-curvestitch.cpp index edf8ab55e..af928fff8 100644 --- a/src/live_effects/lpe-curvestitch.cpp +++ b/src/live_effects/lpe-curvestitch.cpp @@ -151,7 +151,7 @@ LPECurveStitch::doEffect_path (std::vector const & path_in) } void -LPECurveStitch::resetDefaults(SPItem * item) +LPECurveStitch::resetDefaults(SPItem const* item) { Effect::resetDefaults(item); diff --git a/src/live_effects/lpe-curvestitch.h b/src/live_effects/lpe-curvestitch.h index f46f2a5d2..38a11b4af 100644 --- a/src/live_effects/lpe-curvestitch.h +++ b/src/live_effects/lpe-curvestitch.h @@ -30,7 +30,7 @@ public: virtual std::vector doEffect_path (std::vector const & path_in); - virtual void resetDefaults(SPItem * item); + virtual void resetDefaults(SPItem const* item); virtual void transform_multiply(Geom::Affine const& postmul, bool set); diff --git a/src/live_effects/lpe-envelope.cpp b/src/live_effects/lpe-envelope.cpp index 9fd299ee8..bcd63e8cb 100644 --- a/src/live_effects/lpe-envelope.cpp +++ b/src/live_effects/lpe-envelope.cpp @@ -225,7 +225,7 @@ LPEEnvelope::doEffect_pwd2 (Geom::Piecewise > const & pwd } void -LPEEnvelope::resetDefaults(SPItem * item) +LPEEnvelope::resetDefaults(SPItem const* item) { Effect::resetDefaults(item); diff --git a/src/live_effects/lpe-envelope.h b/src/live_effects/lpe-envelope.h index fe1d9561d..6a9fe1c0a 100644 --- a/src/live_effects/lpe-envelope.h +++ b/src/live_effects/lpe-envelope.h @@ -35,7 +35,7 @@ public: virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); - virtual void resetDefaults(SPItem * item); + virtual void resetDefaults(SPItem const* item); private: PathParam bend_path1; diff --git a/src/live_effects/lpe-extrude.cpp b/src/live_effects/lpe-extrude.cpp index 4351f3aa0..7f5a00cf8 100644 --- a/src/live_effects/lpe-extrude.cpp +++ b/src/live_effects/lpe-extrude.cpp @@ -170,7 +170,7 @@ LPEExtrude::doEffect_pwd2 (Geom::Piecewise > const & pwd2 } void -LPEExtrude::resetDefaults(SPItem * item) +LPEExtrude::resetDefaults(SPItem const* item) { Effect::resetDefaults(item); diff --git a/src/live_effects/lpe-extrude.h b/src/live_effects/lpe-extrude.h index 0c9f11444..491fe4959 100644 --- a/src/live_effects/lpe-extrude.h +++ b/src/live_effects/lpe-extrude.h @@ -26,7 +26,7 @@ public: virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); - virtual void resetDefaults(SPItem * item); + virtual void resetDefaults(SPItem const* item); private: VectorParam extrude_vector; diff --git a/src/live_effects/lpe-interpolate.cpp b/src/live_effects/lpe-interpolate.cpp index 227185f91..e41bc6f0e 100644 --- a/src/live_effects/lpe-interpolate.cpp +++ b/src/live_effects/lpe-interpolate.cpp @@ -99,7 +99,7 @@ LPEInterpolate::doEffect_path (Geom::PathVector const & path_in) } void -LPEInterpolate::resetDefaults(SPItem * item) +LPEInterpolate::resetDefaults(SPItem const* item) { Effect::resetDefaults(item); diff --git a/src/live_effects/lpe-interpolate.h b/src/live_effects/lpe-interpolate.h index 3091537f3..679001a81 100644 --- a/src/live_effects/lpe-interpolate.h +++ b/src/live_effects/lpe-interpolate.h @@ -29,7 +29,7 @@ public: virtual std::vector doEffect_path (std::vector const & path_in); - virtual void resetDefaults(SPItem * item); + virtual void resetDefaults(SPItem const* item); private: PathParam trajectory_path; ScalarParam number_of_steps; diff --git a/src/live_effects/lpe-lattice.cpp b/src/live_effects/lpe-lattice.cpp index 2d04c4d41..84fba4659 100644 --- a/src/live_effects/lpe-lattice.cpp +++ b/src/live_effects/lpe-lattice.cpp @@ -179,7 +179,7 @@ LPELattice::doBeforeEffect (SPLPEItem *lpeitem) } void -LPELattice::resetDefaults(SPItem * item) +LPELattice::resetDefaults(SPItem const* item) { Effect::resetDefaults(item); diff --git a/src/live_effects/lpe-lattice.h b/src/live_effects/lpe-lattice.h index f95e33b0b..521875bcf 100644 --- a/src/live_effects/lpe-lattice.h +++ b/src/live_effects/lpe-lattice.h @@ -35,7 +35,7 @@ public: virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); - virtual void resetDefaults(SPItem * item); + virtual void resetDefaults(SPItem const* item); protected: //virtual void addHelperPathsImpl(SPLPEItem *lpeitem, SPDesktop *desktop); diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp index a56909338..4d4837d8d 100644 --- a/src/live_effects/lpe-mirror_symmetry.cpp +++ b/src/live_effects/lpe-mirror_symmetry.cpp @@ -43,7 +43,7 @@ LPEMirrorSymmetry::~LPEMirrorSymmetry() } void -LPEMirrorSymmetry::doOnApply (SPLPEItem *lpeitem) +LPEMirrorSymmetry::doOnApply (SPLPEItem const* lpeitem) { using namespace Geom; diff --git a/src/live_effects/lpe-mirror_symmetry.h b/src/live_effects/lpe-mirror_symmetry.h index a37e0d45c..c01d1bf6f 100644 --- a/src/live_effects/lpe-mirror_symmetry.h +++ b/src/live_effects/lpe-mirror_symmetry.h @@ -28,7 +28,7 @@ public: LPEMirrorSymmetry(LivePathEffectObject *lpeobject); virtual ~LPEMirrorSymmetry(); - virtual void doOnApply (SPLPEItem *lpeitem); + virtual void doOnApply (SPLPEItem const* lpeitem); virtual std::vector doEffect_path (std::vector const & path_in); diff --git a/src/live_effects/lpe-offset.cpp b/src/live_effects/lpe-offset.cpp index 26d42a94f..192bd17ca 100644 --- a/src/live_effects/lpe-offset.cpp +++ b/src/live_effects/lpe-offset.cpp @@ -40,7 +40,7 @@ LPEOffset::~LPEOffset() } void -LPEOffset::doOnApply(SPLPEItem *lpeitem) +LPEOffset::doOnApply(SPLPEItem const* lpeitem) { offset_pt.param_set_and_write_new_value(*(SP_SHAPE(lpeitem)->_curve->first_point())); } diff --git a/src/live_effects/lpe-offset.h b/src/live_effects/lpe-offset.h index f57d41a14..9966fd45d 100644 --- a/src/live_effects/lpe-offset.h +++ b/src/live_effects/lpe-offset.h @@ -26,7 +26,7 @@ public: LPEOffset(LivePathEffectObject *lpeobject); virtual ~LPEOffset(); - virtual void doOnApply (SPLPEItem *lpeitem); + virtual void doOnApply (SPLPEItem const* lpeitem); virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); diff --git a/src/live_effects/lpe-parallel.cpp b/src/live_effects/lpe-parallel.cpp index 4d4b0c17d..cbe3ba509 100644 --- a/src/live_effects/lpe-parallel.cpp +++ b/src/live_effects/lpe-parallel.cpp @@ -65,7 +65,7 @@ LPEParallel::~LPEParallel() } void -LPEParallel::doOnApply (SPLPEItem *lpeitem) +LPEParallel::doOnApply (SPLPEItem const* lpeitem) { SPCurve const *curve = SP_SHAPE(lpeitem)->_curve; diff --git a/src/live_effects/lpe-parallel.h b/src/live_effects/lpe-parallel.h index e23361675..ff19d690e 100644 --- a/src/live_effects/lpe-parallel.h +++ b/src/live_effects/lpe-parallel.h @@ -32,7 +32,7 @@ public: LPEParallel(LivePathEffectObject *lpeobject); virtual ~LPEParallel(); - virtual void doOnApply (SPLPEItem *lpeitem); + virtual void doOnApply (SPLPEItem const* lpeitem); virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); diff --git a/src/live_effects/lpe-perp_bisector.cpp b/src/live_effects/lpe-perp_bisector.cpp index c528ef692..95e56f1ce 100644 --- a/src/live_effects/lpe-perp_bisector.cpp +++ b/src/live_effects/lpe-perp_bisector.cpp @@ -111,7 +111,7 @@ LPEPerpBisector::~LPEPerpBisector() } void -LPEPerpBisector::doOnApply (SPLPEItem */*lpeitem*/) +LPEPerpBisector::doOnApply (SPLPEItem const*/*lpeitem*/) { /* make the path a straight line */ /** diff --git a/src/live_effects/lpe-perp_bisector.h b/src/live_effects/lpe-perp_bisector.h index f5a918028..4ff9909a4 100644 --- a/src/live_effects/lpe-perp_bisector.h +++ b/src/live_effects/lpe-perp_bisector.h @@ -37,7 +37,7 @@ public: virtual EffectType effectType () { return PERP_BISECTOR; } - void doOnApply (SPLPEItem *lpeitem); + void doOnApply (SPLPEItem const* lpeitem); virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp index b042f8d41..0533c1ed6 100644 --- a/src/live_effects/lpe-powerstroke.cpp +++ b/src/live_effects/lpe-powerstroke.cpp @@ -263,7 +263,7 @@ LPEPowerStroke::~LPEPowerStroke() void -LPEPowerStroke::doOnApply(SPLPEItem *lpeitem) +LPEPowerStroke::doOnApply(SPLPEItem const* lpeitem) { if (SP_IS_SHAPE(lpeitem)) { std::vector points; diff --git a/src/live_effects/lpe-powerstroke.h b/src/live_effects/lpe-powerstroke.h index e6c915234..7bc736820 100644 --- a/src/live_effects/lpe-powerstroke.h +++ b/src/live_effects/lpe-powerstroke.h @@ -27,7 +27,7 @@ public: virtual std::vector doEffect_path (std::vector const & path_in); - virtual void doOnApply(SPLPEItem *lpeitem); + virtual void doOnApply(SPLPEItem const* lpeitem); // methods called by path-manipulator upon edits void adjustForNewPath(std::vector const & path_in); diff --git a/src/live_effects/lpe-rough-hatches.cpp b/src/live_effects/lpe-rough-hatches.cpp index f52977fcb..14b21fe39 100644 --- a/src/live_effects/lpe-rough-hatches.cpp +++ b/src/live_effects/lpe-rough-hatches.cpp @@ -555,7 +555,7 @@ LPERoughHatches::doBeforeEffect (SPLPEItem */*lpeitem*/) void -LPERoughHatches::resetDefaults(SPItem * item) +LPERoughHatches::resetDefaults(SPItem const* item) { Effect::resetDefaults(item); diff --git a/src/live_effects/lpe-rough-hatches.h b/src/live_effects/lpe-rough-hatches.h index 5051b313a..867801e74 100644 --- a/src/live_effects/lpe-rough-hatches.h +++ b/src/live_effects/lpe-rough-hatches.h @@ -31,7 +31,7 @@ public: virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); - virtual void resetDefaults(SPItem * item); + virtual void resetDefaults(SPItem const* item); virtual void doBeforeEffect(SPLPEItem * item); diff --git a/src/live_effects/lpe-vonkoch.cpp b/src/live_effects/lpe-vonkoch.cpp index 7e4b5f5fe..ee3daff82 100644 --- a/src/live_effects/lpe-vonkoch.cpp +++ b/src/live_effects/lpe-vonkoch.cpp @@ -269,7 +269,7 @@ LPEVonKoch::doBeforeEffect (SPLPEItem *lpeitem) void -LPEVonKoch::resetDefaults(SPItem * item) +LPEVonKoch::resetDefaults(SPItem const* item) { Effect::resetDefaults(item); diff --git a/src/live_effects/lpe-vonkoch.h b/src/live_effects/lpe-vonkoch.h index 7862cdbb5..1a36ab410 100644 --- a/src/live_effects/lpe-vonkoch.h +++ b/src/live_effects/lpe-vonkoch.h @@ -51,7 +51,7 @@ public: virtual std::vector doEffect_path (std::vector const & path_in); - virtual void resetDefaults(SPItem * item); + virtual void resetDefaults(SPItem const* item); virtual void doBeforeEffect(SPLPEItem * item); -- 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 ++++++------ src/live_effects/effect.h | 14 +++++++------- src/live_effects/lpe-angle_bisector.cpp | 12 ++++++------ src/live_effects/lpe-bendpath.cpp | 2 +- src/live_effects/lpe-bendpath.h | 2 +- src/live_effects/lpe-copy_rotate.cpp | 12 ++++++------ src/live_effects/lpe-envelope.cpp | 2 +- src/live_effects/lpe-envelope.h | 2 +- src/live_effects/lpe-knot.cpp | 8 ++++---- src/live_effects/lpe-knot.h | 2 +- src/live_effects/lpe-lattice.cpp | 2 +- src/live_effects/lpe-lattice.h | 2 +- src/live_effects/lpe-line_segment.cpp | 2 +- src/live_effects/lpe-line_segment.h | 2 +- src/live_effects/lpe-parallel.cpp | 12 ++++++------ src/live_effects/lpe-perp_bisector.cpp | 12 ++++++------ src/live_effects/lpe-perspective_path.cpp | 8 ++++---- src/live_effects/lpe-perspective_path.h | 2 +- src/live_effects/lpe-rough-hatches.cpp | 2 +- src/live_effects/lpe-rough-hatches.h | 2 +- src/live_effects/lpe-skeleton.cpp | 2 +- src/live_effects/lpe-sketch.cpp | 2 +- src/live_effects/lpe-sketch.h | 2 +- src/live_effects/lpe-tangent_to_curve.cpp | 18 +++++++++--------- src/live_effects/lpe-vonkoch.cpp | 2 +- src/live_effects/lpe-vonkoch.h | 2 +- src/live_effects/lpegroupbbox.cpp | 2 +- src/live_effects/lpegroupbbox.h | 2 +- src/live_effects/parameter/originalpath.h | 2 +- src/live_effects/parameter/parameter.h | 2 +- src/live_effects/parameter/path.cpp | 2 +- src/live_effects/parameter/path.h | 2 +- src/live_effects/parameter/point.cpp | 4 ++-- src/live_effects/parameter/powerstrokepointarray.cpp | 6 +++--- src/live_effects/parameter/vector.cpp | 4 ++-- 35 files changed, 84 insertions(+), 84 deletions(-) (limited to 'src/live_effects') 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*/) { } diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index 5862a24ba..f7a7155b0 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -54,13 +54,13 @@ public: EffectType effectType() const; virtual void doOnApply (SPLPEItem const* lpeitem); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); void writeParamsToSVG(); - virtual void acceptParamPath (SPPath *param_path); + virtual void acceptParamPath (SPPath const* param_path); static int acceptsNumClicks(EffectType type); - int acceptsNumClicks() { return acceptsNumClicks(effectType()); } + int acceptsNumClicks() const { return acceptsNumClicks(effectType()); } void doAcceptPathPreparations(SPLPEItem *lpeitem); /* @@ -90,20 +90,20 @@ public: // (but spiro lpe still needs it!) virtual LPEPathFlashType pathFlashType() const { return DEFAULT; } void addHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item); - std::vector getHelperPaths(SPLPEItem *lpeitem); + std::vector getHelperPaths(SPLPEItem const* lpeitem); inline bool providesOwnFlashPaths() const { return provides_own_flash_paths || show_orig_path; } inline bool showOrigPath() const { return show_orig_path; } - Glib::ustring getName(); + Glib::ustring getName() const; Inkscape::XML::Node * getRepr(); SPDocument * getSPDoc(); LivePathEffectObject * getLPEObj() {return lpeobj;}; Parameter * getParameter(const char * key); - void readallParameters(Inkscape::XML::Node * repr); + void readallParameters(Inkscape::XML::Node const* repr); void setParameter(const gchar * key, const gchar * new_value); inline bool isVisible() const { return is_visible; } @@ -128,7 +128,7 @@ protected: virtual void addKnotHolderEntities(KnotHolder * /*knotholder*/, SPDesktop * /*desktop*/, SPItem * /*item*/) {}; - virtual void addCanvasIndicators(SPLPEItem *lpeitem, std::vector &hp_vec); + virtual void addCanvasIndicators(SPLPEItem const* lpeitem, std::vector &hp_vec); std::vector param_vector; bool _provides_knotholder_entities; diff --git a/src/live_effects/lpe-angle_bisector.cpp b/src/live_effects/lpe-angle_bisector.cpp index 8aa88f1f0..91f779ef3 100644 --- a/src/live_effects/lpe-angle_bisector.cpp +++ b/src/live_effects/lpe-angle_bisector.cpp @@ -28,14 +28,14 @@ class KnotHolderEntityLeftEnd : public LPEKnotHolderEntity { public: KnotHolderEntityLeftEnd(LPEAngleBisector* effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; class KnotHolderEntityRightEnd : public LPEKnotHolderEntity { public: KnotHolderEntityRightEnd(LPEAngleBisector* effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; } // namespace TtC @@ -125,16 +125,16 @@ KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*or } Geom::Point -KnotHolderEntityLeftEnd::knot_get() +KnotHolderEntityLeftEnd::knot_get() const { - LPEAngleBisector *lpe = dynamic_cast(_effect); + LPEAngleBisector const* lpe = dynamic_cast(_effect); return lpe->ptA - lpe->dir * lpe->length_left; } Geom::Point -KnotHolderEntityRightEnd::knot_get() +KnotHolderEntityRightEnd::knot_get() const { - LPEAngleBisector *lpe = dynamic_cast(_effect); + LPEAngleBisector const* lpe = dynamic_cast(_effect); return lpe->ptA + lpe->dir * lpe->length_right; } diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp index 59fd145d1..49660c91b 100644 --- a/src/live_effects/lpe-bendpath.cpp +++ b/src/live_effects/lpe-bendpath.cpp @@ -72,7 +72,7 @@ LPEBendPath::~LPEBendPath() } void -LPEBendPath::doBeforeEffect (SPLPEItem *lpeitem) +LPEBendPath::doBeforeEffect (SPLPEItem const* lpeitem) { // get the item bounding box original_bbox(lpeitem); diff --git a/src/live_effects/lpe-bendpath.h b/src/live_effects/lpe-bendpath.h index 0e4b3f726..3d336e2e7 100644 --- a/src/live_effects/lpe-bendpath.h +++ b/src/live_effects/lpe-bendpath.h @@ -33,7 +33,7 @@ public: LPEBendPath(LivePathEffectObject *lpeobject); virtual ~LPEBendPath(); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp index f946f0568..c1b72c3c7 100644 --- a/src/live_effects/lpe-copy_rotate.cpp +++ b/src/live_effects/lpe-copy_rotate.cpp @@ -34,14 +34,14 @@ class KnotHolderEntityStartingAngle : public LPEKnotHolderEntity { public: KnotHolderEntityStartingAngle(LPECopyRotate *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; class KnotHolderEntityRotationAngle : public LPEKnotHolderEntity { public: KnotHolderEntityRotationAngle(LPECopyRotate *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; } // namespace CR @@ -188,16 +188,16 @@ KnotHolderEntityRotationAngle::knot_set(Geom::Point const &p, Geom::Point const } Geom::Point -KnotHolderEntityStartingAngle::knot_get() +KnotHolderEntityStartingAngle::knot_get() const { - LPECopyRotate* lpe = dynamic_cast(_effect); + LPECopyRotate const *lpe = dynamic_cast(_effect); return lpe->start_pos; } Geom::Point -KnotHolderEntityRotationAngle::knot_get() +KnotHolderEntityRotationAngle::knot_get() const { - LPECopyRotate* lpe = dynamic_cast(_effect); + LPECopyRotate const *lpe = dynamic_cast(_effect); return lpe->rot_pos; } diff --git a/src/live_effects/lpe-envelope.cpp b/src/live_effects/lpe-envelope.cpp index bcd63e8cb..4f5623fba 100644 --- a/src/live_effects/lpe-envelope.cpp +++ b/src/live_effects/lpe-envelope.cpp @@ -50,7 +50,7 @@ LPEEnvelope::~LPEEnvelope() } void -LPEEnvelope::doBeforeEffect (SPLPEItem *lpeitem) +LPEEnvelope::doBeforeEffect (SPLPEItem const* lpeitem) { // get the item bounding box original_bbox(lpeitem); diff --git a/src/live_effects/lpe-envelope.h b/src/live_effects/lpe-envelope.h index 6a9fe1c0a..b5d6ceb50 100644 --- a/src/live_effects/lpe-envelope.h +++ b/src/live_effects/lpe-envelope.h @@ -31,7 +31,7 @@ public: LPEEnvelope(LivePathEffectObject *lpeobject); virtual ~LPEEnvelope(); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp index 61e457d35..27652bf0c 100644 --- a/src/live_effects/lpe-knot.cpp +++ b/src/live_effects/lpe-knot.cpp @@ -46,7 +46,7 @@ class KnotHolderEntityCrossingSwitcher : public LPEKnotHolderEntity { public: KnotHolderEntityCrossingSwitcher(LPEKnot *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_click(guint state); }; @@ -531,7 +531,7 @@ collectPathsAndWidths (SPLPEItem const *lpeitem, std::vector &paths, void -LPEKnot::doBeforeEffect (SPLPEItem *lpeitem) +LPEKnot::doBeforeEffect (SPLPEItem const* lpeitem) { using namespace Geom; original_bbox(lpeitem); @@ -631,9 +631,9 @@ KnotHolderEntityCrossingSwitcher::knot_set(Geom::Point const &p, Geom::Point con } Geom::Point -KnotHolderEntityCrossingSwitcher::knot_get() +KnotHolderEntityCrossingSwitcher::knot_get() const { - LPEKnot* lpe = dynamic_cast(_effect); + LPEKnot const *lpe = dynamic_cast(_effect); return lpe->switcher; } diff --git a/src/live_effects/lpe-knot.h b/src/live_effects/lpe-knot.h index 14c61a4e5..a25607981 100644 --- a/src/live_effects/lpe-knot.h +++ b/src/live_effects/lpe-knot.h @@ -56,7 +56,7 @@ public: LPEKnot(LivePathEffectObject *lpeobject); virtual ~LPEKnot(); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); virtual std::vector doEffect_path (std::vector const & input_path); /* the knotholder entity classes must be declared friends */ diff --git a/src/live_effects/lpe-lattice.cpp b/src/live_effects/lpe-lattice.cpp index 84fba4659..8136569e8 100644 --- a/src/live_effects/lpe-lattice.cpp +++ b/src/live_effects/lpe-lattice.cpp @@ -173,7 +173,7 @@ LPELattice::doEffect_pwd2 (Geom::Piecewise > const & pwd2 } void -LPELattice::doBeforeEffect (SPLPEItem *lpeitem) +LPELattice::doBeforeEffect (SPLPEItem const* lpeitem) { original_bbox(lpeitem); } diff --git a/src/live_effects/lpe-lattice.h b/src/live_effects/lpe-lattice.h index 521875bcf..a44dda3fd 100644 --- a/src/live_effects/lpe-lattice.h +++ b/src/live_effects/lpe-lattice.h @@ -31,7 +31,7 @@ public: LPELattice(LivePathEffectObject *lpeobject); virtual ~LPELattice(); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); diff --git a/src/live_effects/lpe-line_segment.cpp b/src/live_effects/lpe-line_segment.cpp index 6619b85ce..2e7240e25 100644 --- a/src/live_effects/lpe-line_segment.cpp +++ b/src/live_effects/lpe-line_segment.cpp @@ -43,7 +43,7 @@ LPELineSegment::~LPELineSegment() } void -LPELineSegment::doBeforeEffect (SPLPEItem *lpeitem) +LPELineSegment::doBeforeEffect (SPLPEItem const* lpeitem) { lpetool_get_limiting_bbox_corners(lpeitem->document, bboxA, bboxB); } diff --git a/src/live_effects/lpe-line_segment.h b/src/live_effects/lpe-line_segment.h index b2bb0994f..1a57688b6 100644 --- a/src/live_effects/lpe-line_segment.h +++ b/src/live_effects/lpe-line_segment.h @@ -32,7 +32,7 @@ public: LPELineSegment(LivePathEffectObject *lpeobject); virtual ~LPELineSegment(); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); virtual std::vector doEffect_path (std::vector const & path_in); diff --git a/src/live_effects/lpe-parallel.cpp b/src/live_effects/lpe-parallel.cpp index cbe3ba509..bb37fd42c 100644 --- a/src/live_effects/lpe-parallel.cpp +++ b/src/live_effects/lpe-parallel.cpp @@ -32,14 +32,14 @@ class KnotHolderEntityLeftEnd : public LPEKnotHolderEntity { public: KnotHolderEntityLeftEnd(LPEParallel *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; class KnotHolderEntityRightEnd : public LPEKnotHolderEntity { public: KnotHolderEntityRightEnd(LPEParallel *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; } // namespace Pl @@ -143,16 +143,16 @@ KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*or } Geom::Point -KnotHolderEntityLeftEnd::knot_get() +KnotHolderEntityLeftEnd::knot_get() const { - LPEParallel *lpe = dynamic_cast(_effect); + LPEParallel const *lpe = dynamic_cast(_effect); return lpe->C; } Geom::Point -KnotHolderEntityRightEnd::knot_get() +KnotHolderEntityRightEnd::knot_get() const { - LPEParallel *lpe = dynamic_cast(_effect); + LPEParallel const *lpe = dynamic_cast(_effect); return lpe->D; } diff --git a/src/live_effects/lpe-perp_bisector.cpp b/src/live_effects/lpe-perp_bisector.cpp index 95e56f1ce..c2a25a187 100644 --- a/src/live_effects/lpe-perp_bisector.cpp +++ b/src/live_effects/lpe-perp_bisector.cpp @@ -38,25 +38,25 @@ class KnotHolderEntityLeftEnd : public KnotHolderEntityEnd { public: KnotHolderEntityLeftEnd(LPEPerpBisector *effect) : KnotHolderEntityEnd(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; class KnotHolderEntityRightEnd : public KnotHolderEntityEnd { public: KnotHolderEntityRightEnd(LPEPerpBisector *effect) : KnotHolderEntityEnd(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; Geom::Point -KnotHolderEntityLeftEnd::knot_get() { - LPEPerpBisector *lpe = dynamic_cast(_effect); +KnotHolderEntityLeftEnd::knot_get() const { + LPEPerpBisector const* lpe = dynamic_cast(_effect); return Geom::Point(lpe->C); } Geom::Point -KnotHolderEntityRightEnd::knot_get() { - LPEPerpBisector *lpe = dynamic_cast(_effect); +KnotHolderEntityRightEnd::knot_get() const { + LPEPerpBisector const* lpe = dynamic_cast(_effect); return Geom::Point(lpe->D); } diff --git a/src/live_effects/lpe-perspective_path.cpp b/src/live_effects/lpe-perspective_path.cpp index aeee77482..c255f8665 100644 --- a/src/live_effects/lpe-perspective_path.cpp +++ b/src/live_effects/lpe-perspective_path.cpp @@ -36,7 +36,7 @@ class KnotHolderEntityOffset : public LPEKnotHolderEntity public: KnotHolderEntityOffset(LPEPerspectivePath *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; } // namespace PP @@ -71,7 +71,7 @@ LPEPerspectivePath::~LPEPerspectivePath() } void -LPEPerspectivePath::doBeforeEffect (SPLPEItem *lpeitem) +LPEPerspectivePath::doBeforeEffect (SPLPEItem const* lpeitem) { original_bbox(lpeitem, true); } @@ -165,9 +165,9 @@ KnotHolderEntityOffset::knot_set(Geom::Point const &p, Geom::Point const &origin } Geom::Point -KnotHolderEntityOffset::knot_get() +KnotHolderEntityOffset::knot_get() const { - LPEPerspectivePath* lpe = dynamic_cast(_effect); + LPEPerspectivePath const *lpe = dynamic_cast(_effect); return lpe->orig + Geom::Point(lpe->offsetx, -lpe->offsety); } diff --git a/src/live_effects/lpe-perspective_path.h b/src/live_effects/lpe-perspective_path.h index 14321f52e..a9ee004f9 100644 --- a/src/live_effects/lpe-perspective_path.h +++ b/src/live_effects/lpe-perspective_path.h @@ -34,7 +34,7 @@ public: LPEPerspectivePath(LivePathEffectObject *lpeobject); virtual ~LPEPerspectivePath(); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); diff --git a/src/live_effects/lpe-rough-hatches.cpp b/src/live_effects/lpe-rough-hatches.cpp index 14b21fe39..96b0bb0ae 100644 --- a/src/live_effects/lpe-rough-hatches.cpp +++ b/src/live_effects/lpe-rough-hatches.cpp @@ -539,7 +539,7 @@ LPERoughHatches::smoothSnake(std::vector > const &linearSnake } void -LPERoughHatches::doBeforeEffect (SPLPEItem */*lpeitem*/) +LPERoughHatches::doBeforeEffect (SPLPEItem const*/*lpeitem*/) { using namespace Geom; top_edge_variation.resetRandomizer(); diff --git a/src/live_effects/lpe-rough-hatches.h b/src/live_effects/lpe-rough-hatches.h index 867801e74..f8454e1ea 100644 --- a/src/live_effects/lpe-rough-hatches.h +++ b/src/live_effects/lpe-rough-hatches.h @@ -33,7 +33,7 @@ public: virtual void resetDefaults(SPItem const* item); - virtual void doBeforeEffect(SPLPEItem * item); + virtual void doBeforeEffect(SPLPEItem const* item); std::vector generateLevels(Geom::Interval const &domain, double x_org); diff --git a/src/live_effects/lpe-skeleton.cpp b/src/live_effects/lpe-skeleton.cpp index 65faef216..c61e9773f 100644 --- a/src/live_effects/lpe-skeleton.cpp +++ b/src/live_effects/lpe-skeleton.cpp @@ -95,7 +95,7 @@ class KnotHolderEntityMyHandle : public LPEKnotHolderEntity public: // the set() and get() methods must be implemented, click() is optional virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; //virtual void knot_click(guint state); }; diff --git a/src/live_effects/lpe-sketch.cpp b/src/live_effects/lpe-sketch.cpp index ccc508144..8ad0e616f 100644 --- a/src/live_effects/lpe-sketch.cpp +++ b/src/live_effects/lpe-sketch.cpp @@ -362,7 +362,7 @@ LPESketch::doEffect_pwd2 (Geom::Piecewise > const & pwd2_ } void -LPESketch::doBeforeEffect (SPLPEItem */*lpeitem*/) +LPESketch::doBeforeEffect (SPLPEItem const*/*lpeitem*/) { //init random parameters. parallel_offset.resetRandomizer(); diff --git a/src/live_effects/lpe-sketch.h b/src/live_effects/lpe-sketch.h index b95f57682..3bef0cf5e 100644 --- a/src/live_effects/lpe-sketch.h +++ b/src/live_effects/lpe-sketch.h @@ -31,7 +31,7 @@ public: virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); private: // add the parameters for your effect here: diff --git a/src/live_effects/lpe-tangent_to_curve.cpp b/src/live_effects/lpe-tangent_to_curve.cpp index b40d404ae..dbebdf7fb 100644 --- a/src/live_effects/lpe-tangent_to_curve.cpp +++ b/src/live_effects/lpe-tangent_to_curve.cpp @@ -36,14 +36,14 @@ class KnotHolderEntityAttachPt : public LPEKnotHolderEntity { public: KnotHolderEntityAttachPt(LPETangentToCurve *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; class KnotHolderEntityLeftEnd : public LPEKnotHolderEntity { public: KnotHolderEntityLeftEnd(LPETangentToCurve *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; class KnotHolderEntityRightEnd : public LPEKnotHolderEntity @@ -51,7 +51,7 @@ class KnotHolderEntityRightEnd : public LPEKnotHolderEntity public: KnotHolderEntityRightEnd(LPETangentToCurve *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; } // namespace TtC @@ -172,23 +172,23 @@ KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*or } Geom::Point -KnotHolderEntityAttachPt::knot_get() +KnotHolderEntityAttachPt::knot_get() const { - LPETangentToCurve* lpe = dynamic_cast(_effect); + LPETangentToCurve const *lpe = dynamic_cast(_effect); return lpe->ptA; } Geom::Point -KnotHolderEntityLeftEnd::knot_get() +KnotHolderEntityLeftEnd::knot_get() const { - LPETangentToCurve *lpe = dynamic_cast(_effect); + LPETangentToCurve const *lpe = dynamic_cast(_effect); return lpe->C; } Geom::Point -KnotHolderEntityRightEnd::knot_get() +KnotHolderEntityRightEnd::knot_get() const { - LPETangentToCurve *lpe = dynamic_cast(_effect); + LPETangentToCurve const *lpe = dynamic_cast(_effect); return lpe->D; } diff --git a/src/live_effects/lpe-vonkoch.cpp b/src/live_effects/lpe-vonkoch.cpp index ee3daff82..f7b2beeba 100644 --- a/src/live_effects/lpe-vonkoch.cpp +++ b/src/live_effects/lpe-vonkoch.cpp @@ -241,7 +241,7 @@ LPEVonKoch::doEffect_path (std::vector const & path_in) */ void -LPEVonKoch::doBeforeEffect (SPLPEItem *lpeitem) +LPEVonKoch::doBeforeEffect (SPLPEItem const* lpeitem) { using namespace Geom; original_bbox(lpeitem); diff --git a/src/live_effects/lpe-vonkoch.h b/src/live_effects/lpe-vonkoch.h index 1a36ab410..2ea7c8169 100644 --- a/src/live_effects/lpe-vonkoch.h +++ b/src/live_effects/lpe-vonkoch.h @@ -53,7 +53,7 @@ public: virtual void resetDefaults(SPItem const* item); - virtual void doBeforeEffect(SPLPEItem * item); + virtual void doBeforeEffect(SPLPEItem const* item); //Usefull?? // protected: diff --git a/src/live_effects/lpegroupbbox.cpp b/src/live_effects/lpegroupbbox.cpp index e2378265a..2a1b70a6a 100644 --- a/src/live_effects/lpegroupbbox.cpp +++ b/src/live_effects/lpegroupbbox.cpp @@ -22,7 +22,7 @@ namespace LivePathEffect { * or of the transformed lpeitem (\c absolute = \c true) using sp_item_i2doc_affine. * @post Updated values of boundingbox_X and boundingbox_Y. These intervals are set to empty intervals when the precondition is not met. */ -void GroupBBoxEffect::original_bbox(SPLPEItem *lpeitem, bool absolute) +void GroupBBoxEffect::original_bbox(SPLPEItem const* lpeitem, bool absolute) { // Get item bounding box Geom::Affine transform; diff --git a/src/live_effects/lpegroupbbox.h b/src/live_effects/lpegroupbbox.h index 57577d20f..cc14203d1 100644 --- a/src/live_effects/lpegroupbbox.h +++ b/src/live_effects/lpegroupbbox.h @@ -22,7 +22,7 @@ protected: Geom::Interval boundingbox_Y; //This sets boundingbox_X and boundingbox_Y - void original_bbox(SPLPEItem *lpeitem, bool absolute = false); + void original_bbox(SPLPEItem const* lpeitem, bool absolute = false); }; }; //namespace LivePathEffect diff --git a/src/live_effects/parameter/originalpath.h b/src/live_effects/parameter/originalpath.h index 7dd17edb0..b3feec41f 100644 --- a/src/live_effects/parameter/originalpath.h +++ b/src/live_effects/parameter/originalpath.h @@ -31,7 +31,7 @@ public: /** Disable the canvas indicators of parent class by overriding this method */ virtual void param_editOncanvas(SPItem * /*item*/, SPDesktop * /*dt*/) {}; /** Disable the canvas indicators of parent class by overriding this method */ - virtual void addCanvasIndicators(SPLPEItem * /*lpeitem*/, std::vector & /*hp_vec*/) {}; + virtual void addCanvasIndicators(SPLPEItem const* /*lpeitem*/, std::vector & /*hp_vec*/) {}; protected: virtual void linked_modified_callback(SPObject *linked_obj, guint flags); diff --git a/src/live_effects/parameter/parameter.h b/src/live_effects/parameter/parameter.h index 526708ed7..785ada92e 100644 --- a/src/live_effects/parameter/parameter.h +++ b/src/live_effects/parameter/parameter.h @@ -61,7 +61,7 @@ public: // overload these for your particular parameter to make it provide knotholder handles or canvas helperpaths virtual bool providesKnotHolderEntities() const { return false; } virtual void addKnotHolderEntities(KnotHolder */*knotholder*/, SPDesktop */*desktop*/, SPItem */*item*/) {}; - virtual void addCanvasIndicators(SPLPEItem */*lpeitem*/, std::vector &/*hp_vec*/) {}; + virtual void addCanvasIndicators(SPLPEItem const*/*lpeitem*/, std::vector &/*hp_vec*/) {}; virtual void param_editOncanvas(SPItem * /*item*/, SPDesktop * /*dt*/) {}; virtual void param_setup_nodepath(Inkscape::NodePath::Path */*np*/) {}; diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index d076cc5d0..eca0d7a22 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -231,7 +231,7 @@ PathParam::param_setup_nodepath(Inkscape::NodePath::Path *) } void -PathParam::addCanvasIndicators(SPLPEItem */*lpeitem*/, std::vector &hp_vec) +PathParam::addCanvasIndicators(SPLPEItem const*/*lpeitem*/, std::vector &hp_vec) { hp_vec.push_back(_pathvector); } diff --git a/src/live_effects/parameter/path.h b/src/live_effects/parameter/path.h index d48b5422d..112a1ea13 100644 --- a/src/live_effects/parameter/path.h +++ b/src/live_effects/parameter/path.h @@ -46,7 +46,7 @@ public: virtual void param_editOncanvas(SPItem * item, SPDesktop * dt); virtual void param_setup_nodepath(Inkscape::NodePath::Path *np); - virtual void addCanvasIndicators(SPLPEItem *lpeitem, std::vector &hp_vec); + virtual void addCanvasIndicators(SPLPEItem const* lpeitem, std::vector &hp_vec); virtual void param_transform_multiply(Geom::Affine const& /*postmul*/, bool /*set*/); diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp index 2be87e048..53866f278 100644 --- a/src/live_effects/parameter/point.cpp +++ b/src/live_effects/parameter/point.cpp @@ -133,7 +133,7 @@ public: virtual ~PointParamKnotHolderEntity() {} virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_click(guint state); private: @@ -149,7 +149,7 @@ PointParamKnotHolderEntity::knot_set(Geom::Point const &p, Geom::Point const &/* } Geom::Point -PointParamKnotHolderEntity::knot_get() +PointParamKnotHolderEntity::knot_get() const { return *pparam; } diff --git a/src/live_effects/parameter/powerstrokepointarray.cpp b/src/live_effects/parameter/powerstrokepointarray.cpp index 93161ec0d..fecdfeda8 100644 --- a/src/live_effects/parameter/powerstrokepointarray.cpp +++ b/src/live_effects/parameter/powerstrokepointarray.cpp @@ -124,11 +124,11 @@ public: virtual ~PowerStrokePointArrayParamKnotHolderEntity() {} virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_click(guint state); /** Checks whether the index falls within the size of the parameter's vector */ - bool valid_index(unsigned int index) { + bool valid_index(unsigned int index) const { return (_pparam->_vector.size() > index); }; @@ -164,7 +164,7 @@ PowerStrokePointArrayParamKnotHolderEntity::knot_set(Geom::Point const &p, Geom: } Geom::Point -PowerStrokePointArrayParamKnotHolderEntity::knot_get() +PowerStrokePointArrayParamKnotHolderEntity::knot_get() const { using namespace Geom; diff --git a/src/live_effects/parameter/vector.cpp b/src/live_effects/parameter/vector.cpp index a20c46042..edd6b863f 100644 --- a/src/live_effects/parameter/vector.cpp +++ b/src/live_effects/parameter/vector.cpp @@ -154,7 +154,7 @@ public: param->setOrigin(s); sp_lpe_item_update_patheffect(SP_LPE_ITEM(item), false, false); }; - virtual Geom::Point knot_get(){ + virtual Geom::Point knot_get() const { return param->origin; }; virtual void knot_click(guint /*state*/){ @@ -176,7 +176,7 @@ public: param->setVector(s); sp_lpe_item_update_patheffect(SP_LPE_ITEM(item), false, false); }; - virtual Geom::Point knot_get(){ + virtual Geom::Point knot_get() const { return param->origin + param->vector; }; virtual void knot_click(guint /*state*/){ -- cgit v1.2.3