Changeset View
Changeset View
Standalone View
Standalone View
colorproxy_p.h
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
47 | { | 47 | { | ||
48 | public: | 48 | public: | ||
49 | ///@warning Replacement loops (e.g. color1 -> color2 -> color3 -> color1) lead to infinite loops. | 49 | ///@warning Replacement loops (e.g. color1 -> color2 -> color3 -> color1) lead to infinite loops. | ||
50 | ///@warning You should not interact with the @a proxiedDevice during the lifetime of this instance. | 50 | ///@warning You should not interact with the @a proxiedDevice during the lifetime of this instance. | ||
51 | QPaintDeviceColorProxy(QPaintDevice* proxiedDevice, const QHash<QColor, QColor>& replacements); | 51 | QPaintDeviceColorProxy(QPaintDevice* proxiedDevice, const QHash<QColor, QColor>& replacements); | ||
52 | ~QPaintDeviceColorProxy(); | 52 | ~QPaintDeviceColorProxy(); | ||
53 | 53 | | |||
54 | QPaintDevice* proxiedDevice() const; | 54 | QPaintDevice* proxiedDevice() const; | ||
55 | QPaintEngine* paintEngine() const Q_DECL_OVERRIDE; | 55 | QPaintEngine* paintEngine() const override; | ||
56 | 56 | | |||
57 | QBrush map(const QBrush& brush) const; | 57 | QBrush map(const QBrush& brush) const; | ||
58 | inline QColor map(const QColor& color) const; | 58 | inline QColor map(const QColor& color) const; | ||
59 | QPen map(const QPen& pen) const; | 59 | QPen map(const QPen& pen) const; | ||
60 | protected: | 60 | protected: | ||
61 | int metric(PaintDeviceMetric metric) const Q_DECL_OVERRIDE; | 61 | int metric(PaintDeviceMetric metric) const override; | ||
62 | private: | 62 | private: | ||
63 | QPaintDevice* m_proxiedDevice; | 63 | QPaintDevice* m_proxiedDevice; | ||
64 | QPaintEngine* m_engine; | 64 | QPaintEngine* m_engine; | ||
65 | QHash<QColor, QColor> m_replacements; | 65 | QHash<QColor, QColor> m_replacements; | ||
66 | }; | 66 | }; | ||
67 | 67 | | |||
68 | class QPaintEngineColorProxy : public QPaintEngine | 68 | class QPaintEngineColorProxy : public QPaintEngine | ||
69 | { | 69 | { | ||
70 | public: | 70 | public: | ||
71 | QPaintEngineColorProxy(); | 71 | QPaintEngineColorProxy(); | ||
72 | ~QPaintEngineColorProxy(); | 72 | ~QPaintEngineColorProxy(); | ||
73 | 73 | | |||
74 | bool begin(QPaintDevice* device) Q_DECL_OVERRIDE; | 74 | bool begin(QPaintDevice* device) override; | ||
75 | bool end() Q_DECL_OVERRIDE; | 75 | bool end() override; | ||
76 | void drawEllipse(const QRectF& rect) Q_DECL_OVERRIDE; | 76 | void drawEllipse(const QRectF& rect) override; | ||
77 | void drawEllipse(const QRect& rect) Q_DECL_OVERRIDE; | 77 | void drawEllipse(const QRect& rect) override; | ||
78 | void drawImage(const QRectF& rectangle, const QImage& image, const QRectF& sr, Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE; | 78 | void drawImage(const QRectF& rectangle, const QImage& image, const QRectF& sr, Qt::ImageConversionFlags flags = Qt::AutoColor) override; | ||
79 | void drawLines(const QLineF* lines, int lineCount) Q_DECL_OVERRIDE; | 79 | void drawLines(const QLineF* lines, int lineCount) override; | ||
80 | void drawLines(const QLine* lines, int lineCount) Q_DECL_OVERRIDE; | 80 | void drawLines(const QLine* lines, int lineCount) override; | ||
81 | void drawPath(const QPainterPath& path) Q_DECL_OVERRIDE; | 81 | void drawPath(const QPainterPath& path) override; | ||
82 | void drawPixmap(const QRectF& r, const QPixmap& pm, const QRectF& sr) Q_DECL_OVERRIDE; | 82 | void drawPixmap(const QRectF& r, const QPixmap& pm, const QRectF& sr) override; | ||
83 | void drawPoints(const QPointF* points, int pointCount) Q_DECL_OVERRIDE; | 83 | void drawPoints(const QPointF* points, int pointCount) override; | ||
84 | void drawPoints(const QPoint* points, int pointCount) Q_DECL_OVERRIDE; | 84 | void drawPoints(const QPoint* points, int pointCount) override; | ||
85 | void drawPolygon(const QPointF* points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE; | 85 | void drawPolygon(const QPointF* points, int pointCount, PolygonDrawMode mode) override; | ||
86 | void drawPolygon(const QPoint* points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE; | 86 | void drawPolygon(const QPoint* points, int pointCount, PolygonDrawMode mode) override; | ||
87 | void drawRects(const QRectF* rects, int rectCount) Q_DECL_OVERRIDE; | 87 | void drawRects(const QRectF* rects, int rectCount) override; | ||
88 | void drawRects(const QRect* rects, int rectCount) Q_DECL_OVERRIDE; | 88 | void drawRects(const QRect* rects, int rectCount) override; | ||
89 | void drawTextItem(const QPointF& p, const QTextItem& textItem) Q_DECL_OVERRIDE; | 89 | void drawTextItem(const QPointF& p, const QTextItem& textItem) override; | ||
90 | void drawTiledPixmap(const QRectF& rect, const QPixmap& pixmap, const QPointF& p) Q_DECL_OVERRIDE; | 90 | void drawTiledPixmap(const QRectF& rect, const QPixmap& pixmap, const QPointF& p) override; | ||
91 | Type type() const Q_DECL_OVERRIDE; | 91 | Type type() const override; | ||
92 | void updateState(const QPaintEngineState& state) Q_DECL_OVERRIDE; | 92 | void updateState(const QPaintEngineState& state) override; | ||
93 | private: | 93 | private: | ||
94 | QPaintDeviceColorProxy* m_proxy; | 94 | QPaintDeviceColorProxy* m_proxy; | ||
95 | QPainter* m_painter; | 95 | QPainter* m_painter; | ||
96 | }; | 96 | }; | ||
97 | 97 | | |||
98 | #endif // LIBKDEGAMES_COLORPROXY_P_H | 98 | #endif // LIBKDEGAMES_COLORPROXY_P_H |