summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 117336b)
raw | patch | inline | side by side (parent: 117336b)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sat, 12 Jul 2008 15:21:12 +0000 (15:21 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sat, 12 Jul 2008 15:21:12 +0000 (15:21 +0000) |
16 files changed:
diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp
index 83b865cdba7a9e4afde351fae3faf41ffffa9260..0f2580eb955eab97db9f0144d68c24e1022e0a6b 100644 (file)
@@ -166,14 +166,14 @@ Implementation::comment(Inkscape::Extension::Print */*module*/, char const */*co
}
unsigned int
-Implementation::fill(Inkscape::Extension::Print */*module*/, const_NRBPath const */*bpath*/, NR::Matrix const */*ctm*/, SPStyle const */*style*/,
+Implementation::fill(Inkscape::Extension::Print */*module*/, Geom::PathVector const &/*pathv*/, NR::Matrix const */*ctm*/, SPStyle const */*style*/,
NRRect const */*pbox*/, NRRect const */*dbox*/, NRRect const */*bbox*/)
{
return 0;
}
unsigned int
-Implementation::stroke(Inkscape::Extension::Print */*module*/, const_NRBPath const */*bpath*/, NR::Matrix const */*transform*/, SPStyle const */*style*/,
+Implementation::stroke(Inkscape::Extension::Print */*module*/, Geom::PathVector const &/*pathv*/, NR::Matrix const */*transform*/, SPStyle const */*style*/,
NRRect const */*pbox*/, NRRect const */*dbox*/, NRRect const */*bbox*/)
{
return 0;
diff --git a/src/extension/implementation/implementation.h b/src/extension/implementation/implementation.h
index 29366ddf5b450044c245e35226c876adc8917932..d90d2e7a9965c42b03008376e8a95261dba62df1 100644 (file)
#include "libnr/nr-forward.h"
#include "libnr/nr-point.h"
#include "xml/node.h"
+#include <2geom/forward.h>
namespace Inkscape {
namespace Extension {
virtual unsigned release(Inkscape::Extension::Print *module);
virtual unsigned comment(Inkscape::Extension::Print *module, const char * comment);
virtual unsigned fill(Inkscape::Extension::Print *module,
- const_NRBPath const *bpath,
+ Geom::PathVector const &pathv,
NR::Matrix const *ctm,
SPStyle const *style,
NRRect const *pbox,
NRRect const *dbox,
NRRect const *bbox);
virtual unsigned stroke(Inkscape::Extension::Print *module,
- const_NRBPath const *bpath,
+ Geom::PathVector const &pathv,
NR::Matrix const *transform,
SPStyle const *style,
NRRect const *pbox,
diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp
index 0e231a60884e10008b1675510b358ea8f4a12331..e696df06d0360cce599e85e026c2b7a8fad24a32 100644 (file)
#include "libnr/nr-matrix-fns.h"
#include "libnr/nr-path.h"
#include "libnr/nr-pixblock.h"
+#include <libnr/n-art-bpath-2geom.h>
#include "display/canvas-bpath.h"
#include "sp-item.h"
unsigned int
PrintEmfWin32::fill(Inkscape::Extension::Print *mod,
- const_NRBPath const *bpath, NR::Matrix const *transform, SPStyle const *style,
+ Geom::PathVector const &pathv, NR::Matrix const *transform, SPStyle const *style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
{
if (!hdc) return 0;
return 0;
}
- fill_path = copy_bpath( bpath->path );
+ NArtBpath * bpath = BPath_from_2GeomPath(pathv);
+ fill_path = copy_bpath( bpath );
+ g_free(bpath);
fill_transform = tf;
fill_pbox = *pbox;
unsigned int
PrintEmfWin32::stroke (Inkscape::Extension::Print *mod,
- const const_NRBPath *bpath, const NR::Matrix *transform, const SPStyle *style,
+ Geom::PathVector const &pathv, const NR::Matrix *transform, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox)
{
if (!hdc) return 0;
NR::Matrix tf = m_tr_stack.top();
- stroke_and_fill = ( cmp_bpath( bpath->path, fill_path ) == 0 );
+ NArtBpath * bpath = BPath_from_2GeomPath(pathv);
+
+ stroke_and_fill = ( cmp_bpath( bpath, fill_path ) == 0 );
if (!stroke_and_fill) {
flush_fill(); // flush any pending fills
return 0;
}
- print_bpath(bpath->path, &tf, pbox);
+ print_bpath(bpath, &tf, pbox);
if (stroke_and_fill) {
if (!simple_shape)
StrokePath( hdc );
}
+ g_free(bpath);
destroy_pen();
return 0;
index b885efbe11e0925a775ea0bbae1de7c36daee55c..11b265dccb3fd31bcfeee00548fa95a1f966d1e5 100644 (file)
virtual unsigned int bind(Inkscape::Extension::Print *module, NR::Matrix const *transform, float opacity);
virtual unsigned int release(Inkscape::Extension::Print *module);
virtual unsigned int fill (Inkscape::Extension::Print * module,
- const const_NRBPath *bpath, const NR::Matrix *ctm, const SPStyle *style,
+ Geom::PathVector const &pathv, const NR::Matrix *ctm, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox);
virtual unsigned int stroke (Inkscape::Extension::Print * module,
- const const_NRBPath *bpath, const NR::Matrix *transform, const SPStyle *style,
+ Geom::PathVector const &pathv, const NR::Matrix *transform, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox);
virtual unsigned int comment(Inkscape::Extension::Print *module, const char * comment);
virtual unsigned int text(Inkscape::Extension::Print *module, char const *text,
index 1496b75f652bf9de028a2ae5184be347f4c1026b..1ef5c57abdfc52902d4043e4cb951ee9b4d45c99 100644 (file)
#include "libnr/nr-scale-translate-ops.h"
#include "libnr/nr-translate-scale-ops.h"
#include <libnr/nr-matrix-fns.h>
-
+#include <libnr/n-art-bpath-2geom.h>
#include "libnr/n-art-bpath.h"
#include "sp-item.h"
unsigned int
PrintLatex::fill(Inkscape::Extension::Print *mod,
- const_NRBPath const *bpath, NR::Matrix const *transform, SPStyle const *style,
- NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
+ Geom::PathVector const &pathv, NR::Matrix const *transform, SPStyle const *style,
+ NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
{
if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned.
os << "\\pscustom[linestyle=none,fillstyle=solid,fillcolor=curcolor]\n{\n";
- print_bpath(os, bpath->path, transform);
+ NArtBpath * bpath = BPath_from_2GeomPath(pathv);
+ print_bpath(os, bpath, transform);
+ g_free(bpath);
os << "}\n}\n";
}
unsigned int
-PrintLatex::stroke (Inkscape::Extension::Print *mod, const const_NRBPath *bpath, const NR::Matrix *transform, const SPStyle *style,
+PrintLatex::stroke (Inkscape::Extension::Print *mod, Geom::PathVector const &pathv, const NR::Matrix *transform, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox)
{
if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned.
@@ -260,7 +262,9 @@ PrintLatex::stroke (Inkscape::Extension::Print *mod, const const_NRBPath *bpath,
os <<"]\n{\n";
- print_bpath(os, bpath->path, transform);
+ NArtBpath * bpath = BPath_from_2GeomPath(pathv);
+ print_bpath(os, bpath, transform);
+ g_free(bpath);
os << "}\n}\n";
index 56600023aa0376c1a0fa7af02fb2eb2163a2f108..d70afc54e8db88342eec6b33db47f56143b50bcf 100644 (file)
virtual unsigned int bind(Inkscape::Extension::Print *module, NR::Matrix const *transform, float opacity);
virtual unsigned int release(Inkscape::Extension::Print *module);
- virtual unsigned int fill (Inkscape::Extension::Print * module, const const_NRBPath *bpath, const NR::Matrix *ctm, const SPStyle *style,
+ virtual unsigned int fill (Inkscape::Extension::Print * module, Geom::PathVector const &pathv, const NR::Matrix *ctm, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox);
- virtual unsigned int stroke (Inkscape::Extension::Print * module, const const_NRBPath *bpath, const NR::Matrix *transform, const SPStyle *style,
+ virtual unsigned int stroke (Inkscape::Extension::Print * module, Geom::PathVector const &pathv, const NR::Matrix *transform, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox);
virtual unsigned int comment(Inkscape::Extension::Print *module, const char * comment);
bool textToPath (Inkscape::Extension::Print * ext);
index dd6956a1e35b718e9f34beb41f5c539898bb2b91..6dfed9e8247cc1846dec0b3c9c87076d007db0f9 100644 (file)
#include <errno.h>
#include <libnr/n-art-bpath.h>
+#include <libnr/n-art-bpath-2geom.h>
#include <glib/gmem.h>
#include <gtk/gtkstock.h>
}
unsigned int
-PrintCairoPDF::fill(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *const style,
+PrintCairoPDF::fill(Inkscape::Extension::Print *mod, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *const style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
{
if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned.
@@ -599,7 +600,9 @@ PrintCairoPDF::fill(Inkscape::Extension::Print *mod, const_NRBPath const *bpath,
cairo_save(cr);
print_fill_style(cr, style, pbox);
- print_bpath(cr, bpath->path);
+ NArtBpath * bpath = BPath_from_2GeomPath(pathv);
+ print_bpath(cr, bpath);
+ g_free(bpath);
if (style->fill_rule.computed == SP_WIND_RULE_EVENODD) {
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
} else {
@@ -684,7 +687,7 @@ PrintCairoPDF::print_stroke_style(cairo_t *cr, SPStyle const *style, NRRect cons
}
unsigned int
-PrintCairoPDF::stroke(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style,
+PrintCairoPDF::stroke(Inkscape::Extension::Print *mod, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
{
if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned.
@@ -697,7 +700,9 @@ PrintCairoPDF::stroke(Inkscape::Extension::Print *mod, const_NRBPath const *bpat
cairo_save(cr);
print_stroke_style(cr, style, pbox);
- print_bpath(cr, bpath->path);
+ NArtBpath * bpath = BPath_from_2GeomPath(pathv);
+ print_bpath(cr, bpath);
+ g_free(bpath);
cairo_stroke(cr);
cairo_restore(cr);
index b37cfe22dc20f81f143b7a2f0869f1f0bc5b4135..8e2764fa41f479f013ef04fcc685a60129d4ee3c 100644 (file)
virtual unsigned int bind(Inkscape::Extension::Print *module, NR::Matrix const *transform, float opacity);
virtual unsigned int release(Inkscape::Extension::Print *module);
virtual unsigned int comment(Inkscape::Extension::Print *module, char const *comment);
- virtual unsigned int fill(Inkscape::Extension::Print *module, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style,
+ virtual unsigned int fill(Inkscape::Extension::Print *module, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox);
- virtual unsigned int stroke(Inkscape::Extension::Print *module, const_NRBPath const *bpath, NR::Matrix const *transform, SPStyle const *style,
+ virtual unsigned int stroke(Inkscape::Extension::Print *module, Geom::PathVector const &pathv, NR::Matrix const *transform, SPStyle const *style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox);
virtual unsigned int image(Inkscape::Extension::Print *module, unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
NR::Matrix const *transform, SPStyle const *style);
index 299157555f763213592e7fc38fd675f5c33a48a5..7670c3a86e58cdd8d32f8a18aa33989102695475 100644 (file)
#include <libnr/n-art-bpath.h>
#include <libnr/nr-matrix-fns.h>
+#include <libnr/n-art-bpath-2geom.h>
#include <glib/gmem.h>
#include <glib/gstrfuncs.h>
unsigned int
-PrintPS::fill(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *const style,
+PrintPS::fill(Inkscape::Extension::Print *mod, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *const style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
{
if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned.
@@ -829,7 +830,9 @@ PrintPS::fill(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR::M
print_fill_style(os, style, pbox);
- print_bpath(os, bpath->path);
+ NArtBpath * bpath = BPath_from_2GeomPath(pathv);
+ print_bpath(os, bpath);
+ g_free(bpath);
if (style->fill_rule.computed == SP_WIND_RULE_EVENODD) {
if (style->fill.isColor()) {
@@ -879,7 +882,7 @@ PrintPS::fill(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR::M
unsigned int
-PrintPS::stroke(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style,
+PrintPS::stroke(Inkscape::Extension::Print *mod, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
{
if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned.
@@ -890,7 +893,9 @@ PrintPS::stroke(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR:
print_stroke_style(os, style);
- print_bpath(os, bpath->path);
+ NArtBpath * bpath = BPath_from_2GeomPath(pathv);
+ print_bpath(os, bpath);
+ g_free(bpath);
os << "stroke\n";
index edeaaeac6786fbdc305593b1ad36e9a20a2cf3f1..407da88a358cf7f1edfa02809710d14ee5e42d63 100644 (file)
virtual unsigned int bind(Inkscape::Extension::Print *module, NR::Matrix const *transform, float opacity);
virtual unsigned int release(Inkscape::Extension::Print *module);
virtual unsigned int comment(Inkscape::Extension::Print *module, char const *comment);
- virtual unsigned int fill(Inkscape::Extension::Print *module, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style,
+ virtual unsigned int fill(Inkscape::Extension::Print *module, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox);
- virtual unsigned int stroke(Inkscape::Extension::Print *module, const_NRBPath const *bpath, NR::Matrix const *transform, SPStyle const *style,
+ virtual unsigned int stroke(Inkscape::Extension::Print *module, Geom::PathVector const &pathv, NR::Matrix const *transform, SPStyle const *style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox);
virtual unsigned int image(Inkscape::Extension::Print *module, unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
NR::Matrix const *transform, SPStyle const *style);
index eded694a50cf1e2cf8db2abc9e9cbdcf214f1305..035865825f3cf93eca5c80c63be49904840716df 100644 (file)
--- a/src/extension/print.cpp
+++ b/src/extension/print.cpp
}
unsigned int
-Print::fill (const const_NRBPath *bpath, const NR::Matrix *ctm, const SPStyle *style,
+Print::fill (Geom::PathVector const &pathv, const NR::Matrix *ctm, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox)
{
- return imp->fill (this, bpath, ctm, style, pbox, dbox, bbox);
+ return imp->fill (this, pathv, ctm, style, pbox, dbox, bbox);
}
unsigned int
-Print::stroke (const const_NRBPath *bpath, const NR::Matrix *transform, const SPStyle *style,
+Print::stroke (Geom::PathVector const &pathv, const NR::Matrix *transform, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox)
{
- return imp->stroke (this, bpath, transform, style, pbox, dbox, bbox);
+ return imp->stroke (this, pathv, transform, style, pbox, dbox, bbox);
}
unsigned int
diff --git a/src/extension/print.h b/src/extension/print.h
index e9796bb2d6197302d0fa46d7abfcfc7dfcc4dcf6..c5f49dd9dbe3e5b6c2b8f47ab13007124627e5fa 100644 (file)
--- a/src/extension/print.h
+++ b/src/extension/print.h
float opacity);
unsigned int release (void);
unsigned int comment (const char * comment);
- unsigned int fill (const_NRBPath const *bpath,
+ unsigned int fill (Geom::PathVector const &pathv,
NR::Matrix const *ctm,
SPStyle const *style,
NRRect const *pbox,
NRRect const *dbox,
NRRect const *bbox);
- unsigned int stroke (const_NRBPath const *bpath,
+ unsigned int stroke (Geom::PathVector const &pathv,
NR::Matrix const *transform,
SPStyle const *style,
NRRect const *pbox,
index eb6514b34462ac422e1c671b902b702fc72d374d..3ad979ccadc52e98cc6170a1d6efe891ad32035a 100644 (file)
Span const &span = _spans[_characters[_glyphs[glyph_index].in_character].in_span];
InputStreamTextSource const *text_source = static_cast<InputStreamTextSource const *>(_input_stream[span.in_input_stream_item]);
if (text_to_path || _path_fitted) {
- NRBPath bpath;
- bpath.path = (NArtBpath*)span.font->ArtBPath(_glyphs[glyph_index].glyph);
- if (bpath.path) {
- const_NRBPath abp;
+ Geom::PathVector const * pv = span.font->PathVector(_glyphs[glyph_index].glyph);
+ if (pv) {
_getGlyphTransformMatrix(glyph_index, &glyph_matrix);
- NArtBpath *temp_bpath = nr_artpath_affine(bpath.path, glyph_matrix);
- abp.path = temp_bpath;
+ Geom::PathVector temp_pv = (*pv) * to_2geom(glyph_matrix);
if (!text_source->style->fill.isNone())
- sp_print_fill(ctx, &abp, &ctm, text_source->style, pbox, dbox, bbox);
+ sp_print_fill(ctx, temp_pv, &ctm, text_source->style, pbox, dbox, bbox);
if (!text_source->style->stroke.isNone())
- sp_print_stroke(ctx, &abp, &ctm, text_source->style, pbox, dbox, bbox);
- g_free(temp_bpath);
+ sp_print_stroke(ctx, temp_pv, &ctm, text_source->style, pbox, dbox, bbox);
}
glyph_index++;
} else {
diff --git a/src/print.cpp b/src/print.cpp
index b1fc6b3b24fac4cfc2172dbec82d0fe1d415ef63..6d4572031957a73074abdf795341b63e8b263a91 100644 (file)
--- a/src/print.cpp
+++ b/src/print.cpp
}
unsigned int
-sp_print_fill(SPPrintContext *ctx, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style,
+sp_print_fill(SPPrintContext *ctx, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
{
- return ctx->module->fill(bpath, ctm, style, pbox, dbox, bbox);
+ return ctx->module->fill(pathv, ctm, style, pbox, dbox, bbox);
}
unsigned int
-sp_print_stroke(SPPrintContext *ctx, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style,
+sp_print_stroke(SPPrintContext *ctx, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
{
- return ctx->module->stroke(bpath, ctm, style, pbox, dbox, bbox);
+ return ctx->module->stroke(pathv, ctm, style, pbox, dbox, bbox);
}
unsigned int
diff --git a/src/print.h b/src/print.h
index ce30b841807ed6d72ea46898a09b65e727b2dbe0..ed56c966376dbf45cf38ffc9359c9ba2be1091d7 100644 (file)
--- a/src/print.h
+++ b/src/print.h
#include <gtkmm.h>
#include <libnr/nr-path.h>
+#include <2geom/forward.h>
#include "forward.h"
#include "extension/extension-forward.h"
unsigned int sp_print_bind(SPPrintContext *ctx, NR::Matrix const *transform, float opacity);
unsigned int sp_print_release(SPPrintContext *ctx);
unsigned int sp_print_comment(SPPrintContext *ctx, char const *comment);
-unsigned int sp_print_fill(SPPrintContext *ctx, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style,
+unsigned int sp_print_fill(SPPrintContext *ctx, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox);
-unsigned int sp_print_stroke(SPPrintContext *ctx, const_NRBPath const *bpath, NR::Matrix const *transform, SPStyle const *style,
+unsigned int sp_print_stroke(SPPrintContext *ctx, Geom::PathVector const &pathv, NR::Matrix const *transform, SPStyle const *style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox);
unsigned int sp_print_image_R8G8B8A8_N(SPPrintContext *ctx,
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index 9a0ee1fd7b203257fdef23c4e5b5d24f01ff4fca..91d7dd5f82fcd5f8377c20d682665afa7311298e 100644 (file)
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
SPStyle* style = SP_OBJECT_STYLE (item);
if (!style->fill.isNone()) {
- const_NRBPath bp;
- bp.path = shape->curve->get_bpath();
- sp_print_fill (ctx, &bp, &i2d, style, &pbox, &dbox, &bbox);
+ sp_print_fill (ctx, shape->curve->get_pathvector(), &i2d, style, &pbox, &dbox, &bbox);
}
if (!style->stroke.isNone()) {
- const_NRBPath bp;
- bp.path = shape->curve->get_bpath();
- sp_print_stroke (ctx, &bp, &i2d, style, &pbox, &dbox, &bbox);
+ sp_print_stroke (ctx, shape->curve->get_pathvector(), &i2d, style, &pbox, &dbox, &bbox);
}
/* TODO: make code prettier: lots of variables can be taken out of the loop! */