2
* kis_tool_select_freehand.h - part of Krayon^WKrita
4
* Copyright (c) 2000 John Califf <jcaliff@compuzone.net>
5
* Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
6
* Copyright (c) 2004 Boudewijn Rempt <boud@valdyas.org>
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
#ifndef __selecttoolfreehand_h__
24
#define __selecttoolfreehand_h__
27
#include <qpointarray.h>
29
#include "kis_point.h"
30
#include "kis_tool_non_paint.h"
31
#include "kis_tool_factory.h"
32
#include "kis_selection.h"
34
class KisSelectionOptions;
36
class KisToolSelectOutline : public KisToolNonPaint {
38
typedef KisToolNonPaint super;
41
KisToolSelectOutline();
42
virtual ~KisToolSelectOutline();
44
virtual void update (KisCanvasSubject *subject);
46
virtual void setup(KActionCollection *collection);
47
virtual Q_UINT32 priority() { return 6; }
48
virtual enumToolType toolType() { return TOOL_SELECT; }
50
virtual void buttonPress(KisButtonPressEvent *event);
51
virtual void move(KisMoveEvent *event);
52
virtual void buttonRelease(KisButtonReleaseEvent *event);
54
QWidget* createOptionWidget(QWidget* parent);
55
virtual QWidget* optionWidget();
58
virtual void slotSetAction(int);
59
virtual void activate();
63
virtual void paint(KisCanvasPainter& gc);
64
virtual void paint(KisCanvasPainter& gc, const QRect& rc);
65
void draw(KisCanvasPainter& gc);
75
typedef QValueVector<KisPoint> KisPointVector;
76
KisCanvasSubject *m_subject;
77
KisPointVector m_points;
78
KisSelectionOptions * m_optWidget;
79
enumSelectionMode m_selectAction;
83
class KisToolSelectOutlineFactory : public KisToolFactory {
84
typedef KisToolFactory super;
86
KisToolSelectOutlineFactory() : super() {};
87
virtual ~KisToolSelectOutlineFactory(){};
89
virtual KisTool * createTool(KActionCollection * ac) {
90
KisTool * t = new KisToolSelectOutline();
95
virtual KisID id() { return KisID("selectoutline", i18n("Select Outline tool")); }
99
#endif //__selecttoolfreehand_h__