summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2013-01-17 18:23:15 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2013-01-17 18:23:15 +0000
commitef59716bfab870d3193fa9670f2cacc3cca39595 (patch)
tree8504673cd161ebad52ae48b5f16bed0a830e2aa0 /src
parentTranslations. Spanish translation update by Lucas Vieites. (diff)
downloadinkscape-ef59716bfab870d3193fa9670f2cacc3cca39595.tar.gz
inkscape-ef59716bfab870d3193fa9670f2cacc3cca39595.zip
const methods
(bzr r12037)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/effect.cpp6
-rw-r--r--src/live_effects/effect.h14
-rw-r--r--src/live_effects/lpe-spiro.h2
-rw-r--r--src/live_effects/parameter/bool.h5
-rw-r--r--src/live_effects/parameter/enum.h5
-rw-r--r--src/live_effects/parameter/parameter.h5
-rw-r--r--src/live_effects/parameter/path.cpp2
-rw-r--r--src/live_effects/parameter/path.h2
-rw-r--r--src/live_effects/parameter/point.h2
-rw-r--r--src/live_effects/parameter/powerstrokepointarray.h6
-rw-r--r--src/live_effects/parameter/random.h3
-rw-r--r--src/live_effects/parameter/text.h2
-rw-r--r--src/live_effects/parameter/unit.cpp2
-rw-r--r--src/live_effects/parameter/unit.h4
-rw-r--r--src/live_effects/parameter/vector.h2
15 files changed, 30 insertions, 32 deletions
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<Parameter *>::iterator p = param_vector.begin(); p != param_vector.end(); ++p) {
+ for (std::vector<Parameter *>::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<Geom::PathVector> 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 &param_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<Geom::PathVector> &/*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<Geom::Path> 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<Geom::Path> const & get_pathvector();
+ std::vector<Geom::Path> const & get_pathvector() const;
Geom::Piecewise<Geom::D2<Geom::SBasis> > 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<Geom::D2<Geom::SBasis> > const & pwd2_in, Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_normal_in);
- Geom::Piecewise<Geom::D2<Geom::SBasis> > const & get_pwd2() { return last_pwd2; }
- Geom::Piecewise<Geom::D2<Geom::SBasis> > const & get_pwd2_normal() { return last_pwd2_normal; }
+ Geom::Piecewise<Geom::D2<Geom::SBasis> > const & get_pwd2() const { return last_pwd2; }
+ Geom::Piecewise<Geom::D2<Geom::SBasis> > const & get_pwd2_normal() const { return last_pwd2_normal; }
void recalculate_controlpoints_for_new_pwd2(Geom::Piecewise<Geom::D2<Geom::SBasis> > 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: