1 /****************************************************************************
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** information use the contact form at http://www.qt.io/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 or version 3 as published by the Free
20 ** Software Foundation and appearing in the file LICENSE.LGPLv21 and
21 ** LICENSE.LGPLv3 included in the packaging of this file. Please review the
22 ** following information to ensure the GNU Lesser General Public License
23 ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
24 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 **
26 ** As a special exception, The Qt Company gives you certain additional
27 ** rights. These rights are described in The Qt Company LGPL Exception
28 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 **
30 ** GNU General Public License Usage
31 ** Alternatively, this file may be used under the terms of the GNU
32 ** General Public License version 3.0 as published by the Free Software
33 ** Foundation and appearing in the file LICENSE.GPL included in the
34 ** packaging of this file. Please review the following information to
35 ** ensure the GNU General Public License version 3.0 requirements will be
36 ** met: http://www.gnu.org/copyleft/gpl.html.
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #ifndef QPAINTER_H
43 #define QPAINTER_H
44
45 #include <QtCore/qnamespace.h>
46 #include <QtCore/qrect.h>
47 #include <QtCore/qpoint.h>
48 #include <QtCore/qscopedpointer.h>
49 #include <QtGui/qpixmap.h>
50 #include <QtGui/qimage.h>
51 #include <QtGui/qtextoption.h>
52 #include <QtGui/qdrawutil.h>
53
54 #ifndef QT_INCLUDE_COMPAT
55 #include <QtGui/qpolygon.h>
56 #include <QtGui/qpen.h>
57 #include <QtGui/qbrush.h>
58 #include <QtGui/qmatrix.h>
59 #include <QtGui/qtransform.h>
60 #include <QtGui/qfontinfo.h>
61 #include <QtGui/qfontmetrics.h>
62 #endif
63
64 QT_BEGIN_HEADER
65
66 QT_BEGIN_NAMESPACE
67
68 QT_MODULE(Gui)
69
70 class QBrush;
71 class QFontInfo;
72 class QFontMetrics;
73 class QPaintDevice;
74 class QPainterPath;
75 class QPainterPrivate;
76 class QPen;
77 class QPolygon;
78 class QTextItem;
79 class QMatrix;
80 class QTransform;
81 class QStaticText;
82 class QGlyphRun;
83
84 class QPainterPrivateDeleter;
85
86 class Q_GUI_EXPORT QPainter
87 {
88 Q_DECLARE_PRIVATE(QPainter)
89 Q_GADGET
90 Q_FLAGS(RenderHint RenderHints)
91
92 public:
93 enum RenderHint {
94 Antialiasing = 0x01,
95 TextAntialiasing = 0x02,
96 SmoothPixmapTransform = 0x04,
97 HighQualityAntialiasing = 0x08,
98 NonCosmeticDefaultPen = 0x10
99 };
100
Q_DECLARE_FLAGS(RenderHints,RenderHint)101 Q_DECLARE_FLAGS(RenderHints, RenderHint)
102
103 class PixmapFragment {
104 public:
105 qreal x;
106 qreal y;
107 qreal sourceLeft;
108 qreal sourceTop;
109 qreal width;
110 qreal height;
111 qreal scaleX;
112 qreal scaleY;
113 qreal rotation;
114 qreal opacity;
115 static PixmapFragment Q_GUI_EXPORT create(const QPointF &pos, const QRectF &sourceRect,
116 qreal scaleX = 1, qreal scaleY = 1,
117 qreal rotation = 0, qreal opacity = 1);
118 };
119
120 enum PixmapFragmentHint {
121 OpaqueHint = 0x01
122 };
123
124 Q_DECLARE_FLAGS(PixmapFragmentHints, PixmapFragmentHint)
125
126 QPainter();
127 explicit QPainter(QPaintDevice *);
128 ~QPainter();
129
130 QPaintDevice *device() const;
131
132 bool begin(QPaintDevice *);
133 bool end();
134 bool isActive() const;
135
136 void initFrom(const QWidget *widget);
137
138 enum CompositionMode {
139 CompositionMode_SourceOver,
140 CompositionMode_DestinationOver,
141 CompositionMode_Clear,
142 CompositionMode_Source,
143 CompositionMode_Destination,
144 CompositionMode_SourceIn,
145 CompositionMode_DestinationIn,
146 CompositionMode_SourceOut,
147 CompositionMode_DestinationOut,
148 CompositionMode_SourceAtop,
149 CompositionMode_DestinationAtop,
150 CompositionMode_Xor,
151
152 //svg 1.2 blend modes
153 CompositionMode_Plus,
154 CompositionMode_Multiply,
155 CompositionMode_Screen,
156 CompositionMode_Overlay,
157 CompositionMode_Darken,
158 CompositionMode_Lighten,
159 CompositionMode_ColorDodge,
160 CompositionMode_ColorBurn,
161 CompositionMode_HardLight,
162 CompositionMode_SoftLight,
163 CompositionMode_Difference,
164 CompositionMode_Exclusion,
165
166 // ROPs
167 RasterOp_SourceOrDestination,
168 RasterOp_SourceAndDestination,
169 RasterOp_SourceXorDestination,
170 RasterOp_NotSourceAndNotDestination,
171 RasterOp_NotSourceOrNotDestination,
172 RasterOp_NotSourceXorDestination,
173 RasterOp_NotSource,
174 RasterOp_NotSourceAndDestination,
175 RasterOp_SourceAndNotDestination
176 };
177 void setCompositionMode(CompositionMode mode);
178 CompositionMode compositionMode() const;
179
180 const QFont &font() const;
181 void setFont(const QFont &f);
182
183 QFontMetrics fontMetrics() const;
184 QFontInfo fontInfo() const;
185
186 void setPen(const QColor &color);
187 void setPen(const QPen &pen);
188 void setPen(Qt::PenStyle style);
189 const QPen &pen() const;
190
191 void setBrush(const QBrush &brush);
192 void setBrush(Qt::BrushStyle style);
193 const QBrush &brush() const;
194
195 // attributes/modes
196 void setBackgroundMode(Qt::BGMode mode);
197 Qt::BGMode backgroundMode() const;
198
199 QPoint brushOrigin() const;
200 inline void setBrushOrigin(int x, int y);
201 inline void setBrushOrigin(const QPoint &);
202 void setBrushOrigin(const QPointF &);
203
204 void setBackground(const QBrush &bg);
205 const QBrush &background() const;
206
207 qreal opacity() const;
208 void setOpacity(qreal opacity);
209
210 // Clip functions
211 QRegion clipRegion() const;
212 QPainterPath clipPath() const;
213
214 void setClipRect(const QRectF &, Qt::ClipOperation op = Qt::ReplaceClip);
215 void setClipRect(const QRect &, Qt::ClipOperation op = Qt::ReplaceClip);
216 inline void setClipRect(int x, int y, int w, int h, Qt::ClipOperation op = Qt::ReplaceClip);
217
218 void setClipRegion(const QRegion &, Qt::ClipOperation op = Qt::ReplaceClip);
219
220 void setClipPath(const QPainterPath &path, Qt::ClipOperation op = Qt::ReplaceClip);
221
222 void setClipping(bool enable);
223 bool hasClipping() const;
224
225 QRectF clipBoundingRect() const;
226
227 void save();
228 void restore();
229
230 // XForm functions
231 void setMatrix(const QMatrix &matrix, bool combine = false);
232 const QMatrix &matrix() const;
233 const QMatrix &deviceMatrix() const;
234 void resetMatrix();
235
236 void setTransform(const QTransform &transform, bool combine = false);
237 const QTransform &transform() const;
238 const QTransform &deviceTransform() const;
239 void resetTransform();
240
241 void setWorldMatrix(const QMatrix &matrix, bool combine = false);
242 const QMatrix &worldMatrix() const;
243
244 void setWorldTransform(const QTransform &matrix, bool combine = false);
245 const QTransform &worldTransform() const;
246
247 QMatrix combinedMatrix() const;
248 QTransform combinedTransform() const;
249
250 void setMatrixEnabled(bool enabled);
251 bool matrixEnabled() const;
252
253 void setWorldMatrixEnabled(bool enabled);
254 bool worldMatrixEnabled() const;
255
256 void scale(qreal sx, qreal sy);
257 void shear(qreal sh, qreal sv);
258 void rotate(qreal a);
259
260 void translate(const QPointF &offset);
261 inline void translate(const QPoint &offset);
262 inline void translate(qreal dx, qreal dy);
263
264 QRect window() const;
265 void setWindow(const QRect &window);
266 inline void setWindow(int x, int y, int w, int h);
267
268 QRect viewport() const;
269 void setViewport(const QRect &viewport);
270 inline void setViewport(int x, int y, int w, int h);
271
272 void setViewTransformEnabled(bool enable);
273 bool viewTransformEnabled() const;
274
275 // drawing functions
276 void strokePath(const QPainterPath &path, const QPen &pen);
277 void fillPath(const QPainterPath &path, const QBrush &brush);
278 void drawPath(const QPainterPath &path);
279
280 inline void drawPoint(const QPointF &pt);
281 inline void drawPoint(const QPoint &p);
282 inline void drawPoint(int x, int y);
283
284 void drawPoints(const QPointF *points, int pointCount);
285 inline void drawPoints(const QPolygonF &points);
286 void drawPoints(const QPoint *points, int pointCount);
287 inline void drawPoints(const QPolygon &points);
288
289 inline void drawLine(const QLineF &line);
290 inline void drawLine(const QLine &line);
291 inline void drawLine(int x1, int y1, int x2, int y2);
292 inline void drawLine(const QPoint &p1, const QPoint &p2);
293 inline void drawLine(const QPointF &p1, const QPointF &p2);
294
295 void drawLines(const QLineF *lines, int lineCount);
296 inline void drawLines(const QVector<QLineF> &lines);
297 void drawLines(const QPointF *pointPairs, int lineCount);
298 inline void drawLines(const QVector<QPointF> &pointPairs);
299 void drawLines(const QLine *lines, int lineCount);
300 inline void drawLines(const QVector<QLine> &lines);
301 void drawLines(const QPoint *pointPairs, int lineCount);
302 inline void drawLines(const QVector<QPoint> &pointPairs);
303
304 inline void drawRect(const QRectF &rect);
305 inline void drawRect(int x1, int y1, int w, int h);
306 inline void drawRect(const QRect &rect);
307
308 void drawRects(const QRectF *rects, int rectCount);
309 inline void drawRects(const QVector<QRectF> &rectangles);
310 void drawRects(const QRect *rects, int rectCount);
311 inline void drawRects(const QVector<QRect> &rectangles);
312
313 void drawEllipse(const QRectF &r);
314 void drawEllipse(const QRect &r);
315 inline void drawEllipse(int x, int y, int w, int h);
316
317 inline void drawEllipse(const QPointF ¢er, qreal rx, qreal ry);
318 inline void drawEllipse(const QPoint ¢er, int rx, int ry);
319
320 void drawPolyline(const QPointF *points, int pointCount);
321 inline void drawPolyline(const QPolygonF &polyline);
322 void drawPolyline(const QPoint *points, int pointCount);
323 inline void drawPolyline(const QPolygon &polygon);
324
325 void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule = Qt::OddEvenFill);
326 inline void drawPolygon(const QPolygonF &polygon, Qt::FillRule fillRule = Qt::OddEvenFill);
327 void drawPolygon(const QPoint *points, int pointCount, Qt::FillRule fillRule = Qt::OddEvenFill);
328 inline void drawPolygon(const QPolygon &polygon, Qt::FillRule fillRule = Qt::OddEvenFill);
329
330 void drawConvexPolygon(const QPointF *points, int pointCount);
331 inline void drawConvexPolygon(const QPolygonF &polygon);
332 void drawConvexPolygon(const QPoint *points, int pointCount);
333 inline void drawConvexPolygon(const QPolygon &polygon);
334
335 void drawArc(const QRectF &rect, int a, int alen);
336 inline void drawArc(const QRect &, int a, int alen);
337 inline void drawArc(int x, int y, int w, int h, int a, int alen);
338
339 void drawPie(const QRectF &rect, int a, int alen);
340 inline void drawPie(int x, int y, int w, int h, int a, int alen);
341 inline void drawPie(const QRect &, int a, int alen);
342
343 void drawChord(const QRectF &rect, int a, int alen);
344 inline void drawChord(int x, int y, int w, int h, int a, int alen);
345 inline void drawChord(const QRect &, int a, int alen);
346
347 void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius,
348 Qt::SizeMode mode = Qt::AbsoluteSize);
349 inline void drawRoundedRect(int x, int y, int w, int h, qreal xRadius, qreal yRadius,
350 Qt::SizeMode mode = Qt::AbsoluteSize);
351 inline void drawRoundedRect(const QRect &rect, qreal xRadius, qreal yRadius,
352 Qt::SizeMode mode = Qt::AbsoluteSize);
353
354 void drawRoundRect(const QRectF &r, int xround = 25, int yround = 25);
355 inline void drawRoundRect(int x, int y, int w, int h, int = 25, int = 25);
356 inline void drawRoundRect(const QRect &r, int xround = 25, int yround = 25);
357
358 void drawTiledPixmap(const QRectF &rect, const QPixmap &pm, const QPointF &offset = QPointF());
359 inline void drawTiledPixmap(int x, int y, int w, int h, const QPixmap &, int sx=0, int sy=0);
360 inline void drawTiledPixmap(const QRect &, const QPixmap &, const QPoint & = QPoint());
361 #ifndef QT_NO_PICTURE
362 void drawPicture(const QPointF &p, const QPicture &picture);
363 inline void drawPicture(int x, int y, const QPicture &picture);
364 inline void drawPicture(const QPoint &p, const QPicture &picture);
365 #endif
366
367 void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect, const QByteArray * data=0);
368 inline void drawPixmap(const QRect &targetRect, const QPixmap &pixmap, const QRect &sourceRect);
369 inline void drawPixmap(int x, int y, int w, int h, const QPixmap &pm,
370 int sx, int sy, int sw, int sh);
371 inline void drawPixmap(int x, int y, const QPixmap &pm,
372 int sx, int sy, int sw, int sh);
373 inline void drawPixmap(const QPointF &p, const QPixmap &pm, const QRectF &sr);
374 inline void drawPixmap(const QPoint &p, const QPixmap &pm, const QRect &sr);
375 void drawPixmap(const QPointF &p, const QPixmap &pm);
376 inline void drawPixmap(const QPoint &p, const QPixmap &pm);
377 inline void drawPixmap(int x, int y, const QPixmap &pm);
378 inline void drawPixmap(const QRect &r, const QPixmap &pm);
379 inline void drawPixmap(int x, int y, int w, int h, const QPixmap &pm);
380
381 void drawPixmapFragments(const PixmapFragment *fragments, int fragmentCount,
382 const QPixmap &pixmap, PixmapFragmentHints hints = 0);
383 void drawPixmapFragments(const QRectF *targetRects, const QRectF *sourceRects, int fragmentCount,
384 const QPixmap &pixmap, PixmapFragmentHints hints = 0);
385
386 void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect,
387 Qt::ImageConversionFlags flags = Qt::AutoColor);
388 inline void drawImage(const QRect &targetRect, const QImage &image, const QRect &sourceRect,
389 Qt::ImageConversionFlags flags = Qt::AutoColor);
390 inline void drawImage(const QPointF &p, const QImage &image, const QRectF &sr,
391 Qt::ImageConversionFlags flags = Qt::AutoColor);
392 inline void drawImage(const QPoint &p, const QImage &image, const QRect &sr,
393 Qt::ImageConversionFlags flags = Qt::AutoColor);
394 inline void drawImage(const QRectF &r, const QImage &image);
395 inline void drawImage(const QRect &r, const QImage &image);
396 void drawImage(const QPointF &p, const QImage &image);
397 inline void drawImage(const QPoint &p, const QImage &image);
398 inline void drawImage(int x, int y, const QImage &image, int sx = 0, int sy = 0,
399 int sw = -1, int sh = -1, Qt::ImageConversionFlags flags = Qt::AutoColor);
400
401 void setLayoutDirection(Qt::LayoutDirection direction);
402 Qt::LayoutDirection layoutDirection() const;
403
404 #if !defined(QT_NO_RAWFONT)
405 void drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun);
406 #endif
407
408 void drawStaticText(const QPointF &topLeftPosition, const QStaticText &staticText);
409 inline void drawStaticText(const QPoint &topLeftPosition, const QStaticText &staticText);
410 inline void drawStaticText(int left, int top, const QStaticText &staticText);
411
412 void drawText(const QPointF &p, const QString &s);
413 inline void drawText(const QPoint &p, const QString &s);
414 inline void drawText(int x, int y, const QString &s);
415
416 void drawText(const QPointF &p, const QString &str, int tf, int justificationPadding);
417
418 void drawText(const QRectF &r, int flags, const QString &text, QRectF *br=0);
419 void drawText(const QRect &r, int flags, const QString &text, QRect *br=0);
420 inline void drawText(int x, int y, int w, int h, int flags, const QString &text, QRect *br=0);
421
422 void drawText(const QRectF &r, const QString &text, const QTextOption &o = QTextOption());
423
424 QRectF boundingRect(const QRectF &rect, int flags, const QString &text);
425 QRect boundingRect(const QRect &rect, int flags, const QString &text);
426 inline QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text);
427
428 QRectF boundingRect(const QRectF &rect, const QString &text, const QTextOption &o = QTextOption());
429
430 void drawTextItem(const QPointF &p, const QTextItem &ti);
431 inline void drawTextItem(int x, int y, const QTextItem &ti);
432 inline void drawTextItem(const QPoint &p, const QTextItem &ti);
433
434 void fillRect(const QRectF &, const QBrush &);
435 inline void fillRect(int x, int y, int w, int h, const QBrush &);
436 void fillRect(const QRect &, const QBrush &);
437
438 void fillRect(const QRectF &, const QColor &color);
439 inline void fillRect(int x, int y, int w, int h, const QColor &color);
440 void fillRect(const QRect &, const QColor &color);
441
442 inline void fillRect(int x, int y, int w, int h, Qt::GlobalColor c);
443 inline void fillRect(const QRect &r, Qt::GlobalColor c);
444 inline void fillRect(const QRectF &r, Qt::GlobalColor c);
445
446 inline void fillRect(int x, int y, int w, int h, Qt::BrushStyle style);
447 inline void fillRect(const QRect &r, Qt::BrushStyle style);
448 inline void fillRect(const QRectF &r, Qt::BrushStyle style);
449
450 inline void addAnchor(int x, int y, int w, int h, const QString &name);
451 inline void addAnchor(const QRect &r, const QString &name);
452 void addAnchor(const QRectF &r, const QString &name);
453
454 inline void addLink(int x, int y, int w, int h, const QString &anchor);
455 inline void addLink(const QRect &r, const QString &anchor);
456 void addLink(const QRectF &r, const QString &anchor);
457
458 void addTextField(const QRectF &r, const QString &text="", const QString &name="", bool multiLine=false, bool password=false, bool readOnly=false, int maxLength=-1);
459 void addCheckBox(const QRectF &r, bool checked=false, const QString &name="", bool readOnly=false);
460 void addRadioButton(const QRectF &r, const QString & group="", bool checked=false, const QString &name="", bool readOnly=false);;
461
462 inline void addHyperlink(int x, int y, int w, int h, const QUrl &url);
463 inline void addHyperlink(const QRect &r, const QUrl &url);
464 void addHyperlink(const QRectF &r, const QUrl &url);
465
466 void eraseRect(const QRectF &);
467 inline void eraseRect(int x, int y, int w, int h);
468 inline void eraseRect(const QRect &);
469
470 void setRenderHint(RenderHint hint, bool on = true);
471 void setRenderHints(RenderHints hints, bool on = true);
472 RenderHints renderHints() const;
testRenderHint(RenderHint hint)473 inline bool testRenderHint(RenderHint hint) const { return renderHints() & hint; }
474
475 QPaintEngine *paintEngine() const;
476
477 static void setRedirected(const QPaintDevice *device, QPaintDevice *replacement,
478 const QPoint& offset = QPoint());
479 static QPaintDevice *redirected(const QPaintDevice *device, QPoint *offset = 0);
480 static void restoreRedirected(const QPaintDevice *device);
481
482 void beginNativePainting();
483 void endNativePainting();
484
485 #ifdef QT3_SUPPORT
486
setBackgroundColor(const QColor & color)487 inline QT3_SUPPORT void setBackgroundColor(const QColor &color) { setBackground(color); }
backgroundColor()488 inline QT3_SUPPORT const QColor &backgroundColor() const { return background().color(); }
489
drawText(int x,int y,const QString & s,int pos,int len)490 inline QT3_SUPPORT void drawText(int x, int y, const QString &s, int pos, int len)
491 { drawText(x, y, s.mid(pos, len)); }
drawText(const QPoint & p,const QString & s,int pos,int len)492 inline QT3_SUPPORT void drawText(const QPoint &p, const QString &s, int pos, int len)
493 { drawText(p, s.mid(pos, len)); }
drawText(int x,int y,const QString & s,int len)494 inline QT3_SUPPORT void drawText(int x, int y, const QString &s, int len)
495 { drawText(x, y, s.left(len)); }
drawText(const QPoint & p,const QString & s,int len)496 inline QT3_SUPPORT void drawText(const QPoint &p, const QString &s, int len)
497 { drawText(p, s.left(len)); }
498 inline QT3_SUPPORT void drawText(const QRect &r, int flags, const QString &str, int len, QRect *br=0)
499 { drawText(r, flags, str.left(len), br); }
500 inline QT3_SUPPORT void drawText(int x, int y, int w, int h, int flags, const QString &text, int len, QRect *br=0)
501 { drawText(QRect(x, y, w, h), flags, text.left(len), br); }
boundingRect(const QRect & rect,int flags,const QString & text,int len)502 inline QT3_SUPPORT QRect boundingRect(const QRect &rect, int flags, const QString &text, int len)
503 { return boundingRect(rect, flags, text.left(len)); }
boundingRect(int x,int y,int w,int h,int flags,const QString & text,int len)504 inline QT3_SUPPORT QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text, int len)
505 { return boundingRect(QRect(x, y, w, h), flags, text.left(len)); }
506
begin(QPaintDevice * pdev,const QWidget * init)507 inline QT3_SUPPORT bool begin(QPaintDevice *pdev, const QWidget *init)
508 { bool ret = begin(pdev); initFrom(init); return ret; }
509 QT3_SUPPORT void drawPoints(const QPolygon &pa, int index, int npoints = -1)
510 { drawPoints(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints); }
511
512 QT3_SUPPORT void drawCubicBezier(const QPolygon &pa, int index = 0);
513
514 QT3_SUPPORT void drawLineSegments(const QPolygon &points, int index = 0, int nlines = -1);
515
516 inline QT3_SUPPORT void drawPolyline(const QPolygon &pa, int index, int npoints = -1)
517 { drawPolyline(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints); }
518
519 inline QT3_SUPPORT void drawPolygon(const QPolygon &pa, bool winding, int index = 0, int npoints = -1)
520 { drawPolygon(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints,
521 winding ? Qt::WindingFill : Qt::OddEvenFill); }
522
523 inline QT3_SUPPORT void drawPolygon(const QPolygonF &polygon, bool winding, int index = 0,
524 int npoints = -1)
525 { drawPolygon(polygon.constData() + index, npoints == -1 ? polygon.size() - index : npoints,
526 winding ? Qt::WindingFill : Qt::OddEvenFill); }
527
528 inline QT3_SUPPORT void drawConvexPolygon(const QPolygonF &polygon, int index, int npoints = -1)
529 { drawConvexPolygon(polygon.constData() + index, npoints == -1 ? polygon.size() - index : npoints); }
530 inline QT3_SUPPORT void drawConvexPolygon(const QPolygon &pa, int index, int npoints = -1)
531 { drawConvexPolygon(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints); }
532
redirect(QPaintDevice * pdev,QPaintDevice * replacement)533 static inline QT3_SUPPORT void redirect(QPaintDevice *pdev, QPaintDevice *replacement)
534 { setRedirected(pdev, replacement); }
redirect(QPaintDevice * pdev)535 static inline QT3_SUPPORT QPaintDevice *redirect(QPaintDevice *pdev)
536 { return const_cast<QPaintDevice*>(redirected(pdev)); }
537
setWorldXForm(bool enabled)538 inline QT3_SUPPORT void setWorldXForm(bool enabled) { setMatrixEnabled(enabled); }
hasWorldXForm()539 inline QT3_SUPPORT bool hasWorldXForm() const { return matrixEnabled(); }
resetXForm()540 inline QT3_SUPPORT void resetXForm() { resetTransform(); }
541
setViewXForm(bool enabled)542 inline QT3_SUPPORT void setViewXForm(bool enabled) { setViewTransformEnabled(enabled); }
hasViewXForm()543 inline QT3_SUPPORT bool hasViewXForm() const { return viewTransformEnabled(); }
544
545 QT3_SUPPORT void map(int x, int y, int *rx, int *ry) const;
546 QT3_SUPPORT QPoint xForm(const QPoint &) const; // map virtual -> deviceb
547 QT3_SUPPORT QRect xForm(const QRect &) const;
548 QT3_SUPPORT QPolygon xForm(const QPolygon &) const;
549 QT3_SUPPORT QPolygon xForm(const QPolygon &, int index, int npoints) const;
550 QT3_SUPPORT QPoint xFormDev(const QPoint &) const; // map device -> virtual
551 QT3_SUPPORT QRect xFormDev(const QRect &) const;
552 QT3_SUPPORT QPolygon xFormDev(const QPolygon &) const;
553 QT3_SUPPORT QPolygon xFormDev(const QPolygon &, int index, int npoints) const;
554 QT3_SUPPORT qreal translationX() const;
555 QT3_SUPPORT qreal translationY() const;
556 #endif
557
558 private:
559 Q_DISABLE_COPY(QPainter)
560 friend class Q3Painter;
561
562 QScopedPointer<QPainterPrivate> d_ptr;
563
564 friend class QFontEngine;
565 friend class QFontEngineBox;
566 friend class QFontEngineFT;
567 friend class QFontEngineMac;
568 friend class QFontEngineWin;
569 friend class QFontEngineXLFD;
570 friend class QWSManager;
571 friend class QPaintEngine;
572 friend class QPaintEngineExPrivate;
573 friend class QOpenGLPaintEngine;
574 friend class QVGPaintEngine;
575 friend class QX11PaintEngine;
576 friend class QX11PaintEnginePrivate;
577 friend class QWin32PaintEngine;
578 friend class QWin32PaintEnginePrivate;
579 friend class QRasterPaintEngine;
580 friend class QAlphaPaintEngine;
581 friend class QPreviewPaintEngine;
582 };
583
Q_DECLARE_OPERATORS_FOR_FLAGS(QPainter::RenderHints)584 Q_DECLARE_OPERATORS_FOR_FLAGS(QPainter::RenderHints)
585
586 //
587 // functions
588 //
589 inline void QPainter::drawLine(const QLineF &l)
590 {
591 drawLines(&l, 1);
592 }
593
drawLine(const QLine & line)594 inline void QPainter::drawLine(const QLine &line)
595 {
596 drawLines(&line, 1);
597 }
598
drawLine(int x1,int y1,int x2,int y2)599 inline void QPainter::drawLine(int x1, int y1, int x2, int y2)
600 {
601 QLine l(x1, y1, x2, y2);
602 drawLines(&l, 1);
603 }
604
drawLine(const QPoint & p1,const QPoint & p2)605 inline void QPainter::drawLine(const QPoint &p1, const QPoint &p2)
606 {
607 QLine l(p1, p2);
608 drawLines(&l, 1);
609 }
610
drawLine(const QPointF & p1,const QPointF & p2)611 inline void QPainter::drawLine(const QPointF &p1, const QPointF &p2)
612 {
613 drawLine(QLineF(p1, p2));
614 }
615
drawLines(const QVector<QLineF> & lines)616 inline void QPainter::drawLines(const QVector<QLineF> &lines)
617 {
618 drawLines(lines.constData(), lines.size());
619 }
620
drawLines(const QVector<QLine> & lines)621 inline void QPainter::drawLines(const QVector<QLine> &lines)
622 {
623 drawLines(lines.constData(), lines.size());
624 }
625
drawLines(const QVector<QPointF> & pointPairs)626 inline void QPainter::drawLines(const QVector<QPointF> &pointPairs)
627 {
628 drawLines(pointPairs.constData(), pointPairs.size() / 2);
629 }
630
drawLines(const QVector<QPoint> & pointPairs)631 inline void QPainter::drawLines(const QVector<QPoint> &pointPairs)
632 {
633 drawLines(pointPairs.constData(), pointPairs.size() / 2);
634 }
635
drawPolyline(const QPolygonF & polyline)636 inline void QPainter::drawPolyline(const QPolygonF &polyline)
637 {
638 drawPolyline(polyline.constData(), polyline.size());
639 }
640
drawPolyline(const QPolygon & polyline)641 inline void QPainter::drawPolyline(const QPolygon &polyline)
642 {
643 drawPolyline(polyline.constData(), polyline.size());
644 }
645
drawPolygon(const QPolygonF & polygon,Qt::FillRule fillRule)646 inline void QPainter::drawPolygon(const QPolygonF &polygon, Qt::FillRule fillRule)
647 {
648 drawPolygon(polygon.constData(), polygon.size(), fillRule);
649 }
650
drawPolygon(const QPolygon & polygon,Qt::FillRule fillRule)651 inline void QPainter::drawPolygon(const QPolygon &polygon, Qt::FillRule fillRule)
652 {
653 drawPolygon(polygon.constData(), polygon.size(), fillRule);
654 }
655
drawConvexPolygon(const QPolygonF & poly)656 inline void QPainter::drawConvexPolygon(const QPolygonF &poly)
657 {
658 drawConvexPolygon(poly.constData(), poly.size());
659 }
660
drawConvexPolygon(const QPolygon & poly)661 inline void QPainter::drawConvexPolygon(const QPolygon &poly)
662 {
663 drawConvexPolygon(poly.constData(), poly.size());
664 }
665
drawRect(const QRectF & rect)666 inline void QPainter::drawRect(const QRectF &rect)
667 {
668 drawRects(&rect, 1);
669 }
670
drawRect(int x,int y,int w,int h)671 inline void QPainter::drawRect(int x, int y, int w, int h)
672 {
673 QRect r(x, y, w, h);
674 drawRects(&r, 1);
675 }
676
drawRect(const QRect & r)677 inline void QPainter::drawRect(const QRect &r)
678 {
679 drawRects(&r, 1);
680 }
681
drawRects(const QVector<QRectF> & rects)682 inline void QPainter::drawRects(const QVector<QRectF> &rects)
683 {
684 drawRects(rects.constData(), rects.size());
685 }
686
drawRects(const QVector<QRect> & rects)687 inline void QPainter::drawRects(const QVector<QRect> &rects)
688 {
689 drawRects(rects.constData(), rects.size());
690 }
691
drawPoint(const QPointF & p)692 inline void QPainter::drawPoint(const QPointF &p)
693 {
694 drawPoints(&p, 1);
695 }
696
drawPoint(int x,int y)697 inline void QPainter::drawPoint(int x, int y)
698 {
699 QPoint p(x, y);
700 drawPoints(&p, 1);
701 }
702
drawPoint(const QPoint & p)703 inline void QPainter::drawPoint(const QPoint &p)
704 {
705 drawPoints(&p, 1);
706 }
707
drawPoints(const QPolygonF & points)708 inline void QPainter::drawPoints(const QPolygonF &points)
709 {
710 drawPoints(points.constData(), points.size());
711 }
712
drawPoints(const QPolygon & points)713 inline void QPainter::drawPoints(const QPolygon &points)
714 {
715 drawPoints(points.constData(), points.size());
716 }
717
drawRoundRect(int x,int y,int w,int h,int xRnd,int yRnd)718 inline void QPainter::drawRoundRect(int x, int y, int w, int h, int xRnd, int yRnd)
719 {
720 drawRoundRect(QRectF(x, y, w, h), xRnd, yRnd);
721 }
722
drawRoundRect(const QRect & rect,int xRnd,int yRnd)723 inline void QPainter::drawRoundRect(const QRect &rect, int xRnd, int yRnd)
724 {
725 drawRoundRect(QRectF(rect), xRnd, yRnd);
726 }
727
drawRoundedRect(int x,int y,int w,int h,qreal xRadius,qreal yRadius,Qt::SizeMode mode)728 inline void QPainter::drawRoundedRect(int x, int y, int w, int h, qreal xRadius, qreal yRadius,
729 Qt::SizeMode mode)
730 {
731 drawRoundedRect(QRectF(x, y, w, h), xRadius, yRadius, mode);
732 }
733
drawRoundedRect(const QRect & rect,qreal xRadius,qreal yRadius,Qt::SizeMode mode)734 inline void QPainter::drawRoundedRect(const QRect &rect, qreal xRadius, qreal yRadius,
735 Qt::SizeMode mode)
736 {
737 drawRoundedRect(QRectF(rect), xRadius, yRadius, mode);
738 }
739
drawEllipse(int x,int y,int w,int h)740 inline void QPainter::drawEllipse(int x, int y, int w, int h)
741 {
742 drawEllipse(QRect(x, y, w, h));
743 }
744
drawEllipse(const QPointF & center,qreal rx,qreal ry)745 inline void QPainter::drawEllipse(const QPointF ¢er, qreal rx, qreal ry)
746 {
747 drawEllipse(QRectF(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
748 }
749
drawEllipse(const QPoint & center,int rx,int ry)750 inline void QPainter::drawEllipse(const QPoint ¢er, int rx, int ry)
751 {
752 drawEllipse(QRect(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
753 }
754
drawArc(const QRect & r,int a,int alen)755 inline void QPainter::drawArc(const QRect &r, int a, int alen)
756 {
757 drawArc(QRectF(r), a, alen);
758 }
759
drawArc(int x,int y,int w,int h,int a,int alen)760 inline void QPainter::drawArc(int x, int y, int w, int h, int a, int alen)
761 {
762 drawArc(QRectF(x, y, w, h), a, alen);
763 }
764
drawPie(const QRect & rect,int a,int alen)765 inline void QPainter::drawPie(const QRect &rect, int a, int alen)
766 {
767 drawPie(QRectF(rect), a, alen);
768 }
769
drawPie(int x,int y,int w,int h,int a,int alen)770 inline void QPainter::drawPie(int x, int y, int w, int h, int a, int alen)
771 {
772 drawPie(QRectF(x, y, w, h), a, alen);
773 }
774
drawChord(const QRect & rect,int a,int alen)775 inline void QPainter::drawChord(const QRect &rect, int a, int alen)
776 {
777 drawChord(QRectF(rect), a, alen);
778 }
779
drawChord(int x,int y,int w,int h,int a,int alen)780 inline void QPainter::drawChord(int x, int y, int w, int h, int a, int alen)
781 {
782 drawChord(QRectF(x, y, w, h), a, alen);
783 }
784
setClipRect(int x,int y,int w,int h,Qt::ClipOperation op)785 inline void QPainter::setClipRect(int x, int y, int w, int h, Qt::ClipOperation op)
786 {
787 setClipRect(QRect(x, y, w, h), op);
788 }
789
eraseRect(const QRect & rect)790 inline void QPainter::eraseRect(const QRect &rect)
791 {
792 eraseRect(QRectF(rect));
793 }
794
eraseRect(int x,int y,int w,int h)795 inline void QPainter::eraseRect(int x, int y, int w, int h)
796 {
797 eraseRect(QRectF(x, y, w, h));
798 }
799
fillRect(int x,int y,int w,int h,const QBrush & b)800 inline void QPainter::fillRect(int x, int y, int w, int h, const QBrush &b)
801 {
802 fillRect(QRect(x, y, w, h), b);
803 }
804
fillRect(int x,int y,int w,int h,const QColor & b)805 inline void QPainter::fillRect(int x, int y, int w, int h, const QColor &b)
806 {
807 fillRect(QRect(x, y, w, h), b);
808 }
809
fillRect(int x,int y,int w,int h,Qt::GlobalColor c)810 inline void QPainter::fillRect(int x, int y, int w, int h, Qt::GlobalColor c)
811 {
812 fillRect(QRect(x, y, w, h), QColor(c));
813 }
814
fillRect(const QRect & r,Qt::GlobalColor c)815 inline void QPainter::fillRect(const QRect &r, Qt::GlobalColor c)
816 {
817 fillRect(r, QColor(c));
818 }
819
fillRect(const QRectF & r,Qt::GlobalColor c)820 inline void QPainter::fillRect(const QRectF &r, Qt::GlobalColor c)
821 {
822 fillRect(r, QColor(c));
823 }
824
fillRect(int x,int y,int w,int h,Qt::BrushStyle style)825 inline void QPainter::fillRect(int x, int y, int w, int h, Qt::BrushStyle style)
826 {
827 fillRect(QRectF(x, y, w, h), QBrush(style));
828 }
829
fillRect(const QRect & r,Qt::BrushStyle style)830 inline void QPainter::fillRect(const QRect &r, Qt::BrushStyle style)
831 {
832 fillRect(QRectF(r), QBrush(style));
833 }
834
fillRect(const QRectF & r,Qt::BrushStyle style)835 inline void QPainter::fillRect(const QRectF &r, Qt::BrushStyle style)
836 {
837 fillRect(r, QBrush(style));
838 }
839
addAnchor(int x,int y,int w,int h,const QString & name)840 inline void QPainter::addAnchor(int x, int y, int w, int h, const QString &name)
841 {
842 addAnchor(QRectF(x, y, w, h), name);
843 }
844
addAnchor(const QRect & r,const QString & name)845 inline void QPainter::addAnchor(const QRect &r, const QString &name)
846 {
847 addAnchor(QRectF(r), name);
848 }
849
addLink(int x,int y,int w,int h,const QString & anchor)850 inline void QPainter::addLink(int x, int y, int w, int h, const QString &anchor)
851 {
852 addLink(QRectF(x, y, w, h), anchor);
853 }
854
addLink(const QRect & r,const QString & anchor)855 inline void QPainter::addLink(const QRect &r, const QString &anchor)
856 {
857 addLink(QRectF(r), anchor);
858 }
859
addHyperlink(int x,int y,int w,int h,const QUrl & url)860 inline void QPainter::addHyperlink(int x, int y, int w, int h, const QUrl &url)
861 {
862 addHyperlink(QRectF(x, y, w, h), url);
863 }
864
addHyperlink(const QRect & r,const QUrl & url)865 inline void QPainter::addHyperlink(const QRect &r, const QUrl &url)
866 {
867 addHyperlink(QRectF(r), url);
868 }
869
setBrushOrigin(int x,int y)870 inline void QPainter::setBrushOrigin(int x, int y)
871 {
872 setBrushOrigin(QPoint(x, y));
873 }
874
setBrushOrigin(const QPoint & p)875 inline void QPainter::setBrushOrigin(const QPoint &p)
876 {
877 setBrushOrigin(QPointF(p));
878 }
879
drawTiledPixmap(const QRect & rect,const QPixmap & pm,const QPoint & offset)880 inline void QPainter::drawTiledPixmap(const QRect &rect, const QPixmap &pm, const QPoint &offset)
881 {
882 drawTiledPixmap(QRectF(rect), pm, QPointF(offset));
883 }
884
drawTiledPixmap(int x,int y,int w,int h,const QPixmap & pm,int sx,int sy)885 inline void QPainter::drawTiledPixmap(int x, int y, int w, int h, const QPixmap &pm, int sx, int sy)
886 {
887 drawTiledPixmap(QRectF(x, y, w, h), pm, QPointF(sx, sy));
888 }
889
drawPixmap(const QRect & targetRect,const QPixmap & pixmap,const QRect & sourceRect)890 inline void QPainter::drawPixmap(const QRect &targetRect, const QPixmap &pixmap, const QRect &sourceRect)
891 {
892 drawPixmap(QRectF(targetRect), pixmap, QRectF(sourceRect));
893 }
894
drawPixmap(const QPoint & p,const QPixmap & pm)895 inline void QPainter::drawPixmap(const QPoint &p, const QPixmap &pm)
896 {
897 drawPixmap(QPointF(p), pm);
898 }
899
drawPixmap(const QRect & r,const QPixmap & pm)900 inline void QPainter::drawPixmap(const QRect &r, const QPixmap &pm)
901 {
902 drawPixmap(QRectF(r), pm, QRectF());
903 }
904
drawPixmap(int x,int y,const QPixmap & pm)905 inline void QPainter::drawPixmap(int x, int y, const QPixmap &pm)
906 {
907 drawPixmap(QPointF(x, y), pm);
908 }
909
drawPixmap(int x,int y,int w,int h,const QPixmap & pm)910 inline void QPainter::drawPixmap(int x, int y, int w, int h, const QPixmap &pm)
911 {
912 drawPixmap(QRectF(x, y, w, h), pm, QRectF());
913 }
914
drawPixmap(int x,int y,int w,int h,const QPixmap & pm,int sx,int sy,int sw,int sh)915 inline void QPainter::drawPixmap(int x, int y, int w, int h, const QPixmap &pm,
916 int sx, int sy, int sw, int sh)
917 {
918 drawPixmap(QRectF(x, y, w, h), pm, QRectF(sx, sy, sw, sh));
919 }
920
drawPixmap(int x,int y,const QPixmap & pm,int sx,int sy,int sw,int sh)921 inline void QPainter::drawPixmap(int x, int y, const QPixmap &pm,
922 int sx, int sy, int sw, int sh)
923 {
924 drawPixmap(QRectF(x, y, -1, -1), pm, QRectF(sx, sy, sw, sh));
925 }
926
drawPixmap(const QPointF & p,const QPixmap & pm,const QRectF & sr)927 inline void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm, const QRectF &sr)
928 {
929 drawPixmap(QRectF(p.x(), p.y(), -1, -1), pm, sr);
930 }
931
drawPixmap(const QPoint & p,const QPixmap & pm,const QRect & sr)932 inline void QPainter::drawPixmap(const QPoint &p, const QPixmap &pm, const QRect &sr)
933 {
934 drawPixmap(QRectF(p.x(), p.y(), -1, -1), pm, sr);
935 }
936
drawTextItem(int x,int y,const QTextItem & ti)937 inline void QPainter::drawTextItem(int x, int y, const QTextItem &ti)
938 {
939 drawTextItem(QPointF(x, y), ti);
940 }
941
drawImage(const QRect & targetRect,const QImage & image,const QRect & sourceRect,Qt::ImageConversionFlags flags)942 inline void QPainter::drawImage(const QRect &targetRect, const QImage &image, const QRect &sourceRect,
943 Qt::ImageConversionFlags flags)
944 {
945 drawImage(QRectF(targetRect), image, QRectF(sourceRect), flags);
946 }
947
drawImage(const QPointF & p,const QImage & image,const QRectF & sr,Qt::ImageConversionFlags flags)948 inline void QPainter::drawImage(const QPointF &p, const QImage &image, const QRectF &sr,
949 Qt::ImageConversionFlags flags)
950 {
951 drawImage(QRectF(p.x(), p.y(), -1, -1), image, sr, flags);
952 }
953
drawImage(const QPoint & p,const QImage & image,const QRect & sr,Qt::ImageConversionFlags flags)954 inline void QPainter::drawImage(const QPoint &p, const QImage &image, const QRect &sr,
955 Qt::ImageConversionFlags flags)
956 {
957 drawImage(QRect(p.x(), p.y(), -1, -1), image, sr, flags);
958 }
959
960
drawImage(const QRectF & r,const QImage & image)961 inline void QPainter::drawImage(const QRectF &r, const QImage &image)
962 {
963 drawImage(r, image, QRect(0, 0, image.width(), image.height()));
964 }
965
drawImage(const QRect & r,const QImage & image)966 inline void QPainter::drawImage(const QRect &r, const QImage &image)
967 {
968 drawImage(r, image, QRectF(0, 0, image.width(), image.height()));
969 }
970
drawImage(const QPoint & p,const QImage & image)971 inline void QPainter::drawImage(const QPoint &p, const QImage &image)
972 {
973 drawImage(QPointF(p), image);
974 }
975
drawImage(int x,int y,const QImage & image,int sx,int sy,int sw,int sh,Qt::ImageConversionFlags flags)976 inline void QPainter::drawImage(int x, int y, const QImage &image, int sx, int sy, int sw, int sh,
977 Qt::ImageConversionFlags flags)
978 {
979 if (sx == 0 && sy == 0 && sw == -1 && sh == -1 && flags == Qt::AutoColor)
980 drawImage(QPointF(x, y), image);
981 else
982 drawImage(QRectF(x, y, -1, -1), image, QRectF(sx, sy, sw, sh), flags);
983 }
984
drawStaticText(const QPoint & p,const QStaticText & staticText)985 inline void QPainter::drawStaticText(const QPoint &p, const QStaticText &staticText)
986 {
987 drawStaticText(QPointF(p), staticText);
988 }
989
drawStaticText(int x,int y,const QStaticText & staticText)990 inline void QPainter::drawStaticText(int x, int y, const QStaticText &staticText)
991 {
992 drawStaticText(QPointF(x, y), staticText);
993 }
994
drawTextItem(const QPoint & p,const QTextItem & ti)995 inline void QPainter::drawTextItem(const QPoint &p, const QTextItem &ti)
996 {
997 drawTextItem(QPointF(p), ti);
998 }
999
drawText(const QPoint & p,const QString & s)1000 inline void QPainter::drawText(const QPoint &p, const QString &s)
1001 {
1002 drawText(QPointF(p), s);
1003 }
1004
drawText(int x,int y,int w,int h,int flags,const QString & str,QRect * br)1005 inline void QPainter::drawText(int x, int y, int w, int h, int flags, const QString &str, QRect *br)
1006 {
1007 drawText(QRect(x, y, w, h), flags, str, br);
1008 }
1009
drawText(int x,int y,const QString & s)1010 inline void QPainter::drawText(int x, int y, const QString &s)
1011 {
1012 drawText(QPointF(x, y), s);
1013 }
1014
boundingRect(int x,int y,int w,int h,int flags,const QString & text)1015 inline QRect QPainter::boundingRect(int x, int y, int w, int h, int flags, const QString &text)
1016 {
1017 return boundingRect(QRect(x, y, w, h), flags, text);
1018 }
1019
translate(qreal dx,qreal dy)1020 inline void QPainter::translate(qreal dx, qreal dy)
1021 {
1022 translate(QPointF(dx, dy));
1023 }
1024
translate(const QPoint & offset)1025 inline void QPainter::translate(const QPoint &offset)
1026 {
1027 translate(offset.x(), offset.y());
1028 }
1029
setViewport(int x,int y,int w,int h)1030 inline void QPainter::setViewport(int x, int y, int w, int h)
1031 {
1032 setViewport(QRect(x, y, w, h));
1033 }
1034
setWindow(int x,int y,int w,int h)1035 inline void QPainter::setWindow(int x, int y, int w, int h)
1036 {
1037 setWindow(QRect(x, y, w, h));
1038 }
1039
1040 #ifndef QT_NO_PICTURE
drawPicture(int x,int y,const QPicture & p)1041 inline void QPainter::drawPicture(int x, int y, const QPicture &p)
1042 {
1043 drawPicture(QPoint(x, y), p);
1044 }
1045
drawPicture(const QPoint & pt,const QPicture & p)1046 inline void QPainter::drawPicture(const QPoint &pt, const QPicture &p)
1047 {
1048 drawPicture(QPointF(pt), p);
1049 }
1050 #endif
1051
1052 QT_END_NAMESPACE
1053
1054 QT_END_HEADER
1055
1056 #endif // QPAINTER_H
1057