From 8867de5daf309e4cdd3fce177b408618490be4f3 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Tue, 29 Jun 2010 23:35:42 +0530 Subject: This is the first c++ification commit from me. It handles sp-line, sp-polyline, sp-item and marks the onset of document c++ification as well. Users can check performace increase with [/usr/bin/time -v inkscape_binary_with_commandline_options]. (bzr r9546.1.1) --- src/sp-ellipse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sp-ellipse.cpp') diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp index 88fc59f17..86b6106c5 100644 --- a/src/sp-ellipse.cpp +++ b/src/sp-ellipse.cpp @@ -281,7 +281,7 @@ static void sp_genericellipse_snappoints(SPItem const *item, std::vectori2d_affine(); // figure out if we have a slice, while guarding against rounding errors bool slice = false; -- cgit v1.2.3 From 6cc35b45eab6422a6b6f67d621aa259a0a73786f Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Mon, 12 Jul 2010 22:06:46 +0530 Subject: SPObject c++ification finalized along with the beginning of XML Privatisation tweaks (bzr r9546.1.6) --- src/sp-ellipse.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/sp-ellipse.cpp') diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp index 86b6106c5..b5f0bdab6 100644 --- a/src/sp-ellipse.cpp +++ b/src/sp-ellipse.cpp @@ -433,10 +433,10 @@ sp_ellipse_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *re if (((SPObjectClass *) ellipse_parent_class)->build) (* ((SPObjectClass *) ellipse_parent_class)->build) (object, document, repr); - sp_object_read_attr(object, "cx"); - sp_object_read_attr(object, "cy"); - sp_object_read_attr(object, "rx"); - sp_object_read_attr(object, "ry"); + object->readAttr( "cx"); + object->readAttr( "cy"); + object->readAttr( "rx"); + object->readAttr( "ry"); } static Inkscape::XML::Node * @@ -581,9 +581,9 @@ sp_circle_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *rep if (((SPObjectClass *) circle_parent_class)->build) (* ((SPObjectClass *) circle_parent_class)->build)(object, document, repr); - sp_object_read_attr(object, "cx"); - sp_object_read_attr(object, "cy"); - sp_object_read_attr(object, "r"); + object->readAttr( "cx"); + object->readAttr( "cy"); + object->readAttr( "r"); } static Inkscape::XML::Node * @@ -706,14 +706,14 @@ sp_arc_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) if (((SPObjectClass *) arc_parent_class)->build) (* ((SPObjectClass *) arc_parent_class)->build) (object, document, repr); - sp_object_read_attr(object, "sodipodi:cx"); - sp_object_read_attr(object, "sodipodi:cy"); - sp_object_read_attr(object, "sodipodi:rx"); - sp_object_read_attr(object, "sodipodi:ry"); + object->readAttr( "sodipodi:cx"); + object->readAttr( "sodipodi:cy"); + object->readAttr( "sodipodi:rx"); + object->readAttr( "sodipodi:ry"); - sp_object_read_attr(object, "sodipodi:start"); - sp_object_read_attr(object, "sodipodi:end"); - sp_object_read_attr(object, "sodipodi:open"); + object->readAttr( "sodipodi:start"); + object->readAttr( "sodipodi:end"); + object->readAttr( "sodipodi:open"); } /* -- cgit v1.2.3 From cde0571b44ec5b108907bda85971c49f3ceb1de8 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Wed, 14 Jul 2010 23:40:35 +0530 Subject: SPShape c++ified to the extent it was possible and more changes done for XML privatisation. Major changes yet to come. (bzr r9546.1.7) --- src/sp-ellipse.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/sp-ellipse.cpp') diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp index b5f0bdab6..7eb473d03 100644 --- a/src/sp-ellipse.cpp +++ b/src/sp-ellipse.cpp @@ -153,7 +153,7 @@ sp_genericellipse_update(SPObject *object, SPCtx *ctx, guint flags) ellipse->cy.update(em, ex, dy); ellipse->rx.update(em, ex, dr); ellipse->ry.update(em, ex, dr); - sp_shape_set_shape((SPShape *) object); + ((SPShape *) object)->setShape(); } if (((SPObjectClass *) ge_parent_class)->update) @@ -190,7 +190,7 @@ static void sp_genericellipse_set_shape(SPShape *shape) // unconditionally read the curve from d, if any, to preserve appearance Geom::PathVector pv = sp_svg_read_pathv(SP_OBJECT_REPR(shape)->attribute("d")); SPCurve *cold = new SPCurve(pv); - sp_shape_set_curve_insync (shape, cold, TRUE); + shape->setCurveInsync( cold, TRUE); cold->unref(); } return; @@ -257,12 +257,12 @@ static void sp_genericellipse_set_shape(SPShape *shape) /* Reset the shape'scurve to the "original_curve" * This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/ - sp_shape_set_curve_insync (shape, curve, TRUE); + shape->setCurveInsync( curve, TRUE); if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(shape)) && sp_lpe_item_path_effects_enabled(SP_LPE_ITEM(shape))) { SPCurve *c_lpe = curve->copy(); bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM (shape), c_lpe); if (success) { - sp_shape_set_curve_insync (shape, c_lpe, TRUE); + shape->setCurveInsync( c_lpe, TRUE); } c_lpe->unref(); } @@ -855,7 +855,7 @@ static void sp_arc_modified(SPObject *object, guint flags) { 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(); } if (((SPObjectClass *) arc_parent_class)->modified) -- cgit v1.2.3