20
20
#define KIS_TOOL_SELECT_PATH_H_
22
22
#include <KoCreatePathTool.h>
23
#include <KoToolFactory.h>
25
#include "kis_selection.h"
26
#include "flake/kis_node_shape.h"
29
class KisSelectionOptions;
23
#include <KoToolFactoryBase.h>
24
#include "kis_tool_select_base.h"
30
26
class KoCanvasBase;
32
class KisToolSelectPath : public KoCreatePathTool
29
class KisToolSelectPath : public KisToolSelectBase
41
38
virtual QWidget * createOptionWidget();
40
virtual void paint(QPainter &painter, const KoViewConverter &converter);
41
void mousePressEvent(KoPointerEvent *event);
42
void mouseDoubleClickEvent(KoPointerEvent *event);
43
void mouseMoveEvent(KoPointerEvent *event);
44
void mouseReleaseEvent(KoPointerEvent *event);
45
virtual void slotSetAction(int);
46
virtual void slotSetSelectionMode(int);
47
virtual void activate(bool);
47
virtual void activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes);
48
virtual void deactivate();
51
52
virtual QMap<QString, QWidget *> createOptionWidgets();
54
KisSelectionOptions * m_optWidget;
55
selectionAction m_selectAction;
56
selectionMode m_selectionMode;
54
class LocalTool : public KoCreatePathTool {
55
friend class KisToolSelectPath;
57
LocalTool(KoCanvasBase * canvas, KisToolSelectPath* selectingTool);
58
virtual void paintPath(KoPathShape &path, QPainter &painter, const KoViewConverter &converter);
59
virtual void addPathShape(KoPathShape* pathShape);
61
KisToolSelectPath* const m_selectingTool;
62
KoLineBorder* m_borderBackup;
64
LocalTool* const m_localTool;
60
class KisToolSelectPathFactory : public KoToolFactory
68
class KisToolSelectPathFactory : public KoToolFactoryBase
64
72
KisToolSelectPathFactory(QObject *parent, const QStringList&)
65
: KoToolFactory(parent, "KisToolSelectPath", i18n("Path Selection")) {
73
: KoToolFactoryBase(parent, "KisToolSelectPath") {
66
74
setToolTip(i18n("Select an area of the image with path."));
67
75
setToolType(TOOL_TYPE_SELECTED);
68
//setActivationShapeId( KIS_NODE_SHAPE_ID );
76
setActivationShapeId(KRITA_TOOL_ACTIVATION_ID);
69
77
setIcon("tool_path_selection");
73
81
virtual ~KisToolSelectPathFactory() {}
75
virtual KoTool * createTool(KoCanvasBase *canvas) {
83
virtual KoToolBase * createTool(KoCanvasBase *canvas) {
76
84
return new KisToolSelectPath(canvas);