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

« back to all changes in this revision

Viewing changes to krita/plugins/tools/defaulttools/kis_tool_ellipse.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:
25
25
 
26
26
#include "kis_tool_shape.h"
27
27
#include "kis_types.h"
28
 
#include "KoToolFactory.h"
 
28
#include "KoToolFactoryBase.h"
29
29
#include "flake/kis_node_shape.h"
 
30
#include <kis_tool_ellipse_base.h>
30
31
 
31
32
 
32
33
class QPainter;
33
 
class KisPainter;
34
34
 
35
35
class KoCanvasBase;
36
36
 
37
 
class KisToolEllipse : public KisToolShape
 
37
class KisToolEllipse : public KisToolEllipseBase
38
38
{
39
 
 
40
39
    Q_OBJECT
41
40
 
42
41
public:
43
42
    KisToolEllipse(KoCanvasBase * canvas);
44
43
    virtual ~KisToolEllipse();
45
44
 
46
 
    virtual void mousePressEvent(KoPointerEvent *event);
47
 
    virtual void mouseMoveEvent(KoPointerEvent *event);
48
 
    virtual void mouseReleaseEvent(KoPointerEvent *event);
49
 
 
50
 
    virtual void paint(QPainter& gc, const KoViewConverter &converter);
51
 
 
52
 
private:
53
 
    void paintEllipse(QPainter& gc, const QRect& rc);
54
 
 
55
 
 
56
45
protected:
57
 
    QPointF m_dragCenter;
58
 
    QPointF m_dragStart;
59
 
    QPointF m_dragEnd;
60
 
 
61
 
    bool m_dragging;
62
 
    KisPainter *m_painter;
 
46
    virtual void finishEllipse(const QRectF& rect);
63
47
};
64
48
 
65
 
class KisToolEllipseFactory : public KoToolFactory
 
49
class KisToolEllipseFactory : public KoToolFactoryBase
66
50
{
67
51
 
68
52
public:
69
53
    KisToolEllipseFactory(QObject *parent, const QStringList&)
70
 
            : KoToolFactory(parent, "KritaShape/KisToolEllipse", i18n("Ellipse")) {
 
54
            : KoToolFactoryBase(parent, "KritaShape/KisToolEllipse") {
71
55
        setToolTip(i18n("Draw an ellipse"));
72
56
        setToolType(TOOL_TYPE_SHAPE);
73
 
        //setActivationShapeId( KIS_NODE_SHAPE_ID );
 
57
        setActivationShapeId(KRITA_TOOL_ACTIVATION_ID);
74
58
        setIcon("krita_tool_ellipse");
75
59
        setPriority(3);
76
60
        setInputDeviceAgnostic(false);
78
62
 
79
63
    virtual ~KisToolEllipseFactory() {}
80
64
 
81
 
    virtual KoTool * createTool(KoCanvasBase *canvas) {
 
65
    virtual KoToolBase * createTool(KoCanvasBase *canvas) {
82
66
        return  new KisToolEllipse(canvas);
83
67
    }
84
68