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/filter-chemistry.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/filter-chemistry.cpp') diff --git a/src/filter-chemistry.cpp b/src/filter-chemistry.cpp index 363663ac3..3d5a795c7 100644 --- a/src/filter-chemistry.cpp +++ b/src/filter-chemistry.cpp @@ -319,7 +319,7 @@ new_filter_blend_gaussian_blur (SPDocument *document, const char *blendmode, gdo SPFilter * new_filter_simple_from_item (SPDocument *document, SPItem *item, const char *mode, gdouble radius) { - Geom::OptRect const r = sp_item_bbox_desktop(item, SPItem::GEOMETRIC_BBOX); + Geom::OptRect const r = item->getBboxDesktop(SPItem::GEOMETRIC_BBOX); double width; double height; @@ -330,7 +330,7 @@ new_filter_simple_from_item (SPDocument *document, SPItem *item, const char *mod width = height = 0; } - Geom::Matrix i2d (sp_item_i2d_affine (item) ); + Geom::Matrix i2d (item->i2d_affine () ); return (new_filter_blend_gaussian_blur (document, mode, radius, i2d.descrim(), i2d.expansionX(), i2d.expansionY(), width, height)); } @@ -367,14 +367,14 @@ modify_filter_gaussian_blur_from_item(SPDocument *document, SPItem *item, } // Determine the required standard deviation value - Geom::Matrix i2d (sp_item_i2d_affine (item)); + Geom::Matrix i2d (item->i2d_affine ()); double expansion = i2d.descrim(); double stdDeviation = radius; if (expansion != 0) stdDeviation /= expansion; // Get the object size - Geom::OptRect const r = sp_item_bbox_desktop(item, SPItem::GEOMETRIC_BBOX); + Geom::OptRect const r = item->getBboxDesktop(SPItem::GEOMETRIC_BBOX); double width; double height; if (r) { -- cgit v1.2.3 From 1aad26aea24f62b63c992118f36b12483f9a5414 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Sat, 3 Jul 2010 22:50:36 +0530 Subject: another c++ification for sp-object.h/cpp and still in progress... (bzr r9546.1.4) --- src/filter-chemistry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/filter-chemistry.cpp') diff --git a/src/filter-chemistry.cpp b/src/filter-chemistry.cpp index 3d5a795c7..f180dc661 100644 --- a/src/filter-chemistry.cpp +++ b/src/filter-chemistry.cpp @@ -50,7 +50,7 @@ count_filter_hrefs(SPObject *o, SPFilter *filter) i ++; } - for (SPObject *child = sp_object_first_child(o); + for (SPObject *child = o->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) { i += count_filter_hrefs(child, filter); } -- cgit v1.2.3 From 1aaf9a0ee3da28012bf43cfa61e2e5fa933edd2e Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Tue, 6 Jul 2010 12:52:32 +0530 Subject: C++ification of SPObject continued along with the onset of XML Privatisation. Users may checkout [grep -Ir XML Tree *] in the source code and all the places where the XML node/Tree is being used shall be reflected. (bzr r9546.1.5) --- src/filter-chemistry.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/filter-chemistry.cpp') diff --git a/src/filter-chemistry.cpp b/src/filter-chemistry.cpp index f180dc661..1f4e91c3b 100644 --- a/src/filter-chemistry.cpp +++ b/src/filter-chemistry.cpp @@ -168,7 +168,8 @@ filter_add_primitive(SPFilter *filter, const Inkscape::Filters::FilterPrimitiveT } //set primitive as child of filter node - filter->repr->appendChild(repr); + // XML tree being used directly while/where it shouldn't be... + filter->getRepr()->appendChild(repr); Inkscape::GC::release(repr); // get corresponding object -- cgit v1.2.3 From 7396564ea83c67c0e40a8b0aa453a13ddf21e0e0 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma public Date: Sat, 24 Jul 2010 20:58:27 +0530 Subject: Yet mor in c++ification (bzr r9546.1.11) --- src/filter-chemistry.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/filter-chemistry.cpp') diff --git a/src/filter-chemistry.cpp b/src/filter-chemistry.cpp index 1f4e91c3b..9e0ee8383 100644 --- a/src/filter-chemistry.cpp +++ b/src/filter-chemistry.cpp @@ -101,7 +101,8 @@ SPFilter *new_filter(SPDocument *document) repr = xml_doc->createElement("svg:filter"); // Append the new filter node to defs - SP_OBJECT_REPR(defs)->appendChild(repr); + //SP_OBJECT_REPR(defs)->appendChild(repr); + defs->appendChild(repr); Inkscape::GC::release(repr); // get corresponding object @@ -169,7 +170,8 @@ filter_add_primitive(SPFilter *filter, const Inkscape::Filters::FilterPrimitiveT //set primitive as child of filter node // XML tree being used directly while/where it shouldn't be... - filter->getRepr()->appendChild(repr); + //filter->getRepr()->appendChild(repr); + filter->appendChild(repr); Inkscape::GC::release(repr); // get corresponding object @@ -218,7 +220,8 @@ new_filter_gaussian_blur (SPDocument *document, gdouble radius, double expansion Inkscape::GC::release(b_repr); // Append the new filter node to defs - SP_OBJECT_REPR(defs)->appendChild(repr); + //SP_OBJECT_REPR(defs)->appendChild(repr); + defs->appendChild(repr); Inkscape::GC::release(repr); // get corresponding object @@ -254,7 +257,8 @@ new_filter_blend_gaussian_blur (SPDocument *document, const char *blendmode, gdo repr->setAttribute("inkscape:collect", "always"); // Append the new filter node to defs - SP_OBJECT_REPR(defs)->appendChild(repr); + //SP_OBJECT_REPR(defs)->appendChild(repr); + defs->appendChild(repr); Inkscape::GC::release(repr); // get corresponding object @@ -361,7 +365,8 @@ modify_filter_gaussian_blur_from_item(SPDocument *document, SPItem *item, Inkscape::XML::Node *repr; repr = SP_OBJECT_REPR(item->style->getFilter())->duplicate(xml_doc); SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS(document); - SP_OBJECT_REPR(defs)->appendChild(repr); + //SP_OBJECT_REPR(defs)->appendChild(repr); + defs->appendChild(repr); filter = SP_FILTER( document->getObjectByRepr(repr) ); Inkscape::GC::release(repr); -- cgit v1.2.3