diff options
| author | craig <craig@11d20701-8431-0410-a711-e3c959e3b870> | 2012-01-01 11:40:09 +0000 |
|---|---|---|
| committer | craig <craig@11d20701-8431-0410-a711-e3c959e3b870> | 2012-01-01 11:40:09 +0000 |
| commit | 7ed83b6c6666eb8b6b104c211ae7e52907350372 (patch) | |
| tree | 4430b556abac0ad660a0aacf1887d77f85d8be02 /scribus/plugins/import/wmf/wmfcontext.h | |
| download | scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.tar.gz scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.tar.xz scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.zip | |
Branch 1.3.5 tree to 1.4.x tree, goodbye 1.3.x
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17163 11d20701-8431-0410-a711-e3c959e3b870
Diffstat (limited to 'scribus/plugins/import/wmf/wmfcontext.h')
| -rw-r--r-- | scribus/plugins/import/wmf/wmfcontext.h | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/scribus/plugins/import/wmf/wmfcontext.h b/scribus/plugins/import/wmf/wmfcontext.h new file mode 100644 index 0000000..6514220 --- /dev/null +++ b/scribus/plugins/import/wmf/wmfcontext.h @@ -0,0 +1,107 @@ +/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+
+#ifndef WMFCONTEXT_H
+#define WMFCONTEXT_H
+
+#include <QBrush>
+#include <QFont>
+#include <QMatrix>
+#include <QPen>
+#include <QPoint>
+#include <QSize>
+#include <QStack>
+#include "fpointarray.h"
+
+class WMFGraphicsState
+{
+protected:
+
+ QPointF windowOrg;
+ QSizeF windowExt;
+ QPointF viewportOrg;
+ QSizeF viewportExt;
+
+ void updateWorldMatrix(void);
+
+public:
+ QFont font;
+ QPoint position;
+ QPen pen;
+ QBrush brush;
+ QColor backgroundColor;
+ Qt::BGMode backgroundMode;
+ QColor textColor;
+ int textAlign;
+ int textCharset;
+ double textRotation;
+ bool windingFill;
+ FPointArray path;
+ QMatrix worldMatrix;
+
+public:
+ WMFGraphicsState(void);
+
+ void setWindowOrg(double x, double y);
+ void setWindowExt(double x, double y);
+ void setViewportOrg(double x, double y);
+ void setViewportExt(double x, double y);
+};
+
+class WMFContext : public QStack<WMFGraphicsState>
+{
+public:
+
+ WMFContext(void);
+
+ void save(void);
+ void restore(void);
+ void reset(void);
+
+ WMFGraphicsState& current(void);
+
+ QFont font(void) { return current().font; }
+ QPoint position(void) { return current().position; }
+ QPen pen(void) { return current().pen; }
+ QBrush brush(void) { return current().brush; }
+ QColor backgroundColor(void) { return current().backgroundColor; }
+ Qt::BGMode backgroundMode(void) { return current().backgroundMode; }
+ QColor textColor(void) { return current().textColor; }
+ int textAlign(void) { return current().textAlign; }
+ int textCharSet(void) { return current().textCharset; }
+ double textRotation(void) { return current().textRotation; }
+ bool windingFill(void) { return current().windingFill; }
+ FPointArray& path (void) { return current().path; }
+ QMatrix& worldMatrix (void) { return current().worldMatrix; }
+ void setFont (const QFont& font) { current().font = font; }
+ void setPosition (const QPoint& pos) { current().position = pos; }
+ void setPen (const QPen& pen) { current().pen = pen; }
+ void setBrush (const QBrush& brush) { current().brush = brush; }
+ void setBackgroundColor (const QColor& color) { current().backgroundColor = color; }
+ void setBackgroundMode (const Qt::BGMode& mode) { current().backgroundMode = mode; }
+ void setTextColor (const QColor& color) { current().textColor = color; }
+ void setTextAlign (int align) { current().textAlign = align; }
+ void setTextCharset(int align) { current().textCharset = align; }
+ void setTextRotation (double rot) { current().textRotation = rot; }
+ void setWindingFill (const bool winding) { current().windingFill = winding; }
+ void setPath (const FPointArray& path) { current().path = path; }
+ void setWorldMatrix (const QMatrix& matrix) { current().worldMatrix = matrix; }
+
+ // window operations
+ void setWindowOrg(double x, double y) { current().setWindowOrg(x, y); }
+ void setWindowExt(double x, double y) { current().setWindowExt(x, y); }
+ void setViewportOrg(double x, double y) { current().setViewportOrg(x, y); }
+ void setViewportExt(double x, double y) { current().setViewportExt(x, y); }
+
+ // matrix operations
+ void translate (double x, double y) { current().worldMatrix.translate(x, y); }
+ void scale (double x, double y) { current().worldMatrix.scale(x, y); }
+ void rotate (double deg) { current().worldMatrix.rotate(deg); }
+};
+
+
+#endif
|
