index d1ac819391974087e2bdf1107b09ef8b7d1d148a..5c1d8439d329670ba048c4e7fb542c5829cf2f81 100644 (file)
-#ifndef __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__\r
-#define __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__\r
-\r
-/*\r
- * Enhanced Metafile Printing.\r
- *\r
- * Author:\r
- * Ulf Erikson <ulferikson@users.sf.net>\r
- *\r
- * Copyright (C) 2006 Authors\r
- *\r
- * Released under GNU GPL, read the file 'COPYING' for more information\r
- */\r
-\r
-#ifdef WIN32\r
-\r
-#ifdef HAVE_CONFIG_H\r
-# include "config.h"\r
-#endif\r
-\r
-#include "extension/implementation/implementation.h"\r
-#include "extension/extension.h"\r
-\r
-#include "svg/stringstream.h"\r
-#include "libnr/nr-matrix.h"\r
-#include "libnr/nr-rect.h"\r
-\r
-#define WIN32_LEAN_AND_MEAN\r
-#include <windows.h>\r
-\r
-namespace Inkscape {\r
-namespace Extension {\r
-namespace Internal {\r
-\r
-class PrintEmfWin32 : public Inkscape::Extension::Implementation::Implementation\r
-{\r
- double _width;\r
- double _height;\r
- HDC hdc;\r
- RECT rc;\r
-\r
- HBRUSH hbrush, hbrushOld;\r
- HPEN hpen, hpenOld;\r
-\r
- NArtBpath *fill_path;\r
- NArtBpath *fill_path_copy;\r
- NRMatrix fill_transform;\r
- NRRect fill_pbox;\r
-\r
- unsigned int print_bpath (const NArtBpath *bp, const NRMatrix *transform, NRRect const *pbox);\r
-\r
-public:\r
- PrintEmfWin32 (void);\r
- virtual ~PrintEmfWin32 (void);\r
-\r
- /* Print functions */\r
- virtual unsigned int setup (Inkscape::Extension::Print * module);\r
-\r
- virtual unsigned int begin (Inkscape::Extension::Print * module, SPDocument *doc);\r
- virtual unsigned int finish (Inkscape::Extension::Print * module);\r
-\r
- /* Rendering methods */\r
- virtual unsigned int fill (Inkscape::Extension::Print * module,\r
- const NRBPath *bpath, const NRMatrix *ctm, const SPStyle *style,\r
- const NRRect *pbox, const NRRect *dbox, const NRRect *bbox);\r
- virtual unsigned int stroke (Inkscape::Extension::Print * module,\r
- const NRBPath *bpath, const NRMatrix *transform, const SPStyle *style,\r
- const NRRect *pbox, const NRRect *dbox, const NRRect *bbox);\r
- virtual unsigned int comment(Inkscape::Extension::Print *module, const char * comment);\r
- bool textToPath (Inkscape::Extension::Print * ext);\r
-\r
- static void init (void);\r
-\r
-protected:\r
- void create_brush(SPStyle const *style);\r
-\r
- void destroy_brush();\r
-\r
- void create_pen(SPStyle const *style);\r
-\r
- void destroy_pen();\r
-\r
- void flush_fill();\r
-\r
- NArtBpath *copy_bpath(const NArtBpath *bp);\r
- int cmp_bpath(const NArtBpath *bp1, const NArtBpath *bp2);\r
-\r
-};\r
-\r
-} /* namespace Internal */\r
-} /* namespace Extension */\r
-} /* namespace Inkscape */\r
-\r
-#endif /* WIN32 */\r
-\r
-#endif /* __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__ */\r
-\r
-/*\r
- Local Variables:\r
- mode:cpp\r
- c-file-style:"stroustrup"\r
- c-file-offsets:((innamespace . 0)(inline-open . 0))\r
- indent-tabs-mode:nil\r
- fill-column:99\r
- End:\r
-*/\r
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :\r
+/** @file
+ * @brief Enhanced Metafile printing - implementation
+ */
+/* Author:
+ * Ulf Erikson <ulferikson@users.sf.net>
+ *
+ * Copyright (C) 2006-2008 Authors
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__
+
+#ifdef WIN32
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "extension/implementation/implementation.h"
+//#include "extension/extension.h"
+
+#include <2geom/pathvector.h>
+
+#include <stack>
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+
+class PrintEmfWin32 : public Inkscape::Extension::Implementation::Implementation
+{
+ double _width;
+ double _height;
+ HDC hdc;
+ RECT rc;
+
+ HBRUSH hbrush, hbrushOld;
+ HPEN hpen, hpenOld;
+
+ std::stack<Geom::Matrix> m_tr_stack;
+ Geom::PathVector fill_pathv;
+ Geom::Matrix fill_transform;
+ bool stroke_and_fill;
+ bool fill_only;
+ bool simple_shape;
+
+ unsigned int print_pathv (Geom::PathVector const &pathv, const Geom::Matrix &transform);
+ bool print_simple_shape (Geom::PathVector const &pathv, const Geom::Matrix &transform);
+
+public:
+ PrintEmfWin32 (void);
+ virtual ~PrintEmfWin32 (void);
+
+ /* Print functions */
+ virtual unsigned int setup (Inkscape::Extension::Print * module);
+
+ virtual unsigned int begin (Inkscape::Extension::Print * module, SPDocument *doc);
+ virtual unsigned int finish (Inkscape::Extension::Print * module);
+
+ /* Rendering methods */
+ virtual unsigned int bind(Inkscape::Extension::Print *module, Geom::Matrix const *transform, float opacity);
+ virtual unsigned int release(Inkscape::Extension::Print *module);
+ virtual unsigned int fill (Inkscape::Extension::Print * module,
+ Geom::PathVector const &pathv, const Geom::Matrix *ctm, const SPStyle *style,
+ const NRRect *pbox, const NRRect *dbox, const NRRect *bbox);
+ virtual unsigned int stroke (Inkscape::Extension::Print * module,
+ Geom::PathVector const &pathv, const Geom::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,
+ Geom::Point p, SPStyle const *style);
+ bool textToPath (Inkscape::Extension::Print * ext);
+
+ static void init (void);
+
+protected:
+ int create_brush(SPStyle const *style);
+
+ void destroy_brush();
+
+ void create_pen(SPStyle const *style, const Geom::Matrix &transform);
+
+ void destroy_pen();
+
+ void flush_fill();
+
+};
+
+} /* namespace Internal */
+} /* namespace Extension */
+} /* namespace Inkscape */
+
+#endif /* WIN32 */
+
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__ */
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :