Code

Filters. New custom predefined cross-smooth filter (very experimental...).
[inkscape.git] / src / extension / internal / emf-win32-print.h
index c0eb58481ba811811c6721c7d4efc9baba9a4a2b..a0f26abb588fc5db2c25c410a2bba628ef75fa7e 100644 (file)
@@ -1,16 +1,15 @@
-#ifndef __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__
-#define __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__
-
-/*
- * Enhanced Metafile Printing.
- *
- * Author:
+/** @file
+ * @brief Enhanced Metafile printing - implementation
+ */
+/* Author:
  *   Ulf Erikson <ulferikson@users.sf.net>
  *
- * Copyright (C) 2006 Authors
+ * 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
 
 #endif
 
 #include "extension/implementation/implementation.h"
-#include "extension/extension.h"
+//#include "extension/extension.h"
 
-#include "svg/stringstream.h"
-#include "libnr/nr-matrix.h"
-#include "libnr/nr-rect.h"
+#include <2geom/pathvector.h>
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include <stack>
 
 namespace Inkscape {
 namespace Extension {
@@ -42,13 +38,15 @@ class PrintEmfWin32 : public Inkscape::Extension::Implementation::Implementation
     HBRUSH hbrush, hbrushOld;
     HPEN hpen, hpenOld;
 
-    NArtBpath *fill_path;
-    NArtBpath *fill_path_copy;
-    NR::Matrix fill_transform;
-    NRRect fill_pbox;
-    NR::Matrix text_transform;
+    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_bpath (const NArtBpath *bp, const NR::Matrix *transform, NRRect const *pbox);
+    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);
@@ -61,17 +59,17 @@ public:
     virtual unsigned int finish (Inkscape::Extension::Print * module);
 
     /* Rendering methods */
-    virtual unsigned int bind(Inkscape::Extension::Print *module, NR::Matrix const *transform, float opacity);
+    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,
-                               const const_NRBPath *bpath, const NR::Matrix *ctm, const SPStyle *style,
+                               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,
-                                 const const_NRBPath *bpath, const NR::Matrix *transform, const SPStyle *style,
+                                 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,
-                              NR::Point p, SPStyle const *style);
+                              Geom::Point p, SPStyle const *style);
     bool textToPath (Inkscape::Extension::Print * ext);
 
     static void init (void);
@@ -81,15 +79,12 @@ protected:
 
     void destroy_brush();
 
-    void create_pen(SPStyle const *style, const NR::Matrix *transform);
+    void create_pen(SPStyle const *style, const Geom::Matrix &transform);
 
     void destroy_pen();
 
     void flush_fill();
 
-    NArtBpath *copy_bpath(const NArtBpath *bp);
-    int cmp_bpath(const NArtBpath *bp1, const NArtBpath *bp2);
-
 };
 
 }  /* namespace Internal */
@@ -102,11 +97,11 @@ protected:
 
 /*
   Local Variables:
-  mode:cpp
+  mode:c++
   c-file-style:"stroustrup"
-  c-file-offsets:((innamespace . 0)(inline-open . 0))
+  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 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :