Inkscape
Vector Graphics Editor
|
#include <emf-print.h>
Public Member Functions | |
PrintEmf () | |
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 () |
Static Protected Member Functions | |
static void | smuggle_adxkyrtl_out (const char *string, uint32_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 | hbrushOld |
uint32_t | hpen |
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 25 of file emf-print.h.
Inkscape::Extension::Internal::PrintEmf::PrintEmf | ( | ) |
Definition at line 112 of file emf-print.cpp.
|
overridevirtual |
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 124 of file emf-print.cpp.
References Inkscape::Extension::Internal::PrintMetafile::_doc_unit_scale, Inkscape::Extension::Internal::PrintMetafile::_gethexcolor(), Inkscape::XML::Node::attribute(), Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::bgc, Inkscape::Util::Quantity::convert(), U_SIZE::cx, U_SIZE::cy, SPItem::desktopVisualBounds(), U_XFORM::eDx, U_XFORM::eDy, Inkscape::Extension::Internal::eht, U_XFORM::eM11, U_XFORM::eM12, U_XFORM::eM21, U_XFORM::eM22, Inkscape::Extension::Internal::et, Inkscape::Extension::Internal::FixImageRot, Inkscape::Extension::Internal::FixPPTCharPos, Inkscape::Extension::Internal::FixPPTDashLine, Inkscape::Extension::Internal::FixPPTGrad2Polys, Inkscape::Extension::Internal::FixPPTLinGrad, Inkscape::Extension::Internal::FixPPTPatternAsHatch, SPDocument::getDocumentScale(), SPDocument::getReprNamedView(), SPDocument::getRoot(), Inkscape::Extension::Internal::PrintMetafile::gv, hbrush, hbrushOld, Geom::GenericRect< C >::height(), hpen, Inkscape::Extension::Internal::PrintMetafile::hpolyfillmode, Inkscape::Extension::Internal::PrintMetafile::htextalignment, Inkscape::Extension::Internal::PrintMetafile::htextcolor_rgb, MAX, SPDocument::preferredBounds(), Inkscape::Extension::Internal::PX2WORLD, Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::rgb, Inkscape::Extension::Internal::PrintMetafile::simple_shape, U_Utf16leEdit(), U_Utf8ToUtf16le(), Inkscape::Extension::Internal::PrintMetafile::use_fill, Inkscape::Extension::Internal::PrintMetafile::use_stroke, Inkscape::Extension::Internal::PrintMetafile::usebk, Inkscape::version_string, wchar16len(), Geom::GenericRect< C >::width(), and Geom::X.
|
overrideprotectedvirtual |
Implements Inkscape::Extension::Internal::PrintMetafile.
Definition at line 325 of file emf-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, Inkscape::Extension::Internal::eht, SPGradient::ensureVector(), Inkscape::Extension::Internal::et, SPStyle::fill, SPStyle::fill_opacity, SPStyle::fill_rule, Inkscape::Extension::Internal::FixPPTGrad2Polys, Inkscape::Extension::Internal::FixPPTLinGrad, 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(), rgb, Inkscape::Extension::Internal::PrintMetafile::swapRBinRGBA(), Inkscape::Extension::Internal::PrintMetafile::usebk, and width.
Referenced by fill().
|
overrideprotectedvirtual |
Implements Inkscape::Extension::Internal::PrintMetafile.
Definition at line 516 of file emf-print.cpp.
References Inkscape::Extension::Internal::PrintMetafile::avg_stop_color(), Inkscape::Extension::Internal::PrintMetafile::brush_classify(), c, Inkscape::Extension::Internal::eht, Inkscape::Extension::Internal::et, Inkscape::Extension::Internal::FixPPTDashLine, Inkscape::Extension::Internal::FixPPTPatternAsHatch, height, hpen, MAX, Inkscape::Pixbuf::PF_CAIRO, Inkscape::Pixbuf::pixelFormat(), Inkscape::Pixbuf::pixels(), Inkscape::Extension::Internal::PX2WORLD, rgb, scale, SPStyle::stroke, SPStyle::stroke_dasharray, SPStyle::stroke_linecap, SPStyle::stroke_linejoin, SPStyle::stroke_miterlimit, SPStyle::stroke_width, Inkscape::Extension::Internal::PrintMetafile::swapRBinRGBA(), Inkscape::Extension::Internal::PrintMetafile::usebk, width, Geom::X, and Geom::Y.
Referenced by stroke().
|
overrideprotectedvirtual |
Implements Inkscape::Extension::Internal::PrintMetafile.
Definition at line 496 of file emf-print.cpp.
References Inkscape::Extension::Internal::eht, Inkscape::Extension::Internal::et, and hbrush.
Referenced by print_pathv().
|
overrideprotectedvirtual |
Implements Inkscape::Extension::Internal::PrintMetafile.
Definition at line 755 of file emf-print.cpp.
References Inkscape::Extension::Internal::eht, Inkscape::Extension::Internal::et, and hpen.
Referenced by fill(), and print_pathv().
|
protected |
Definition at line 970 of file emf-print.cpp.
References Inkscape::Extension::Internal::PrintMetafile::_doc_unit_scale, child, SPObject::children, draw_pathv_to_EMF(), Geom::PathVector::empty(), Inkscape::Extension::Internal::et, SPItem::getClipObject(), item, merge_PathVector_with_group(), merge_PathVector_with_shape(), SPStyle::object, SPObject::parent, and SPItem::transform.
Referenced by fill(), finish(), image(), stroke(), and text().
|
protected |
For all Subpaths in the <path>
For all segments in the subpath
Definition at line 1780 of file emf-print.cpp.
References Inkscape::Extension::Internal::et, is_straight_curve(), pathv_to_linear_and_cubic_beziers(), Inkscape::Extension::Internal::PX2WORLD, Geom::X, U_PAIR::x, Geom::Y, and U_PAIR::y.
Referenced by do_clip_if_present(), and print_pathv().
|
overridevirtual |
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 1105 of file emf-print.cpp.
References bool_op_inters, U_RECT::bottom, 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(), do_clip_if_present(), Inkscape::Extension::Internal::DRAW_LINEAR_GRADIENT, Inkscape::Extension::Internal::DRAW_RADIAL_GRADIENT, U_XFORM::eDx, U_XFORM::eDy, U_XFORM::eM11, U_XFORM::eM12, U_XFORM::eM21, U_XFORM::eM22, Inkscape::Extension::Internal::et, fill_nonZero, fill_oddEven, SPStyle::fill_rule, Inkscape::Extension::Internal::PrintMetafile::fill_transform, Inkscape::Extension::Internal::FixPPTDashLine, Inkscape::Extension::Internal::FixPPTGrad2Polys, Inkscape::Extension::Internal::FixPPTLinGrad, get_pathrect_corner(), Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::grad, Inkscape::Extension::Internal::PrintMetafile::gv, U_RECT::left, U_GRADIENT4::LowerRight, Inkscape::Extension::Internal::PrintMetafile::m_tr_stack, make_trivertex(), Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::mode, Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::p1, Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::p2, Inkscape::Extension::Internal::PrintMetafile::GRADVALUES::p3, pathv_to_rect(), print_pathv(), Inkscape::Extension::Internal::PX2WORLD, Inkscape::Extension::Internal::PrintMetafile::rect_cutter(), U_RECT::right, 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(), U_RECT::top, Geom::unit_vector(), U_GRADIENT4::UpperLeft, Inkscape::Extension::Internal::PrintMetafile::use_fill, Inkscape::Extension::Internal::PrintMetafile::use_stroke, SPGradient::vector, vector_rect_alignment(), 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 302 of file emf-print.cpp.
References do_clip_if_present(), Inkscape::Extension::Internal::eht, and Inkscape::Extension::Internal::et.
|
protected |
Definition at line 912 of file emf-print.cpp.
References Geom::Path::begin(), dot(), and Geom::Path::end_open().
Referenced by fill().
|
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:
Bounding rectangle in device units
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 1681 of file emf-print.cpp.
References do_clip_if_present(), U_XFORM::eDx, U_XFORM::eDy, U_XFORM::eM11, U_XFORM::eM12, U_XFORM::eM21, U_XFORM::eM22, Inkscape::Extension::Internal::et, Inkscape::Extension::Internal::FixImageRot, Inkscape::Extension::Internal::PrintMetafile::m_tr_stack, Inkscape::Extension::Internal::PX2WORLD, rs, w, Geom::X, U_PAIR::x, Geom::Y, and U_PAIR::y.
|
static |
Definition at line 2153 of file emf-print.cpp.
References Inkscape::Extension::build_from_mem().
Referenced by Inkscape::Extension::init().
|
protected |
Definition at line 953 of file emf-print.cpp.
References U_TRIVERTEX::Alpha, U_COLORREF::Blue, U_TRIVERTEX::Blue, U_COLORREF::Green, U_TRIVERTEX::Green, U_COLORREF::Red, U_TRIVERTEX::Red, U_COLORREF::Reserved, Geom::X, U_TRIVERTEX::x, Geom::Y, and U_TRIVERTEX::y.
Referenced by fill().
|
protected |
Definition at line 1059 of file emf-print.cpp.
References child, item, merge_PathVector_with_group(), merge_PathVector_with_shape(), and SPItem::transform.
Referenced by do_clip_if_present(), and merge_PathVector_with_group().
|
protected |
Definition at line 1083 of file emf-print.cpp.
References bool_op_union, Geom::PathVector::empty(), fill_oddEven, item, sp_pathvector_boolop(), and SPItem::transform.
Referenced by do_clip_if_present(), and merge_PathVector_with_group().
|
protected |
Definition at line 837 of file emf-print.cpp.
References ang(), Geom::are_near(), Geom::Path::begin(), dot(), Geom::Path::end_open(), pathv_to_simple_polygon(), Geom::X, and Geom::Y.
Referenced by fill().
|
protected |
Definition at line 779 of file emf-print.cpp.
References Geom::Path::append(), Geom::are_near(), Geom::PathVector::begin(), Geom::Path::close(), dot(), Geom::PathVector::end(), is_straight_curve(), pathv_to_linear_and_cubic_beziers(), and Geom::Path::start().
Referenced by pathv_to_rect().
|
private |
Definition at line 1893 of file emf-print.cpp.
References destroy_brush(), destroy_pen(), draw_pathv_to_EMF(), Geom::PathVector::empty(), Inkscape::Extension::Internal::et, print_simple_shape(), Inkscape::Extension::Internal::PrintMetafile::simple_shape, Inkscape::Extension::Internal::PrintMetafile::use_fill, and Inkscape::Extension::Internal::PrintMetafile::use_stroke.
|
private |
For all Subpaths in the <path>
For all segments in the subpath
Definition at line 1472 of file emf-print.cpp.
References Inkscape::Extension::Internal::eht, Inkscape::Extension::Internal::et, hbrush, hpen, is_straight_curve(), pathv_to_linear_and_cubic_beziers(), Inkscape::Extension::Internal::PX2WORLD, Inkscape::Extension::Internal::PrintMetafile::use_fill, Inkscape::Extension::Internal::PrintMetafile::use_stroke, Geom::X, U_PAIR::x, Geom::Y, and U_PAIR::y.
Referenced by print_pathv().
|
overridevirtual |
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 118 of file emf-print.cpp.
|
staticprotected |
|
overridevirtual |
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 1395 of file emf-print.cpp.
References Geom::Piecewise< T >::concat(), create_pen(), do_clip_if_present(), Inkscape::Extension::Internal::et, 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, and Inkscape::Extension::Internal::PrintMetafile::usebk.
|
overridevirtual |
Reimplemented from Inkscape::Extension::Implementation::Implementation.
Definition at line 1941 of file emf-print.cpp.
References Inkscape::Extension::Internal::PrintMetafile::_lookup_ppt_fontfix(), Inkscape::Extension::Internal::PrintMetafile::_translate_weight(), CVTSYM, CVTWDG, CVTZDG, do_clip_if_present(), Inkscape::Extension::Internal::eht, Inkscape::Extension::Internal::et, 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_adxkyrtl_out(), SP_CSS_FONT_STYLE_ITALIC, text(), SPStyle::text_decoration_line, Inkscape::Extension::Internal::toColorRef(), U_Utf8ToUtf16le(), UnicodeToNon(), Geom::X, and Geom::Y.
Referenced by text().
|
protected |
Definition at line 891 of file emf-print.cpp.
References Geom::are_near(), dot(), and Geom::unit_vector().
Referenced by fill().
|
private |
Definition at line 27 of file emf-print.h.
Referenced by begin(), create_brush(), destroy_brush(), and print_simple_shape().
|
private |
Definition at line 27 of file emf-print.h.
Referenced by begin().
|
private |
Definition at line 27 of file emf-print.h.
Referenced by begin(), create_pen(), destroy_pen(), and print_simple_shape().