diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2013-01-17 20:02:50 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2013-01-17 20:02:50 +0000 |
| commit | bf58d4cb9c86682d1416c64378d1cfc8a95554e8 (patch) | |
| tree | 573e206bdd797d1ca26d62a55dbff3078b0fe292 /src | |
| parent | more const happiness (and removal of duplicate code in sp-object.h) (diff) | |
| download | inkscape-bf58d4cb9c86682d1416c64378d1cfc8a95554e8.tar.gz inkscape-bf58d4cb9c86682d1416c64378d1cfc8a95554e8.zip | |
const ....
(bzr r12039)
Diffstat (limited to 'src')
44 files changed, 211 insertions, 211 deletions
diff --git a/src/knot-holder-entity.cpp b/src/knot-holder-entity.cpp index 75732f805..043685460 100644 --- a/src/knot-holder-entity.cpp +++ b/src/knot-holder-entity.cpp @@ -133,13 +133,13 @@ KnotHolderEntity::snap_knot_position_constrained(Geom::Point const &p, Inkscape: /* TODO: this pattern manipulation is not able to handle general transformation matrices. Only matrices that are the result of a pure scale times a pure rotation. */ -static gdouble sp_pattern_extract_theta(SPPattern *pat) +static gdouble sp_pattern_extract_theta(SPPattern const *pat) { Geom::Affine transf = pat->patternTransform; return Geom::atan2(transf.xAxis()); } -static Geom::Point sp_pattern_extract_scale(SPPattern *pat) +static Geom::Point sp_pattern_extract_scale(SPPattern const *pat) { Geom::Affine transf = pat->patternTransform; return Geom::Point( transf.expansionX(), transf.expansionY() ); @@ -175,18 +175,18 @@ PatternKnotHolderEntityXY::knot_set(Geom::Point const &p, Geom::Point const &ori } Geom::Point -PatternKnotHolderEntityXY::knot_get() +PatternKnotHolderEntityXY::knot_get() const { SPPattern const *pat = SP_PATTERN(SP_STYLE_FILL_SERVER(SP_OBJECT(item)->style)); return sp_pattern_extract_trans(pat); } Geom::Point -PatternKnotHolderEntityAngle::knot_get() +PatternKnotHolderEntityAngle::knot_get() const { - SPPattern *pat = SP_PATTERN(SP_STYLE_FILL_SERVER(SP_OBJECT(item)->style)); + SPPattern const *pat = SP_PATTERN(SP_STYLE_FILL_SERVER(SP_OBJECT(item)->style)); - gdouble x = (pattern_width(pat)); + gdouble x = pattern_width(pat); gdouble y = 0; Geom::Point delta = Geom::Point(x,y); Geom::Point scale = sp_pattern_extract_scale(pat); @@ -258,9 +258,9 @@ PatternKnotHolderEntityScale::knot_set(Geom::Point const &p, Geom::Point const & Geom::Point -PatternKnotHolderEntityScale::knot_get() +PatternKnotHolderEntityScale::knot_get() const { - SPPattern *pat = SP_PATTERN(SP_STYLE_FILL_SERVER(SP_OBJECT(item)->style)); + SPPattern const *pat = SP_PATTERN(SP_STYLE_FILL_SERVER(SP_OBJECT(item)->style)); gdouble x = pattern_width(pat); gdouble y = pattern_height(pat); diff --git a/src/knot-holder-entity.h b/src/knot-holder-entity.h index 09d70f8c9..a4e6528cf 100644 --- a/src/knot-holder-entity.h +++ b/src/knot-holder-entity.h @@ -59,7 +59,7 @@ public: /* the get/set/click handlers are virtual functions; each handler class for a knot should be derived from KnotHolderEntity and override these functions */ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state) = 0; - virtual Geom::Point knot_get() = 0; + virtual Geom::Point knot_get() const = 0; virtual void knot_click(guint /*state*/) {} void update_knot(); @@ -101,19 +101,19 @@ protected: class PatternKnotHolderEntityXY : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; class PatternKnotHolderEntityAngle : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; class PatternKnotHolderEntityScale : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; 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<Geom::D2<Geom::SBasis> > const & pwd2_in) } void -Effect::readallParameters(Inkscape::XML::Node * repr) +Effect::readallParameters(Inkscape::XML::Node const* repr) { std::vector<Parameter *>::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<Geom::PathVector> -Effect::getHelperPaths(SPLPEItem *lpeitem) +Effect::getHelperPaths(SPLPEItem const* lpeitem) { std::vector<Geom::PathVector> 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<Geom::PathVector> &/*hp_vec*/) +Effect::addCanvasIndicators(SPLPEItem const*/*lpeitem*/, std::vector<Geom::PathVector> &/*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<Geom::PathVector> getHelperPaths(SPLPEItem *lpeitem); + std::vector<Geom::PathVector> 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<Geom::PathVector> &hp_vec); + virtual void addCanvasIndicators(SPLPEItem const* lpeitem, std::vector<Geom::PathVector> &hp_vec); std::vector<Parameter *> 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<LPEAngleBisector *>(_effect); + LPEAngleBisector const* lpe = dynamic_cast<LPEAngleBisector const*>(_effect); return lpe->ptA - lpe->dir * lpe->length_left; } Geom::Point -KnotHolderEntityRightEnd::knot_get() +KnotHolderEntityRightEnd::knot_get() const { - LPEAngleBisector *lpe = dynamic_cast<LPEAngleBisector *>(_effect); + LPEAngleBisector const* lpe = dynamic_cast<LPEAngleBisector const*>(_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<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > 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<LPECopyRotate *>(_effect); + LPECopyRotate const *lpe = dynamic_cast<LPECopyRotate const*>(_effect); return lpe->start_pos; } Geom::Point -KnotHolderEntityRotationAngle::knot_get() +KnotHolderEntityRotationAngle::knot_get() const { - LPECopyRotate* lpe = dynamic_cast<LPECopyRotate *>(_effect); + LPECopyRotate const *lpe = dynamic_cast<LPECopyRotate const*>(_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<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > 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<Geom::Path> &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<LPEKnot *>(_effect); + LPEKnot const *lpe = dynamic_cast<LPEKnot const*>(_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<Geom::Path> doEffect_path (std::vector<Geom::Path> 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<Geom::D2<Geom::SBasis> > 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<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > 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<Geom::Path> doEffect_path (std::vector<Geom::Path> 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<LPEParallel *>(_effect); + LPEParallel const *lpe = dynamic_cast<LPEParallel const*>(_effect); return lpe->C; } Geom::Point -KnotHolderEntityRightEnd::knot_get() +KnotHolderEntityRightEnd::knot_get() const { - LPEParallel *lpe = dynamic_cast<LPEParallel *>(_effect); + LPEParallel const *lpe = dynamic_cast<LPEParallel const*>(_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<LPEPerpBisector *>(_effect); +KnotHolderEntityLeftEnd::knot_get() const { + LPEPerpBisector const* lpe = dynamic_cast<LPEPerpBisector const*>(_effect); return Geom::Point(lpe->C); } Geom::Point -KnotHolderEntityRightEnd::knot_get() { - LPEPerpBisector *lpe = dynamic_cast<LPEPerpBisector *>(_effect); +KnotHolderEntityRightEnd::knot_get() const { + LPEPerpBisector const* lpe = dynamic_cast<LPEPerpBisector const*>(_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<LPEPerspectivePath *>(_effect); + LPEPerspectivePath const *lpe = dynamic_cast<LPEPerspectivePath const*>(_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<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > 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<std::vector<Point> > 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<double> 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<Geom::D2<Geom::SBasis> > 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<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > 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<LPETangentToCurve *>(_effect); + LPETangentToCurve const *lpe = dynamic_cast<LPETangentToCurve const*>(_effect); return lpe->ptA; } Geom::Point -KnotHolderEntityLeftEnd::knot_get() +KnotHolderEntityLeftEnd::knot_get() const { - LPETangentToCurve *lpe = dynamic_cast<LPETangentToCurve *>(_effect); + LPETangentToCurve const *lpe = dynamic_cast<LPETangentToCurve const*>(_effect); return lpe->C; } Geom::Point -KnotHolderEntityRightEnd::knot_get() +KnotHolderEntityRightEnd::knot_get() const { - LPETangentToCurve *lpe = dynamic_cast<LPETangentToCurve *>(_effect); + LPETangentToCurve const *lpe = dynamic_cast<LPETangentToCurve const*>(_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<Geom::Path> 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<Geom::PathVector> & /*hp_vec*/) {}; + virtual void addCanvasIndicators(SPLPEItem const* /*lpeitem*/, std::vector<Geom::PathVector> & /*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<Geom::PathVector> &/*hp_vec*/) {}; + virtual void addCanvasIndicators(SPLPEItem const*/*lpeitem*/, std::vector<Geom::PathVector> &/*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<Geom::PathVector> &hp_vec) +PathParam::addCanvasIndicators(SPLPEItem const*/*lpeitem*/, std::vector<Geom::PathVector> &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<Geom::PathVector> &hp_vec); + virtual void addCanvasIndicators(SPLPEItem const* lpeitem, std::vector<Geom::PathVector> &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*/){ diff --git a/src/object-edit.cpp b/src/object-edit.cpp index 1c7f76a7f..54aef2b71 100644 --- a/src/object-edit.cpp +++ b/src/object-edit.cpp @@ -95,7 +95,7 @@ KnotHolder *createKnotHolder(SPItem *item, SPDesktop *desktop) /* handle for horizontal rounding radius */ class RectKnotHolderEntityRX : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); virtual void knot_click(guint state); }; @@ -103,7 +103,7 @@ public: /* handle for vertical rounding radius */ class RectKnotHolderEntityRY : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); virtual void knot_click(guint state); }; @@ -111,7 +111,7 @@ public: /* handle for width/height adjustment */ class RectKnotHolderEntityWH : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); protected: @@ -121,12 +121,12 @@ protected: /* handle for x/y adjustment */ class RectKnotHolderEntityXY : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; Geom::Point -RectKnotHolderEntityRX::knot_get() +RectKnotHolderEntityRX::knot_get() const { SPRect *rect = SP_RECT(item); @@ -175,7 +175,7 @@ RectKnotHolderEntityRX::knot_click(guint state) } Geom::Point -RectKnotHolderEntityRY::knot_get() +RectKnotHolderEntityRY::knot_get() const { SPRect *rect = SP_RECT(item); @@ -247,7 +247,7 @@ static void sp_rect_clamp_radii(SPRect *rect) } Geom::Point -RectKnotHolderEntityWH::knot_get() +RectKnotHolderEntityWH::knot_get() const { SPRect *rect = SP_RECT(item); @@ -334,7 +334,7 @@ RectKnotHolderEntityWH::knot_set(Geom::Point const &p, Geom::Point const &origin } Geom::Point -RectKnotHolderEntityXY::knot_get() +RectKnotHolderEntityXY::knot_get() const { SPRect *rect = SP_RECT(item); @@ -467,15 +467,15 @@ RectKnotHolder::RectKnotHolder(SPDesktop *desktop, SPItem *item, SPKnotHolderRel class Box3DKnotHolderEntity : public KnotHolderEntity { public: - virtual Geom::Point knot_get() = 0; + virtual Geom::Point knot_get() const = 0; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state) = 0; - Geom::Point knot_get_generic(SPItem *item, unsigned int knot_id); + Geom::Point knot_get_generic(SPItem *item, unsigned int knot_id) const; void knot_set_generic(SPItem *item, unsigned int knot_id, Geom::Point const &p, guint state); }; Geom::Point -Box3DKnotHolderEntity::knot_get_generic(SPItem *item, unsigned int knot_id) +Box3DKnotHolderEntity::knot_get_generic(SPItem *item, unsigned int knot_id) const { return box3d_get_corner_screen(SP_BOX3D(item), knot_id); } @@ -503,108 +503,108 @@ Box3DKnotHolderEntity::knot_set_generic(SPItem *item, unsigned int knot_id, Geom class Box3DKnotHolderEntity0 : public Box3DKnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; class Box3DKnotHolderEntity1 : public Box3DKnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; class Box3DKnotHolderEntity2 : public Box3DKnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; class Box3DKnotHolderEntity3 : public Box3DKnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; class Box3DKnotHolderEntity4 : public Box3DKnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; class Box3DKnotHolderEntity5 : public Box3DKnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; class Box3DKnotHolderEntity6 : public Box3DKnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; class Box3DKnotHolderEntity7 : public Box3DKnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; class Box3DKnotHolderEntityCenter : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; Geom::Point -Box3DKnotHolderEntity0::knot_get() +Box3DKnotHolderEntity0::knot_get() const { return knot_get_generic(item, 0); } Geom::Point -Box3DKnotHolderEntity1::knot_get() +Box3DKnotHolderEntity1::knot_get() const { return knot_get_generic(item, 1); } Geom::Point -Box3DKnotHolderEntity2::knot_get() +Box3DKnotHolderEntity2::knot_get() const { return knot_get_generic(item, 2); } Geom::Point -Box3DKnotHolderEntity3::knot_get() +Box3DKnotHolderEntity3::knot_get() const { return knot_get_generic(item, 3); } Geom::Point -Box3DKnotHolderEntity4::knot_get() +Box3DKnotHolderEntity4::knot_get() const { return knot_get_generic(item, 4); } Geom::Point -Box3DKnotHolderEntity5::knot_get() +Box3DKnotHolderEntity5::knot_get() const { return knot_get_generic(item, 5); } Geom::Point -Box3DKnotHolderEntity6::knot_get() +Box3DKnotHolderEntity6::knot_get() const { return knot_get_generic(item, 6); } Geom::Point -Box3DKnotHolderEntity7::knot_get() +Box3DKnotHolderEntity7::knot_get() const { return knot_get_generic(item, 7); } Geom::Point -Box3DKnotHolderEntityCenter::knot_get() +Box3DKnotHolderEntityCenter::knot_get() const { return box3d_get_center_screen(SP_BOX3D(item)); } @@ -738,28 +738,28 @@ Box3DKnotHolder::Box3DKnotHolder(SPDesktop *desktop, SPItem *item, SPKnotHolderR class ArcKnotHolderEntityStart : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); virtual void knot_click(guint state); }; class ArcKnotHolderEntityEnd : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); virtual void knot_click(guint state); }; class ArcKnotHolderEntityRX : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); virtual void knot_click(guint state); }; class ArcKnotHolderEntityRY : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); virtual void knot_click(guint state); }; @@ -806,9 +806,9 @@ ArcKnotHolderEntityStart::knot_set(Geom::Point const &p, Geom::Point const &/*or } Geom::Point -ArcKnotHolderEntityStart::knot_get() +ArcKnotHolderEntityStart::knot_get() const { - SPGenericEllipse *ge = SP_GENERICELLIPSE(item); + SPGenericEllipse const *ge = SP_GENERICELLIPSE(item); SPArc *arc = SP_ARC(item); return sp_arc_get_xy(arc, ge->start); @@ -849,9 +849,9 @@ ArcKnotHolderEntityEnd::knot_set(Geom::Point const &p, Geom::Point const &/*orig } Geom::Point -ArcKnotHolderEntityEnd::knot_get() +ArcKnotHolderEntityEnd::knot_get() const { - SPGenericEllipse *ge = SP_GENERICELLIPSE(item); + SPGenericEllipse const *ge = SP_GENERICELLIPSE(item); SPArc *arc = SP_ARC(item); return sp_arc_get_xy(arc, ge->end); @@ -887,9 +887,9 @@ ArcKnotHolderEntityRX::knot_set(Geom::Point const &p, Geom::Point const &/*origi } Geom::Point -ArcKnotHolderEntityRX::knot_get() +ArcKnotHolderEntityRX::knot_get() const { - SPGenericEllipse *ge = SP_GENERICELLIPSE(item); + SPGenericEllipse const *ge = SP_GENERICELLIPSE(item); return (Geom::Point(ge->cx.computed, ge->cy.computed) - Geom::Point(ge->rx.computed, 0)); } @@ -922,9 +922,9 @@ ArcKnotHolderEntityRY::knot_set(Geom::Point const &p, Geom::Point const &/*origi } Geom::Point -ArcKnotHolderEntityRY::knot_get() +ArcKnotHolderEntityRY::knot_get() const { - SPGenericEllipse *ge = SP_GENERICELLIPSE(item); + SPGenericEllipse const *ge = SP_GENERICELLIPSE(item); return (Geom::Point(ge->cx.computed, ge->cy.computed) - Geom::Point(0, ge->ry.computed)); } @@ -978,14 +978,14 @@ ArcKnotHolder::ArcKnotHolder(SPDesktop *desktop, SPItem *item, SPKnotHolderRelea class StarKnotHolderEntity1 : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); virtual void knot_click(guint state); }; class StarKnotHolderEntity2 : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); virtual void knot_click(guint state); }; @@ -1046,22 +1046,22 @@ StarKnotHolderEntity2::knot_set(Geom::Point const &p, Geom::Point const &/*origi } Geom::Point -StarKnotHolderEntity1::knot_get() +StarKnotHolderEntity1::knot_get() const { g_assert(item != NULL); - SPStar *star = SP_STAR(item); + SPStar const *star = SP_STAR(item); return sp_star_get_xy(star, SP_STAR_POINT_KNOT1, 0); } Geom::Point -StarKnotHolderEntity2::knot_get() +StarKnotHolderEntity2::knot_get() const { g_assert(item != NULL); - SPStar *star = SP_STAR(item); + SPStar const *star = SP_STAR(item); return sp_star_get_xy(star, SP_STAR_POINT_KNOT2, 0); } @@ -1122,14 +1122,14 @@ StarKnotHolder::StarKnotHolder(SPDesktop *desktop, SPItem *item, SPKnotHolderRel class SpiralKnotHolderEntityInner : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); virtual void knot_click(guint state); }; class SpiralKnotHolderEntityOuter : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; @@ -1264,17 +1264,17 @@ SpiralKnotHolderEntityOuter::knot_set(Geom::Point const &p, Geom::Point const &/ } Geom::Point -SpiralKnotHolderEntityInner::knot_get() +SpiralKnotHolderEntityInner::knot_get() const { - SPSpiral *spiral = SP_SPIRAL(item); + SPSpiral const *spiral = SP_SPIRAL(item); return sp_spiral_get_xy(spiral, spiral->t0); } Geom::Point -SpiralKnotHolderEntityOuter::knot_get() +SpiralKnotHolderEntityOuter::knot_get() const { - SPSpiral *spiral = SP_SPIRAL(item); + SPSpiral const *spiral = SP_SPIRAL(item); return sp_spiral_get_xy(spiral, 1.0); } @@ -1317,7 +1317,7 @@ SpiralKnotHolder::SpiralKnotHolder(SPDesktop *desktop, SPItem *item, SPKnotHolde class OffsetKnotHolderEntity : public KnotHolderEntity { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; @@ -1335,9 +1335,9 @@ OffsetKnotHolderEntity::knot_set(Geom::Point const &p, Geom::Point const &/*orig Geom::Point -OffsetKnotHolderEntity::knot_get() +OffsetKnotHolderEntity::knot_get() const { - SPOffset *offset = SP_OFFSET(item); + SPOffset const *offset = SP_OFFSET(item); Geom::Point np; sp_offset_top_point(offset,&np); @@ -1360,14 +1360,14 @@ OffsetKnotHolder::OffsetKnotHolder(SPDesktop *desktop, SPItem *item, SPKnotHolde // sense logically. class FlowtextKnotHolderEntity : public RectKnotHolderEntityWH { public: - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); }; Geom::Point -FlowtextKnotHolderEntity::knot_get() +FlowtextKnotHolderEntity::knot_get() const { - SPRect *rect = SP_RECT(item); + SPRect const *rect = SP_RECT(item); return Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed + rect->height.computed); } diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp index b98399171..bc8a46252 100644 --- a/src/sp-offset.cpp +++ b/src/sp-offset.cpp @@ -941,7 +941,7 @@ sp_offset_distance_to_original (SPOffset * offset, Geom::Point px) * \return the topmost point on the offset. */ void -sp_offset_top_point (SPOffset * offset, Geom::Point *px) +sp_offset_top_point (SPOffset const * offset, Geom::Point *px) { (*px) = Geom::Point(0, 0); if (offset == NULL) diff --git a/src/sp-offset.h b/src/sp-offset.h index ec8c2cf29..4e245f952 100644 --- a/src/sp-offset.h +++ b/src/sp-offset.h @@ -88,7 +88,7 @@ struct SPOffsetClass GType sp_offset_get_type (void); double sp_offset_distance_to_original (SPOffset * offset, Geom::Point px); -void sp_offset_top_point (SPOffset * offset, Geom::Point *px); +void sp_offset_top_point (SPOffset const *offset, Geom::Point *px); SPItem *sp_offset_get_source (SPOffset *offset); diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp index 137864101..f18199e96 100644 --- a/src/sp-pattern.cpp +++ b/src/sp-pattern.cpp @@ -515,73 +515,73 @@ SPPattern *pattern_getroot(SPPattern *pat) // Access functions that look up fields up the chain of referenced patterns and return the first one which is set // FIXME: all of them must use chase_hrefs the same as in SPGradient, to avoid lockup on circular refs -guint pattern_patternUnits (SPPattern *pat) +guint pattern_patternUnits (SPPattern const *pat) { - for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->patternUnits_set) - return pat_i->patternUnits; - } - return pat->patternUnits; + for (SPPattern const *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { + if (pat_i->patternUnits_set) + return pat_i->patternUnits; + } + return pat->patternUnits; } -guint pattern_patternContentUnits (SPPattern *pat) +guint pattern_patternContentUnits (SPPattern const *pat) { - for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->patternContentUnits_set) - return pat_i->patternContentUnits; - } - return pat->patternContentUnits; + for (SPPattern const *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { + if (pat_i->patternContentUnits_set) + return pat_i->patternContentUnits; + } + return pat->patternContentUnits; } Geom::Affine const &pattern_patternTransform(SPPattern const *pat) { - for (SPPattern const *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->patternTransform_set) - return pat_i->patternTransform; - } - return pat->patternTransform; + for (SPPattern const *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { + if (pat_i->patternTransform_set) + return pat_i->patternTransform; + } + return pat->patternTransform; } -gdouble pattern_x (SPPattern *pat) +gdouble pattern_x (SPPattern const *pat) { - for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->x._set) - return pat_i->x.computed; - } - return 0; + for (SPPattern const *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { + if (pat_i->x._set) + return pat_i->x.computed; + } + return 0; } -gdouble pattern_y (SPPattern *pat) +gdouble pattern_y (SPPattern const *pat) { - for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->y._set) - return pat_i->y.computed; - } - return 0; + for (SPPattern const *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { + if (pat_i->y._set) + return pat_i->y.computed; + } + return 0; } -gdouble pattern_width (SPPattern *pat) +gdouble pattern_width (SPPattern const* pat) { - for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->width._set) - return pat_i->width.computed; - } - return 0; + for (SPPattern const *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { + if (pat_i->width._set) + return pat_i->width.computed; + } + return 0; } -gdouble pattern_height (SPPattern *pat) +gdouble pattern_height (SPPattern const *pat) { - for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { - if (pat_i->height._set) - return pat_i->height.computed; - } - return 0; + for (SPPattern const *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { + if (pat_i->height._set) + return pat_i->height.computed; + } + return 0; } -Geom::OptRect pattern_viewBox (SPPattern *pat) +Geom::OptRect pattern_viewBox (SPPattern const *pat) { Geom::OptRect viewbox; - for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { + for (SPPattern const *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) { if (pat_i->viewBox_set) { viewbox = pat_i->viewBox; break; @@ -590,10 +590,10 @@ Geom::OptRect pattern_viewBox (SPPattern *pat) return viewbox; } -static bool pattern_hasItemChildren (SPPattern *pat) +static bool pattern_hasItemChildren (SPPattern const *pat) { bool hasChildren = false; - for (SPObject *child = pat->firstChild() ; child && !hasChildren ; child = child->getNext() ) { + for (SPObject const *child = pat->firstChild() ; child && !hasChildren ; child = child->getNext() ) { if (SP_IS_ITEM(child)) { hasChildren = true; } diff --git a/src/sp-pattern.h b/src/sp-pattern.h index debce86fb..e0a7dce54 100644 --- a/src/sp-pattern.h +++ b/src/sp-pattern.h @@ -91,14 +91,14 @@ const gchar *pattern_tile (GSList *reprs, Geom::Rect bounds, SPDocument *documen SPPattern *pattern_getroot (SPPattern *pat); -guint pattern_patternUnits (SPPattern *pat); -guint pattern_patternContentUnits (SPPattern *pat); +guint pattern_patternUnits (SPPattern const *pat); +guint pattern_patternContentUnits (SPPattern const *pat); Geom::Affine const &pattern_patternTransform(SPPattern const *pat); -gdouble pattern_x (SPPattern *pat); -gdouble pattern_y (SPPattern *pat); -gdouble pattern_width (SPPattern *pat); -gdouble pattern_height (SPPattern *pat); -Geom::OptRect pattern_viewBox (SPPattern *pat); +gdouble pattern_x (SPPattern const *pat); +gdouble pattern_y (SPPattern const *pat); +gdouble pattern_width (SPPattern const *pat); +gdouble pattern_height (SPPattern const *pat); +Geom::OptRect pattern_viewBox (SPPattern const *pat); #endif // SEEN_SP_PATTERN_H diff --git a/src/sp-star.cpp b/src/sp-star.cpp index e0f05d0f4..08de1732b 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -566,7 +566,7 @@ static void sp_star_snappoints(SPItem const *item, std::vector<Inkscape::SnapCan */ Geom::Point -sp_star_get_xy (SPStar *star, SPStarPoint point, gint index, bool randomized) +sp_star_get_xy (SPStar const *star, SPStarPoint point, gint index, bool randomized) { gdouble darg = 2.0 * M_PI / (double) star->sides; diff --git a/src/sp-star.h b/src/sp-star.h index 82197d13d..bd271ccc0 100644 --- a/src/sp-star.h +++ b/src/sp-star.h @@ -52,7 +52,7 @@ GType sp_star_get_type (void); void sp_star_position_set (SPStar *star, gint sides, Geom::Point center, gdouble r1, gdouble r2, gdouble arg1, gdouble arg2, bool isflat, double rounded, double randomized); -Geom::Point sp_star_get_xy (SPStar *star, SPStarPoint point, gint index, bool randomized = false); +Geom::Point sp_star_get_xy (SPStar const *star, SPStarPoint point, gint index, bool randomized = false); |
