Diffstat (limited to 'qmake/include/private/qsvgdevice_p.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | qmake/include/private/qsvgdevice_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/qmake/include/private/qsvgdevice_p.h b/qmake/include/private/qsvgdevice_p.h index c1cc389..3407705 100644 --- a/qmake/include/private/qsvgdevice_p.h +++ b/qmake/include/private/qsvgdevice_p.h | |||
@@ -1,134 +1,134 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** $Id$ | 2 | ** $Id$ |
3 | ** | 3 | ** |
4 | ** Definition of the QSvgDevice class | 4 | ** Definition of the QSvgDevice class |
5 | ** | 5 | ** |
6 | ** Created : 20001024 | 6 | ** Created : 001024 |
7 | ** | 7 | ** |
8 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 8 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
9 | ** | 9 | ** |
10 | ** This file is part of the xml module of the Qt GUI Toolkit. | 10 | ** This file is part of the xml module of the Qt GUI Toolkit. |
11 | ** | 11 | ** |
12 | ** This file may be distributed under the terms of the Q Public License | 12 | ** This file may be distributed under the terms of the Q Public License |
13 | ** as defined by Trolltech AS of Norway and appearing in the file | 13 | ** as defined by Trolltech AS of Norway and appearing in the file |
14 | ** LICENSE.QPL included in the packaging of this file. | 14 | ** LICENSE.QPL included in the packaging of this file. |
15 | ** | 15 | ** |
16 | ** This file may be distributed and/or modified under the terms of the | 16 | ** This file may be distributed and/or modified under the terms of the |
17 | ** GNU General Public License version 2 as published by the Free Software | 17 | ** GNU General Public License version 2 as published by the Free Software |
18 | ** Foundation and appearing in the file LICENSE.GPL included in the | 18 | ** Foundation and appearing in the file LICENSE.GPL included in the |
19 | ** packaging of this file. | 19 | ** packaging of this file. |
20 | ** | 20 | ** |
21 | ** Licensees holding valid Qt Enterprise Edition licenses may use this | 21 | ** Licensees holding valid Qt Enterprise Edition licenses may use this |
22 | ** file in accordance with the Qt Commercial License Agreement provided | 22 | ** file in accordance with the Qt Commercial License Agreement provided |
23 | ** with the Software. | 23 | ** with the Software. |
24 | ** | 24 | ** |
25 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 25 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
26 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 26 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
27 | ** | 27 | ** |
28 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for | 28 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for |
29 | ** information about Qt Commercial License Agreements. | 29 | ** information about Qt Commercial License Agreements. |
30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. | 30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. |
31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
32 | ** | 32 | ** |
33 | ** Contact info@trolltech.com if any conditions of this licensing are | 33 | ** Contact info@trolltech.com if any conditions of this licensing are |
34 | ** not clear to you. | 34 | ** not clear to you. |
35 | ** | 35 | ** |
36 | *****************************************************************************/ | 36 | *****************************************************************************/ |
37 | 37 | ||
38 | #ifndef QSVGDEVICE_H | 38 | #ifndef QSVGDEVICE_P_H |
39 | #define QSVGDEVICE_H | 39 | #define QSVGDEVICE_P_H |
40 | 40 | ||
41 | // | 41 | // |
42 | // W A R N I N G | 42 | // W A R N I N G |
43 | // ------------- | 43 | // ------------- |
44 | // | 44 | // |
45 | // This file is not part of the Qt API. It exists for the convenience | 45 | // This file is not part of the Qt API. It exists for the convenience |
46 | // of the QPicture class. This header file may change from | 46 | // of the QPicture class. This header file may change from |
47 | // version to version without notice, or even be removed. | 47 | // version to version without notice, or even be removed. |
48 | // | 48 | // |
49 | // We mean it. | 49 | // We mean it. |
50 | // | 50 | // |
51 | // | 51 | // |
52 | 52 | ||
53 | #ifndef QT_H | 53 | #ifndef QT_H |
54 | #include "qpaintdevice.h" | 54 | #include "qpaintdevice.h" |
55 | #include "qrect.h" | 55 | #include "qrect.h" |
56 | #include "qdom.h" | 56 | #include "qdom.h" |
57 | #endif // QT_H | 57 | #endif // QT_H |
58 | 58 | ||
59 | #if !defined(QT_MODULE_XML) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_XML ) | 59 | #if !defined(QT_MODULE_XML) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_XML ) |
60 | #define QM_EXPORT_SVG | 60 | #define QM_EXPORT_SVG |
61 | #else | 61 | #else |
62 | #define QM_EXPORT_SVG Q_EXPORT | 62 | #define QM_EXPORT_SVG Q_EXPORT |
63 | #endif | 63 | #endif |
64 | 64 | ||
65 | #ifndef QT_NO_SVG | 65 | #ifndef QT_NO_SVG |
66 | 66 | ||
67 | class QPainter; | 67 | class QPainter; |
68 | class QDomNode; | 68 | class QDomNode; |
69 | class QDomNamedNodeMap; | 69 | class QDomNamedNodeMap; |
70 | struct QSvgDeviceState; | 70 | struct QSvgDeviceState; |
71 | class QSvgDevicePrivate; | 71 | class QSvgDevicePrivate; |
72 | 72 | ||
73 | class QM_EXPORT_SVG QSvgDevice : public QPaintDevice | 73 | class QM_EXPORT_SVG QSvgDevice : public QPaintDevice |
74 | { | 74 | { |
75 | public: | 75 | public: |
76 | QSvgDevice(); | 76 | QSvgDevice(); |
77 | ~QSvgDevice(); | 77 | ~QSvgDevice(); |
78 | 78 | ||
79 | bool play( QPainter *p ); | 79 | bool play( QPainter *p ); |
80 | 80 | ||
81 | QString toString() const; | 81 | QString toString() const; |
82 | 82 | ||
83 | bool load( QIODevice *dev ); | 83 | bool load( QIODevice *dev ); |
84 | bool save( QIODevice *dev ); | 84 | bool save( QIODevice *dev ); |
85 | bool save( const QString &fileName ); | 85 | bool save( const QString &fileName ); |
86 | 86 | ||
87 | QRect boundingRect() const; | 87 | QRect boundingRect() const; |
88 | void setBoundingRect( const QRect &r ); | 88 | void setBoundingRect( const QRect &r ); |
89 | 89 | ||
90 | protected: | 90 | protected: |
91 | virtual bool cmd ( int, QPainter*, QPDevCmdParam* ); | 91 | virtual bool cmd ( int, QPainter*, QPDevCmdParam* ); |
92 | virtual int metric( int ) const; | 92 | virtual int metric( int ) const; |
93 | 93 | ||
94 | private: | 94 | private: |
95 | // reading | 95 | // reading |
96 | bool play( const QDomNode &node ); | 96 | bool play( const QDomNode &node ); |
97 | void saveAttributes(); | 97 | void saveAttributes(); |
98 | void restoreAttributes(); | 98 | void restoreAttributes(); |
99 | QColor parseColor( const QString &col ); | 99 | QColor parseColor( const QString &col ); |
100 | double parseLen( const QString &str, bool *ok=0, bool horiz=TRUE ) const; | 100 | double parseLen( const QString &str, bool *ok=0, bool horiz=TRUE ) const; |
101 | int lenToInt( const QDomNamedNodeMap &map, const QString &attr, | 101 | int lenToInt( const QDomNamedNodeMap &map, const QString &attr, |
102 | int def=0 ) const; | 102 | int def=0 ) const; |
103 | void setStyleProperty( const QString &prop, const QString &val, | 103 | void setStyleProperty( const QString &prop, const QString &val, |
104 | QPen *pen, QFont *font, int *talign ); | 104 | QPen *pen, QFont *font, int *talign ); |
105 | void setStyle( const QString &s ); | 105 | void setStyle( const QString &s ); |
106 | void setTransform( const QString &tr ); | 106 | void setTransform( const QString &tr ); |
107 | void drawPath( const QString &data ); | 107 | void drawPath( const QString &data ); |
108 | 108 | ||
109 | // writing | 109 | // writing |
110 | void applyStyle( QDomElement *e, int c ) const; | 110 | void applyStyle( QDomElement *e, int c ) const; |
111 | void applyTransform( QDomElement *e ) const; | 111 | void applyTransform( QDomElement *e ) const; |
112 | 112 | ||
113 | // reading | 113 | // reading |
114 | QRect brect; // bounding rectangle | 114 | QRect brect; // bounding rectangle |
115 | QDomDocument doc; // document tree | 115 | QDomDocument doc; // document tree |
116 | QDomNode current; | 116 | QDomNode current; |
117 | QPoint curPt; | 117 | QPoint curPt; |
118 | QSvgDeviceState *curr; | 118 | QSvgDeviceState *curr; |
119 | QPainter *pt; // used by play() et al | 119 | QPainter *pt; // used by play() et al |
120 | 120 | ||
121 | // writing | 121 | // writing |
122 | bool dirtyTransform, dirtyStyle; | 122 | bool dirtyTransform, dirtyStyle; |
123 | 123 | ||
124 | QSvgDevicePrivate *d; | 124 | QSvgDevicePrivate *d; |
125 | }; | 125 | }; |
126 | 126 | ||
127 | inline QRect QSvgDevice::boundingRect() const | 127 | inline QRect QSvgDevice::boundingRect() const |
128 | { | 128 | { |
129 | return brect; | 129 | return brect; |
130 | } | 130 | } |
131 | 131 | ||
132 | #endif // QT_NO_SVG | 132 | #endif // QT_NO_SVG |
133 | 133 | ||
134 | #endif // QSVGDEVICE_H | 134 | #endif // QSVGDEVICE_P_H |