Code

Merge and cleanup of GSoC C++-ification project.
[inkscape.git] / src / sp-skeleton.cpp
index 878d8f31b590919fb6fe52931cf6b03e20480f2b..42fc5289f7e70bf6d9cc5e0f5b7de88b40a0ff1c 100644 (file)
@@ -1,5 +1,3 @@
-#define __SP_SKELETON_CPP__
-
 /** \file
  * SVG <skeleton> implementation, used as an example for a base starting class
  * when implementing new sp-objects.
@@ -14,6 +12,7 @@
 /*
  * Authors:
  *   Kees Cook <kees@outflux.net>
+ *   Abhishek Sharma
  *
  * Copyright (C) 2004 Kees Cook
  *
@@ -48,7 +47,7 @@ static void sp_skeleton_build(SPObject *object, SPDocument *document, Inkscape::
 static void sp_skeleton_release(SPObject *object);
 static void sp_skeleton_set(SPObject *object, unsigned int key, gchar const *value);
 static void sp_skeleton_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_skeleton_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_skeleton_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
 
 static SPObjectClass *skeleton_parent_class;
 
@@ -110,18 +109,18 @@ sp_skeleton_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *r
     /*
        Pay attention to certain settings here
 
-    sp_object_read_attr(object, "xlink:href");
-    sp_object_read_attr(object, "attributeName");
-    sp_object_read_attr(object, "attributeType");
-    sp_object_read_attr(object, "begin");
-    sp_object_read_attr(object, "dur");
-    sp_object_read_attr(object, "end");
-    sp_object_read_attr(object, "min");
-    sp_object_read_attr(object, "max");
-    sp_object_read_attr(object, "restart");
-    sp_object_read_attr(object, "repeatCount");
-    sp_object_read_attr(object, "repeatDur");
-    sp_object_read_attr(object, "fill");
+    object->readAttr( "xlink:href" );
+    object->readAttr( "attributeName" );
+    object->readAttr( "attributeType" );
+    object->readAttr( "begin" );
+    object->readAttr( "dur" );
+    object->readAttr( "end" );
+    object->readAttr( "min" );
+    object->readAttr( "max" );
+    object->readAttr( "restart" );
+    object->readAttr( "repeatCount" );
+    object->readAttr( "repeatDur" );
+    object->readAttr( "fill" );
     */
 }
 
@@ -147,7 +146,7 @@ sp_skeleton_set(SPObject *object, unsigned int key, gchar const *value)
 {
     debug("0x%p %s(%u): '%s'",object,
             sp_attribute_name(key),key,value ? value : "<no value>");
-    SPSkeleton *skeleton = SP_SKELETON(object);
+    //SPSkeleton *skeleton = SP_SKELETON(object);
 
     /* See if any parents need this value. */
     if (((SPObjectClass *) skeleton_parent_class)->set) {
@@ -180,7 +179,7 @@ sp_skeleton_update(SPObject *object, SPCtx *ctx, guint flags)
  * Writes its settings to an incoming repr object, if any.
  */
 static Inkscape::XML::Node *
-sp_skeleton_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_skeleton_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
 {
     debug("0x%p",object);
     //SPSkeleton *skeleton = SP_SKELETON(object);
@@ -191,12 +190,12 @@ sp_skeleton_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
             // is this sane?
             repr->mergeFrom(SP_OBJECT_REPR(object), "id");
         } else {
-            repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+            repr = SP_OBJECT_REPR(object)->duplicate(doc);
         }
     }
 
     if (((SPObjectClass *) skeleton_parent_class)->write) {
-        ((SPObjectClass *) skeleton_parent_class)->write(object, repr, flags);
+        ((SPObjectClass *) skeleton_parent_class)->write(object, doc, repr, flags);
     }
 
     return repr;
@@ -212,4 +211,4 @@ sp_skeleton_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
   fill-column:99
   End:
 */
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :