summaryrefslogtreecommitdiffstats
path: root/src/sp-clippath.cpp
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-04-06 14:26:39 +0000
committerMarkus Engel <markus.engel@tum.de>2013-04-06 14:26:39 +0000
commit8f5e6d495f0478701218adc8078db5063b710a05 (patch)
treecc1fb0bbfbe239c40db179cc4f8b42e66c74603e /src/sp-clippath.cpp
parentMerged PaintServer and subclasses; moved Gradient classes to own files. (diff)
downloadinkscape-8f5e6d495f0478701218adc8078db5063b710a05.tar.gz
inkscape-8f5e6d495f0478701218adc8078db5063b710a05.zip
Merged ObjectGroup and subclasses.
(bzr r11608.1.83)
Diffstat (limited to 'src/sp-clippath.cpp')
-rw-r--r--src/sp-clippath.cpp70
1 files changed, 23 insertions, 47 deletions
diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp
index 496a4ed82..17571d195 100644
--- a/src/sp-clippath.cpp
+++ b/src/sp-clippath.cpp
@@ -50,46 +50,22 @@ namespace {
bool clipPathRegistered = SPFactory::instance().registerObject("svg:clipPath", createClipPath);
}
-G_DEFINE_TYPE(SPClipPath, sp_clippath, G_TYPE_OBJECT);
-
-static void
-sp_clippath_class_init(SPClipPathClass *klass)
-{
-}
-
-CClipPath::CClipPath(SPClipPath* clippath) : CObjectGroup(clippath) {
- this->spclippath = clippath;
-}
-
-CClipPath::~CClipPath() {
-}
-
SPClipPath::SPClipPath() : SPObjectGroup() {
- SPClipPath* cp = this;
-
- cp->cclippath = new CClipPath(cp);
- cp->typeHierarchy.insert(typeid(SPClipPath));
+ this->cobject = this;
- delete cp->cobjectgroup;
- cp->cobjectgroup = cp->cclippath;
- cp->cobject = cp->cclippath;
+ this->clipPathUnits_set = FALSE;
+ this->clipPathUnits = SP_CONTENT_UNITS_USERSPACEONUSE;
- cp->clipPathUnits_set = FALSE;
- cp->clipPathUnits = SP_CONTENT_UNITS_USERSPACEONUSE;
-
- cp->display = NULL;
+ this->display = NULL;
}
-static void
-sp_clippath_init(SPClipPath *cp)
-{
- new (cp) SPClipPath();
+SPClipPath::~SPClipPath() {
}
-void CClipPath::build(SPDocument* doc, Inkscape::XML::Node* repr) {
- SPClipPath* object = this->spclippath;
+void SPClipPath::build(SPDocument* doc, Inkscape::XML::Node* repr) {
+ SPClipPath* object = this;
- CObjectGroup::build(doc, repr);
+ SPObjectGroup::build(doc, repr);
object->readAttr( "style" );
object->readAttr( "clipPathUnits" );
@@ -98,8 +74,8 @@ void CClipPath::build(SPDocument* doc, Inkscape::XML::Node* repr) {
doc->addResource("clipPath", object);
}
-void CClipPath::release() {
- SPClipPath* object = this->spclippath;
+void SPClipPath::release() {
+ SPClipPath* object = this;
if (object->document) {
// Unregister ourselves
@@ -112,11 +88,11 @@ void CClipPath::release() {
cp->display = sp_clippath_view_list_remove(cp->display, cp->display);
}
- CObjectGroup::release();
+ SPObjectGroup::release();
}
-void CClipPath::set(unsigned int key, const gchar* value) {
- SPClipPath* object = this->spclippath;
+void SPClipPath::set(unsigned int key, const gchar* value) {
+ SPClipPath* object = this;
SPClipPath *cp = SP_CLIPPATH(object);
@@ -139,17 +115,17 @@ void CClipPath::set(unsigned int key, const gchar* value) {
sp_style_read_from_object(object->style, object);
object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG);
} else {
- CObjectGroup::set(key, value);
+ SPObjectGroup::set(key, value);
}
break;
}
}
-void CClipPath::child_added(Inkscape::XML::Node* child, Inkscape::XML::Node* ref) {
- SPClipPath* object = this->spclippath;
+void SPClipPath::child_added(Inkscape::XML::Node* child, Inkscape::XML::Node* ref) {
+ SPClipPath* object = this;
/* Invoke SPObjectGroup implementation */
- CObjectGroup::child_added(child, ref);
+ SPObjectGroup::child_added(child, ref);
/* Show new object */
SPObject *ochild = object->document->getObjectByRepr(child);
@@ -166,8 +142,8 @@ void CClipPath::child_added(Inkscape::XML::Node* child, Inkscape::XML::Node* ref
}
}
-void CClipPath::update(SPCtx* ctx, unsigned int flags) {
- SPClipPath* object = this->spclippath;
+void SPClipPath::update(SPCtx* ctx, unsigned int flags) {
+ SPClipPath* object = this;
if (flags & SP_OBJECT_MODIFIED_FLAG) {
flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
@@ -204,8 +180,8 @@ void CClipPath::update(SPCtx* ctx, unsigned int flags) {
}
}
-void CClipPath::modified(unsigned int flags) {
- SPClipPath* object = this->spclippath;
+void SPClipPath::modified(unsigned int flags) {
+ SPClipPath* object = this;
if (flags & SP_OBJECT_MODIFIED_FLAG) {
flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
@@ -230,12 +206,12 @@ void CClipPath::modified(unsigned int flags) {
}
}
-Inkscape::XML::Node* CClipPath::write(Inkscape::XML::Document* xml_doc, Inkscape::XML::Node* repr, guint flags) {
+Inkscape::XML::Node* SPClipPath::write(Inkscape::XML::Document* xml_doc, Inkscape::XML::Node* repr, guint flags) {
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
repr = xml_doc->createElement("svg:clipPath");
}
- CObjectGroup::write(xml_doc, repr, flags);
+ SPObjectGroup::write(xml_doc, repr, flags);
return repr;
}