~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to krita/plugins/tools/selectiontools/kis_tool_select_path.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-21 15:36:35 UTC
  • mfrom: (1.4.1 upstream) (60.2.11 maverick)
  • Revision ID: james.westby@ubuntu.com-20100921153635-6tejqkiro2u21ydi
Tags: 1:2.2.2-0ubuntu3
Add kubuntu_03_fix-crash-on-closing-sqlite-connection-2.2.2.diff and
kubuntu_04_support-large-memo-values-for-msaccess-2.2.2.diff as
recommended by upstream http://kexi-
project.org/wiki/wikiview/index.php@Kexi2.2_Patches.html#sqlite_stab
ility

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#define KIS_TOOL_SELECT_PATH_H_
21
21
 
22
22
#include <KoCreatePathTool.h>
23
 
#include <KoToolFactory.h>
24
 
 
25
 
#include "kis_selection.h"
26
 
#include "flake/kis_node_shape.h"
27
 
#include "kis_tool.h"
28
 
 
29
 
class KisSelectionOptions;
 
23
#include <KoToolFactoryBase.h>
 
24
#include "kis_tool_select_base.h"
 
25
 
30
26
class KoCanvasBase;
 
27
class KoLineBorder;
31
28
 
32
 
class KisToolSelectPath : public KoCreatePathTool
 
29
class KisToolSelectPath : public KisToolSelectBase
33
30
{
34
31
 
35
32
    Q_OBJECT
40
37
 
41
38
    virtual QWidget * createOptionWidget();
42
39
 
43
 
    void addPathShape();
 
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
 
44
46
public slots:
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();
48
49
 
49
 
protected:
 
50
private:
50
51
    /// reimplemented
51
52
    virtual QMap<QString, QWidget *> createOptionWidgets();
52
53
 
53
 
private:
54
 
    KisSelectionOptions * m_optWidget;
55
 
    selectionAction m_selectAction;
56
 
    selectionMode m_selectionMode;
 
54
    class LocalTool : public KoCreatePathTool {
 
55
        friend class KisToolSelectPath;
 
56
    public:
 
57
        LocalTool(KoCanvasBase * canvas, KisToolSelectPath* selectingTool);
 
58
        virtual void paintPath(KoPathShape &path, QPainter &painter, const KoViewConverter &converter);
 
59
        virtual void addPathShape(KoPathShape* pathShape);
 
60
    private:
 
61
        KisToolSelectPath* const m_selectingTool;
 
62
        KoLineBorder* m_borderBackup;
 
63
    };
 
64
    LocalTool* const m_localTool;
57
65
 
58
66
};
59
67
 
60
 
class KisToolSelectPathFactory : public KoToolFactory
 
68
class KisToolSelectPathFactory : public KoToolFactoryBase
61
69
{
62
70
 
63
71
public:
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");
70
78
        setPriority(58);
71
79
    }
72
80
 
73
81
    virtual ~KisToolSelectPathFactory() {}
74
82
 
75
 
    virtual KoTool * createTool(KoCanvasBase *canvas) {
 
83
    virtual KoToolBase * createTool(KoCanvasBase *canvas) {
76
84
        return new KisToolSelectPath(canvas);
77
85
    }
78
86
};