author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Fri, 16 Apr 2010 11:39:52 +0300 | |
branch | RCL_3 |
changeset 8 | 740e5562c97f |
parent 4 | 3b1da2848fc7 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the QtOpenVG module of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#ifndef QPAINTENGINE_VG_P_H |
|
43 |
#define QPAINTENGINE_VG_P_H |
|
44 |
||
45 |
// |
|
46 |
// W A R N I N G |
|
47 |
// ------------- |
|
48 |
// |
|
49 |
// This file is not part of the Qt API. It exists purely as an |
|
50 |
// implementation detail. This header file may change from version to |
|
51 |
// version without notice, or even be removed. |
|
52 |
// |
|
53 |
// We mean it. |
|
54 |
// |
|
55 |
||
56 |
#include <QtGui/private/qpaintengineex_p.h> |
|
57 |
||
58 |
QT_BEGIN_NAMESPACE |
|
59 |
||
60 |
class QVGPaintEnginePrivate; |
|
61 |
class QPixmapData; |
|
62 |
class QVGEGLWindowSurfacePrivate; |
|
63 |
||
64 |
class Q_OPENVG_EXPORT QVGPainterState : public QPainterState |
|
65 |
{ |
|
66 |
public: |
|
67 |
QVGPainterState(QVGPainterState& other); |
|
68 |
QVGPainterState(); |
|
69 |
~QVGPainterState(); |
|
70 |
||
71 |
bool isNew; |
|
72 |
QRegion clipRegion; |
|
73 |
QPaintEngine::DirtyFlags savedDirty; |
|
74 |
}; |
|
75 |
||
76 |
class Q_OPENVG_EXPORT QVGPaintEngine : public QPaintEngineEx |
|
77 |
{ |
|
78 |
Q_DECLARE_PRIVATE(QVGPaintEngine) |
|
79 |
public: |
|
80 |
QVGPaintEngine(); |
|
81 |
~QVGPaintEngine(); |
|
82 |
||
83 |
Type type() const { return OpenVG; } |
|
84 |
||
85 |
QPainterState *createState(QPainterState *orig) const; |
|
86 |
||
87 |
bool begin(QPaintDevice *pdev); |
|
88 |
bool end(); |
|
89 |
||
90 |
void draw(const QVectorPath &path); |
|
91 |
void fill(const QVectorPath &path, const QBrush &brush); |
|
92 |
void stroke(const QVectorPath &path, const QPen &pen); |
|
93 |
||
94 |
void clip(const QVectorPath &path, Qt::ClipOperation op); |
|
95 |
void clip(const QRect &rect, Qt::ClipOperation op); |
|
96 |
void clip(const QRegion ®ion, Qt::ClipOperation op); |
|
97 |
void clip(const QPainterPath &path, Qt::ClipOperation op); |
|
98 |
||
99 |
void clipEnabledChanged(); |
|
100 |
void penChanged(); |
|
101 |
void brushChanged(); |
|
102 |
void brushOriginChanged(); |
|
103 |
void opacityChanged(); |
|
104 |
void compositionModeChanged(); |
|
105 |
void renderHintsChanged(); |
|
106 |
void transformChanged(); |
|
107 |
||
108 |
void fillRect(const QRectF &rect, const QBrush &brush); |
|
109 |
void fillRect(const QRectF &rect, const QColor &color); |
|
110 |
||
111 |
void drawRoundedRect(const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode); |
|
112 |
||
113 |
void drawRects(const QRect *rects, int rectCount); |
|
114 |
void drawRects(const QRectF *rects, int rectCount); |
|
115 |
||
116 |
void drawLines(const QLine *lines, int lineCount); |
|
117 |
void drawLines(const QLineF *lines, int lineCount); |
|
118 |
||
119 |
void drawEllipse(const QRectF &r); |
|
120 |
void drawEllipse(const QRect &r); |
|
121 |
||
122 |
void drawPath(const QPainterPath &path); |
|
123 |
||
124 |
void drawPoints(const QPointF *points, int pointCount); |
|
125 |
void drawPoints(const QPoint *points, int pointCount); |
|
126 |
||
127 |
void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode); |
|
128 |
void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode); |
|
129 |
||
130 |
void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr); |
|
131 |
void drawPixmap(const QPointF &pos, const QPixmap &pm); |
|
132 |
||
133 |
void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr, |
|
134 |
Qt::ImageConversionFlags flags = Qt::AutoColor); |
|
135 |
void drawImage(const QPointF &pos, const QImage &image); |
|
136 |
||
137 |
void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s); |
|
138 |
||
139 |
void drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QFlags<QDrawPixmaps::DrawingHint> hints); |
|
140 |
||
141 |
void drawTextItem(const QPointF &p, const QTextItem &textItem); |
|
142 |
||
143 |
void setState(QPainterState *s); |
|
144 |
QVGPainterState *state() { return static_cast<QVGPainterState *>(QPaintEngineEx::state()); } |
|
145 |
const QVGPainterState *state() const { return static_cast<const QVGPainterState *>(QPaintEngineEx::state()); } |
|
146 |
||
147 |
void beginNativePainting(); |
|
148 |
void endNativePainting(); |
|
149 |
||
150 |
QPixmapFilter *pixmapFilter(int type, const QPixmapFilter *prototype); |
|
151 |
||
152 |
QVGPaintEnginePrivate *vgPrivate() { Q_D(QVGPaintEngine); return d; } |
|
153 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
154 |
void fillRegion(const QRegion& region, const QColor& color, const QSize& surfaceSize); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
155 |
|
0 | 156 |
protected: |
157 |
QVGPaintEngine(QVGPaintEnginePrivate &data); |
|
158 |
||
159 |
private: |
|
160 |
void restoreState(QPaintEngine::DirtyFlags dirty); |
|
161 |
void updateScissor(); |
|
162 |
QRegion defaultClipRegion(); |
|
163 |
bool isDefaultClipRegion(const QRegion& region); |
|
164 |
bool isDefaultClipRect(const QRect& rect); |
|
165 |
bool clearRect(const QRectF &rect, const QColor &color); |
|
166 |
}; |
|
167 |
||
168 |
||
169 |
QT_END_NAMESPACE |
|
170 |
||
171 |
#endif |