Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_tool_path.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2007 Sven Langkamp <sven.langkamp@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KIS_TOOL_PATH_H_
8#define KIS_TOOL_PATH_H_
9
10#include <KoCreatePathTool.h>
11#include <KoToolFactoryBase.h>
12
14#include "kis_tool_shape.h"
15#include "kis_delegated_tool.h"
16#include <kis_icon.h>
17
18class KoCanvasBase;
19class KisToolPath;
20
21
23public:
25
26 void paintPath(KoPathShape &path, QPainter &painter, const KoViewConverter &converter) override;
27 void addPathShape(KoPathShape* pathShape) override;
28
34
35private:
37};
38
42
44{
45 Q_OBJECT
46
47public:
48 KisToolPath(KoCanvasBase * canvas);
49 void mousePressEvent(KoPointerEvent *event) override;
50
52
53 bool eventFilter(QObject *obj, QEvent *event) override;
54
55 void beginPrimaryAction(KoPointerEvent* event) override;
56 void continuePrimaryAction(KoPointerEvent *event) override;
57 void endPrimaryAction(KoPointerEvent *event) override;
58
59 void beginAlternateAction(KoPointerEvent *event, AlternateAction action) override;
60
61 // reimplementing KisTool's method because that method calls beginPrimaryAction
62 // which now is used to start the path tool.
64
66
67protected:
68 void requestStrokeCancellation() override;
69 void requestStrokeEnd() override;
70
71protected Q_SLOTS:
72 void resetCursorStyle() override;
73
74private:
76};
77
79{
80
81public:
83 : KisToolPaintFactoryBase("KisToolPath") {
84 setToolTip(i18n("Bezier Curve Tool: Shift-mouseclick ends the curve."));
87 setIconName(koIconNameCStr("krita_draw_path"));
88 setPriority(7);
89 }
90
91 ~KisToolPathFactory() override {}
92
94 return new KisToolPath(canvas);
95 }
96};
97
98
99
100#endif // KIS_TOOL_PATH_H_
The PopupWidgetInterface abstract class defines the basic interface that will be used by all popup wi...
KoToolBase * createTool(KoCanvasBase *canvas) override
~KisToolPathFactory() override
void requestStrokeCancellation() override
bool eventFilter(QObject *obj, QEvent *event) override
void resetCursorStyle() override
void beginPrimaryDoubleClickAction(KoPointerEvent *event) override
void mousePressEvent(KoPointerEvent *event) override
KisToolPath(KoCanvasBase *canvas)
void endPrimaryAction(KoPointerEvent *event) override
KisPopupWidgetInterface * popupWidget() override
void requestStrokeEnd() override
void beginPrimaryAction(KoPointerEvent *event) override
void beginAlternateAction(KoPointerEvent *event, AlternateAction action) override
void continuePrimaryAction(KoPointerEvent *event) override
QList< QPointer< QWidget > > createOptionWidgets() override
QList< QPointer< QWidget > > createOptionWidgets() override
reimplemented
The position of a path point within a path shape.
Definition KoPathShape.h:63
KoCanvasBase * canvas() const
Returns the canvas the tool is working on.
void setSection(const QString &section)
void setActivationShapeId(const QString &activationShapeId)
void setIconName(const char *iconName)
void setToolTip(const QString &tooltip)
void setPriority(int newPriority)
void addPathShape(KoPathShape *pathShape) override
KisToolPath *const m_parentTool
__KisToolPathLocalTool(KoCanvasBase *canvas, KisToolPath *parentTool)
void paintPath(KoPathShape &path, QPainter &painter, const KoViewConverter &converter) override
#define koIconNameCStr(name)
Definition kis_icon.h:28
static const QString KRITA_TOOL_ACTIVATION_ID
Definition kis_tool.h:37
KisDelegatedTool< KisToolShape, __KisToolPathLocalTool, DeselectShapesActivationPolicy > DelegatedPathTool
static const QString Shape
Freehand and shapes like ellipses and lines.
KisCanvas2 * canvas