Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_infinity_manager.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2013 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef __KIS_INFINITY_MANAGER_H
8#define __KIS_INFINITY_MANAGER_H
9
11
12#include <QPointer>
13#include <QPainterPath>
14#include <QCursor>
15
16#include <kis_canvas2.h>
17
18class KisView;
19
20static const QString INFINITY_DECORATION_ID = "infinity-decorations";
21
22class KRITAUI_EXPORT KisInfinityManager : public KisCanvasDecoration
23{
24Q_OBJECT
25
26public:
28
29protected:
30 void drawDecoration(QPainter& gc, const QRectF& updateArea, const KisCoordinatesConverter *converter, KisCanvas2 *canvas) override;
31 bool eventFilter(QObject *obj, QEvent *event) override;
32
33public Q_SLOTS:
34 void imagePositionChanged();
35
36private:
37 enum Side {
38 Right = 0,
42
43 NSides
44 };
45 inline void addDecoration(const QRect &areaRect, const QPointF &handlePoint, qreal angle, Side side);
46
47private:
48 QPainterPath m_decorationPath;
49
52 QCursor m_oldCursor;
54
56
58};
59
60#endif /* __KIS_INFINITY_MANAGER_H */
virtual void drawDecoration(QPainter &gc, const QRectF &updateArea, const KisCoordinatesConverter *converter, KisCanvas2 *canvas)=0
QPointer< KisCanvas2 > m_canvas
QVector< QTransform > m_handleTransform
QVector< QRect > m_sideRects
static const QString INFINITY_DECORATION_ID