summaryrefslogtreecommitdiffstats
path: root/src/sp-title.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-09-19 22:33:11 +0000
committerJabiertxof <jtx@jtx.marker.es>2013-09-19 22:33:11 +0000
commit4bda89e32e33c7bdff5d3ea3c1ceee1f806de9f7 (patch)
treecaeb924426bcc861badc6fa81318b67460b26d47 /src/sp-title.cpp
parentUpdate to trunk (diff)
parentupdates for cmake (diff)
downloadinkscape-4bda89e32e33c7bdff5d3ea3c1ceee1f806de9f7.tar.gz
inkscape-4bda89e32e33c7bdff5d3ea3c1ceee1f806de9f7.zip
Update to trunk
(bzr r11950.1.141)
Diffstat (limited to 'src/sp-title.cpp')
-rw-r--r--src/sp-title.cpp34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/sp-title.cpp b/src/sp-title.cpp
index 489a6f448..4ecfcfa8e 100644
--- a/src/sp-title.cpp
+++ b/src/sp-title.cpp
@@ -16,35 +16,31 @@
#include "sp-title.h"
#include "xml/repr.h"
-static Inkscape::XML::Node *sp_title_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
+#include "sp-factory.h"
-G_DEFINE_TYPE(SPTitle, sp_title, SP_TYPE_OBJECT);
+namespace {
+ SPObject* createTitle() {
+ return new SPTitle();
+ }
-static void
-sp_title_class_init(SPTitleClass *klass)
-{
- SPObjectClass *sp_object_class = (SPObjectClass *) klass;
+ bool titleRegistered = SPFactory::instance().registerObject("svg:title", createTitle);
+}
- sp_object_class->write = sp_title_write;
+SPTitle::SPTitle() : SPObject() {
}
-static void
-sp_title_init(SPTitle */*desc*/)
-{
+SPTitle::~SPTitle() {
}
-/**
- * Writes it's settings to an incoming repr object, if any.
- */
-static Inkscape::XML::Node *sp_title_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
-{
+Inkscape::XML::Node* SPTitle::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) {
+ SPTitle* object = this;
+
if (!repr) {
- repr = object->getRepr()->duplicate(doc);
+ repr = object->getRepr()->duplicate(xml_doc);
}
- if (((SPObjectClass *) sp_title_parent_class)->write) {
- ((SPObjectClass *) sp_title_parent_class)->write(object, doc, repr, flags);
- }
+ SPObject::write(xml_doc, repr, flags);
return repr;
}
+