Code

Merge and cleanup of GSoC C++-ification project.
[inkscape.git] / src / filters / componenttransfer-funcnode.cpp
index 2fad817971c2e16ca20edc374a5cb9348f67d430..a245e1c89f21349c81d16e0e2ca1ba2a9fe60bb2 100644 (file)
@@ -1,5 +1,3 @@
-#define __SP_FEFUNCNODE_CPP__
-
 /** \file
  * SVG <funcR>, <funcG>, <funcB> and <funcA> implementations.
  */
@@ -8,6 +6,7 @@
  *   Hugo Rodrigues <haa.rodrigues@gmail.com>
  *   Niko Kiirala <niko@kiirala.com>
  *   Felipe CorrĂȘa da Silva Sanches <juca@members.fsf.org>
+ *   Abhishek Sharma
  *
  * Copyright (C) 2006, 2007, 2008 Authors
  *
@@ -168,17 +167,17 @@ sp_fefuncnode_build(SPObject *object, SPDocument *document, Inkscape::XML::Node
     }
 
     //Read values of key attributes from XML nodes into object.
-    sp_object_read_attr(object, "type");
-    sp_object_read_attr(object, "tableValues");
-    sp_object_read_attr(object, "slope");
-    sp_object_read_attr(object, "intercept");
-    sp_object_read_attr(object, "amplitude");
-    sp_object_read_attr(object, "exponent");
-    sp_object_read_attr(object, "offset");
+    object->readAttr( "type" );
+    object->readAttr( "tableValues" );
+    object->readAttr( "slope" );
+    object->readAttr( "intercept" );
+    object->readAttr( "amplitude" );
+    object->readAttr( "exponent" );
+    object->readAttr( "offset" );
 
 
 //is this necessary?
-    sp_document_add_resource(document, "fefuncnode", object); //maybe feFuncR, fefuncG, feFuncB and fefuncA ?
+    document->addResource("fefuncnode", object); //maybe feFuncR, fefuncG, feFuncB and fefuncA ?
 }
 
 /**
@@ -191,7 +190,7 @@ sp_fefuncnode_release(SPObject *object)
 
     if (SP_OBJECT_DOCUMENT(object)) {
         /* Unregister ourselves */
-        sp_document_remove_resource(SP_OBJECT_DOCUMENT(object), "fefuncnode", SP_OBJECT(object));
+        SP_OBJECT_DOCUMENT(object)->removeResource("fefuncnode", SP_OBJECT(object));
     }
 
 //TODO: release resources here
@@ -296,8 +295,8 @@ sp_fefuncnode_update(SPObject *object, SPCtx *ctx, guint flags)
     if (flags & SP_OBJECT_MODIFIED_FLAG) {
         /* do something to trigger redisplay, updates? */
         //TODO
-        //sp_object_read_attr(object, "azimuth");
-        //sp_object_read_attr(object, "elevation");
+        //object->readAttr( "azimuth" );
+        //object->readAttr( "elevation" );
     }
 
     if (((SPObjectClass *) feFuncNode_parent_class)->update) {