diff options
| author | Markus Engel <markus.engel@tum.de> | 2012-08-21 14:34:14 +0000 |
|---|---|---|
| committer | Markus Engel <markus.engel@tum.de> | 2012-08-21 14:34:14 +0000 |
| commit | a744227f5585a589533611f0609edad961b8cbfc (patch) | |
| tree | 9f5c3eb128f85b809f8df1e9063f5113681e782b /src/sp-defs.cpp | |
| parent | Added "virtual pad" to SPDesc. (diff) | |
| download | inkscape-a744227f5585a589533611f0609edad961b8cbfc.tar.gz inkscape-a744227f5585a589533611f0609edad961b8cbfc.zip | |
Added "virtual pad" to SPDefs.
(bzr r11608.1.43)
Diffstat (limited to 'src/sp-defs.cpp')
| -rw-r--r-- | src/sp-defs.cpp | 49 |
1 files changed, 38 insertions, 11 deletions
diff --git a/src/sp-defs.cpp b/src/sp-defs.cpp index 2737b3f5c..9cd926d5b 100644 --- a/src/sp-defs.cpp +++ b/src/sp-defs.cpp @@ -56,20 +56,32 @@ void SPDefsClass::sp_defs_class_init(SPDefsClass *dc) sp_object_class->write = SPDefs::write; } -void SPDefs::init(SPDefs */*defs*/) +CDefs::CDefs(SPDefs* defs) : CObject(defs) { + this->spdefs = defs; +} + +CDefs::~CDefs() { +} + + +void SPDefs::init(SPDefs *defs) { + defs->cdefs = new CDefs(defs); + defs->cobject = defs->cdefs; +} +void CDefs::onRelease() { + CObject::onRelease(); } void SPDefs::release(SPObject *object) { - if (((SPObjectClass *) (SPDefsClass::static_parent_class))->release) { - ((SPObjectClass *) (SPDefsClass::static_parent_class))->release(object); - } + ((SPDefs*)object)->cdefs->onRelease(); } -void SPDefs::update(SPObject *object, SPCtx *ctx, guint flags) -{ +void CDefs::onUpdate(SPCtx *ctx, guint flags) { + SPDefs* object = this->spdefs; + if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; } @@ -87,8 +99,14 @@ void SPDefs::update(SPObject *object, SPCtx *ctx, guint flags) } } -void SPDefs::modified(SPObject *object, guint flags) +void SPDefs::update(SPObject *object, SPCtx *ctx, guint flags) { + ((SPDefs*)object)->cdefs->onUpdate(ctx, flags); +} + +void CDefs::onModified(unsigned int flags) { + SPDefs* object = this->spdefs; + if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; } @@ -113,8 +131,14 @@ void SPDefs::modified(SPObject *object, guint flags) } } -Inkscape::XML::Node * SPDefs::write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) +void SPDefs::modified(SPObject *object, guint flags) { + ((SPDefs*)object)->cdefs->onModified(flags); +} + +Inkscape::XML::Node* CDefs::onWrite(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + SPDefs* object = this->spdefs; + if (flags & SP_OBJECT_WRITE_BUILD) { if (!repr) { @@ -141,13 +165,16 @@ Inkscape::XML::Node * SPDefs::write(SPObject *object, Inkscape::XML::Document *x } } - if (((SPObjectClass *) (SPDefsClass::static_parent_class))->write) { - (* ((SPObjectClass *) (SPDefsClass::static_parent_class))->write)(object, xml_doc, repr, flags); - } + CObject::onWrite(xml_doc, repr, flags); return repr; } +Inkscape::XML::Node * SPDefs::write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) +{ + return ((SPDefs*)object)->cdefs->onWrite(xml_doc, repr, flags); +} + /* Local Variables: mode:c++ |
