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/helper/png-write.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/helper/png-write.cpp') diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp index b1c135db0..81c8612fb 100644 --- a/src/helper/png-write.cpp +++ b/src/helper/png-write.cpp @@ -371,7 +371,7 @@ hide_other_items_recursively(SPObject *o, GSList *list, unsigned dkey) && !SP_IS_GROUP(o) && !g_slist_find(list, o) ) { - sp_item_invoke_hide(SP_ITEM(o), dkey); + SP_ITEM(o)->invoke_hide(dkey); } // recurse @@ -461,10 +461,10 @@ sp_export_png_file(SPDocument *doc, gchar const *filename, NRArena *const arena = NRArena::create(); // export with maximum blur rendering quality nr_arena_set_renderoffscreen(arena); - unsigned const dkey = sp_item_display_key_new(1); + unsigned const dkey = SPItem::display_key_new(1); /* Create ArenaItems and set transform */ - ebp.root = sp_item_invoke_show(SP_ITEM(sp_document_root(doc)), arena, dkey, SP_ITEM_SHOW_DISPLAY); + ebp.root = SP_ITEM(sp_document_root(doc))->invoke_show(arena, dkey, SP_ITEM_SHOW_DISPLAY); nr_arena_item_set_transform(NR_ARENA_ITEM(ebp.root), affine); // We show all and then hide all items we don't want, instead of showing only requested items, @@ -490,7 +490,7 @@ sp_export_png_file(SPDocument *doc, gchar const *filename, } // Hide items, this releases arenaitem - sp_item_invoke_hide(SP_ITEM(sp_document_root(doc)), dkey); + SP_ITEM(sp_document_root(doc))->invoke_hide(dkey); /* Free arena */ nr_object_unref((NRObject *) arena); -- cgit v1.2.3 From 121815791be2d24cb745663520b111ee914fbc09 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Thu, 1 Jul 2010 15:36:56 +0530 Subject: C++fied SPDocument added (bzr r9546.1.2) --- src/helper/png-write.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/helper/png-write.cpp') diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp index 81c8612fb..f8321cc03 100644 --- a/src/helper/png-write.cpp +++ b/src/helper/png-write.cpp @@ -422,10 +422,10 @@ sp_export_png_file(SPDocument *doc, gchar const *filename, return true; } - sp_document_ensure_up_to_date(doc); + doc->ensure_up_to_date(); /* Calculate translation by transforming to document coordinates (flipping Y)*/ - Geom::Point translation = Geom::Point(-area[Geom::X][0], area[Geom::Y][1] - sp_document_height(doc)); + Geom::Point translation = Geom::Point(-area[Geom::X][0], area[Geom::Y][1] - doc->getHeight()); /* This calculation is only valid when assumed that (x0,y0)= area.corner(0) and (x1,y1) = area.corner(2) * 1) a[0] * x0 + a[2] * y1 + a[4] = 0.0 -- 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/helper/png-write.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/helper/png-write.cpp') diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp index f8321cc03..5ccb6c7fa 100644 --- a/src/helper/png-write.cpp +++ b/src/helper/png-write.cpp @@ -376,7 +376,7 @@ hide_other_items_recursively(SPObject *o, GSList *list, unsigned dkey) // recurse if (!g_slist_find(list, o)) { - for (SPObject *child = sp_object_first_child(o) ; child != NULL; child = SP_OBJECT_NEXT(child) ) { + for (SPObject *child = o->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) { hide_other_items_recursively(child, list, dkey); } } -- cgit v1.2.3