From c260fcd615791615b33f55459dabe38e64ee3471 Mon Sep 17 00:00:00 2001 From: Jasper van de Gronde Date: Fri, 15 Apr 2011 09:17:08 +0200 Subject: No more PrintWin32, including no special cases for non-Unicode Windows anymore. (bzr r9508.1.82) --- src/print.cpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'src/print.cpp') diff --git a/src/print.cpp b/src/print.cpp index fe52ea6dd..0774f5751 100644 --- a/src/print.cpp +++ b/src/print.cpp @@ -84,43 +84,6 @@ unsigned int sp_print_text(SPPrintContext *ctx, char const *text, Geom::Point p, /* UI */ -void -sp_print_preview_document(SPDocument *doc) -{ - Inkscape::Extension::Print *mod; - unsigned int ret; - - doc->ensureUpToDate(); - - mod = Inkscape::Extension::get_print(SP_MODULE_KEY_PRINT_DEFAULT); - - ret = mod->set_preview(); - - if (ret) { - SPPrintContext context; - context.module = mod; - - /* fixme: This has to go into module constructor somehow */ - /* Create new arena */ - mod->base = SP_ITEM(doc->getRoot()); - mod->arena = NRArena::create(); - mod->dkey = SPItem::display_key_new(1); - mod->root = (mod->base)->invoke_show(mod->arena, mod->dkey, SP_ITEM_SHOW_DISPLAY); - /* Print document */ - ret = mod->begin(doc); - (mod->base)->invoke_print(&context); - ret = mod->finish(); - /* Release arena */ - (mod->base)->invoke_hide(mod->dkey); - mod->base = NULL; - mod->root = NULL; - nr_object_unref((NRObject *) mod->arena); - mod->arena = NULL; - } - - return; -} - void sp_print_document(Gtk::Window& parentWindow, SPDocument *doc) { -- cgit v1.2.3 From 2be2cf32db0668dc64512a98f6c2394152bd10cc Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 16 Jul 2011 00:42:39 -0700 Subject: Cleanup of oudated/redundant SP_ITEM() macro use. (bzr r10461) --- src/print.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/print.cpp') diff --git a/src/print.cpp b/src/print.cpp index 0774f5751..1ee58a3e6 100644 --- a/src/print.cpp +++ b/src/print.cpp @@ -21,6 +21,7 @@ #include "extension/print.h" #include "extension/system.h" #include "print.h" +#include "sp-root.h" #include "ui/dialog/print.h" @@ -90,7 +91,7 @@ sp_print_document(Gtk::Window& parentWindow, SPDocument *doc) doc->ensureUpToDate(); // Build arena - SPItem *base = SP_ITEM(doc->getRoot()); + SPItem *base = doc->getRoot(); NRArena *arena = NRArena::create(); unsigned int dkey = SPItem::display_key_new(1); // TODO investigate why we are grabbing root and then ignoring it. @@ -126,7 +127,7 @@ sp_print_document_to_file(SPDocument *doc, gchar const *filename) context.module = mod; /* fixme: This has to go into module constructor somehow */ /* Create new arena */ - mod->base = SP_ITEM(doc->getRoot()); + mod->base = doc->getRoot(); mod->arena = NRArena::create(); mod->dkey = SPItem::display_key_new(1); mod->root = (mod->base)->invoke_show(mod->arena, mod->dkey, SP_ITEM_SHOW_DISPLAY); -- cgit v1.2.3 From 4dd33aa4d5c57706c7f64f63391174954160a308 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 6 Aug 2011 14:18:32 +0200 Subject: Rewrite NRArenaItem hierarchy into C++ (bzr r10347.1.21) --- src/print.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/print.cpp') diff --git a/src/print.cpp b/src/print.cpp index 1ee58a3e6..29c5b0ed2 100644 --- a/src/print.cpp +++ b/src/print.cpp @@ -15,6 +15,8 @@ # include "config.h" #endif +#include "display/nr-arena.h" +#include "display/drawing-item.h" #include "inkscape.h" #include "desktop.h" #include "sp-item.h" @@ -80,9 +82,6 @@ unsigned int sp_print_text(SPPrintContext *ctx, char const *text, Geom::Point p, return ctx->module->text(text, p, style); } -#include "display/nr-arena.h" -#include "display/nr-arena-item.h" - /* UI */ void @@ -92,19 +91,11 @@ sp_print_document(Gtk::Window& parentWindow, SPDocument *doc) // Build arena SPItem *base = doc->getRoot(); - NRArena *arena = NRArena::create(); - unsigned int dkey = SPItem::display_key_new(1); - // TODO investigate why we are grabbing root and then ignoring it. - NRArenaItem *root = base->invoke_show(arena, dkey, SP_ITEM_SHOW_DISPLAY); // Run print dialog Inkscape::UI::Dialog::Print printop(doc,base); Gtk::PrintOperationResult res = printop.run(Gtk::PRINT_OPERATION_ACTION_PRINT_DIALOG, parentWindow); (void)res; // TODO handle this - - // Release arena - base->invoke_hide(dkey); - nr_object_unref((NRObject *) arena); } void @@ -138,8 +129,8 @@ sp_print_document_to_file(SPDocument *doc, gchar const *filename) /* Release arena */ (mod->base)->invoke_hide(mod->dkey); mod->base = NULL; - mod->root = NULL; nr_object_unref((NRObject *) mod->arena); + mod->root = NULL; // should be deleted by invoke_hide mod->arena = NULL; /* end */ -- cgit v1.2.3 From 75976ea07dba9b97186667524d0a76603de416af Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 7 Aug 2011 12:53:12 +0200 Subject: Rewrite NRArena -> Inkscape::Drawing. Call render and update methods on the Drawing rather than on the root DrawingItem. (bzr r10347.1.25) --- src/print.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/print.cpp') diff --git a/src/print.cpp b/src/print.cpp index 29c5b0ed2..2eadf0fa9 100644 --- a/src/print.cpp +++ b/src/print.cpp @@ -15,7 +15,7 @@ # include "config.h" #endif -#include "display/nr-arena.h" +#include "display/drawing.h" #include "display/drawing-item.h" #include "inkscape.h" #include "desktop.h" @@ -117,21 +117,20 @@ sp_print_document_to_file(SPDocument *doc, gchar const *filename) /* Start */ context.module = mod; /* fixme: This has to go into module constructor somehow */ - /* Create new arena */ + /* Create new drawing */ mod->base = doc->getRoot(); - mod->arena = NRArena::create(); + Inkscape::Drawing drawing; mod->dkey = SPItem::display_key_new(1); - mod->root = (mod->base)->invoke_show(mod->arena, mod->dkey, SP_ITEM_SHOW_DISPLAY); + mod->root = (mod->base)->invoke_show(drawing, mod->dkey, SP_ITEM_SHOW_DISPLAY); + drawing.setRoot(mod->root); /* Print document */ ret = mod->begin(doc); (mod->base)->invoke_print(&context); ret = mod->finish(); - /* Release arena */ + /* Release drawing items */ (mod->base)->invoke_hide(mod->dkey); mod->base = NULL; - nr_object_unref((NRObject *) mod->arena); mod->root = NULL; // should be deleted by invoke_hide - mod->arena = NULL; /* end */ mod->set_param_string("destination", oldoutput); -- cgit v1.2.3 From 72cc39b9f0b340548f395c7f61ca9662b34aea09 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 27 Aug 2011 11:04:37 +0200 Subject: Refactor SPItem bounding box methods: remove NRRect usage and make code using them more obvious. Fix filter region computation. (bzr r10582.1.1) --- src/print.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/print.cpp') diff --git a/src/print.cpp b/src/print.cpp index 2eadf0fa9..3e477c976 100644 --- a/src/print.cpp +++ b/src/print.cpp @@ -56,16 +56,18 @@ sp_print_comment(SPPrintContext *ctx, char const *comment) unsigned int sp_print_fill(SPPrintContext *ctx, Geom::PathVector const &pathv, Geom::Affine const *ctm, SPStyle const *style, - NRRect const *pbox, NRRect const *dbox, NRRect const *bbox) + Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox) { - return ctx->module->fill(pathv, ctm, style, pbox, dbox, bbox); + NRRect nrpbox(pbox), nrdbox(dbox), nrbbox(bbox); + return ctx->module->fill(pathv, ctm, style, &nrpbox, &nrdbox, &nrbbox); } unsigned int sp_print_stroke(SPPrintContext *ctx, Geom::PathVector const &pathv, Geom::Affine const *ctm, SPStyle const *style, - NRRect const *pbox, NRRect const *dbox, NRRect const *bbox) + Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox) { - return ctx->module->stroke(pathv, ctm, style, pbox, dbox, bbox); + NRRect nrpbox(pbox), nrdbox(dbox), nrbbox(bbox); + return ctx->module->stroke(pathv, ctm, style, &nrpbox, &nrdbox, &nrbbox); } unsigned int -- cgit v1.2.3 From 84194ec2d0b9830437a5470320422265d5dd8c35 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 27 Aug 2011 12:20:13 +0200 Subject: Remove NRRect use from the extension system (bzr r10582.1.2) --- src/print.cpp | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src/print.cpp') diff --git a/src/print.cpp b/src/print.cpp index 3e477c976..d2fc72175 100644 --- a/src/print.cpp +++ b/src/print.cpp @@ -27,17 +27,8 @@ #include "ui/dialog/print.h" - -/* Identity typedef */ - -unsigned int sp_print_bind(SPPrintContext *ctx, Geom::Affine const &transform, float opacity) -{ - Geom::Affine const ntransform(transform); - return sp_print_bind(ctx, &ntransform, opacity); -} - unsigned int -sp_print_bind(SPPrintContext *ctx, Geom::Affine const *transform, float opacity) +sp_print_bind(SPPrintContext *ctx, Geom::Affine const &transform, float opacity) { return ctx->module->bind(transform, opacity); } @@ -55,25 +46,23 @@ sp_print_comment(SPPrintContext *ctx, char const *comment) } unsigned int -sp_print_fill(SPPrintContext *ctx, Geom::PathVector const &pathv, Geom::Affine const *ctm, SPStyle const *style, +sp_print_fill(SPPrintContext *ctx, Geom::PathVector const &pathv, Geom::Affine const &ctm, SPStyle const *style, Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox) { - NRRect nrpbox(pbox), nrdbox(dbox), nrbbox(bbox); - return ctx->module->fill(pathv, ctm, style, &nrpbox, &nrdbox, &nrbbox); + return ctx->module->fill(pathv, ctm, style, pbox, dbox, bbox); } unsigned int -sp_print_stroke(SPPrintContext *ctx, Geom::PathVector const &pathv, Geom::Affine const *ctm, SPStyle const *style, +sp_print_stroke(SPPrintContext *ctx, Geom::PathVector const &pathv, Geom::Affine const &ctm, SPStyle const *style, Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox) { - NRRect nrpbox(pbox), nrdbox(dbox), nrbbox(bbox); - return ctx->module->stroke(pathv, ctm, style, &nrpbox, &nrdbox, &nrbbox); + return ctx->module->stroke(pathv, ctm, style, pbox, dbox, bbox); } unsigned int sp_print_image_R8G8B8A8_N(SPPrintContext *ctx, guchar *px, unsigned int w, unsigned int h, unsigned int rs, - Geom::Affine const *transform, SPStyle const *style) + Geom::Affine const &transform, SPStyle const *style) { return ctx->module->image(px, w, h, rs, transform, style); } -- cgit v1.2.3