From 7b7e0294b0c06a8d3ec19b73486a91e12cf67adf Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 6 Apr 2013 22:16:05 +0200 Subject: Merged more classes. (bzr r11608.1.84) --- src/sp-defs.cpp | 48 +++++++++++------------------------------------- 1 file changed, 11 insertions(+), 37 deletions(-) (limited to 'src/sp-defs.cpp') diff --git a/src/sp-defs.cpp b/src/sp-defs.cpp index a385dca6a..6202c19f7 100644 --- a/src/sp-defs.cpp +++ b/src/sp-defs.cpp @@ -30,46 +30,20 @@ namespace { bool defsRegistered = SPFactory::instance().registerObject("svg:defs", createDefs); } -G_DEFINE_TYPE(SPDefs, sp_defs, G_TYPE_OBJECT); - -static void -sp_defs_class_init(SPDefsClass *dc) -{ - SPObjectClass *sp_object_class = (SPObjectClass *) dc; - -} - -SPDefs::SPDefs() : SPObject() { - SPDefs* defs = this; - - defs->cdefs = new CDefs(defs); - defs->typeHierarchy.insert(typeid(SPDefs)); - - delete defs->cobject; - defs->cobject = defs->cdefs; +SPDefs::SPDefs() : SPObject(), CObject(this) { + delete this->cobject; + this->cobject = this; } -static void -sp_defs_init(SPDefs* defs) -{ - new (defs) SPDefs(); +SPDefs::~SPDefs() { } -CDefs::CDefs(SPDefs* defs) : CObject(defs) { - this->spdefs = defs; -} - -CDefs::~CDefs() { -} - - - -void CDefs::release() { +void SPDefs::release() { CObject::release(); } -void CDefs::update(SPCtx *ctx, guint flags) { - SPDefs* object = this->spdefs; +void SPDefs::update(SPCtx *ctx, guint flags) { + SPDefs* object = this; if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -88,8 +62,8 @@ void CDefs::update(SPCtx *ctx, guint flags) { } } -void CDefs::modified(unsigned int flags) { - SPDefs* object = this->spdefs; +void SPDefs::modified(unsigned int flags) { + SPDefs* object = this; if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -115,8 +89,8 @@ void CDefs::modified(unsigned int flags) { } } -Inkscape::XML::Node* CDefs::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { - SPDefs* object = this->spdefs; +Inkscape::XML::Node* SPDefs::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + SPDefs* object = this; if (flags & SP_OBJECT_WRITE_BUILD) { -- cgit v1.2.3