1 #ifndef __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__\r
2 #define __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__\r
3 \r
4 /*\r
5 * Enhanced Metafile Printing.\r
6 *\r
7 * Author:\r
8 * Ulf Erikson <ulferikson@users.sf.net>\r
9 *\r
10 * Copyright (C) 2006 Authors\r
11 *\r
12 * Released under GNU GPL, read the file 'COPYING' for more information\r
13 */\r
14 \r
15 #ifdef WIN32\r
16 \r
17 #ifdef HAVE_CONFIG_H\r
18 # include "config.h"\r
19 #endif\r
20 \r
21 #include "extension/implementation/implementation.h"\r
22 #include "extension/extension.h"\r
23 \r
24 #include "svg/stringstream.h"\r
25 #include "libnr/nr-matrix.h"\r
26 #include "libnr/nr-rect.h"\r
27 \r
28 #define WIN32_LEAN_AND_MEAN\r
29 #include <windows.h>\r
30 \r
31 namespace Inkscape {\r
32 namespace Extension {\r
33 namespace Internal {\r
34 \r
35 class PrintEmfWin32 : public Inkscape::Extension::Implementation::Implementation\r
36 {\r
37 double _width;\r
38 double _height;\r
39 HDC hdc;\r
40 RECT rc;\r
41 \r
42 HBRUSH hbrush, hbrushOld;\r
43 HPEN hpen, hpenOld;\r
44 \r
45 NArtBpath *fill_path;\r
46 NArtBpath *fill_path_copy;\r
47 NRMatrix fill_transform;\r
48 NRRect fill_pbox;\r
49 \r
50 unsigned int print_bpath (const NArtBpath *bp, const NRMatrix *transform, NRRect const *pbox);\r
51 \r
52 public:\r
53 PrintEmfWin32 (void);\r
54 virtual ~PrintEmfWin32 (void);\r
55 \r
56 /* Print functions */\r
57 virtual unsigned int setup (Inkscape::Extension::Print * module);\r
58 \r
59 virtual unsigned int begin (Inkscape::Extension::Print * module, SPDocument *doc);\r
60 virtual unsigned int finish (Inkscape::Extension::Print * module);\r
61 \r
62 /* Rendering methods */\r
63 virtual unsigned int fill (Inkscape::Extension::Print * module,\r
64 const NRBPath *bpath, const NRMatrix *ctm, const SPStyle *style,\r
65 const NRRect *pbox, const NRRect *dbox, const NRRect *bbox);\r
66 virtual unsigned int stroke (Inkscape::Extension::Print * module,\r
67 const NRBPath *bpath, const NRMatrix *transform, const SPStyle *style,\r
68 const NRRect *pbox, const NRRect *dbox, const NRRect *bbox);\r
69 virtual unsigned int comment(Inkscape::Extension::Print *module, const char * comment);\r
70 bool textToPath (Inkscape::Extension::Print * ext);\r
71 \r
72 static void init (void);\r
73 \r
74 protected:\r
75 void create_brush(SPStyle const *style);\r
76 \r
77 void destroy_brush();\r
78 \r
79 void create_pen(SPStyle const *style);\r
80 \r
81 void destroy_pen();\r
82 \r
83 void flush_fill();\r
84 \r
85 NArtBpath *copy_bpath(const NArtBpath *bp);\r
86 int cmp_bpath(const NArtBpath *bp1, const NArtBpath *bp2);\r
87 \r
88 };\r
89 \r
90 } /* namespace Internal */\r
91 } /* namespace Extension */\r
92 } /* namespace Inkscape */\r
93 \r
94 #endif /* WIN32 */\r
95 \r
96 #endif /* __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__ */\r
97 \r
98 /*\r
99 Local Variables:\r
100 mode:cpp\r
101 c-file-style:"stroustrup"\r
102 c-file-offsets:((innamespace . 0)(inline-open . 0))\r
103 indent-tabs-mode:nil\r
104 fill-column:99\r
105 End:\r
106 */\r
107 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :\r