diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp
index ff915c92f2b39e0657b7cd286c81a15796970347..51bb1e1ccc190c845e808588b3f47b2a26a99114 100644 (file)
--- a/src/sp-offset.cpp
+++ b/src/sp-offset.cpp
-#define __SP_OFFSET_C__
-
/** \file
* Implementation of <path sodipodi:type="inkscape:offset">.
*/
* Authors: (of the sp-spiral.c upon which this file was constructed):
* Mitsuru Oka <oka326@parkcity.ne.jp>
* Lauris Kaplinski <lauris@kaplinski.com>
+ * Abhishek Sharma
*
* Copyright (C) 1999-2002 Lauris Kaplinski
* Copyright (C) 2000-2001 Ximian, Inc.
@@ -217,31 +216,29 @@ sp_offset_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
if (((SPObjectClass *) parent_class)->build)
((SPObjectClass *) parent_class)->build (object, document, repr);
- //XML Tree being used directly here while it shouldn't be.
+ //XML Tree being used directly here while it shouldn't be.
if (object->getRepr()->attribute("inkscape:radius")) {
- sp_object_read_attr (object, "inkscape:radius");
+ object->readAttr( "inkscape:radius" );
} else {
-
-
- //XML Tree being used directly here (as object->getRepr)
- //in all the below lines in the block while it shouldn't be.
+ //XML Tree being used directly here (as object->getRepr)
+ //in all the below lines in the block while it shouldn't be.
gchar const *oldA = object->getRepr()->attribute("sodipodi:radius");
object->getRepr()->setAttribute("inkscape:radius",oldA);
object->getRepr()->setAttribute("sodipodi:radius",NULL);
- sp_object_read_attr (object, "inkscape:radius");
+ object->readAttr( "inkscape:radius" );
}
if (object->getRepr()->attribute("inkscape:original")) {
- sp_object_read_attr (object, "inkscape:original");
+ object->readAttr( "inkscape:original" );
} else {
gchar const *oldA = object->getRepr()->attribute("sodipodi:original");
object->getRepr()->setAttribute("inkscape:original",oldA);
object->getRepr()->setAttribute("sodipodi:original",NULL);
- sp_object_read_attr (object, "inkscape:original");
+ object->readAttr( "inkscape:original" );
}
if (object->getRepr()->attribute("xlink:href")) {
- sp_object_read_attr(object, "xlink:href");
+ object->readAttr( "xlink:href" );
} else {
gchar const *oldA = object->getRepr()->attribute("inkscape:href");
if (oldA) {
@@ -254,7 +251,7 @@ sp_offset_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
free(nA);
object->getRepr()->setAttribute("inkscape:href",NULL);
}
- sp_object_read_attr (object, "xlink:href");
+ object->readAttr( "xlink:href" );
}
}
@@ -283,7 +280,7 @@ sp_offset_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XM
// Make sure the object has curve
- SPCurve *curve = sp_shape_get_curve (SP_SHAPE (offset));
+ SPCurve *curve = SP_SHAPE (offset)->getCurve();
if (curve == NULL) {
sp_offset_set_shape (SP_SHAPE (offset));
}
if (flags &
(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
- sp_shape_set_shape ((SPShape *) object);
+ ((SPShape *) object)->setShape ();
}
offset->isUpdating=false;
// just put the source shape as the offseted one, no one will notice
// it's also useless to compute the offset with a 0 radius
- //XML Tree being used directly here while it shouldn't be.
+ //XML Tree being used directly here while it shouldn't be.
const char *res_d = SP_OBJECT(shape)->getRepr()->attribute("inkscape:original");
if ( res_d ) {
Geom::PathVector pv = sp_svg_read_pathv(res_d);
SPCurve *c = new SPCurve(pv);
g_assert(c != NULL);
- sp_shape_set_curve_insync ((SPShape *) offset, c, TRUE);
+ ((SPShape *) offset)->setCurveInsync (c, TRUE);
c->unref();
}
return;
Geom::PathVector pv = sp_svg_read_pathv(res_d);
SPCurve *c = new SPCurve(pv);
g_assert(c != NULL);
- sp_shape_set_curve_insync ((SPShape *) offset, c, TRUE);
+ ((SPShape *) offset)->setCurveInsync (c, TRUE);
c->unref();
free (res_d);
return;
}
- SPCurve *curve = sp_shape_get_curve (SP_SHAPE (offset));
+ SPCurve *curve = SP_SHAPE (offset)->getCurve();
if (curve == NULL)
{
sp_offset_set_shape (SP_SHAPE (offset));
- curve = sp_shape_get_curve (SP_SHAPE (offset));
+ curve = SP_SHAPE (offset)->getCurve();
if (curve == NULL)
return;
}
@@ -1082,7 +1079,7 @@ sp_offset_source_modified (SPObject */*iSource*/, guint /*flags*/, SPItem *item)
SPOffset *offset = SP_OFFSET(item);
offset->sourceDirty=true;
refresh_offset_source(offset);
- sp_shape_set_shape ((SPShape *) offset);
+ ((SPShape *) offset)->setShape ();
}
static void
SPCurve *curve=NULL;
if (!SP_IS_SHAPE (item) && !SP_IS_TEXT (item)) return;
if (SP_IS_SHAPE (item)) {
- curve = sp_shape_get_curve (SP_SHAPE (item));
+ curve = SP_SHAPE (item)->getCurve ();
if (curve == NULL)
return;
}
delete res;
delete orig;
- //XML Tree being used diectly here while it shouldn't be.
+ //XML Tree being used diectly here while it shouldn't be.
SP_OBJECT (offset)->getRepr()->setAttribute("inkscape:original", res_d);
free (res_d);
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 :