summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-04-07 16:28:22 +0000
committerMarkus Engel <markus.engel@tum.de>2013-04-07 16:28:22 +0000
commit27e2102f96a5554bcd5310ec11435d155773b279 (patch)
treee5f982c25aed199f9027a6277b17302f97b4c80c /src
parentMerged FilterPrimitive and subclasses. (diff)
downloadinkscape-27e2102f96a5554bcd5310ec11435d155773b279.tar.gz
inkscape-27e2102f96a5554bcd5310ec11435d155773b279.zip
Merge Object and subclasses. Merging of SP- and C-classes complete.
(bzr r11608.1.86)
Diffstat (limited to 'src')
-rw-r--r--src/box3d-side.cpp2
-rw-r--r--src/box3d.cpp2
-rw-r--r--src/color-profile.cpp11
-rw-r--r--src/color-profile.h4
-rw-r--r--src/filters/blend.cpp2
-rw-r--r--src/filters/colormatrix.cpp2
-rw-r--r--src/filters/componenttransfer-funcnode.cpp13
-rw-r--r--src/filters/componenttransfer-funcnode.h2
-rw-r--r--src/filters/componenttransfer.cpp2
-rw-r--r--src/filters/composite.cpp2
-rw-r--r--src/filters/convolvematrix.cpp2
-rw-r--r--src/filters/diffuselighting.cpp2
-rw-r--r--src/filters/displacementmap.cpp2
-rw-r--r--src/filters/distantlight.cpp13
-rw-r--r--src/filters/distantlight.h2
-rw-r--r--src/filters/flood.cpp2
-rw-r--r--src/filters/gaussian-blur.cpp1
-rw-r--r--src/filters/image.cpp2
-rw-r--r--src/filters/merge.cpp1
-rw-r--r--src/filters/mergenode.cpp13
-rw-r--r--src/filters/mergenode.h2
-rw-r--r--src/filters/morphology.cpp2
-rw-r--r--src/filters/offset.cpp2
-rw-r--r--src/filters/pointlight.cpp13
-rw-r--r--src/filters/pointlight.h2
-rw-r--r--src/filters/specularlighting.cpp2
-rw-r--r--src/filters/spotlight.cpp13
-rw-r--r--src/filters/spotlight.h2
-rw-r--r--src/filters/tile.cpp1
-rw-r--r--src/filters/turbulence.cpp2
-rw-r--r--src/live_effects/lpeobject.cpp13
-rw-r--r--src/live_effects/lpeobject.h2
-rw-r--r--src/marker.cpp2
-rw-r--r--src/persp3d.cpp13
-rw-r--r--src/persp3d.h2
-rw-r--r--src/sp-anchor.cpp2
-rw-r--r--src/sp-clippath.cpp2
-rw-r--r--src/sp-defs.cpp8
-rw-r--r--src/sp-defs.h2
-rw-r--r--src/sp-desc.cpp6
-rw-r--r--src/sp-desc.h2
-rw-r--r--src/sp-ellipse.cpp5
-rw-r--r--src/sp-filter-primitive.cpp15
-rw-r--r--src/sp-filter-primitive.h2
-rw-r--r--src/sp-filter.cpp19
-rw-r--r--src/sp-filter.h2
-rw-r--r--src/sp-flowdiv.cpp23
-rw-r--r--src/sp-flowdiv.h4
-rw-r--r--src/sp-flowregion.cpp4
-rw-r--r--src/sp-flowtext.cpp2
-rw-r--r--src/sp-font-face.cpp19
-rw-r--r--src/sp-font-face.h2
-rw-r--r--src/sp-font.cpp19
-rw-r--r--src/sp-font.h2
-rw-r--r--src/sp-glyph-kerning.cpp15
-rw-r--r--src/sp-glyph-kerning.h2
-rw-r--r--src/sp-glyph.cpp15
-rw-r--r--src/sp-glyph.h2
-rw-r--r--src/sp-gradient.cpp16
-rw-r--r--src/sp-guide.cpp11
-rw-r--r--src/sp-guide.h2
-rw-r--r--src/sp-image.cpp2
-rw-r--r--src/sp-item-group.cpp2
-rw-r--r--src/sp-item.cpp15
-rw-r--r--src/sp-item.h2
-rw-r--r--src/sp-line.cpp2
-rw-r--r--src/sp-linear-gradient.cpp2
-rw-r--r--src/sp-lpe-item.cpp2
-rw-r--r--src/sp-mask.cpp2
-rw-r--r--src/sp-mesh-gradient.cpp2
-rw-r--r--src/sp-mesh-patch.cpp9
-rw-r--r--src/sp-mesh-patch.h4
-rw-r--r--src/sp-mesh-row.cpp8
-rw-r--r--src/sp-mesh-row.h2
-rw-r--r--src/sp-metadata.cpp15
-rw-r--r--src/sp-metadata.h2
-rw-r--r--src/sp-missing-glyph.cpp13
-rw-r--r--src/sp-missing-glyph.h2
-rw-r--r--src/sp-namedview.cpp2
-rw-r--r--src/sp-object-group.cpp12
-rw-r--r--src/sp-object-group.h2
-rw-r--r--src/sp-object.cpp182
-rw-r--r--src/sp-object.h36
-rw-r--r--src/sp-offset.cpp2
-rw-r--r--src/sp-paint-server.cpp5
-rw-r--r--src/sp-paint-server.h2
-rw-r--r--src/sp-path.cpp1
-rw-r--r--src/sp-pattern.cpp2
-rw-r--r--src/sp-polygon.cpp1
-rw-r--r--src/sp-polyline.cpp1
-rw-r--r--src/sp-radial-gradient.cpp2
-rw-r--r--src/sp-rect.cpp1
-rw-r--r--src/sp-root.cpp2
-rw-r--r--src/sp-script.cpp11
-rw-r--r--src/sp-script.h2
-rw-r--r--src/sp-shape.cpp2
-rw-r--r--src/sp-spiral.cpp2
-rw-r--r--src/sp-star.cpp2
-rw-r--r--src/sp-stop.cpp11
-rw-r--r--src/sp-stop.h2
-rw-r--r--src/sp-string.cpp11
-rw-r--r--src/sp-string.h2
-rw-r--r--src/sp-style-elem.cpp17
-rw-r--r--src/sp-style-elem.h2
-rw-r--r--src/sp-switch.cpp2
-rw-r--r--src/sp-symbol.cpp2
-rw-r--r--src/sp-text.cpp2
-rw-r--r--src/sp-title.cpp6
-rw-r--r--src/sp-title.h2
-rw-r--r--src/sp-tref.cpp2
-rw-r--r--src/sp-tspan.cpp4
-rw-r--r--src/sp-use.cpp2
112 files changed, 251 insertions, 532 deletions
diff --git a/src/box3d-side.cpp b/src/box3d-side.cpp
index fc261ae85..d3d3b82a2 100644
--- a/src/box3d-side.cpp
+++ b/src/box3d-side.cpp
@@ -37,8 +37,6 @@ namespace {
}
Box3DSide::Box3DSide() : SPPolygon() {
- this->cobject = this;
-
this->dir1 = Box3D::NONE;
this->dir2 = Box3D::NONE;
this->front_or_rear = Box3D::FRONT;
diff --git a/src/box3d.cpp b/src/box3d.cpp
index e7abf4793..0f528a592 100644
--- a/src/box3d.cpp
+++ b/src/box3d.cpp
@@ -54,8 +54,6 @@ namespace {
}
SPBox3D::SPBox3D() : SPGroup() {
- this->cobject = this;
-
this->my_counter = 0;
this->swapped = Box3D::NONE;
diff --git a/src/color-profile.cpp b/src/color-profile.cpp
index 0373ab317..6e9414074 100644
--- a/src/color-profile.cpp
+++ b/src/color-profile.cpp
@@ -190,10 +190,7 @@ namespace {
bool rectRegistered = SPFactory::instance().registerObject("svg:color-profile", createColorProfile);
}
-ColorProfile::ColorProfile() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+ColorProfile::ColorProfile() : SPObject() {
this->impl = new ColorProfileImpl();
this->href = 0;
@@ -282,7 +279,7 @@ void ColorProfile::build(SPDocument *document, Inkscape::XML::Node *repr) {
g_assert(cprof->name == 0);
g_assert(cprof->intentStr == 0);
- CObject::build(document, repr);
+ SPObject::build(document, repr);
object->readAttr( "xlink:href" );
object->readAttr( "local" );
@@ -410,7 +407,7 @@ void ColorProfile::set(unsigned key, gchar const *value) {
break;
default:
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -443,7 +440,7 @@ Inkscape::XML::Node* ColorProfile::write(Inkscape::XML::Document *xml_doc, Inksc
repr->setAttribute( "rendering-intent", cprof->intentStr );
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/color-profile.h b/src/color-profile.h
index 7606705f3..152e61f57 100644
--- a/src/color-profile.h
+++ b/src/color-profile.h
@@ -26,7 +26,7 @@ class ColorProfileImpl;
/**
* Color Profile.
*/
-class ColorProfile : public SPObject, public CObject {
+class ColorProfile : public SPObject {
public:
ColorProfile();
virtual ~ColorProfile();
@@ -70,7 +70,7 @@ public:
#define COLORPROFILE_TYPE (Inkscape::colorprofile_get_type())
#define COLORPROFILE(obj) ((Inkscape::ColorProfile*)obj)
-#define IS_COLORPROFILE(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(Inkscape::ColorProfile)))
+#define IS_COLORPROFILE(obj) (dynamic_cast<const Inkscape::ColorProfile*>((SPObject*)obj))
#endif // !SEEN_COLOR_PROFILE_H
diff --git a/src/filters/blend.cpp b/src/filters/blend.cpp
index 7a9a2d2b2..d2f281805 100644
--- a/src/filters/blend.cpp
+++ b/src/filters/blend.cpp
@@ -41,8 +41,6 @@ namespace {
}
SPFeBlend::SPFeBlend() : SPFilterPrimitive() {
- this->cobject = this;
-
this->blend_mode = Inkscape::Filters::BLEND_NORMAL;
this->in2 = Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
diff --git a/src/filters/colormatrix.cpp b/src/filters/colormatrix.cpp
index 02acd30ac..28f848ec7 100644
--- a/src/filters/colormatrix.cpp
+++ b/src/filters/colormatrix.cpp
@@ -40,8 +40,6 @@ namespace {
}
SPFeColorMatrix::SPFeColorMatrix() : SPFilterPrimitive() {
- this->cobject = this;
-
this->value = 0;
this->type = Inkscape::Filters::COLORMATRIX_MATRIX;
}
diff --git a/src/filters/componenttransfer-funcnode.cpp b/src/filters/componenttransfer-funcnode.cpp
index 26e92bf15..8b5a8a3ab 100644
--- a/src/filters/componenttransfer-funcnode.cpp
+++ b/src/filters/componenttransfer-funcnode.cpp
@@ -31,10 +31,7 @@
#include "macros.h"
/* FeFuncNode class */
-SPFeFuncNode::SPFeFuncNode() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPFeFuncNode::SPFeFuncNode() : SPObject() {
this->type = Inkscape::Filters::COMPONENTTRANSFER_TYPE_IDENTITY;
//this->tableValues = NULL;
this->slope = 1;
@@ -53,7 +50,7 @@ SPFeFuncNode::~SPFeFuncNode() {
* sp-object-repr.cpp's repr_name_entries array.
*/
void SPFeFuncNode::build(SPDocument *document, Inkscape::XML::Node *repr) {
- CObject::build(document, repr);
+ SPObject::build(document, repr);
SPFeFuncNode* object = this;
@@ -169,7 +166,7 @@ void SPFeFuncNode::set(unsigned int key, gchar const *value) {
default:
// if (((SPObjectClass *) feFuncNode_parent_class)->set)
// ((SPObjectClass *) feFuncNode_parent_class)->set(object, key, value);
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -190,7 +187,7 @@ void SPFeFuncNode::update(SPCtx *ctx, guint flags) {
//object->readAttr( "elevation" );
}
- CObject::update(ctx, flags);
+ SPObject::update(ctx, flags);
}
/**
@@ -213,7 +210,7 @@ TODO: I'm not sure what to do here...
if (fefuncnode->elevation_set)
sp_repr_set_css_double(repr, "elevation", fefuncnode->elevation);*/
- CObject::write(doc, repr, flags);
+ SPObject::write(doc, repr, flags);
return repr;
}
diff --git a/src/filters/componenttransfer-funcnode.h b/src/filters/componenttransfer-funcnode.h
index b23e52324..deed46839 100644
--- a/src/filters/componenttransfer-funcnode.h
+++ b/src/filters/componenttransfer-funcnode.h
@@ -41,7 +41,7 @@
#define SP_IS_FEFUNCB(obj) (dynamic_cast<const SPFeFuncNode*>((SPObject*)obj))
#define SP_IS_FEFUNCA(obj) (dynamic_cast<const SPFeFuncNode*>((SPObject*)obj))
-class SPFeFuncNode : public SPObject, public CObject {
+class SPFeFuncNode : public SPObject {
public:
SPFeFuncNode();
virtual ~SPFeFuncNode();
diff --git a/src/filters/componenttransfer.cpp b/src/filters/componenttransfer.cpp
index 96848a095..4d6206bf7 100644
--- a/src/filters/componenttransfer.cpp
+++ b/src/filters/componenttransfer.cpp
@@ -38,8 +38,6 @@ namespace {
}
SPFeComponentTransfer::SPFeComponentTransfer() : SPFilterPrimitive() {
- this->cobject = this;
-
this->renderer = NULL;
}
diff --git a/src/filters/composite.cpp b/src/filters/composite.cpp
index ebc248c1e..28147fa80 100644
--- a/src/filters/composite.cpp
+++ b/src/filters/composite.cpp
@@ -36,8 +36,6 @@ namespace {
}
SPFeComposite::SPFeComposite() : SPFilterPrimitive() {
- this->cobject = this;
-
this->composite_operator = COMPOSITE_DEFAULT;
this->k1 = 0;
this->k2 = 0;
diff --git a/src/filters/convolvematrix.cpp b/src/filters/convolvematrix.cpp
index 5f487e9d6..b104a2f9f 100644
--- a/src/filters/convolvematrix.cpp
+++ b/src/filters/convolvematrix.cpp
@@ -39,8 +39,6 @@ namespace {
}
SPFeConvolveMatrix::SPFeConvolveMatrix() : SPFilterPrimitive() {
- this->cobject = this;
-
this->bias = 0;
this->divisorIsSet = 0;
this->divisor = 0;
diff --git a/src/filters/diffuselighting.cpp b/src/filters/diffuselighting.cpp
index 45a3bbbf9..c6c0ef311 100644
--- a/src/filters/diffuselighting.cpp
+++ b/src/filters/diffuselighting.cpp
@@ -47,8 +47,6 @@ namespace {
}
SPFeDiffuseLighting::SPFeDiffuseLighting() : SPFilterPrimitive() {
- this->cobject = this;
-
this->surfaceScale = 1;
this->diffuseConstant = 1;
this->lighting_color = 0xffffffff;
diff --git a/src/filters/displacementmap.cpp b/src/filters/displacementmap.cpp
index 8a7fd09ff..03b2834b6 100644
--- a/src/filters/displacementmap.cpp
+++ b/src/filters/displacementmap.cpp
@@ -36,8 +36,6 @@ namespace {
}
SPFeDisplacementMap::SPFeDisplacementMap() : SPFilterPrimitive() {
- this->cobject = this;
-
this->scale=0;
this->xChannelSelector = DISPLACEMENTMAP_CHANNEL_ALPHA;
this->yChannelSelector = DISPLACEMENTMAP_CHANNEL_ALPHA;
diff --git a/src/filters/distantlight.cpp b/src/filters/distantlight.cpp
index 4aef86034..763ddbe7a 100644
--- a/src/filters/distantlight.cpp
+++ b/src/filters/distantlight.cpp
@@ -29,10 +29,7 @@
#define SP_MACROS_SILENT
#include "macros.h"
-SPFeDistantLight::SPFeDistantLight() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPFeDistantLight::SPFeDistantLight() : SPObject() {
this->azimuth = 0;
this->elevation = 0;
this->azimuth_set = FALSE;
@@ -48,7 +45,7 @@ SPFeDistantLight::~SPFeDistantLight() {
* sp-object-repr.cpp's repr_name_entries array.
*/
void SPFeDistantLight::build(SPDocument *document, Inkscape::XML::Node *repr) {
- CObject::build(document, repr);
+ SPObject::build(document, repr);
SPFeDistantLight* object = this;
@@ -122,7 +119,7 @@ void SPFeDistantLight::set(unsigned int key, gchar const *value) {
break;
default:
// See if any parents need this value.
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -141,7 +138,7 @@ void SPFeDistantLight::update(SPCtx *ctx, guint flags) {
object->readAttr( "elevation" );
}
- CObject::update(ctx, flags);
+ SPObject::update(ctx, flags);
}
/**
@@ -160,7 +157,7 @@ Inkscape::XML::Node* SPFeDistantLight::write(Inkscape::XML::Document *doc, Inksc
if (fedistantlight->elevation_set)
sp_repr_set_css_double(repr, "elevation", fedistantlight->elevation);
- CObject::write(doc, repr, flags);
+ SPObject::write(doc, repr, flags);
return repr;
}
diff --git a/src/filters/distantlight.h b/src/filters/distantlight.h
index 21ece336d..b808eb279 100644
--- a/src/filters/distantlight.h
+++ b/src/filters/distantlight.h
@@ -21,7 +21,7 @@
#define SP_IS_FEDISTANTLIGHT(obj) (dynamic_cast<const SPFeDistantLight*>((SPObject*)obj))
/* Distant light class */
-class SPFeDistantLight : public SPObject, public CObject {
+class SPFeDistantLight : public SPObject {
public:
SPFeDistantLight();
virtual ~SPFeDistantLight();
diff --git a/src/filters/flood.cpp b/src/filters/flood.cpp
index fd6a1c1c8..a3d357b64 100644
--- a/src/filters/flood.cpp
+++ b/src/filters/flood.cpp
@@ -38,8 +38,6 @@ namespace {
}
SPFeFlood::SPFeFlood() : SPFilterPrimitive() {
- this->cobject = this;
-
this->color = 0;
this->opacity = 1;
diff --git a/src/filters/gaussian-blur.cpp b/src/filters/gaussian-blur.cpp
index df9973a8b..e2f58f476 100644
--- a/src/filters/gaussian-blur.cpp
+++ b/src/filters/gaussian-blur.cpp
@@ -41,7 +41,6 @@ namespace {
}
SPGaussianBlur::SPGaussianBlur() : SPFilterPrimitive() {
- this->cobject = this;
}
SPGaussianBlur::~SPGaussianBlur() {
diff --git a/src/filters/image.cpp b/src/filters/image.cpp
index 01653fc6f..150e9a33f 100644
--- a/src/filters/image.cpp
+++ b/src/filters/image.cpp
@@ -40,8 +40,6 @@ namespace {
}
SPFeImage::SPFeImage() : SPFilterPrimitive() {
- this->cobject = this;
-
this->document = NULL;
this->href = NULL;
this->from_element = 0;
diff --git a/src/filters/merge.cpp b/src/filters/merge.cpp
index e1770eb48..3b126f747 100644
--- a/src/filters/merge.cpp
+++ b/src/filters/merge.cpp
@@ -35,7 +35,6 @@ namespace {
}
SPFeMerge::SPFeMerge() : SPFilterPrimitive() {
- this->cobject = this;
}
SPFeMerge::~SPFeMerge() {
diff --git a/src/filters/mergenode.cpp b/src/filters/mergenode.cpp
index 478a9f9a8..e356ac771 100644
--- a/src/filters/mergenode.cpp
+++ b/src/filters/mergenode.cpp
@@ -33,10 +33,7 @@ namespace {
bool mergeNodeRegistered = SPFactory::instance().registerObject("svg:feMergeNode", createMergeNode);
}
-SPFeMergeNode::SPFeMergeNode() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPFeMergeNode::SPFeMergeNode() : SPObject() {
this->input = Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
}
@@ -57,7 +54,7 @@ void SPFeMergeNode::build(SPDocument *document, Inkscape::XML::Node *repr) {
* Drops any allocated memory.
*/
void SPFeMergeNode::release() {
- CObject::release();
+ SPObject::release();
}
/**
@@ -77,7 +74,7 @@ void SPFeMergeNode::set(unsigned int key, gchar const *value) {
}
/* See if any parents need this value. */
- CObject::set(key, value);
+ SPObject::set(key, value);
}
/**
@@ -91,7 +88,7 @@ void SPFeMergeNode::update(SPCtx *ctx, guint flags) {
object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
- CObject::update(ctx, flags);
+ SPObject::update(ctx, flags);
}
/**
@@ -111,7 +108,7 @@ Inkscape::XML::Node* SPFeMergeNode::write(Inkscape::XML::Document *doc, Inkscape
}
}
- CObject::write(doc, repr, flags);
+ SPObject::write(doc, repr, flags);
return repr;
}
diff --git a/src/filters/mergenode.h b/src/filters/mergenode.h
index 0b533c4c2..346d8da24 100644
--- a/src/filters/mergenode.h
+++ b/src/filters/mergenode.h
@@ -20,7 +20,7 @@
#define SP_FEMERGENODE(obj) ((SPFeMergeNode*)obj)
#define SP_IS_FEMERGENODE(obj) (dynamic_cast<const SPFeMergeNode*>((SPObject*)obj))
-class SPFeMergeNode : public SPObject, public CObject {
+class SPFeMergeNode : public SPObject {
public:
SPFeMergeNode();
virtual ~SPFeMergeNode();
diff --git a/src/filters/morphology.cpp b/src/filters/morphology.cpp
index 198a9057a..14783584f 100644
--- a/src/filters/morphology.cpp
+++ b/src/filters/morphology.cpp
@@ -37,8 +37,6 @@ namespace {
}
SPFeMorphology::SPFeMorphology() : SPFilterPrimitive() {
- this->cobject = this;
-
this->Operator = Inkscape::Filters::MORPHOLOGY_OPERATOR_ERODE;
//Setting default values:
diff --git a/src/filters/offset.cpp b/src/filters/offset.cpp
index dcdceaf92..22582c167 100644
--- a/src/filters/offset.cpp
+++ b/src/filters/offset.cpp
@@ -36,8 +36,6 @@ namespace {
}
SPFeOffset::SPFeOffset() : SPFilterPrimitive() {
- this->cobject = this;
-
this->dx = 0;
this->dy = 0;
}
diff --git a/src/filters/pointlight.cpp b/src/filters/pointlight.cpp
index 2e09151ac..ab0b1b582 100644
--- a/src/filters/pointlight.cpp
+++ b/src/filters/pointlight.cpp
@@ -39,10 +39,7 @@ namespace {
bool pointLightRegistered = SPFactory::instance().registerObject("svg:fePointLight", createPointLight);
}
-SPFePointLight::SPFePointLight() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPFePointLight::SPFePointLight() : SPObject() {
this->x = 0;
this->y = 0;
this->z = 0;
@@ -62,7 +59,7 @@ SPFePointLight::~SPFePointLight() {
* sp-object-repr.cpp's repr_name_entries array.
*/
void SPFePointLight::build(SPDocument *document, Inkscape::XML::Node *repr) {
- CObject::build(document, repr);
+ SPObject::build(document, repr);
SPFePointLight* object = this;
@@ -155,7 +152,7 @@ void SPFePointLight::set(unsigned int key, gchar const *value) {
break;
default:
// See if any parents need this value.
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -176,7 +173,7 @@ void SPFePointLight::update(SPCtx *ctx, guint flags) {
object->readAttr( "z" );
}
- CObject::update(ctx, flags);
+ SPObject::update(ctx, flags);
}
/**
@@ -197,7 +194,7 @@ Inkscape::XML::Node* SPFePointLight::write(Inkscape::XML::Document *doc, Inkscap
if (fepointlight->z_set)
sp_repr_set_css_double(repr, "z", fepointlight->z);
- CObject::write(doc, repr, flags);
+ SPObject::write(doc, repr, flags);
return repr;
}
diff --git a/src/filters/pointlight.h b/src/filters/pointlight.h
index ac065d7fd..96bef8945 100644
--- a/src/filters/pointlight.h
+++ b/src/filters/pointlight.h
@@ -20,7 +20,7 @@
#define SP_FEPOINTLIGHT(obj) ((SPFePointLight*)obj)
#define SP_IS_FEPOINTLIGHT(obj) (dynamic_cast<const SPFePointLight*>((SPObject*)obj))
-class SPFePointLight : public SPObject, public CObject {
+class SPFePointLight : public SPObject {
public:
SPFePointLight();
virtual ~SPFePointLight();
diff --git a/src/filters/specularlighting.cpp b/src/filters/specularlighting.cpp
index 5784bf63c..bb291f2a9 100644
--- a/src/filters/specularlighting.cpp
+++ b/src/filters/specularlighting.cpp
@@ -47,8 +47,6 @@ namespace {
}
SPFeSpecularLighting::SPFeSpecularLighting() : SPFilterPrimitive() {
- this->cobject = this;
-
this->surfaceScale = 1;
this->specularConstant = 1;
this->specularExponent = 1;
diff --git a/src/filters/spotlight.cpp b/src/filters/spotlight.cpp
index 13a45bbb8..1942c7710 100644
--- a/src/filters/spotlight.cpp
+++ b/src/filters/spotlight.cpp
@@ -39,10 +39,7 @@ namespace {
bool spotLightRegistered = SPFactory::instance().registerObject("svg:feSpotLight", createSpotLight);
}
-SPFeSpotLight::SPFeSpotLight() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPFeSpotLight::SPFeSpotLight() : SPObject() {
this->x = 0;
this->y = 0;
this->z = 0;
@@ -72,7 +69,7 @@ SPFeSpotLight::~SPFeSpotLight() {
* sp-object-repr.cpp's repr_name_entries array.
*/
void SPFeSpotLight::build(SPDocument *document, Inkscape::XML::Node *repr) {
- CObject::build(document, repr);
+ SPObject::build(document, repr);
SPFeSpotLight* object = this;
@@ -253,7 +250,7 @@ void SPFeSpotLight::set(unsigned int key, gchar const *value) {
break;
default:
// See if any parents need this value.
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -279,7 +276,7 @@ void SPFeSpotLight::update(SPCtx *ctx, guint flags) {
object->readAttr( "limitingConeAngle" );
}
- CObject::update(ctx, flags);
+ SPObject::update(ctx, flags);
}
/**
@@ -310,7 +307,7 @@ Inkscape::XML::Node* SPFeSpotLight::write(Inkscape::XML::Document *doc, Inkscape
if (fespotlight->limitingConeAngle_set)
sp_repr_set_css_double(repr, "limitingConeAngle", fespotlight->limitingConeAngle);
- CObject::write(doc, repr, flags);
+ SPObject::write(doc, repr, flags);
return repr;
}
diff --git a/src/filters/spotlight.h b/src/filters/spotlight.h
index 69c36e2d7..9ea73a800 100644
--- a/src/filters/spotlight.h
+++ b/src/filters/spotlight.h
@@ -20,7 +20,7 @@
#define SP_FESPOTLIGHT(obj) ((SPFeSpotLight*)obj)
#define SP_IS_FESPOTLIGHT(obj) (dynamic_cast<const SPFeSpotLight*>((SPObject*)obj))
-class SPFeSpotLight : public SPObject, public CObject {
+class SPFeSpotLight : public SPObject {
public:
SPFeSpotLight();
virtual ~SPFeSpotLight();
diff --git a/src/filters/tile.cpp b/src/filters/tile.cpp
index fcd366277..4bb93603c 100644
--- a/src/filters/tile.cpp
+++ b/src/filters/tile.cpp
@@ -33,7 +33,6 @@ namespace {
}
SPFeTile::SPFeTile() : SPFilterPrimitive() {
- this->cobject = this;
}
SPFeTile::~SPFeTile() {
diff --git a/src/filters/turbulence.cpp b/src/filters/turbulence.cpp
index 8519d730d..caf93c3c0 100644
--- a/src/filters/turbulence.cpp
+++ b/src/filters/turbulence.cpp
@@ -39,8 +39,6 @@ namespace {
}
SPFeTurbulence::SPFeTurbulence() : SPFilterPrimitive() {
- this->cobject = this;
-
this->stitchTiles = 0;
this->seed = 0;
this->numOctaves = 0;
diff --git a/src/live_effects/lpeobject.cpp b/src/live_effects/lpeobject.cpp
index 012bf6612..b708a36cd 100644
--- a/src/live_effects/lpeobject.cpp
+++ b/src/live_effects/lpeobject.cpp
@@ -41,14 +41,11 @@ static Inkscape::XML::NodeEventVector const livepatheffect_repr_events = {
};
-LivePathEffectObject::LivePathEffectObject() : SPObject(), CObject(this) {
+LivePathEffectObject::LivePathEffectObject() : SPObject() {
#ifdef LIVEPATHEFFECT_VERBOSE
g_message("Init livepatheffectobject");
#endif
- delete this->cobject;
- this->cobject = this;
-
this->effecttype = Inkscape::LivePathEffect::INVALID_LPE;
this->lpe = NULL;
@@ -67,7 +64,7 @@ void LivePathEffectObject::build(SPDocument *document, Inkscape::XML::Node *repr
g_assert(object != NULL);
g_assert(SP_IS_OBJECT(object));
- CObject::build(document, repr);
+ SPObject::build(document, repr);
object->readAttr( "effect" );
@@ -113,7 +110,7 @@ void LivePathEffectObject::release() {
}
lpeobj->effecttype = Inkscape::LivePathEffect::INVALID_LPE;
- CObject::release();
+ SPObject::release();
}
/**
@@ -145,7 +142,7 @@ void LivePathEffectObject::set(unsigned key, gchar const *value) {
break;
}
- CObject::set(key, value);
+ SPObject::set(key, value);
}
/**
@@ -166,7 +163,7 @@ Inkscape::XML::Node* LivePathEffectObject::write(Inkscape::XML::Document *xml_do
lpeobj->lpe->writeParamsToSVG();
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/live_effects/lpeobject.h b/src/live_effects/lpeobject.h
index d5aaa09bf..28ed93f1a 100644
--- a/src/live_effects/lpeobject.h
+++ b/src/live_effects/lpeobject.h
@@ -25,7 +25,7 @@ namespace Inkscape {
#define LIVEPATHEFFECT(obj) ((LivePathEffectObject*)obj)
#define IS_LIVEPATHEFFECT(obj) (dynamic_cast<const LivePathEffectObject*>((SPObject*)obj))
-class LivePathEffectObject : public SPObject, public CObject {
+class LivePathEffectObject : public SPObject {
public:
LivePathEffectObject();
virtual ~LivePathEffectObject();
diff --git a/src/marker.cpp b/src/marker.cpp
index bcb246d2b..518895a57 100644
--- a/src/marker.cpp
+++ b/src/marker.cpp
@@ -53,8 +53,6 @@ namespace {
}
SPMarker::SPMarker() : SPGroup() {
- this->cobject = this;
-
this->aspect_clip = 0;
this->aspect_align = 0;
this->aspect_set = 0;
diff --git a/src/persp3d.cpp b/src/persp3d.cpp
index 7e5045d67..5188821e8 100644
--- a/src/persp3d.cpp
+++ b/src/persp3d.cpp
@@ -62,10 +62,7 @@ static Inkscape::XML::NodeEventVector const persp3d_repr_events = {
};
-Persp3D::Persp3D() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+Persp3D::Persp3D() : SPObject() {
this->perspective_impl = new Persp3DImpl();
}
@@ -77,7 +74,7 @@ Persp3D::~Persp3D() {
* Virtual build: set persp3d attributes from its associated XML node.
*/
void Persp3D::build(SPDocument *document, Inkscape::XML::Node *repr) {
- CObject::build(document, repr);
+ SPObject::build(document, repr);
Persp3D* object = this;
@@ -143,7 +140,7 @@ void Persp3D::set(unsigned key, gchar const *value) {
}
}
default: {
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -166,7 +163,7 @@ void Persp3D::update(SPCtx *ctx, guint flags) {
}
- CObject::update(ctx, flags);
+ SPObject::update(ctx, flags);
}
Persp3D *persp3d_create_xml_element(SPDocument *document, Persp3DImpl *dup) {// if dup is given, copy the attributes over
@@ -251,7 +248,7 @@ Inkscape::XML::Node* Persp3D::write(Inkscape::XML::Document *xml_doc, Inkscape::
repr->setAttribute("inkscape:persp3d-origin", str);
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/persp3d.h b/src/persp3d.h
index df20a9202..2ef467cc4 100644
--- a/src/persp3d.h
+++ b/src/persp3d.h
@@ -43,7 +43,7 @@ public:
// friend class Persp3D;
};
-class Persp3D : public SPObject, public CObject {
+class Persp3D : public SPObject {
public:
Persp3D();
virtual ~Persp3D();
diff --git a/src/sp-anchor.cpp b/src/sp-anchor.cpp
index 2682d1906..d9a8c4142 100644
--- a/src/sp-anchor.cpp
+++ b/src/sp-anchor.cpp
@@ -36,8 +36,6 @@ namespace {
}
SPAnchor::SPAnchor() : SPGroup() {
- this->cobject = this;
-
this->href = NULL;
}
diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp
index 17571d195..6a2fbfbb3 100644
--- a/src/sp-clippath.cpp
+++ b/src/sp-clippath.cpp
@@ -51,8 +51,6 @@ namespace {
}
SPClipPath::SPClipPath() : SPObjectGroup() {
- this->cobject = this;
-
this->clipPathUnits_set = FALSE;
this->clipPathUnits = SP_CONTENT_UNITS_USERSPACEONUSE;
diff --git a/src/sp-defs.cpp b/src/sp-defs.cpp
index 6202c19f7..b60c830e6 100644
--- a/src/sp-defs.cpp
+++ b/src/sp-defs.cpp
@@ -30,16 +30,14 @@ namespace {
bool defsRegistered = SPFactory::instance().registerObject("svg:defs", createDefs);
}
-SPDefs::SPDefs() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
+SPDefs::SPDefs() : SPObject() {
}
SPDefs::~SPDefs() {
}
void SPDefs::release() {
- CObject::release();
+ SPObject::release();
}
void SPDefs::update(SPCtx *ctx, guint flags) {
@@ -118,7 +116,7 @@ Inkscape::XML::Node* SPDefs::write(Inkscape::XML::Document *xml_doc, Inkscape::X
}
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-defs.h b/src/sp-defs.h
index 4c87def3b..ece6cd46a 100644
--- a/src/sp-defs.h
+++ b/src/sp-defs.h
@@ -18,7 +18,7 @@
#define SP_DEFS(obj) ((SPDefs*)obj)
#define SP_IS_DEFS(obj) (dynamic_cast<const SPDefs*>((SPObject*)obj))
-class SPDefs : public SPObject, public CObject {
+class SPDefs : public SPObject {
public:
SPDefs();
virtual ~SPDefs();
diff --git a/src/sp-desc.cpp b/src/sp-desc.cpp
index e7530e501..c8e0f16e4 100644
--- a/src/sp-desc.cpp
+++ b/src/sp-desc.cpp
@@ -26,9 +26,7 @@ namespace {
bool descRegistered = SPFactory::instance().registerObject("svg:desc", createDesc);
}
-SPDesc::SPDesc() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
+SPDesc::SPDesc() : SPObject() {
}
SPDesc::~SPDesc() {
@@ -41,7 +39,7 @@ Inkscape::XML::Node* SPDesc::write(Inkscape::XML::Document* doc, Inkscape::XML::
repr = object->getRepr()->duplicate(doc);
}
- CObject::write(doc, repr, flags);
+ SPObject::write(doc, repr, flags);
return repr;
}
diff --git a/src/sp-desc.h b/src/sp-desc.h
index 1e12296a4..224e3eab1 100644
--- a/src/sp-desc.h
+++ b/src/sp-desc.h
@@ -17,7 +17,7 @@
#define SP_DESC(obj) ((SPDesc*)obj)
#define SP_IS_DESC(obj) (dynamic_cast<const SPDesc*>((SPObject*)obj))
-class SPDesc : public SPObject, public CObject {
+class SPDesc : public SPObject {
public:
SPDesc();
virtual ~SPDesc();
diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index 5efd9ade2..294970fef 100644
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
@@ -89,8 +89,6 @@ static double sp_round(double x, double y)
static gboolean sp_arc_set_elliptical_path_attribute(SPArc *arc, Inkscape::XML::Node *repr);
SPGenericEllipse::SPGenericEllipse() : SPShape() {
- this->cobject = this;
-
this->cx.unset();
this->cy.unset();
this->rx.unset();
@@ -364,7 +362,6 @@ Inkscape::XML::Node* SPGenericEllipse::write(Inkscape::XML::Document *xml_doc, I
/* SVG <ellipse> element */
SPEllipse::SPEllipse() : SPGenericEllipse() {
- this->cobject = this;
}
SPEllipse::~SPEllipse() {
@@ -455,7 +452,6 @@ sp_ellipse_position_set(SPEllipse *ellipse, gdouble x, gdouble y, gdouble rx, gd
/* SVG <circle> element */
SPCircle::SPCircle() : SPGenericEllipse() {
- this->cobject = this;
}
SPCircle::~SPCircle() {
@@ -517,7 +513,6 @@ gchar* SPCircle::description() {
/* <path sodipodi:type="arc"> element */
SPArc::SPArc() : SPGenericEllipse() {
- this->cobject = this;
}
SPArc::~SPArc() {
diff --git a/src/sp-filter-primitive.cpp b/src/sp-filter-primitive.cpp
index d2ace4e31..bf264011a 100644
--- a/src/sp-filter-primitive.cpp
+++ b/src/sp-filter-primitive.cpp
@@ -33,10 +33,7 @@ void SPFilterPrimitive::build_renderer(Inkscape::Filters::Filter* filter) {
// throw;
}
-SPFilterPrimitive::SPFilterPrimitive() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPFilterPrimitive::SPFilterPrimitive() : SPObject() {
this->image_in = Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
this->image_out = Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
@@ -70,14 +67,14 @@ void SPFilterPrimitive::build(SPDocument *document, Inkscape::XML::Node *repr) {
object->readAttr( "width" );
object->readAttr( "height" );
- CObject::build(document, repr);
+ SPObject::build(document, repr);
}
/**
* Drops any allocated memory.
*/
void SPFilterPrimitive::release() {
- CObject::release();
+ SPObject::release();
}
/**
@@ -133,7 +130,7 @@ void SPFilterPrimitive::set(unsigned int key, gchar const *value) {
}
/* See if any parents need this value. */
- CObject::set(key, value);
+ SPObject::set(key, value);
}
/**
@@ -155,7 +152,7 @@ void SPFilterPrimitive::update(SPCtx *ctx, guint flags) {
object->readAttr( "height" );
}
- CObject::update(ctx, flags);
+ SPObject::update(ctx, flags);
}
/**
@@ -178,7 +175,7 @@ Inkscape::XML::Node* SPFilterPrimitive::write(Inkscape::XML::Document *doc, Inks
repr->setAttribute("result", out_name);
/* Do we need to add x,y,width,height? */
- CObject::write(doc, repr, flags);
+ SPObject::write(doc, repr, flags);
return repr;
}
diff --git a/src/sp-filter-primitive.h b/src/sp-filter-primitive.h
index cf8817402..fbb4dbe29 100644
--- a/src/sp-filter-primitive.h
+++ b/src/sp-filter-primitive.h
@@ -26,7 +26,7 @@ class Filter;
class FilterPrimitive;
} }
-class SPFilterPrimitive : public SPObject, public CObject {
+class SPFilterPrimitive : public SPObject {
public:
SPFilterPrimitive();
virtual ~SPFilterPrimitive();
diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp
index 1eb25f9c1..2a566efa2 100644
--- a/src/sp-filter.cpp
+++ b/src/sp-filter.cpp
@@ -51,10 +51,7 @@ namespace {
bool filterRegistered = SPFactory::instance().registerObject("svg:filter", createFilter);
}
-SPFilter::SPFilter() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPFilter::SPFilter() : SPObject() {
this->href = new SPFilterReference(this);
this->href->changedSignal().connect(sigc::bind(sigc::ptr_fun(filter_ref_changed), this));
@@ -102,7 +99,7 @@ void SPFilter::build(SPDocument *document, Inkscape::XML::Node *repr) {
object->readAttr( "filterRes" );
object->readAttr( "xlink:href" );
- CObject::build(document, repr);
+ SPObject::build(document, repr);
//is this necessary?
document->addResource("filter", object);
@@ -133,7 +130,7 @@ void SPFilter::release() {
filter->modified_connection.~connection();
delete filter->_image_name;
- CObject::release();
+ SPObject::release();
}
/**
@@ -206,7 +203,7 @@ void SPFilter::set(unsigned int key, gchar const *value) {
break;
default:
// See if any parents need this value.
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -224,7 +221,7 @@ void SPFilter::update(SPCtx *ctx, guint flags) {
}
- CObject::update(ctx, flags);
+ SPObject::update(ctx, flags);
}
/**
@@ -317,7 +314,7 @@ Inkscape::XML::Node* SPFilter::write(Inkscape::XML::Document *doc, Inkscape::XML
g_free(uri_string);
}
- CObject::write(doc, repr, flags);
+ SPObject::write(doc, repr, flags);
return repr;
}
@@ -354,7 +351,7 @@ void SPFilter::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref)
SPFilter* object = this;
//SPFilter *f = SP_FILTER(object);
- CObject::child_added(child, ref);
+ SPObject::child_added(child, ref);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
@@ -366,7 +363,7 @@ void SPFilter::remove_child(Inkscape::XML::Node *child) {
SPFilter* object = this;
// SPFilter *f = SP_FILTER(object);
- CObject::remove_child(child);
+ SPObject::remove_child(child);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
diff --git a/src/sp-filter.h b/src/sp-filter.h
index 38fb18426..8af400367 100644
--- a/src/sp-filter.h
+++ b/src/sp-filter.h
@@ -39,7 +39,7 @@ struct ltstr {
bool operator()(const char* s1, const char* s2) const;
};
-class SPFilter : public SPObject, public CObject {
+class SPFilter : public SPObject {
public:
SPFilter();
virtual ~SPFilter();
diff --git a/src/sp-flowdiv.cpp b/src/sp-flowdiv.cpp
index 1052b4a64..13233748d 100644
--- a/src/sp-flowdiv.cpp
+++ b/src/sp-flowdiv.cpp
@@ -45,7 +45,6 @@ namespace {
}
SPFlowdiv::SPFlowdiv() : SPItem() {
- this->cobject = this;
}
SPFlowdiv::~SPFlowdiv() {
@@ -179,7 +178,6 @@ Inkscape::XML::Node* SPFlowdiv::write(Inkscape::XML::Document *xml_doc, Inkscape
*/
SPFlowtspan::SPFlowtspan() : SPItem() {
- this->cobject = this;
}
SPFlowtspan::~SPFlowtspan() {
@@ -312,7 +310,6 @@ Inkscape::XML::Node *SPFlowtspan::write(Inkscape::XML::Document *xml_doc, Inksca
*
*/
SPFlowpara::SPFlowpara() : SPItem() {
- this->cobject = this;
}
SPFlowpara::~SPFlowpara() {
@@ -442,20 +439,18 @@ Inkscape::XML::Node *SPFlowpara::write(Inkscape::XML::Document *xml_doc, Inkscap
*
*/
-SPFlowline::SPFlowline() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
+SPFlowline::SPFlowline() : SPObject() {
}
SPFlowline::~SPFlowline() {
}
void SPFlowline::release() {
- CObject::release();
+ SPObject::release();
}
void SPFlowline::modified(unsigned int flags) {
- CObject::modified(flags);
+ SPObject::modified(flags);
if (flags & SP_OBJECT_MODIFIED_FLAG) {
flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
@@ -472,7 +467,7 @@ Inkscape::XML::Node *SPFlowline::write(Inkscape::XML::Document *xml_doc, Inkscap
} else {
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
@@ -482,20 +477,18 @@ Inkscape::XML::Node *SPFlowline::write(Inkscape::XML::Document *xml_doc, Inkscap
*
*/
-SPFlowregionbreak::SPFlowregionbreak() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
+SPFlowregionbreak::SPFlowregionbreak() : SPObject() {
}
SPFlowregionbreak::~SPFlowregionbreak() {
}
void SPFlowregionbreak::release() {
- CObject::release();
+ SPObject::release();
}
void SPFlowregionbreak::modified(unsigned int flags) {
- CObject::modified(flags);
+ SPObject::modified(flags);
if (flags & SP_OBJECT_MODIFIED_FLAG) {
flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
@@ -512,7 +505,7 @@ Inkscape::XML::Node *SPFlowregionbreak::write(Inkscape::XML::Document *xml_doc,
} else {
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-flowdiv.h b/src/sp-flowdiv.h
index 91f62522d..8fa64e2b8 100644
--- a/src/sp-flowdiv.h
+++ b/src/sp-flowdiv.h
@@ -66,7 +66,7 @@ public:
};
// these do not need any style
-class SPFlowline : public SPObject, public CObject {
+class SPFlowline : public SPObject {
public:
SPFlowline();
virtual ~SPFlowline();
@@ -77,7 +77,7 @@ public:
virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);
};
-class SPFlowregionbreak : public SPObject, public CObject {
+class SPFlowregionbreak : public SPObject {
public:
SPFlowregionbreak();
virtual ~SPFlowregionbreak();
diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp
index 360bf49f3..fab4c1f23 100644
--- a/src/sp-flowregion.cpp
+++ b/src/sp-flowregion.cpp
@@ -42,8 +42,6 @@ static void GetDest(SPObject* child,Shape **computed);
SPFlowregion::SPFlowregion() : SPItem() {
- this->cobject = this;
-
new (&this->computed) std::vector<Shape*>;
}
@@ -199,8 +197,6 @@ gchar* SPFlowregion::description() {
*
*/
SPFlowregionExclude::SPFlowregionExclude() : SPItem() {
- this->cobject = this;
-
this->computed = NULL;
}
diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp
index 3b3d3cee7..4ee0a64b1 100644
--- a/src/sp-flowtext.cpp
+++ b/src/sp-flowtext.cpp
@@ -44,8 +44,6 @@ namespace {
}
SPFlowtext::SPFlowtext() : SPItem() {
- this->cobject = this;
-
this->par_indent = 0;
new (&this->layout) Inkscape::Text::Layout();
}
diff --git a/src/sp-font-face.cpp b/src/sp-font-face.cpp
index d91910bec..39242b870 100644
--- a/src/sp-font-face.cpp
+++ b/src/sp-font-face.cpp
@@ -269,10 +269,7 @@ namespace {
bool fontFaceRegistered = SPFactory::instance().registerObject("svg:font-face", createFontFace);
}
-SPFontFace::SPFontFace() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPFontFace::SPFontFace() : SPObject() {
std::vector<FontFaceStyleType> style;
style.push_back(SP_FONTFACE_STYLE_ALL);
this->font_style = style;
@@ -328,7 +325,7 @@ SPFontFace::~SPFontFace() {
}
void SPFontFace::build(SPDocument *document, Inkscape::XML::Node *repr) {
- CObject::build(document, repr);
+ SPObject::build(document, repr);
SPFontFace* object = this;
@@ -379,7 +376,7 @@ void SPFontFace::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *re
SPFontFace *f = SP_FONTFACE(object);
- CObject::child_added(child, ref);
+ SPObject::child_added(child, ref);
sp_fontface_children_modified(f);
object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
@@ -394,14 +391,14 @@ void SPFontFace::remove_child(Inkscape::XML::Node *child) {
SPFontFace *f = SP_FONTFACE(object);
- CObject::remove_child(child);
+ SPObject::remove_child(child);
sp_fontface_children_modified(f);
object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
void SPFontFace::release() {
- CObject::release();
+ SPObject::release();
}
void SPFontFace::set(unsigned int key, const gchar *value) {
@@ -689,7 +686,7 @@ void SPFontFace::set(unsigned int key, const gchar *value) {
break;
}
default:
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -736,7 +733,7 @@ void SPFontFace::update(SPCtx *ctx, guint flags) {
object->readAttr( "overline-thickness" );
}
- CObject::update(ctx, flags);
+ SPObject::update(ctx, flags);
}
#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key));
@@ -823,7 +820,7 @@ Inkscape::XML::Node* SPFontFace::write(Inkscape::XML::Document *xml_doc, Inkscap
COPY_ATTR(repr, object->getRepr(), "overline-thickness");
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-font-face.h b/src/sp-font-face.h
index cf77f1a73..688f3735e 100644
--- a/src/sp-font-face.h
+++ b/src/sp-font-face.h
@@ -71,7 +71,7 @@ enum FontFaceUnicodeRangeType{
FONTFACE_UNICODERANGE_FIXME_HERE,
};
-class SPFontFace : public SPObject, public CObject {
+class SPFontFace : public SPObject {
public:
SPFontFace();
virtual ~SPFontFace();
diff --git a/src/sp-font.cpp b/src/sp-font.cpp
index 3a8997820..b85d25918 100644
--- a/src/sp-font.cpp
+++ b/src/sp-font.cpp
@@ -40,10 +40,7 @@ double FNT_DEFAULT_ADV = 90; // TODO determine proper default
double FNT_DEFAULT_ASCENT = 90; // TODO determine proper default
double FNT_UNITS_PER_EM = 90; // TODO determine proper default
-SPFont::SPFont() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPFont::SPFont() : SPObject() {
this->horiz_origin_x = 0;
this->horiz_origin_y = 0;
this->horiz_adv_x = FNT_DEFAULT_ADV;
@@ -56,7 +53,7 @@ SPFont::~SPFont() {
}
void SPFont::build(SPDocument *document, Inkscape::XML::Node *repr) {
- CObject::build(document, repr);
+ SPObject::build(document, repr);
SPFont* object = this;
@@ -80,7 +77,7 @@ static void sp_font_children_modified(SPFont */*sp_font*/)
void SPFont::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) {
SPFont* object = this;
SPFont *f = SP_FONT(object);
- CObject::child_added(child, ref);
+ SPObject::child_added(child, ref);
sp_font_children_modified(f);
object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
@@ -94,7 +91,7 @@ void SPFont::remove_child(Inkscape::XML::Node* child) {
SPFont* object = this;
SPFont *f = SP_FONT(object);
- CObject::remove_child(child);
+ SPObject::remove_child(child);
sp_font_children_modified(f);
object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
@@ -106,7 +103,7 @@ void SPFont::release() {
object->document->removeResource("font", object);
- CObject::release();
+ SPObject::release();
}
void SPFont::set(unsigned int key, const gchar *value) {
@@ -170,7 +167,7 @@ void SPFont::set(unsigned int key, const gchar *value) {
break;
}
default:
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -190,7 +187,7 @@ void SPFont::update(SPCtx *ctx, guint flags) {
object->readAttr( "vert-adv-y" );
}
- CObject::update(ctx, flags);
+ SPObject::update(ctx, flags);
}
#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key));
@@ -221,7 +218,7 @@ Inkscape::XML::Node* SPFont::write(Inkscape::XML::Document *xml_doc, Inkscape::X
COPY_ATTR(repr, object->getRepr(), "vert-adv-y");
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-font.h b/src/sp-font.h
index 26718e187..f88d522eb 100644
--- a/src/sp-font.h
+++ b/src/sp-font.h
@@ -21,7 +21,7 @@
#define SP_FONT(obj) ((SPFont*)obj)
#define SP_IS_FONT(obj) (dynamic_cast<const SPFont*>((SPObject*)obj))
-class SPFont : public SPObject, public CObject {
+class SPFont : public SPObject {
public:
SPFont();
virtual ~SPFont();
diff --git a/src/sp-glyph-kerning.cpp b/src/sp-glyph-kerning.cpp
index c0d408d30..287ade4b8 100644
--- a/src/sp-glyph-kerning.cpp
+++ b/src/sp-glyph-kerning.cpp
@@ -26,10 +26,7 @@
#include <cstring>
-SPGlyphKerning::SPGlyphKerning() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPGlyphKerning::SPGlyphKerning() : SPObject() {
//TODO: correct these values:
this->u1 = NULL;
this->g1 = NULL;
@@ -44,7 +41,7 @@ SPGlyphKerning::~SPGlyphKerning() {
void SPGlyphKerning::build(SPDocument *document, Inkscape::XML::Node *repr) {
SPGlyphKerning* object = this;
- CObject::build(document, repr);
+ SPObject::build(document, repr);
object->readAttr( "u1" );
object->readAttr( "g1" );
@@ -54,7 +51,7 @@ void SPGlyphKerning::build(SPDocument *document, Inkscape::XML::Node *repr) {
}
void SPGlyphKerning::release() {
- CObject::release();
+ SPObject::release();
}
GlyphNames::GlyphNames(const gchar* value){
@@ -129,7 +126,7 @@ void SPGlyphKerning::set(unsigned int key, const gchar *value) {
}
default:
{
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -152,7 +149,7 @@ void SPGlyphKerning::update(SPCtx *ctx, guint flags) {
object->readAttr( "k" );
}
- CObject::update(ctx, flags);
+ SPObject::update(ctx, flags);
}
#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key));
@@ -188,7 +185,7 @@ Inkscape::XML::Node* SPGlyphKerning::write(Inkscape::XML::Document *xml_doc, Ink
COPY_ATTR(repr, object->getRepr(), "k");
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-glyph-kerning.h b/src/sp-glyph-kerning.h
index 2a2eb1763..b805c353a 100644
--- a/src/sp-glyph-kerning.h
+++ b/src/sp-glyph-kerning.h
@@ -46,7 +46,7 @@ private:
gchar* names;
};
-class SPGlyphKerning : public SPObject, public CObject {
+class SPGlyphKerning : public SPObject {
public:
SPGlyphKerning();
virtual ~SPGlyphKerning();
diff --git a/src/sp-glyph.cpp b/src/sp-glyph.cpp
index 6acef4db9..f18c3ef6d 100644
--- a/src/sp-glyph.cpp
+++ b/src/sp-glyph.cpp
@@ -32,10 +32,7 @@ namespace {
bool glyphRegistered = SPFactory::instance().registerObject("svg:glyph", createGlyph);
}
-SPGlyph::SPGlyph() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPGlyph::SPGlyph() : SPObject() {
//TODO: correct these values:
new (&this->unicode) Glib::ustring();
@@ -54,7 +51,7 @@ SPGlyph::~SPGlyph() {
}
void SPGlyph::build(SPDocument *document, Inkscape::XML::Node *repr) {
- CObject::build(document, repr);
+ SPObject::build(document, repr);
SPGlyph* object = this;
@@ -71,7 +68,7 @@ void SPGlyph::build(SPDocument *document, Inkscape::XML::Node *repr) {
}
void SPGlyph::release() {
- CObject::release();
+ SPObject::release();
}
static glyphArabicForm sp_glyph_read_arabic_form(gchar const *value){
@@ -195,7 +192,7 @@ void SPGlyph::set(unsigned int key, const gchar *value) {
}
default:
{
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -224,7 +221,7 @@ void SPGlyph::update(SPCtx *ctx, guint flags) {
object->readAttr( "vert-adv-y" );
}
- CObject::update(ctx, flags);
+ SPObject::update(ctx, flags);
}
#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key));
@@ -265,7 +262,7 @@ Inkscape::XML::Node* SPGlyph::write(Inkscape::XML::Document *xml_doc, Inkscape::
COPY_ATTR(repr, object->getRepr(), "vert-adv-y");
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-glyph.h b/src/sp-glyph.h
index 5ac0b4707..fbb3aa2ff 100644
--- a/src/sp-glyph.h
+++ b/src/sp-glyph.h
@@ -34,7 +34,7 @@ enum glyphOrientation {
GLYPH_ORIENTATION_BOTH
};
-class SPGlyph : public SPObject, public CObject {
+class SPGlyph : public SPObject {
public:
SPGlyph();
virtual ~SPGlyph();
diff --git a/src/sp-gradient.cpp b/src/sp-gradient.cpp
index 530e5be40..2cdf2198f 100644
--- a/src/sp-gradient.cpp
+++ b/src/sp-gradient.cpp
@@ -145,9 +145,6 @@ SPGradient::SPGradient() : SPPaintServer(), units(),
state(2),
vector() {
-
- this->cobject = this;
-
this->has_patches = 0;
this->ref = new SPGradientReference(this);
@@ -421,7 +418,9 @@ void SPGradient::remove_child(Inkscape::XML::Node *child)
void SPGradient::modified(guint flags)
{
if (flags & SP_OBJECT_CHILD_MODIFIED_FLAG) {
- if( this->get_type() != SP_GRADIENT_TYPE_MESH ) {
+ // CPPIFY
+ //if( this->get_type() != SP_GRADIENT_TYPE_MESH ) {
+ if (!SP_IS_MESHGRADIENT(this)) {
this->invalidateVector();
} else {
this->invalidateArray();
@@ -429,7 +428,9 @@ void SPGradient::modified(guint flags)
}
if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) {
- if( this->get_type() != SP_GRADIENT_TYPE_MESH ) {
+ // CPPIFY
+ //if( this->get_type() != SP_GRADIENT_TYPE_MESH ) {
+ if (!SP_IS_MESHGRADIENT(this)) {
this->ensureVector();
} else {
this->ensureArray();
@@ -1043,8 +1044,9 @@ sp_gradient_create_preview_pattern(SPGradient *gr, double width)
{
cairo_pattern_t *pat = NULL;
- if( gr->get_type() != SP_GRADIENT_TYPE_MESH ) {
-
+ // CPPIFY
+ //if( gr->get_type() != SP_GRADIENT_TYPE_MESH ) {
+ if (!SP_IS_MESHGRADIENT(gr)) {
gr->ensureVector();
pat = cairo_pattern_create_linear(0, 0, width, 0);
diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp
index 970ba25ba..3182195ff 100644
--- a/src/sp-guide.cpp
+++ b/src/sp-guide.cpp
@@ -91,10 +91,7 @@ namespace {
//}
// CPPIFY: properties!
-SPGuide::SPGuide() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPGuide::SPGuide() : SPObject() {
this->label = NULL;
this->views = NULL;
@@ -140,7 +137,7 @@ static void sp_guide_get_property(GObject *object, guint prop_id, GValue *value,
}
void SPGuide::build(SPDocument *document, Inkscape::XML::Node *repr) {
- CObject::build(document, repr);
+ SPObject::build(document, repr);
SPGuide* object = this;
@@ -166,7 +163,7 @@ void SPGuide::release() {
object->document->removeResource("guide", object);
}
- CObject::release();
+ SPObject::release();
}
void SPGuide::set(unsigned int key, const gchar *value) {
@@ -240,7 +237,7 @@ void SPGuide::set(unsigned int key, const gchar *value) {
}
break;
default:
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
diff --git a/src/sp-guide.h b/src/sp-guide.h
index 30a9b8b75..748420d40 100644
--- a/src/sp-guide.h
+++ b/src/sp-guide.h
@@ -27,7 +27,7 @@ class SPDesktop;
#define SP_IS_GUIDE(obj) (dynamic_cast<const SPGuide*>((SPObject*)obj))
/* Represents the constraint on p that dot(g.direction, p) == g.position. */
-class SPGuide : public SPObject, public CObject {
+class SPGuide : public SPObject {
public:
SPGuide();
virtual ~SPGuide();
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index 632340ee4..d4cd2eff2 100644
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
@@ -515,8 +515,6 @@ namespace {
}
SPImage::SPImage() : SPItem() {
- this->cobject = this;
-
this->aspect_clip = 0;
this->x.unset();
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index 45617e282..ab38636f6 100644
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
@@ -66,8 +66,6 @@ namespace {
}
SPGroup::SPGroup() : SPLPEItem() {
- this->cobject = this;
-
this->_layer_mode = SPGroup::GROUP;
new (&this->_display_modes) std::map<unsigned int, SPGroup::LayerMode>();
}
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 57c00d12d..c2e502e7e 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -80,10 +80,7 @@ static SPItemView* sp_item_view_list_remove(SPItemView *list,
SPItemView *view);
-SPItem::SPItem() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPItem::SPItem() : SPObject() {
this->sensitive = 0;
this->clip_ref = NULL;
this->avoidRef = NULL;
@@ -398,7 +395,7 @@ void SPItem::build(SPDocument *document, Inkscape::XML::Node *repr) {
object->readAttr( "inkscape:connector-avoid" );
object->readAttr( "inkscape:connection-points" );
- CObject::build(document, repr);
+ SPObject::build(document, repr);
}
void SPItem::release() {
@@ -415,7 +412,7 @@ void SPItem::release() {
delete item->clip_ref;
delete item->mask_ref;
- CObject::release();
+ SPObject::release();
while (item->display) {
item->display = sp_item_view_list_remove(item->display, item->display);
@@ -507,7 +504,7 @@ void SPItem::set(unsigned int key, gchar const* value) {
sp_style_read_from_object(object->style, object);
object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG);
} else {
- CObject::set(key, value);
+ SPObject::set(key, value);
}
break;
}
@@ -567,7 +564,7 @@ void SPItem::update(SPCtx *ctx, guint flags) {
SPItem *item = this;
SPItem* object = item;
-// CObject::onUpdate(ctx, flags);
+// SPObject::onUpdate(ctx, flags);
// any of the modifications defined in sp-object.h might change bbox,
// so we invalidate it unconditionally
@@ -681,7 +678,7 @@ Inkscape::XML::Node* SPItem::write(Inkscape::XML::Document *xml_doc, Inkscape::X
}
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-item.h b/src/sp-item.h
index 1f581e6c2..a5587f7f6 100644
--- a/src/sp-item.h
+++ b/src/sp-item.h
@@ -103,7 +103,7 @@ public:
#define SP_IS_ITEM(obj) (dynamic_cast<const SPItem*>((SPObject*)obj))
/** Abstract base class for all visible shapes. */
-class SPItem : public SPObject, public CObject {
+class SPItem : public SPObject {
public:
enum BBoxType {
// legacy behavior: includes crude stroke, markers; excludes long miters, blur margin; is known to be wrong for caps
diff --git a/src/sp-line.cpp b/src/sp-line.cpp
index eee59930b..3963007de 100644
--- a/src/sp-line.cpp
+++ b/src/sp-line.cpp
@@ -35,8 +35,6 @@ namespace {
}
SPLine::SPLine() : SPShape() {
- this->cobject = this;
-
this->x1.unset();
this->y1.unset();
this->x2.unset();
diff --git a/src/sp-linear-gradient.cpp b/src/sp-linear-gradient.cpp
index d1d3f9d74..4305d1acf 100644
--- a/src/sp-linear-gradient.cpp
+++ b/src/sp-linear-gradient.cpp
@@ -18,8 +18,6 @@ namespace {
* Linear Gradient
*/
SPLinearGradient::SPLinearGradient() : SPGradient() {
- this->cobject = this;
-
this->x1.unset(SVGLength::PERCENT, 0.0, 0.0);
this->y1.unset(SVGLength::PERCENT, 0.0, 0.0);
this->x2.unset(SVGLength::PERCENT, 1.0, 1.0);
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index dc8e166e4..fa5930570 100644
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
@@ -50,8 +50,6 @@ static std::string patheffectlist_write_svg(PathEffectList const & list);
static std::string hreflist_write_svg(HRefList const & list);
SPLPEItem::SPLPEItem() : SPItem() {
- this->cobject = this;
-
this->path_effects_enabled = 1;
this->path_effect_list = new PathEffectList();
diff --git a/src/sp-mask.cpp b/src/sp-mask.cpp
index 101c041d2..186e927f7 100644
--- a/src/sp-mask.cpp
+++ b/src/sp-mask.cpp
@@ -48,8 +48,6 @@ namespace {
}
SPMask::SPMask() : SPObjectGroup() {
- this->cobject = this;
-
this->maskUnits_set = FALSE;
this->maskUnits = SP_CONTENT_UNITS_OBJECTBOUNDINGBOX;
diff --git a/src/sp-mesh-gradient.cpp b/src/sp-mesh-gradient.cpp
index 5021b516e..2e12a2d32 100644
--- a/src/sp-mesh-gradient.cpp
+++ b/src/sp-mesh-gradient.cpp
@@ -20,8 +20,6 @@ namespace {
*/
//#define MESH_DEBUG
SPMeshGradient::SPMeshGradient() : SPGradient() {
- this->cobject = this;
-
// Start coordinate of mesh
this->x.unset(SVGLength::NONE, 0.0, 0.0);
this->y.unset(SVGLength::NONE, 0.0, 0.0);
diff --git a/src/sp-mesh-patch.cpp b/src/sp-mesh-patch.cpp
index e3e9044a5..b4d0e951b 100644
--- a/src/sp-mesh-patch.cpp
+++ b/src/sp-mesh-patch.cpp
@@ -69,10 +69,7 @@ SPMeshPatch* SPMeshPatch::getPrevMeshPatch()
* Mesh Patch
*/
-SPMeshPatch::SPMeshPatch() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPMeshPatch::SPMeshPatch() : SPObject() {
this->tensor_string = NULL;
}
@@ -82,7 +79,7 @@ SPMeshPatch::~SPMeshPatch() {
void SPMeshPatch::build(SPDocument* doc, Inkscape::XML::Node* repr) {
SPMeshPatch* object = this;
- CObject::build(doc, repr);
+ SPObject::build(doc, repr);
object->readAttr( "tensor" );
}
@@ -119,7 +116,7 @@ Inkscape::XML::Node* SPMeshPatch::write(Inkscape::XML::Document* xml_doc, Inksca
repr = xml_doc->createElement("svg:meshPatch");
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-mesh-patch.h b/src/sp-mesh-patch.h
index 4f2b4a566..1b8d58df1 100644
--- a/src/sp-mesh-patch.h
+++ b/src/sp-mesh-patch.h
@@ -17,13 +17,11 @@
//#include "svg/svg-length.h"
#include "sp-object.h"
-class SPObjectClass;
-
#define SP_MESHPATCH(obj) ((SPMeshPatch*)obj)
#define SP_IS_MESHPATCH(obj) (dynamic_cast<const SPMeshPatch*>((SPObject*)obj))
/** Gradient MeshPatch. */
-class SPMeshPatch : public SPObject, public CObject {
+class SPMeshPatch : public SPObject {
public:
SPMeshPatch();
virtual ~SPMeshPatch();
diff --git a/src/sp-mesh-row.cpp b/src/sp-mesh-row.cpp
index 9cffb3389..04619d6cc 100644
--- a/src/sp-mesh-row.cpp
+++ b/src/sp-mesh-row.cpp
@@ -67,16 +67,14 @@ SPMeshRow* SPMeshRow::getPrevMeshRow()
/*
* Mesh Row
*/
-SPMeshRow::SPMeshRow() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
+SPMeshRow::SPMeshRow() : SPObject() {
}
SPMeshRow::~SPMeshRow() {
}
void SPMeshRow::build(SPDocument* doc, Inkscape::XML::Node* repr) {
- CObject::build(doc, repr);
+ SPObject::build(doc, repr);
}
/**
@@ -95,7 +93,7 @@ Inkscape::XML::Node* SPMeshRow::write(Inkscape::XML::Document* xml_doc, Inkscape
repr = xml_doc->createElement("svg:meshRow");
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-mesh-row.h b/src/sp-mesh-row.h
index aeb4af561..3d9dd6b99 100644
--- a/src/sp-mesh-row.h
+++ b/src/sp-mesh-row.h
@@ -20,7 +20,7 @@ class SPObjectClass;
#define SP_IS_MESHROW(obj) (dynamic_cast<const SPMeshRow*>((SPObject*)obj))
/** Gradient MeshRow. */
-class SPMeshRow : public SPObject, public CObject {
+class SPMeshRow : public SPObject {
public:
SPMeshRow();
virtual ~SPMeshRow();
diff --git a/src/sp-metadata.cpp b/src/sp-metadata.cpp
index 22fbc320a..edb73c9b1 100644
--- a/src/sp-metadata.cpp
+++ b/src/sp-metadata.cpp
@@ -43,10 +43,7 @@ namespace {
bool metadataRegistered = SPFactory::instance().registerObject("svg:metadata", createMetadata);
}
-SPMetadata::SPMetadata() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPMetadata::SPMetadata() : SPObject() {
(void)this;
debug("0x%08x",(unsigned int)this);
}
@@ -83,7 +80,7 @@ void SPMetadata::build(SPDocument* doc, Inkscape::XML::Node* repr) {
}
}
- CObject::build(doc, repr);
+ SPObject::build(doc, repr);
}
void SPMetadata::release() {
@@ -91,7 +88,7 @@ void SPMetadata::release() {
// handle ourself
- CObject::release();
+ SPObject::release();
}
void SPMetadata::set(unsigned int key, const gchar* value) {
@@ -99,7 +96,7 @@ void SPMetadata::set(unsigned int key, const gchar* value) {
sp_attribute_name(key),key,value);
// see if any parents need this value
- CObject::set(key, value);
+ SPObject::set(key, value);
}
void SPMetadata::update(SPCtx* ctx, unsigned int flags) {
@@ -113,7 +110,7 @@ void SPMetadata::update(SPCtx* ctx, unsigned int flags) {
}
-// CObject::onUpdate(ctx, flags);
+// SPObject::onUpdate(ctx, flags);
}
Inkscape::XML::Node* SPMetadata::write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, guint flags) {
@@ -130,7 +127,7 @@ Inkscape::XML::Node* SPMetadata::write(Inkscape::XML::Document* doc, Inkscape::X
}
}
- CObject::write(doc, repr, flags);
+ SPObject::write(doc, repr, flags);
return repr;
}
diff --git a/src/sp-metadata.h b/src/sp-metadata.h
index 8857e1645..02193f1ed 100644
--- a/src/sp-metadata.h
+++ b/src/sp-metadata.h
@@ -20,7 +20,7 @@
#define SP_METADATA(obj) ((SPMetadata*)obj)
#define SP_IS_METADATA(obj) (dynamic_cast<const SPMetadata*>((SPObject*)obj))
-class SPMetadata : public SPObject, public CObject {
+class SPMetadata : public SPObject {
public:
SPMetadata();
virtual ~SPMetadata();
diff --git a/src/sp-missing-glyph.cpp b/src/sp-missing-glyph.cpp
index ef9843cea..a3b440ab0 100644
--- a/src/sp-missing-glyph.cpp
+++ b/src/sp-missing-glyph.cpp
@@ -29,10 +29,7 @@ namespace {
bool missingGlyphRegistered = SPFactory::instance().registerObject("svg:missing-glyph", createMissingGlyph);
}
-SPMissingGlyph::SPMissingGlyph() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPMissingGlyph::SPMissingGlyph() : SPObject() {
//TODO: correct these values:
this->d = NULL;
this->horiz_adv_x = 0;
@@ -47,7 +44,7 @@ SPMissingGlyph::~SPMissingGlyph() {
void SPMissingGlyph::build(SPDocument* doc, Inkscape::XML::Node* repr) {
SPMissingGlyph* object = this;
- CObject::build(doc, repr);
+ SPObject::build(doc, repr);
object->readAttr( "d" );
object->readAttr( "horiz-adv-x" );
@@ -57,7 +54,7 @@ void SPMissingGlyph::build(SPDocument* doc, Inkscape::XML::Node* repr) {
}
void SPMissingGlyph::release() {
- CObject::release();
+ SPObject::release();
}
@@ -114,7 +111,7 @@ void SPMissingGlyph::set(unsigned int key, const gchar* value) {
}
default:
{
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -149,7 +146,7 @@ Inkscape::XML::Node* SPMissingGlyph::write(Inkscape::XML::Document* xml_doc, Ink
COPY_ATTR(repr, object->getRepr(), "vert-adv-y");
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-missing-glyph.h b/src/sp-missing-glyph.h
index 513adf464..a9d94b311 100644
--- a/src/sp-missing-glyph.h
+++ b/src/sp-missing-glyph.h
@@ -21,7 +21,7 @@
#define SP_MISSING_GLYPH(obj) ((SPMissingGlyph*)obj)
#define SP_IS_MISSING_GLYPH(obj) (dynamic_cast<const SPMissingGlyph*>((SPObject*)obj))
-class SPMissingGlyph : public SPObject, public CObject {
+class SPMissingGlyph : public SPObject {
public:
SPMissingGlyph();
virtual ~SPMissingGlyph();
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp
index 767017e6d..31074732d 100644
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
@@ -66,8 +66,6 @@ namespace {
}
SPNamedView::SPNamedView() : SPObjectGroup(), snap_manager(this) {
- this->cobject = this;
-
this->zoom = 0;
this->guidecolor = 0;
this->guidehicolor = 0;
diff --git a/src/sp-object-group.cpp b/src/sp-object-group.cpp
index afe425211..19b813236 100644
--- a/src/sp-object-group.cpp
+++ b/src/sp-object-group.cpp
@@ -16,9 +16,7 @@
#include "xml/repr.h"
#include "document.h"
-SPObjectGroup::SPObjectGroup() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
+SPObjectGroup::SPObjectGroup() : SPObject() {
}
SPObjectGroup::~SPObjectGroup() {
@@ -27,7 +25,7 @@ SPObjectGroup::~SPObjectGroup() {
void SPObjectGroup::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) {
SPObjectGroup* object = this;
- CObject::child_added(child, ref);
+ SPObject::child_added(child, ref);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
@@ -36,7 +34,7 @@ void SPObjectGroup::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node
void SPObjectGroup::remove_child(Inkscape::XML::Node *child) {
SPObjectGroup* object = this;
- CObject::remove_child(child);
+ SPObject::remove_child(child);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
@@ -45,7 +43,7 @@ void SPObjectGroup::remove_child(Inkscape::XML::Node *child) {
void SPObjectGroup::order_changed(Inkscape::XML::Node *child, Inkscape::XML::Node *old_ref, Inkscape::XML::Node *new_ref) {
SPObjectGroup* object = this;
- CObject::order_changed(child, old_ref, new_ref);
+ SPObject::order_changed(child, old_ref, new_ref);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
@@ -76,7 +74,7 @@ Inkscape::XML::Node *SPObjectGroup::write(Inkscape::XML::Document *xml_doc, Inks
}
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-object-group.h b/src/sp-object-group.h
index faa7872ed..06249e4ae 100644
--- a/src/sp-object-group.h
+++ b/src/sp-object-group.h
@@ -19,7 +19,7 @@
#define SP_OBJECTGROUP(obj) ((SPObjectGroup*)obj)
#define SP_IS_OBJECTGROUP(obj) (dynamic_cast<const SPObjectGroup*>((SPObject*)obj))
-class SPObjectGroup : public SPObject, public CObject {
+class SPObjectGroup : public SPObject {
public:
SPObjectGroup();
virtual ~SPObjectGroup();
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 510b53177..7d42efebe 100644
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
@@ -103,136 +103,78 @@ public:
}
};
-static void sp_object_finalize(GObject *object);
-
static gchar *sp_object_get_unique_id(SPObject *object,
gchar const *defid);
-G_DEFINE_TYPE(SPObject, sp_object, G_TYPE_OBJECT);
-
-/**
- * Initializes the SPObject vtable.
- */
-static void
-sp_object_class_init(SPObjectClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS(klass);
- object_class->finalize = sp_object_finalize;
-}
-
SPObject::SPObject() {
- SPObject* object = this;
-
- debug("id=%x, typename=%s",object, g_type_name_from_instance((GTypeInstance*)object));
+ debug("id=%x, typename=%s",this, g_type_name_from_instance((GTypeInstance*)object));
- object->cobject = new CObject(object);
-
- new (&object->typeHierarchy) std::set<TypeInfo>();
- object->typeHierarchy.insert(typeid(SPObject));
-
- object->repr = NULL;
- object->mflags = 0;
- object->id = NULL;
- object->cloned = 0;
- object->uflags = 0;
+ this->repr = NULL;
+ this->mflags = 0;
+ this->id = NULL;
+ this->cloned = 0;
+ this->uflags = 0;
- object->hrefcount = 0;
- object->_total_hrefcount = 0;
- object->document = NULL;
- object->children = object->_last_child = NULL;
- object->parent = object->next = NULL;
+ this->hrefcount = 0;
+ this->_total_hrefcount = 0;
+ this->document = NULL;
+ this->children = this->_last_child = NULL;
+ this->parent = this->next = NULL;
//used XML Tree here.
- object->getRepr(); // TODO check why this call is made
+ this->getRepr(); // TODO check why this call is made
- SPObjectImpl::setIdNull(object);
+ SPObjectImpl::setIdNull(this);
- object->_collection_policy = SPObject::COLLECT_WITH_PARENT;
+ this->_collection_policy = SPObject::COLLECT_WITH_PARENT;
- new (&object->_release_signal) sigc::signal<void, SPObject *>();
- new (&object->_modified_signal) sigc::signal<void, SPObject *, unsigned int>();
- new (&object->_delete_signal) sigc::signal<void, SPObject *>();
- new (&object->_position_changed_signal) sigc::signal<void, SPObject *>();
- object->_successor = NULL;
+ new (&this->_release_signal) sigc::signal<void, SPObject *>();
+ new (&this->_modified_signal) sigc::signal<void, SPObject *, unsigned int>();
+ new (&this->_delete_signal) sigc::signal<void, SPObject *>();
+ new (&this->_position_changed_signal) sigc::signal<void, SPObject *>();
+ this->_successor = NULL;
// FIXME: now we create style for all objects, but per SVG, only the following can have style attribute:
// vg, g, defs, desc, title, symbol, use, image, switch, path, rect, circle, ellipse, line, polyline,
// polygon, text, tspan, tref, textPath, altGlyph, glyphRef, marker, linearGradient, radialGradient,
// stop, pattern, clipPath, mask, filter, feImage, a, font, glyph, missing-glyph, foreignObject
- object->style = sp_style_new_from_object(object);
+ this->style = sp_style_new_from_object(this);
- object->_label = NULL;
- object->_default_label = NULL;
+ this->_label = NULL;
+ this->_default_label = NULL;
}
SPObject::~SPObject() {
+ g_free(this->_label);
+ g_free(this->_default_label);
-}
+ this->_label = NULL;
+ this->_default_label = NULL;
-/**
- * Callback to initialize the SPObject object.
- */
-static void
-sp_object_init(SPObject *object)
-{
- new (object) SPObject();
+ if (this->_successor) {
+ sp_object_unref(this->_successor, NULL);
+ this->_successor = NULL;
+ }
+
+ this->_release_signal.~signal();
+ this->_modified_signal.~signal();
+ this->_delete_signal.~signal();
+ this->_position_changed_signal.~signal();
}
// CPPIFY: make pure virtual
-void CObject::read_content() {
+void SPObject::read_content() {
//throw;
}
-void CObject::update(SPCtx* ctx, unsigned int flags) {
+void SPObject::update(SPCtx* ctx, unsigned int flags) {
//throw;
}
-void CObject::modified(unsigned int flags) {
+void SPObject::modified(unsigned int flags) {
//throw;
}
-
-/**
- * Callback to destroy all members and connections of object and itself.
- */
-static void
-sp_object_finalize(GObject *object)
-{
- SPObject *spobject = (SPObject *)object;
-
- spobject->typeHierarchy.~set();
- delete spobject->cobject;
-
- g_free(spobject->_label);
- g_free(spobject->_default_label);
- spobject->_label = NULL;
- spobject->_default_label = NULL;
-
- if (spobject->_successor) {
- sp_object_unref(spobject->_successor, NULL);
- spobject->_successor = NULL;
- }
-
- spobject->_release_signal.~signal();
- spobject->_modified_signal.~signal();
- spobject->_delete_signal.~signal();
- spobject->_position_changed_signal.~signal();
-
- if (((GObjectClass *) (sp_object_parent_class))->finalize) {
- (* ((GObjectClass *) (sp_object_parent_class))->finalize)(object);
- }
-}
-
-
-// CPPIFY: remove
-CObject::CObject(SPObject* object) {
- this->spobject = object;
-}
-
-CObject::~CObject() {
-}
-
-
namespace {
namespace Debug = Inkscape::Debug;
@@ -647,8 +589,8 @@ SPObject *SPObject::get_child_by_repr(Inkscape::XML::Node *repr)
return result;
}
-void CObject::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) {
- SPObject* object = this->spobject;
+void SPObject::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) {
+ SPObject* object = this;
// GType type = sp_repr_type_lookup(child);
// if (!type) {
@@ -668,8 +610,8 @@ void CObject::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref)
ochild->invoke_build(object->document, child, object->cloned);
}
-void CObject::release() {
- SPObject* object = this->spobject;
+void SPObject::release() {
+ SPObject* object = this;
debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));
while (object->children) {
@@ -677,8 +619,8 @@ void CObject::release() {
}
}
-void CObject::remove_child(Inkscape::XML::Node* child) {
- SPObject* object = this->spobject;
+void SPObject::remove_child(Inkscape::XML::Node* child) {
+ SPObject* object = this;
debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));
SPObject *ochild = object->get_child_by_repr(child);
@@ -688,8 +630,8 @@ void CObject::remove_child(Inkscape::XML::Node* child) {
}
}
-void CObject::order_changed(Inkscape::XML::Node *child, Inkscape::XML::Node * old_ref, Inkscape::XML::Node *new_ref) {
- SPObject* object = this->spobject;
+void SPObject::order_changed(Inkscape::XML::Node *child, Inkscape::XML::Node * old_ref, Inkscape::XML::Node *new_ref) {
+ SPObject* object = this;
SPObject *ochild = object->get_child_by_repr(child);
g_return_if_fail(ochild != NULL);
@@ -698,8 +640,8 @@ void CObject::order_changed(Inkscape::XML::Node *child, Inkscape::XML::Node * ol
ochild->_position_changed_signal.emit(ochild);
}
-void CObject::build(SPDocument *document, Inkscape::XML::Node *repr) {
- SPObject* object = this->spobject;
+void SPObject::build(SPDocument *document, Inkscape::XML::Node *repr) {
+ SPObject* object = this;
/* Nothing specific here */
debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));
@@ -782,7 +724,7 @@ void SPObject::invoke_build(SPDocument *document, Inkscape::XML::Node *repr, uns
}
/* Invoke derived methods, if any */
- this->cobject->build(document, repr);
+ this->build(document, repr);
/* Signalling (should be connected AFTER processing derived methods */
sp_repr_add_listener(repr, &object_event_vector, this);
@@ -821,7 +763,7 @@ void SPObject::releaseReferences() {
this->_release_signal.emit(this);
- this->cobject->release();
+ this->release();
/* all hrefs should be released by the "release" handlers */
g_assert(this->hrefcount == 0);
@@ -867,27 +809,27 @@ void SPObject::repr_child_added(Inkscape::XML::Node * /*repr*/, Inkscape::XML::N
{
SPObject *object = SP_OBJECT(data);
- object->cobject->child_added(child, ref);
+ object->child_added(child, ref);
}
void SPObject::repr_child_removed(Inkscape::XML::Node * /*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node * /*ref*/, gpointer data)
{
SPObject *object = SP_OBJECT(data);
- object->cobject->remove_child(child);
+ object->remove_child(child);
}
void SPObject::repr_order_changed(Inkscape::XML::Node * /*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node *old, Inkscape::XML::Node *newer, gpointer data)
{
SPObject *object = SP_OBJECT(data);
- object->cobject->order_changed(child, old, newer);
+ object->order_changed(child, old, newer);
}
-void CObject::set(unsigned int key, gchar const* value) {
+void SPObject::set(unsigned int key, gchar const* value) {
g_assert(key != SP_ATTR_INVALID);
- SPObject* object = this->spobject;
+ SPObject* object = this;
switch (key) {
case SP_ATTR_ID:
@@ -975,7 +917,7 @@ void SPObject::setKeyValue(unsigned int key, gchar const *value)
//g_assert(object != NULL);
//g_assert(SP_IS_OBJECT(object));
- this->cobject->set(key, value);
+ this->set(key, value);
}
void SPObject::readAttr(gchar const *key)
@@ -1013,7 +955,7 @@ void SPObject::repr_content_changed(Inkscape::XML::Node * /*repr*/, gchar const
{
SPObject *object = SP_OBJECT(data);
- object->cobject->read_content();
+ object->read_content();
}
/**
@@ -1031,8 +973,8 @@ static gchar const *sp_xml_get_space_string(unsigned int space)
}
}
-Inkscape::XML::Node* CObject::write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags) {
- SPObject* object = this->spobject;
+Inkscape::XML::Node* SPObject::write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags) {
+ SPObject* object = this;
if (!repr && (flags & SP_OBJECT_WRITE_BUILD)) {
repr = object->getRepr()->duplicate(doc);
@@ -1137,7 +1079,7 @@ Inkscape::XML::Node * SPObject::updateRepr(Inkscape::XML::Document *doc, Inkscap
if (!(flags & SP_OBJECT_WRITE_BUILD) && !repr) {
repr = getRepr();
}
- return this->cobject->write(doc, repr, flags);
+ return this->write(doc, repr, flags);
}
@@ -1204,7 +1146,7 @@ void SPObject::updateDisplay(SPCtx *ctx, unsigned int flags)
try
{
- this->cobject->update(ctx, flags);
+ this->update(ctx, flags);
}
catch(...)
{
@@ -1262,7 +1204,7 @@ void SPObject::emitModified(unsigned int flags)
sp_object_ref(this);
- this->cobject->modified(flags);
+ this->modified(flags);
_modified_signal.emit(this, flags);
sp_object_unref(this);
diff --git a/src/sp-object.h b/src/sp-object.h
index 2d3b412c9..e57a0d3d7 100644
--- a/src/sp-object.h
+++ b/src/sp-object.h
@@ -16,11 +16,8 @@
/* SPObject flags */
class SPObject;
-class SPObjectClass;
-#define SP_TYPE_OBJECT (sp_object_get_type())
#define SP_OBJECT(obj) ((SPObject*)obj)
-//#define SP_IS_OBJECT(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(SPObject)))
#define SP_IS_OBJECT(obj) (dynamic_cast<const SPObject*>((SPObject*)obj))
/* Async modification flags */
@@ -49,9 +46,6 @@ class SPObjectClass;
#define SP_OBJECT_WRITE_EXT (1 << 1)
#define SP_OBJECT_WRITE_ALL (1 << 2)
-#include <set>
-#include "type-info.h"
-
#include <glib-object.h>
#include <stddef.h>
#include <sigc++/connection.h>
@@ -117,8 +111,6 @@ struct SPIXmlSpace {
guint value : 1;
};
-GType sp_object_get_type() G_GNUC_CONST;
-
/*
* Refcounting
*
@@ -172,8 +164,6 @@ SPObject *sp_object_href(SPObject *object, gpointer owner);
*/
SPObject *sp_object_hunref(SPObject *object, gpointer owner);
-class CObject;
-
/**
* SPObject is an abstract base class of all of the document nodes at the
* SVG document level. Each SPObject subclass implements a certain SVG
@@ -201,9 +191,6 @@ public:
SPObject();
virtual ~SPObject();
- CObject* cobject;
- std::set<TypeInfo> typeHierarchy;
-
unsigned int cloned : 1;
unsigned int uflags : 8;
unsigned int mflags : 8;
@@ -801,9 +788,6 @@ private:
/* Real handlers of repr signals */
public:
-
- static GType get_type() {return sp_object_get_type();}
-
/**
* Callback for attr_changed node event.
*/
@@ -832,26 +816,9 @@ public:
static void repr_order_changed(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *old, Inkscape::XML::Node *newer, gpointer data);
- friend class SPObjectClass;
friend class SPObjectImpl;
- friend class CObject;
-};
-/// The SPObject vtable.
-class SPObjectClass {
public:
- GObjectClass parent_class;
-
-private:
- friend class SPObject;
-};
-
-
-class CObject {
-public:
- CObject(SPObject* object);
- virtual ~CObject();
-
virtual void build(SPDocument* doc, Inkscape::XML::Node* repr);
virtual void release();
@@ -868,9 +835,6 @@ public:
virtual void modified(unsigned int flags);
virtual Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, guint flags);
-
-protected:
- SPObject* spobject;
};
diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp
index 89f6e20d4..ef18acc8e 100644
--- a/src/sp-offset.cpp
+++ b/src/sp-offset.cpp
@@ -96,8 +96,6 @@ static void sp_offset_source_modified (SPObject *iSource, guint flags, SPItem *i
static bool use_slow_but_correct_offset_method=false;
SPOffset::SPOffset() : SPShape() {
- this->cobject = this;
-
this->rad = 1.0;
this->original = NULL;
this->originalPath = NULL;
diff --git a/src/sp-paint-server.cpp b/src/sp-paint-server.cpp
index b438e44b1..54b39a981 100644
--- a/src/sp-paint-server.cpp
+++ b/src/sp-paint-server.cpp
@@ -31,10 +31,7 @@ bool SPPaintServerReference::_acceptObject(SPObject *obj) const
}
-SPPaintServer::SPPaintServer() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPPaintServer::SPPaintServer() : SPObject() {
this->swatch = 0;
}
diff --git a/src/sp-paint-server.h b/src/sp-paint-server.h
index d13c26481..79d8929c2 100644
--- a/src/sp-paint-server.h
+++ b/src/sp-paint-server.h
@@ -23,7 +23,7 @@
#define SP_PAINT_SERVER(obj) ((SPPaintServer*)obj)
#define SP_IS_PAINT_SERVER(obj) (dynamic_cast<const SPPaintServer*>((SPObject*)obj))
-class SPPaintServer : public SPObject, public CObject {
+class SPPaintServer : public SPObject {
public:
SPPaintServer();
virtual ~SPPaintServer();
diff --git a/src/sp-path.cpp b/src/sp-path.cpp
index d8c43aa68..105506d6e 100644
--- a/src/sp-path.cpp
+++ b/src/sp-path.cpp
@@ -120,7 +120,6 @@ void SPPath::convert_to_guides() {
}
SPPath::SPPath() : SPShape(), connEndPair(this) {
- this->cobject = this;
}
SPPath::~SPPath() {
diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp
index 27c5e9a25..e88bd2886 100644
--- a/src/sp-pattern.cpp
+++ b/src/sp-pattern.cpp
@@ -54,8 +54,6 @@ namespace {
}
SPPattern::SPPattern() : SPPaintServer() {
- this->cobject = this;
-
this->href = NULL;
this->ref = new SPPatternReference(this);
diff --git a/src/sp-polygon.cpp b/src/sp-polygon.cpp
index 0efd06b27..983a738ce 100644
--- a/src/sp-polygon.cpp
+++ b/src/sp-polygon.cpp
@@ -36,7 +36,6 @@ namespace {
}
SPPolygon::SPPolygon() : SPShape() {
- this->cobject = this;
}
SPPolygon::~SPPolygon() {
diff --git a/src/sp-polyline.cpp b/src/sp-polyline.cpp
index 4638952a6..1de5492cd 100644
--- a/src/sp-polyline.cpp
+++ b/src/sp-polyline.cpp
@@ -31,7 +31,6 @@ namespace {
}
SPPolyLine::SPPolyLine() : SPShape() {
- this->cobject = this;
}
SPPolyLine::~SPPolyLine() {
diff --git a/src/sp-radial-gradient.cpp b/src/sp-radial-gradient.cpp
index 31d8c3e56..14f95b060 100644
--- a/src/sp-radial-gradient.cpp
+++ b/src/sp-radial-gradient.cpp
@@ -19,8 +19,6 @@ namespace {
* Radial Gradient
*/
SPRadialGradient::SPRadialGradient() : SPGradient() {
- this->cobject = this;
-
this->cx.unset(SVGLength::PERCENT, 0.5, 0.5);
this->cy.unset(SVGLength::PERCENT, 0.5, 0.5);
this->r.unset(SVGLength::PERCENT, 0.5, 0.5);
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp
index 94a92079a..820f05dff 100644
--- a/src/sp-rect.cpp
+++ b/src/sp-rect.cpp
@@ -39,7 +39,6 @@ namespace {
SPRect::SPRect() : SPShape() {
- this->cobject = this;
}
SPRect::~SPRect() {
diff --git a/src/sp-root.cpp b/src/sp-root.cpp
index b1484759d..4faefabef 100644
--- a/src/sp-root.cpp
+++ b/src/sp-root.cpp
@@ -42,8 +42,6 @@ namespace {
}
SPRoot::SPRoot() : SPGroup() {
- this->cobject = this;
-
this->aspect_set = 0;
this->aspect_align = 0;
this->onload = NULL;
diff --git a/src/sp-script.cpp b/src/sp-script.cpp
index e0cae1ea5..99b57d8e9 100644
--- a/src/sp-script.cpp
+++ b/src/sp-script.cpp
@@ -26,10 +26,7 @@ namespace {
bool scriptRegistered = SPFactory::instance().registerObject("svg:script", createScript);
}
-SPScript::SPScript() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPScript::SPScript() : SPObject() {
this->xlinkhref = NULL;
}
@@ -39,7 +36,7 @@ SPScript::~SPScript() {
void SPScript::build(SPDocument* doc, Inkscape::XML::Node* repr) {
SPScript* object = this;
- CObject::build(doc, repr);
+ SPObject::build(doc, repr);
//Read values of key attributes from XML nodes into object.
object->readAttr( "xlink:href" );
@@ -61,7 +58,7 @@ void SPScript::release() {
object->document->removeResource("script", object);
}
- CObject::release();
+ SPObject::release();
}
void SPScript::update(SPCtx* ctx, unsigned int flags) {
@@ -84,7 +81,7 @@ void SPScript::set(unsigned int key, const gchar* value) {
object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
break;
default:
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
diff --git a/src/sp-script.h b/src/sp-script.h
index 8194cb48a..7355cd124 100644
--- a/src/sp-script.h
+++ b/src/sp-script.h
@@ -18,7 +18,7 @@
#define SP_IS_SCRIPT(obj) (dynamic_cast<const SPScript*>((SPObject*)obj))
/* SPScript */
-class SPScript : public SPObject, public CObject {
+class SPScript : public SPObject {
public:
SPScript();
virtual ~SPScript();
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index b5c920bee..b1fd31f3d 100644
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
@@ -56,8 +56,6 @@
static void sp_shape_update_marker_view (SPShape *shape, Inkscape::DrawingItem *ai);
SPShape::SPShape() : SPLPEItem() {
- this->cobject = this;
-
for ( int i = 0 ; i < SP_MARKER_LOC_QTY ; i++ ) {
new (&this->_release_connect[i]) sigc::connection();
new (&this->_modified_connect[i]) sigc::connection();
diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp
index e1e175e9d..8d2954c6e 100644
--- a/src/sp-spiral.cpp
+++ b/src/sp-spiral.cpp
@@ -40,8 +40,6 @@ namespace {
}
SPSpiral::SPSpiral() : SPShape() {
- this->cobject = this;
-
this->cx = 0.0;
this->cy = 0.0;
this->exp = 1.0;
diff --git a/src/sp-star.cpp b/src/sp-star.cpp
index 489c896b9..4a3a8cbe3 100644
--- a/src/sp-star.cpp
+++ b/src/sp-star.cpp
@@ -43,8 +43,6 @@ namespace {
}
SPStar::SPStar() : SPPolygon() {
- this->cobject = this;
-
this->sides = 5;
this->center = Geom::Point(0, 0);
this->r[0] = 1.0;
diff --git a/src/sp-stop.cpp b/src/sp-stop.cpp
index 71d06ced9..a8d81818b 100644
--- a/src/sp-stop.cpp
+++ b/src/sp-stop.cpp
@@ -34,10 +34,7 @@ namespace {
bool stopRegistered = SPFactory::instance().registerObject("svg:stop", createStop);
}
-SPStop::SPStop() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPStop::SPStop() : SPObject() {
this->path_string = NULL;
this->offset = 0.0;
@@ -52,7 +49,7 @@ SPStop::~SPStop() {
void SPStop::build(SPDocument* doc, Inkscape::XML::Node* repr) {
SPStop* object = this;
- CObject::build(doc, repr);
+ SPObject::build(doc, repr);
object->readAttr( "offset" );
object->readAttr( "stop-color" );
@@ -138,7 +135,7 @@ void SPStop::set(unsigned int key, const gchar* value) {
break;
}
default: {
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -160,7 +157,7 @@ Inkscape::XML::Node* SPStop::write(Inkscape::XML::Document* xml_doc, Inkscape::X
Glib::ustring colorStr = stop->specified_color.toString();
gfloat opacity = stop->opacity;
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
// Since we do a hackish style setting here (because SPStyle does not support stop-color and
// stop-opacity), we must do it AFTER calling the parent write method; otherwise
diff --git a/src/sp-stop.h b/src/sp-stop.h
index 31a9dbb5d..3b09b4c7d 100644
--- a/src/sp-stop.h
+++ b/src/sp-stop.h
@@ -20,7 +20,7 @@ class ustring;
#define SP_IS_STOP(obj) (dynamic_cast<const SPStop*>((SPObject*)obj))
/** Gradient stop. */
-class SPStop : public SPObject, public CObject {
+class SPStop : public SPObject {
public:
SPStop();
virtual ~SPStop();
diff --git a/src/sp-string.cpp b/src/sp-string.cpp
index a5df0c726..67f86033e 100644
--- a/src/sp-string.cpp
+++ b/src/sp-string.cpp
@@ -46,10 +46,7 @@ namespace {
# SPSTRING
#####################################################*/
-SPString::SPString() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPString::SPString() : SPObject() {
new (&this->string) Glib::ustring();
}
@@ -60,7 +57,7 @@ void SPString::build(SPDocument *doc, Inkscape::XML::Node *repr) {
SPString* object = this;
object->read_content();
- CObject::build(doc, repr);
+ SPObject::build(doc, repr);
}
void SPString::release() {
@@ -69,7 +66,7 @@ void SPString::release() {
string->string.~ustring();
- CObject::release();
+ SPObject::release();
}
@@ -117,7 +114,7 @@ void SPString::read_content() {
}
void SPString::update(SPCtx *ctx, unsigned flags) {
-// CObject::onUpdate(ctx, flags);
+// SPObject::onUpdate(ctx, flags);
if (flags & (SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_MODIFIED_FLAG)) {
/* Parent style or we ourselves changed, so recalculate */
diff --git a/src/sp-string.h b/src/sp-string.h
index 2aa1d98cb..2c6a92001 100644
--- a/src/sp-string.h
+++ b/src/sp-string.h
@@ -13,7 +13,7 @@
#define SP_STRING(obj) ((SPString*)obj)
#define SP_IS_STRING(obj) (dynamic_cast<const SPString*>((SPObject*)obj))
-class SPString : public SPObject, public CObject {
+class SPString : public SPObject {
public:
SPString();
virtual ~SPString();
diff --git a/src/sp-style-elem.cpp b/src/sp-style-elem.cpp
index 16974ebce..84f110134 100644
--- a/src/sp-style-elem.cpp
+++ b/src/sp-style-elem.cpp
@@ -17,10 +17,7 @@ namespace {
bool styleRegistered = SPFactory::instance().registerObject("svg:style", createStyle);
}
-SPStyleElem::SPStyleElem() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
-
+SPStyleElem::SPStyleElem() : SPObject() {
media_set_all(this->media);
this->is_css = false;
}
@@ -59,7 +56,7 @@ void SPStyleElem::set(unsigned int key, const gchar* value) {
/* title is ignored. */
default: {
- CObject::set(key, value);
+ SPObject::set(key, value);
break;
}
}
@@ -70,14 +67,14 @@ static void
child_add_rm_cb(Inkscape::XML::Node *, Inkscape::XML::Node *, Inkscape::XML::Node *,
void *const data)
{
- static_cast<SPObject *>(data)->cobject->read_content();
+ static_cast<SPObject *>(data)->read_content();
}
static void
content_changed_cb(Inkscape::XML::Node *, gchar const *, gchar const *,
void *const data)
{
- static_cast<SPObject *>(data)->cobject->read_content();
+ static_cast<SPObject *>(data)->read_content();
}
static void
@@ -85,7 +82,7 @@ child_order_changed_cb(Inkscape::XML::Node *, Inkscape::XML::Node *,
Inkscape::XML::Node *, Inkscape::XML::Node *,
void *const data)
{
- static_cast<SPObject *>(data)->cobject->read_content();
+ static_cast<SPObject *>(data)->read_content();
}
Inkscape::XML::Node* SPStyleElem::write(Inkscape::XML::Document* xml_doc, Inkscape::XML::Node* repr, guint flags) {
@@ -107,7 +104,7 @@ Inkscape::XML::Node* SPStyleElem::write(Inkscape::XML::Document* xml_doc, Inksca
}
/* todo: media */
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
@@ -370,7 +367,7 @@ void SPStyleElem::build(SPDocument *document, Inkscape::XML::Node *repr) {
};
rec_add_listener(*repr, &nodeEventVector, object);
- CObject::build(document, repr);
+ SPObject::build(document, repr);
}
diff --git a/src/sp-style-elem.h b/src/sp-style-elem.h
index 7b55818dd..cc080eb90 100644
--- a/src/sp-style-elem.h
+++ b/src/sp-style-elem.h
@@ -7,7 +7,7 @@
#define SP_STYLE_ELEM(obj) ((SPStyleElem*)obj)
#define SP_IS_STYLE_ELEM(obj) (dynamic_cast<const SPStyleElem*>((SPObject*)obj))
-class SPStyleElem : public SPObject, public CObject {
+class SPStyleElem : public SPObject {
public:
SPStyleElem();
virtual ~SPStyleElem();
diff --git a/src/sp-switch.cpp b/src/sp-switch.cpp
index c2515ef66..ec4d9c1f0 100644
--- a/src/sp-switch.cpp
+++ b/src/sp-switch.cpp
@@ -36,8 +36,6 @@ namespace {
}
SPSwitch::SPSwitch() : SPGroup() {
- this->cobject = this;
-
this->_cached_item = 0;
}
diff --git a/src/sp-symbol.cpp b/src/sp-symbol.cpp
index 989b6ea15..6ee377bc6 100644
--- a/src/sp-symbol.cpp
+++ b/src/sp-symbol.cpp
@@ -37,8 +37,6 @@ namespace {
}
SPSymbol::SPSymbol() : SPGroup() {
- this->cobject = this;
-
this->aspect_align = 0;
this->aspect_clip = 0;
this->aspect_set = 0;
diff --git a/src/sp-text.cpp b/src/sp-text.cpp
index c59093ae9..89d1f6510 100644
--- a/src/sp-text.cpp
+++ b/src/sp-text.cpp
@@ -72,8 +72,6 @@ namespace {
# SPTEXT
#####################################################*/
SPText::SPText() : SPItem() {
- this->cobject = this;
-
new (&this->layout) Inkscape::Text::Layout;
new (&this->attributes) TextTagAttributes;
}
diff --git a/src/sp-title.cpp b/src/sp-title.cpp
index 57c61f590..4ecfcfa8e 100644
--- a/src/sp-title.cpp
+++ b/src/sp-title.cpp
@@ -26,9 +26,7 @@ namespace {
bool titleRegistered = SPFactory::instance().registerObject("svg:title", createTitle);
}
-SPTitle::SPTitle() : SPObject(), CObject(this) {
- delete this->cobject;
- this->cobject = this;
+SPTitle::SPTitle() : SPObject() {
}
SPTitle::~SPTitle() {
@@ -41,7 +39,7 @@ Inkscape::XML::Node* SPTitle::write(Inkscape::XML::Document *xml_doc, Inkscape::
repr = object->getRepr()->duplicate(xml_doc);
}
- CObject::write(xml_doc, repr, flags);
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-title.h b/src/sp-title.h
index 3258d0a67..0660492ee 100644
--- a/src/sp-title.h
+++ b/src/sp-title.h
@@ -17,7 +17,7 @@
#define SP_TITLE(obj) ((SPTitle*)obj)
#define SP_IS_TITLE(obj) (dynamic_cast<const SPTitle*>((SPObject*)obj))
-class SPTitle : public SPObject, public CObject {
+class SPTitle : public SPObject {
public:
SPTitle();
virtual ~SPTitle();
diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp
index 6c6490ad5..dc0fac093 100644
--- a/src/sp-tref.cpp
+++ b/src/sp-tref.cpp
@@ -64,8 +64,6 @@ static void sp_tref_href_changed(SPObject *old_ref, SPObject *ref, SPTRef *tref)
static void sp_tref_delete_self(SPObject *deleted, SPTRef *self);
SPTRef::SPTRef() : SPItem() {
- this->cobject = this;
-
this->stringChild = NULL;
new (&this->attributes) TextTagAttributes;
diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp
index f76fa1b27..41afb1761 100644
--- a/src/sp-tspan.cpp
+++ b/src/sp-tspan.cpp
@@ -62,8 +62,6 @@ namespace {
# SPTSPAN
#####################################################*/
SPTSpan::SPTSpan() : SPItem() {
- this->cobject = this;
-
this->role = SP_TSPAN_ROLE_UNSPECIFIED;
new (&this->attributes) TextTagAttributes;
}
@@ -229,8 +227,6 @@ gchar* SPTSpan::description() {
void refresh_textpath_source(SPTextPath* offset);
SPTextPath::SPTextPath() : SPItem() {
- this->cobject = this;
-
new (&this->attributes) TextTagAttributes;
this->startOffset._set = false;
diff --git a/src/sp-use.cpp b/src/sp-use.cpp
index 8fadc0fac..bf9ac7f2e 100644
--- a/src/sp-use.cpp
+++ b/src/sp-use.cpp
@@ -53,8 +53,6 @@ namespace {
}
SPUse::SPUse() : SPItem() {
- this->cobject = this;
-
this->child = NULL;
this->x.unset();