Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_tool_smart_patch.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Eugene Ingerman
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KIS_TOOL_SMART_PATCH_H_
8#define KIS_TOOL_SMART_PATCH_H_
9
10#include <QScopedPointer>
11#include <QPainterPath>
12
13#include "kis_tool_paint.h"
14
16
18#include <kis_icon.h>
19#include <QKeySequence>
20
21#include <kconfig.h>
22#include <kconfiggroup.h>
23#include <KoIcon.h>
24
26class KoCanvasBase;
29
30
32{
33 Q_OBJECT
34public:
36 ~KisToolSmartPatch() override;
37
38 QWidget * createOptionWidget() override;
39
40 void activatePrimaryAction() override;
41 void deactivatePrimaryAction() override;
42
43 void beginPrimaryAction(KoPointerEvent *event) override;
44 void continuePrimaryAction(KoPointerEvent *event) override;
45 void endPrimaryAction(KoPointerEvent *event) override;
46 void paint(QPainter &painter, const KoViewConverter &converter) override;
48
49protected Q_SLOTS:
50 void resetCursorStyle() override;
51
52public Q_SLOTS:
53 void activate(const QSet<KoShape*> &shapes) override;
54 void deactivate() override;
55
56private:
57 //QRect inpaintImage(KisPaintDeviceSP maskDev, KisPaintDeviceSP imageDev);
58 QPainterPath getBrushOutlinePath(const QPointF &documentPos, const KoPointerEvent *event);
59 QPainterPath brushOutline();
60 void requestUpdateOutline(const QPointF &outlineDocPoint, const KoPointerEvent *event) override;
61
62private:
63 struct Private;
64 class InpaintCommand;
65 const QScopedPointer<Private> m_d;
66
67 void addMaskPath(KoPointerEvent *event);
68};
69
70
72{
73
74public:
76 : KisToolPaintFactoryBase("KritaShape/KisToolSmartPatch")
77 {
78
79 setToolTip(i18n("Smart Patch Tool"));
80
82 setIconName(koIconNameCStr("krita_tool_smart_patch"));
83 setPriority(4);
85 }
86
88
90 {
91 return new KisToolSmartPatch(canvas);
92 }
93
94};
95
96
97#endif // KIS_TOOL_SMART_PATCH_H_
A container for a set of QAction objects.
KoToolBase * createTool(KoCanvasBase *canvas) override
void deactivatePrimaryAction() override
QPainterPath getBrushOutlinePath(const QPointF &documentPos, const KoPointerEvent *event)
void beginPrimaryAction(KoPointerEvent *event) override
void paint(QPainter &painter, const KoViewConverter &converter) override
QWidget * createOptionWidget() override
const QScopedPointer< Private > m_d
void activate(const QSet< KoShape * > &shapes) override
void endPrimaryAction(KoPointerEvent *event) override
void continuePrimaryAction(KoPointerEvent *event) override
void addMaskPath(KoPointerEvent *event)
KisToolSmartPatch(KoCanvasBase *canvas)
void resetCursorStyle() override
void requestUpdateOutline(const QPointF &outlineDocPoint, const KoPointerEvent *event) override
int flags() const override
void activatePrimaryAction() override
void setSection(const QString &section)
void setActivationShapeId(const QString &activationShapeId)
void setIconName(const char *iconName)
void setToolTip(const QString &tooltip)
void setPriority(int newPriority)
#define koIconNameCStr(name)
Definition kis_icon.h:28
static const QString KRITA_TOOL_ACTIVATION_ID
Definition kis_tool.h:37
static const QString Fill
Tools that fill parts of the canvas.
@ FLAG_USES_CUSTOM_SIZE
Definition kis_tool.h:47
@ FLAG_USES_CUSTOM_PRESET
Definition kis_tool.h:47
KisCanvas2 * canvas