diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2013-09-19 02:05:00 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2013-09-19 02:05:00 +0000 |
| commit | f6e99d7d1b76dd7a7933f55ba095bdcb534f81b3 (patch) | |
| tree | cbee5d1eec2e1afe8c3f8033d528cab4504c3c49 /src/sp-desc.cpp | |
| parent | Encapsulate the shared memory hack for Cairo and GdkPixbuf in a class (diff) | |
| parent | Added gpl notice (diff) | |
| download | inkscape-f6e99d7d1b76dd7a7933f55ba095bdcb534f81b3.tar.gz inkscape-f6e99d7d1b76dd7a7933f55ba095bdcb534f81b3.zip | |
Merge C++ification of the SP tree by Markus Engel
(bzr r12532)
Diffstat (limited to 'src/sp-desc.cpp')
| -rw-r--r-- | src/sp-desc.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/sp-desc.cpp b/src/sp-desc.cpp index aec90714d..199ae0176 100644 --- a/src/sp-desc.cpp +++ b/src/sp-desc.cpp @@ -16,33 +16,31 @@ #include "sp-desc.h" #include "xml/repr.h" -static Inkscape::XML::Node *sp_desc_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); +#include "sp-factory.h" -G_DEFINE_TYPE(SPDesc, sp_desc, SP_TYPE_OBJECT); +namespace { + SPObject* createDesc() { + return new SPDesc(); + } -static void sp_desc_class_init(SPDescClass *klass) -{ - SPObjectClass *sp_object_class = reinterpret_cast<SPObjectClass *>(klass); + bool descRegistered = SPFactory::instance().registerObject("svg:desc", createDesc); +} - sp_object_class->write = sp_desc_write; +SPDesc::SPDesc() : SPObject() { } -static void sp_desc_init(SPDesc */*desc*/) -{ +SPDesc::~SPDesc() { } /** * Writes it's settings to an incoming repr object, if any. */ -static Inkscape::XML::Node *sp_desc_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags) -{ +Inkscape::XML::Node* SPDesc::write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, guint flags) { if (!repr) { - repr = object->getRepr()->duplicate(doc); + repr = this->getRepr()->duplicate(doc); } - if ((static_cast<SPObjectClass *>(sp_desc_parent_class))->write) { - (static_cast<SPObjectClass *>(sp_desc_parent_class))->write(object, doc, repr, flags); - } + SPObject::write(doc, repr, flags); return repr; } |
