42 #ifndef QPAINTENGINE_H
43 #define QPAINTENGINE_H
59 class QPaintEnginePrivate;
78 Q_DECLARE_FLAGS(RenderFlags, RenderFlag)
79 qreal descent() const;
83 RenderFlags renderFlags() const;
92 Q_DECLARE_PRIVATE(QPaintEngine)
95 PrimitiveTransform = 0x00000001,
96 PatternTransform = 0x00000002,
97 PixmapTransform = 0x00000004,
98 PatternBrush = 0x00000008,
99 LinearGradientFill = 0x00000010,
100 RadialGradientFill = 0x00000020,
101 ConicalGradientFill = 0x00000040,
102 AlphaBlend = 0x00000080,
103 PorterDuff = 0x00000100,
104 PainterPaths = 0x00000200,
106 BrushStroke = 0x00000800,
107 ConstantOpacity = 0x00001000,
108 MaskedBrush = 0x00002000,
109 PerspectiveTransform = 0x00004000,
110 BlendModes = 0x00008000,
111 ObjectBoundingModeGradients = 0x00010000,
112 RasterOpModes = 0x00020000,
113 PaintOutsidePaintEvent = 0x20000000,
121 AllFeatures = 0xffffffff
123 Q_DECLARE_FLAGS(PaintEngineFeatures, PaintEngineFeature)
128 DirtyBrushOrigin = 0x0004,
130 DirtyBackground = 0x0010,
131 DirtyBackgroundMode = 0x0020,
132 DirtyTransform = 0x0040,
133 DirtyClipRegion = 0x0080,
134 DirtyClipPath = 0x0100,
136 DirtyCompositionMode = 0x0400,
137 DirtyClipEnabled = 0x0800,
138 DirtyOpacity = 0x1000,
142 Q_DECLARE_FLAGS(DirtyFlags, DirtyFlag)
151 explicit QPaintEngine(PaintEngineFeatures features=0);
152 virtual ~QPaintEngine();
157 virtual bool begin(QPaintDevice *pdev) = 0;
158 virtual bool end() = 0;
160 virtual void updateState(
const QPaintEngineState &state) = 0;
162 virtual void drawRects(
const QRect *rects,
int rectCount);
163 virtual void drawRects(
const QRectF *rects,
int rectCount);
165 virtual void drawLines(
const QLine *lines,
int lineCount);
166 virtual void drawLines(
const QLineF *lines,
int lineCount);
168 virtual void drawEllipse(
const QRectF &
r);
169 virtual void drawEllipse(
const QRect &
r);
171 virtual void drawPath(
const QPainterPath &path);
173 virtual void drawPoints(
const QPointF *
points,
int pointCount);
174 virtual void drawPoints(
const QPoint *
points,
int pointCount);
176 virtual void drawPolygon(
const QPointF *
points,
int pointCount, PolygonDrawMode
mode);
177 virtual void drawPolygon(
const QPoint *
points,
int pointCount, PolygonDrawMode
mode);
179 virtual void drawPixmap(
const QRectF &
r,
const QPixmap &pm,
const QRectF &sr) = 0;
180 virtual void drawTextItem(
const QPointF &
p,
const QTextItem &textItem);
181 virtual void drawTiledPixmap(
const QRectF &
r,
const QPixmap &
pixmap,
const QPointF &
s);
182 virtual void drawImage(
const QRectF &
r,
const QImage &pm,
const QRectF &sr,
185 void setPaintDevice(QPaintDevice *device);
186 QPaintDevice *paintDevice()
const;
188 void setSystemClip(
const QRegion &baseClip);
191 void setSystemRect(
const QRect &rect);
192 QRect systemRect()
const;
195 virtual HDC getDC()
const;
196 virtual void releaseDC(HDC hdc)
const;
199 virtual QPoint coordinateOffset()
const;
221 virtual Type
type()
const = 0;
223 inline void fix_neg_rect(
int *
x,
int *
y,
int *
w,
int *
h);
225 inline bool testDirty(DirtyFlags df);
226 inline void setDirty(DirtyFlags df);
227 inline void clearDirty(DirtyFlags df);
229 bool hasFeature(PaintEngineFeatures feature)
const {
return (gccaps & feature) != 0; }
237 QPaintEngine(QPaintEnginePrivate &
data, PaintEngineFeatures devcaps=0);
243 uint selfDestruct : 1;
249 void setAutoDestruct(
bool autoDestr) { selfDestruct = autoDestr; }
250 bool autoDestruct()
const {
return selfDestruct; }
251 Q_DISABLE_COPY(QPaintEngine)
253 friend class QPainterReplayer;
254 friend class QFontEngineBox;
255 friend class QFontEngineMac;
256 friend class QFontEngineWin;
257 #ifndef QT_NO_FREETYPE
258 friend class QFontEngineFT;
260 #ifndef QT_NO_QWS_QPF
261 friend class QFontEngineQPF1;
263 #ifndef QT_NO_QWS_QPF2
264 friend class QFontEngineQPF;
266 friend class QPSPrintEngine;
267 friend class QMacPrintEngine;
268 friend class QMacPrintEnginePrivate;
270 friend class QtopiaPrintEngine;
271 friend class QtopiaPrintEnginePrivate;
272 friend class QProxyFontEngine;
275 friend class QFontEngineQPA;
278 friend class QPainterPrivate;
280 friend class QWidgetPrivate;
281 friend class QWin32PaintEngine;
282 friend class QWin32PaintEnginePrivate;
283 friend class QMacCGContext;
284 friend class QPreviewPaintEngine;
285 friend class QX11GLPixmapData;
289 class Q_GUI_EXPORT QPaintEngineState
292 QPaintEngine::DirtyFlags
state()
const {
return dirtyFlags; }
296 QPointF brushOrigin()
const;
297 QBrush backgroundBrush()
const;
305 QPainterPath clipPath()
const;
306 bool isClipEnabled()
const;
308 QPainter::RenderHints renderHints()
const;
310 qreal opacity()
const;
314 bool brushNeedsResolving()
const;
315 bool penNeedsResolving()
const;
318 friend class QPaintEngine;
319 friend class QRasterPaintEngine;
322 friend class QPainterPrivate;
323 friend class QMacPrintEnginePrivate;
360 Q_DECLARE_OPERATORS_FOR_FLAGS(QTextItem::RenderFlags)
361 Q_DECLARE_OPERATORS_FOR_FLAGS(QPaintEngine::PaintEngineFeatures)
362 Q_DECLARE_OPERATORS_FOR_FLAGS(QPaintEngine::DirtyFlags)
368 #endif // QPAINTENGINE_H
GLuint GLuint GLsizei GLenum type
GLdouble GLdouble GLdouble r
void setDirty(DirtyFlags df)
QPaintEngineState * state
GLXFBConfig Pixmap pixmap
bool hasFeature(PaintEngineFeatures feature) const
QPaintEngine::DirtyFlags dirtyFlags
void clearDirty(DirtyFlags df)
QScopedPointer< QPaintEnginePrivate > d_ptr
void setActive(bool newState)
#define QT_BEGIN_NAMESPACE
GLsizei GLsizei GLenum GLenum const GLvoid * data
Q_DECLARE_TYPEINFO(QTextItem, Q_PRIMITIVE_TYPE)
GLuint GLenum GLenum transform
bool testDirty(DirtyFlags df)
PaintEngineFeatures gccaps
void fix_neg_rect(int *x, int *y, int *w, int *h)
int int int int int int h
QPaintEngine::DirtyFlags state() const
GLsizei const GLfloat * points
GLubyte GLubyte GLubyte GLubyte w