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