chalk

kis_tool_dummy.h
1/*
2 * Copyright (c) 2004 Adrian Page <adrian@pagenet.plus.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef KIS_TOOL_DUMMY_H_
20#define KIS_TOOL_DUMMY_H_
21
22#include "kis_tool_non_paint.h"
23#include "kis_tool_factory.h"
24#include <koffice_export.h>
25
26#include "kis_point.h"
27
28class TQLabel;
30
39class KRITATOOL_EXPORT KisToolDummy : public KisToolNonPaint {
40
41 typedef KisToolNonPaint super;
42 TQ_OBJECT
43
44
45public:
47 virtual ~KisToolDummy();
48
49 virtual void update(KisCanvasSubject *subject);
50
51 virtual void setup(TDEActionCollection *collection);
52 virtual void buttonPress(KisButtonPressEvent *e);
53 virtual void move(KisMoveEvent *e);
54 virtual void buttonRelease(KisButtonReleaseEvent *e);
55
56 virtual TQWidget* createOptionWidget(TQWidget* parent);
57 virtual TQWidget* optionWidget();
58
59private:
60 TQLabel * m_optionWidget;
61 KisCanvasSubject *m_subject;
62 KisPoint m_dragPos;
63 TQ_INT32 m_origScrollX;
64 TQ_INT32 m_origScrollY;
65 bool m_dragging;
66};
67
68class KisToolDummyFactory : public KisToolFactory {
69 typedef KisToolFactory super;
70public:
71 KisToolDummyFactory() : super() {};
72 virtual ~KisToolDummyFactory() {};
73
74 virtual KisTool * createTool(TDEActionCollection * ac) {
75 KisTool * t = new KisToolDummy();
76 TQ_CHECK_PTR(t);
77 t->setup(ac);
78 return t;
79 }
80 virtual KisID id() { return KisID("dummy", i18n("Dummy Tool")); }
81};
82
83
84#endif // KIS_TOOL_DUMMY_H_
85
KisCanvasSubject is part of the Observer pattern.
Chalk has a large number of extensible resources.
Definition kis_id.h:57
A double-based point class that can return it's coordinates approximated to integers.
Definition kis_point.h:28
The dummy tool is activated when a layer does not permit painting or any other destructive action.