Inkscape
Vector Graphics Editor
|
#include <wmf-print.h>
Public Member Functions | |
PrintWmf () | |
unsigned int | setup (Inkscape::Extension::Print *module) override |
unsigned int | begin (Inkscape::Extension::Print *module, SPDocument *doc) override |
unsigned int | finish (Inkscape::Extension::Print *module) override |
unsigned int | fill (Inkscape::Extension::Print *module, Geom::PathVector const &pathv, Geom::Affine const &ctm, SPStyle const *style, Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox) override |
unsigned int | stroke (Inkscape::Extension::Print *module, Geom::PathVector const &pathv, Geom::Affine const &ctm, SPStyle const *style, Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox) override |
unsigned int | image (Inkscape::Extension::Print *module, unsigned char *px, unsigned int w, unsigned int h, unsigned int rs, Geom::Affine const &transform, SPStyle const *style) override |
Some parts based on win32.cpp by Lauris Kaplinski lauri.nosp@m.s@ka.nosp@m.plins.nosp@m.ki.c.nosp@m.om. | |
unsigned int | text (Inkscape::Extension::Print *module, char const *text, Geom::Point const &p, SPStyle const *style) override |
![]() | |
PrintMetafile ()=default | |
~PrintMetafile () override | |
bool | textToPath (Inkscape::Extension::Print *ext) override |
Tell the printing engine whether text should be text or path. | |
unsigned int | bind (Inkscape::Extension::Print *module, Geom::Affine const &transform, float opacity) override |
unsigned int | release (Inkscape::Extension::Print *module) override |
![]() | |
Implementation ()=default | |
virtual | ~Implementation ()=default |
virtual bool | load (Inkscape::Extension::Extension *) |
virtual void | unload (Inkscape::Extension::Extension *) |
virtual ImplementationDocumentCache * | newDocCache (Inkscape::Extension::Extension *, SPDesktop *) |
Create a new document cache object. | |
virtual bool | check (Inkscape::Extension::Extension *) |
Verify any dependencies. | |
virtual bool | cancelProcessing () |
virtual void | commitDocument () |
virtual std::unique_ptr< SPDocument > | new_from_template (Inkscape::Extension::Template *) |
virtual void | get_template_presets (const Template *tmod, TemplatePresets &presets) const |
virtual void | resize_to_template (Inkscape::Extension::Template *tmod, SPDocument *doc, SPPage *page) |
virtual bool | match_template_size (Inkscape::Extension::Template *tmod, double width, double height) |
virtual std::unique_ptr< SPDocument > | open (Inkscape::Extension::Input *module, char const *filename, bool is_importing) |
Open a file. | |
virtual void | save (Inkscape::Extension::Output *, SPDocument *, gchar const *) |
Find out information about the file. | |
virtual void | export_raster (Inkscape::Extension::Output *module, const SPDocument *doc, std::string const &png_file, gchar const *filename) |
Convert from PNG to raster format. | |
virtual Gtk::Widget * | prefs_effect (Inkscape::Extension::Effect *module, SPDesktop *desktop, sigc::signal< void()> *changeSignal, ImplementationDocumentCache *docCache) |
Find out information about the file. | |
virtual void | effect (Inkscape::Extension::Effect *, ExecutionEnv *, SPDesktop *, ImplementationDocumentCache *) |
virtual void | effect (Inkscape::Extension::Effect *, ExecutionEnv *, SPDocument *document) |
virtual bool | apply_filter (Inkscape::Extension::Effect *module, SPItem *item) |
virtual unsigned | set_preview (Inkscape::Extension::Print *) |
virtual bool | fontEmbedded (Inkscape::Extension::Print *) |
Get "fontEmbedded" param, i.e. | |
virtual void | processPath (Inkscape::XML::Node *) |
virtual void | setDetachBase (bool detach) |
If detach = true, when saving to a file, don't store URIs relative to the filename. | |
Static Public Member Functions | |
static void | init () |
Protected Member Functions | |
int | create_brush (SPStyle const *style, PU_COLORREF fcolor) override |
void | destroy_brush () override |
int | create_pen (SPStyle const *style, const Geom::Affine &transform) override |
void | destroy_pen () override |
![]() | |
U_COLORREF | avg_stop_color (SPGradient *gr) |
U_COLORREF | weight_opacity (U_COLORREF c1) |
U_COLORREF | weight_colors (U_COLORREF c1, U_COLORREF c2, double t) |
void | hatch_classify (char *name, int *hatchType, U_COLORREF *hatchColor, U_COLORREF *bkColor) |
void | brush_classify (SPObject *parent, int depth, Inkscape::Pixbuf const **epixbuf, int *hatchType, U_COLORREF *hatchColor, U_COLORREF *bkColor) |
int | hold_gradient (void *gr, int mode) |
Static Protected Member Functions | |
static void | smuggle_adxky_out (const char *string, int16_t **adx, double *ky, int *rtl, int *ndx, float scale) |
![]() | |
static void | _lookup_ppt_fontfix (Glib::ustring const &fontname, FontfixParams &) |
static U_COLORREF | _gethexcolor (uint32_t color) |
static uint32_t | _translate_weight (unsigned inkweight) |
static void | swapRBinRGBA (char *px, int pixels) |
static int | snprintf_dots (char *s, size_t n, const char *format,...) |
static Geom::PathVector | center_ellipse_as_SVG_PathV (Geom::Point ctr, double rx, double ry, double F) |
static Geom::PathVector | center_elliptical_ring_as_SVG_PathV (Geom::Point ctr, double rx1, double ry1, double rx2, double ry2, double F) |
static Geom::PathVector | center_elliptical_hole_as_SVG_PathV (Geom::Point ctr, double rx, double ry, double F) |
static Geom::PathVector | rect_cutter (Geom::Point ctr, Geom::Point pos, Geom::Point neg, Geom::Point width) |
static FillRule | SPWR_to_LVFR (SPWindRule wr) |
Private Member Functions | |
unsigned int | print_pathv (Geom::PathVector const &pathv, const Geom::Affine &transform) |
bool | print_simple_shape (Geom::PathVector const &pathv, const Geom::Affine &transform) |
Private Attributes | |
uint32_t | hbrush |
uint32_t | hpen |
uint32_t | hbrush_null |
uint32_t | hpen_null |
uint32_t | hmiterlimit |
Additional Inherited Members | |
![]() | |
double | _width |
double | _height |
double | _doc_unit_scale |
U_RECTL | rc |
uint32_t | htextalignment |
uint32_t | hpolyfillmode |
std::optional< Inkscape::Colors::Color > | htextcolor_rgb |
std::stack< Geom::Affine > | m_tr_stack |
Geom::PathVector | fill_pathv |
Geom::Affine | fill_transform |
bool | use_stroke |
bool | use_fill |
bool | simple_shape |
bool | usebk |
GRADVALUES | gv |
Definition at line 22 of file wmf-print.h.
Inkscape::Extension::Internal::PrintWmf::PrintWmf | ( | ) |
Definition at line 109 of file wmf-print.cpp.
|
overridevirtual |
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 121 of file wmf-print.cpp.
References Inkscape::Extension::Internal::PrintMetafile::_gethexcolor(), Inkscape::XML::Node::attribute(), Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::bgc, Inkscape::Util::Quantity::convert(), SPItem::desktopVisualBounds(), destroy_brush(), destroy_pen(), Inkscape::Extension::Internal::FixPPTCharPos, Inkscape::Extension::Internal::FixPPTDashLine, Inkscape::Extension::Internal::FixPPTGrad2Polys, Inkscape::Extension::Internal::FixPPTPatternAsHatch, SPDocument::getReprNamedView(), SPDocument::getRoot(), Inkscape::Extension::Internal::PrintMetafile::gv, hbrush, hbrush_null, Geom::GenericRect< C >::height(), hmiterlimit, hpen, hpen_null, Inkscape::Extension::Internal::PrintMetafile::hpolyfillmode, Inkscape::Extension::Internal::PrintMetafile::htextalignment, Inkscape::Extension::Internal::PrintMetafile::htextcolor_rgb, SPDocument::preferredBounds(), Inkscape::Extension::Internal::PX2WORLD, Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::rgb, Inkscape::Extension::Internal::PrintMetafile::simple_shape, Inkscape::Extension::Internal::PrintMetafile::use_fill, Inkscape::Extension::Internal::PrintMetafile::use_stroke, Inkscape::Extension::Internal::PrintMetafile::usebk, Inkscape::Extension::Internal::wht, Geom::GenericRect< C >::width(), and Inkscape::Extension::Internal::wt.
|
overrideprotectedvirtual |
Implements Inkscape::Extension::Internal::PrintMetafile.
Definition at line 328 of file wmf-print.cpp.
References Inkscape::Extension::Internal::PrintMetafile::avg_stop_color(), Inkscape::Extension::Internal::PrintMetafile::brush_classify(), Inkscape::Extension::Internal::DRAW_IMAGE, Inkscape::Extension::Internal::DRAW_LINEAR_GRADIENT, Inkscape::Extension::Internal::DRAW_PAINT, Inkscape::Extension::Internal::DRAW_PATTERN, Inkscape::Extension::Internal::DRAW_RADIAL_GRADIENT, SPGradient::ensureVector(), SPStyle::fill, SPStyle::fill_rule, Inkscape::Extension::Internal::FixPPTGrad2Polys, Inkscape::Extension::Internal::FixPPTPatternAsHatch, hbrush, height, Inkscape::Extension::Internal::PrintMetafile::hold_gradient(), Inkscape::Extension::Internal::PrintMetafile::hpolyfillmode, Inkscape::Pixbuf::PF_CAIRO, Inkscape::Pixbuf::pixelFormat(), Inkscape::Pixbuf::pixels(), Inkscape::Extension::Internal::PrintMetafile::swapRBinRGBA(), Inkscape::Extension::Internal::toColorRef(), Inkscape::Extension::Internal::PrintMetafile::usebk, Inkscape::Extension::Internal::wht, width, and Inkscape::Extension::Internal::wt.
Referenced by fill().
|
overrideprotectedvirtual |
Implements Inkscape::Extension::Internal::PrintMetafile.
Definition at line 517 of file wmf-print.cpp.
References Inkscape::Extension::Internal::FixPPTDashLine, hmiterlimit, hpen, MAX, Inkscape::Extension::Internal::PX2WORLD, scale, SPStyle::stroke, SPStyle::stroke_dasharray, SPStyle::stroke_linecap, SPStyle::stroke_linejoin, SPStyle::stroke_miterlimit, SPStyle::stroke_width, Inkscape::Extension::Internal::toColorRef(), Inkscape::Extension::Internal::wht, Inkscape::Extension::Internal::wt, Geom::X, and Geom::Y.
Referenced by stroke().
|
overrideprotectedvirtual |
Implements Inkscape::Extension::Internal::PrintMetafile.
Definition at line 496 of file wmf-print.cpp.
References hbrush, hbrush_null, Inkscape::Extension::Internal::wht, and Inkscape::Extension::Internal::wt.
Referenced by begin(), and print_pathv().
|
overrideprotectedvirtual |
Implements Inkscape::Extension::Internal::PrintMetafile.
Definition at line 637 of file wmf-print.cpp.
References hpen, hpen_null, Inkscape::Extension::Internal::wht, and Inkscape::Extension::Internal::wt.
Referenced by begin(), fill(), and print_pathv().
|
overridevirtual |
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 658 of file wmf-print.cpp.
References bool_op_inters, Inkscape::Extension::Internal::PrintMetafile::center_elliptical_hole_as_SVG_PathV(), Inkscape::Extension::Internal::PrintMetafile::center_elliptical_ring_as_SVG_PathV(), create_brush(), Geom::Point::cw(), destroy_pen(), Geom::distance(), Inkscape::Extension::Internal::DRAW_LINEAR_GRADIENT, Inkscape::Extension::Internal::DRAW_RADIAL_GRADIENT, fill_nonZero, fill_oddEven, SPStyle::fill_rule, Inkscape::Extension::Internal::PrintMetafile::fill_transform, Inkscape::Extension::Internal::FixPPTDashLine, Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::grad, Inkscape::Extension::Internal::PrintMetafile::gv, Inkscape::Extension::Internal::PrintMetafile::m_tr_stack, Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::mode, Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::p1, Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::p2, Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::p3, print_pathv(), Inkscape::Extension::Internal::PrintMetafile::rect_cutter(), sp_pathvector_boolop(), Inkscape::Extension::Internal::PrintMetafile::SPWR_to_LVFR(), start, SPGradientVector::stops, SPStyle::stroke, SPStyle::stroke_dasharray, SPStyle::stroke_width, Inkscape::Extension::Internal::toColorRef(), Geom::unit_vector(), Inkscape::Extension::Internal::PrintMetafile::use_fill, Inkscape::Extension::Internal::PrintMetafile::use_stroke, SPGradient::vector, Inkscape::Extension::Internal::PrintMetafile::weight_colors(), Inkscape::Extension::Internal::PrintMetafile::weight_opacity(), Geom::X, and Geom::Y.
|
overridevirtual |
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 290 of file wmf-print.cpp.
References hbrush_null, hpen, hpen_null, Inkscape::Extension::Internal::wht, and Inkscape::Extension::Internal::wt.
|
overridevirtual |
Some parts based on win32.cpp by Lauris Kaplinski lauri.nosp@m.s@ka.nosp@m.plins.nosp@m.ki.c.nosp@m.om.
Was a part of Inkscape in the past (or will be in the future?) Not in current trunk. (4/19/2012)
Limitations of this code:
Destination UL corner in logical units
Destination W & H in logical units
Source UL corner in logical units
Source W & H in logical units
DIBColors Enumeration
RasterOPeration Enumeration
(Optional) bitmapbuffer (U_BITMAPINFO section)
size in bytes of px
(Optional) bitmapbuffer (U_BITMAPINFO section)
rgba_px | not used |
w | array of pixel values, Gdk::Pixbuf bitmap format |
h | width of bitmap |
rs | height of bitmap |
tf_rect | row stride (normally w*4) |
style | affine transform only used for defining location and size of rect, for all other transforms, use the one from m_tr_stack |
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 1099 of file wmf-print.cpp.
References Inkscape::Extension::Internal::PrintMetafile::m_tr_stack, Inkscape::Extension::Internal::PX2WORLD, rs, w, Geom::Affine::withoutTranslation(), Inkscape::Extension::Internal::wt, Geom::X, and Geom::Y.
|
static |
Definition at line 1545 of file wmf-print.cpp.
References Inkscape::Extension::build_from_mem().
Referenced by Inkscape::Extension::init().
|
private |
For all Subpaths in the <path>
For each segment in the subpath
For each segment in the subpath
Definition at line 1170 of file wmf-print.cpp.
References destroy_brush(), destroy_pen(), Geom::PathVector::empty(), pathv_to_linear(), print_simple_shape(), Inkscape::Extension::Internal::PX2WORLD, Inkscape::Extension::Internal::PrintMetafile::simple_shape, Inkscape::Extension::Internal::PrintMetafile::use_fill, Inkscape::Extension::Internal::PrintMetafile::use_stroke, Inkscape::Extension::Internal::wt, Geom::X, and Geom::Y.
|
private |
For all Subpaths in the <path>
For all segments in the subpath
Definition at line 914 of file wmf-print.cpp.
References is_straight_curve(), pathv_to_linear(), Inkscape::Extension::Internal::PX2WORLD, Inkscape::Extension::Internal::wt, Geom::X, U_POINT16::x, Geom::Y, and U_POINT16::y.
Referenced by print_pathv().
|
overridevirtual |
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 115 of file wmf-print.cpp.
|
staticprotected |
|
overridevirtual |
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 838 of file wmf-print.cpp.
References Geom::Piecewise< T >::concat(), create_pen(), Inkscape::Extension::Internal::FixPPTDashLine, fragment, Inkscape::Extension::Internal::PrintMetafile::m_tr_stack, Geom::path_from_piecewise(), print_pathv(), SPStyle::stroke_dasharray, Inkscape::Extension::Internal::PrintMetafile::use_fill, Inkscape::Extension::Internal::PrintMetafile::use_stroke, Inkscape::Extension::Internal::PrintMetafile::usebk, and Inkscape::Extension::Internal::wt.
|
overridevirtual |
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 1325 of file wmf-print.cpp.
References Inkscape::Extension::Internal::PrintMetafile::_lookup_ppt_fontfix(), Inkscape::Extension::Internal::PrintMetafile::_translate_weight(), CVTSYM, CVTWDG, CVTZDG, Geom::Affine::expansionX(), Geom::Affine::expansionY(), Inkscape::Extension::Internal::FontfixParams::f1, Inkscape::Extension::Internal::FontfixParams::f2, Inkscape::Extension::Internal::FontfixParams::f3, SPStyle::fill, Inkscape::Extension::Internal::FixPPTCharPos, SPStyle::font_family, SPStyle::font_size, SPStyle::font_style, SPStyle::font_weight, FontName(), Inkscape::Extension::Internal::PrintMetafile::htextalignment, Inkscape::Extension::Internal::PrintMetafile::htextcolor_rgb, Inkscape::Extension::Internal::PrintMetafile::m_tr_stack, Inkscape::Extension::Internal::PX2WORLD, rgb, smuggle_adxky_out(), SP_CSS_FONT_STYLE_ITALIC, text(), SPStyle::text_decoration_line, Inkscape::Extension::Internal::toColorRef(), U_Utf16leToLatin1(), U_Utf8ToLatin1(), U_Utf8ToUtf16le(), UnicodeToNon(), Inkscape::Extension::Internal::wht, Inkscape::Extension::Internal::wt, Geom::X, and Geom::Y.
Referenced by text().
|
private |
Definition at line 24 of file wmf-print.h.
Referenced by begin(), create_brush(), and destroy_brush().
|
private |
Definition at line 24 of file wmf-print.h.
Referenced by begin(), destroy_brush(), and finish().
|
private |
Definition at line 25 of file wmf-print.h.
Referenced by begin(), and create_pen().
|
private |
Definition at line 24 of file wmf-print.h.
Referenced by begin(), create_pen(), destroy_pen(), and finish().
|
private |
Definition at line 24 of file wmf-print.h.
Referenced by begin(), destroy_pen(), and finish().