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/stock-items.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/helper/stock-items.cpp') diff --git a/src/helper/stock-items.cpp b/src/helper/stock-items.cpp index 1c184da72..72f97c6da 100644 --- a/src/helper/stock-items.cpp +++ b/src/helper/stock-items.cpp @@ -56,7 +56,7 @@ static SPObject * sp_marker_load_from_svg(gchar const *name, SPDocument *current if (!edoc && !doc) { gchar *markers = g_build_filename(INKSCAPE_MARKERSDIR, "/markers.svg", NULL); if (Inkscape::IO::file_test(markers, G_FILE_TEST_IS_REGULAR)) { - doc = sp_document_new(markers, FALSE); + doc = SPDocument::createDoc(markers, FALSE); } g_free(markers); if (doc) { @@ -94,12 +94,12 @@ sp_pattern_load_from_svg(gchar const *name, SPDocument *current_doc) if (!edoc && !doc) { gchar *patterns = g_build_filename(INKSCAPE_PATTERNSDIR, "/patterns.svg", NULL); if (Inkscape::IO::file_test(patterns, G_FILE_TEST_IS_REGULAR)) { - doc = sp_document_new(patterns, FALSE); + doc = SPDocument::createDoc(patterns, FALSE); } if (!doc) { gchar *patterns = g_build_filename(CREATE_PATTERNSDIR, "/patterns.svg", NULL); if (Inkscape::IO::file_test(patterns, G_FILE_TEST_IS_REGULAR)) { - doc = sp_document_new(patterns, FALSE); + doc = SPDocument::createDoc(patterns, FALSE); } g_free(patterns); if (doc) { @@ -137,12 +137,12 @@ sp_gradient_load_from_svg(gchar const *name, SPDocument *current_doc) if (!edoc && !doc) { gchar *gradients = g_build_filename(INKSCAPE_GRADIENTSDIR, "/gradients.svg", NULL); if (Inkscape::IO::file_test(gradients, G_FILE_TEST_IS_REGULAR)) { - doc = sp_document_new(gradients, FALSE); + doc = SPDocument::createDoc(gradients, FALSE); } if (!doc) { gchar *gradients = g_build_filename(CREATE_GRADIENTSDIR, "/gradients.svg", NULL); if (Inkscape::IO::file_test(gradients, G_FILE_TEST_IS_REGULAR)) { - doc = sp_document_new(gradients, FALSE); + doc = SPDocument::createDoc(gradients, FALSE); } g_free(gradients); if (doc) { -- 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/stock-items.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/helper/stock-items.cpp') diff --git a/src/helper/stock-items.cpp b/src/helper/stock-items.cpp index 72f97c6da..cb2769c8e 100644 --- a/src/helper/stock-items.cpp +++ b/src/helper/stock-items.cpp @@ -56,11 +56,11 @@ static SPObject * sp_marker_load_from_svg(gchar const *name, SPDocument *current if (!edoc && !doc) { gchar *markers = g_build_filename(INKSCAPE_MARKERSDIR, "/markers.svg", NULL); if (Inkscape::IO::file_test(markers, G_FILE_TEST_IS_REGULAR)) { - doc = SPDocument::createDoc(markers, FALSE); + doc = SPDocument::createNewDoc(markers, FALSE); } g_free(markers); if (doc) { - sp_document_ensure_up_to_date(doc); + doc->ensure_up_to_date(); } else { edoc = TRUE; } @@ -94,16 +94,16 @@ sp_pattern_load_from_svg(gchar const *name, SPDocument *current_doc) if (!edoc && !doc) { gchar *patterns = g_build_filename(INKSCAPE_PATTERNSDIR, "/patterns.svg", NULL); if (Inkscape::IO::file_test(patterns, G_FILE_TEST_IS_REGULAR)) { - doc = SPDocument::createDoc(patterns, FALSE); + doc = SPDocument::createNewDoc(patterns, FALSE); } if (!doc) { gchar *patterns = g_build_filename(CREATE_PATTERNSDIR, "/patterns.svg", NULL); if (Inkscape::IO::file_test(patterns, G_FILE_TEST_IS_REGULAR)) { - doc = SPDocument::createDoc(patterns, FALSE); + doc = SPDocument::createNewDoc(patterns, FALSE); } g_free(patterns); if (doc) { - sp_document_ensure_up_to_date(doc); + doc->ensure_up_to_date(); } else { edoc = TRUE; } @@ -137,16 +137,16 @@ sp_gradient_load_from_svg(gchar const *name, SPDocument *current_doc) if (!edoc && !doc) { gchar *gradients = g_build_filename(INKSCAPE_GRADIENTSDIR, "/gradients.svg", NULL); if (Inkscape::IO::file_test(gradients, G_FILE_TEST_IS_REGULAR)) { - doc = SPDocument::createDoc(gradients, FALSE); + doc = SPDocument::createNewDoc(gradients, FALSE); } if (!doc) { gchar *gradients = g_build_filename(CREATE_GRADIENTSDIR, "/gradients.svg", NULL); if (Inkscape::IO::file_test(gradients, G_FILE_TEST_IS_REGULAR)) { - doc = SPDocument::createDoc(gradients, FALSE); + doc = SPDocument::createNewDoc(gradients, FALSE); } g_free(gradients); if (doc) { - sp_document_ensure_up_to_date(doc); + doc->ensure_up_to_date(); } else { edoc = TRUE; } -- 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/stock-items.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/helper/stock-items.cpp') diff --git a/src/helper/stock-items.cpp b/src/helper/stock-items.cpp index cb2769c8e..6cdb50c35 100644 --- a/src/helper/stock-items.cpp +++ b/src/helper/stock-items.cpp @@ -199,7 +199,7 @@ SPObject *get_stock_item(gchar const *urn) SPObject *object = NULL; if (!strcmp(base, "marker")) { - for (SPObject *child = sp_object_first_child(SP_OBJECT(defs)); + for (SPObject *child = SP_OBJECT(defs)->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) { @@ -213,7 +213,7 @@ SPObject *get_stock_item(gchar const *urn) } else if (!strcmp(base,"pattern")) { - for (SPObject *child = sp_object_first_child(SP_OBJECT(defs)) ; + for (SPObject *child = SP_OBJECT(defs)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) { @@ -227,7 +227,7 @@ SPObject *get_stock_item(gchar const *urn) } else if (!strcmp(base,"gradient")) { - for (SPObject *child = sp_object_first_child(SP_OBJECT(defs)); + for (SPObject *child = SP_OBJECT(defs)->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) { -- cgit v1.2.3