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

« back to all changes in this revision

Viewing changes to krita/tools/kis_tool_fill.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-04-20 21:38:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060420213853-j5lxluqvymxt2zny
Tags: 1:1.5.0-0ubuntu2
UbuntuĀ uploadĀ 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  kis_tool_fill.h - part of Krayon^Krita
3
 
 *
4
 
 *  Copyright (c) 2004 Bart Coppens <kde@bartcoppens.be>
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; either version 2 of the License, or
9
 
 *  (at your option) any later version.
10
 
 *
11
 
 *  This program is distributed in the hope that it will be useful,
12
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 *  GNU General Public License for more details.
15
 
 *
16
 
 *  You should have received a copy of the GNU General Public License
17
 
 *  along with this program; if not, write to the Free Software
18
 
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
 
 */
20
 
 
21
 
#ifndef __filltool_h__
22
 
#define __filltool_h__
23
 
 
24
 
#include <qpoint.h>
25
 
 
26
 
#include "kis_tool.h"
27
 
#include "kis_tool_paint.h"
28
 
 
29
 
class KisPainter;
30
 
class QWidget;
31
 
class QLabel;
32
 
class QCheckBox;
33
 
class KIntNumInput;
34
 
class KActionCollection;
35
 
 
36
 
class KisToolFill : public KisToolPaint {
37
 
 
38
 
        typedef KisToolPaint super;
39
 
        Q_OBJECT
40
 
 
41
 
public:
42
 
 
43
 
        KisToolFill();
44
 
        virtual ~KisToolFill();
45
 
  
46
 
        virtual void setup(KActionCollection *collection);
47
 
        virtual void update(KisCanvasSubject *subject);
48
 
 
49
 
        virtual void buttonPress(KisButtonPressEvent*); 
50
 
 
51
 
        bool flood(int startX, int startY);
52
 
      
53
 
        virtual QWidget* createOptionWidget(QWidget* parent);
54
 
 
55
 
public slots:
56
 
        virtual void slotSetThreshold(int);
57
 
        virtual void slotSetUsePattern(int);
58
 
 
59
 
private:
60
 
        int m_threshold;
61
 
        Q_INT32 m_depth;
62
 
        KisLayerSP m_lay;
63
 
        QUANTUM* m_oldColor, *m_color;
64
 
        KisPainter *m_painter;
65
 
        KisCanvasSubject *m_subject;
66
 
        KisImageSP m_currentImage;
67
 
        bool *m_map, m_samplemerged, m_usePattern, m_useSelection;
68
 
        KisSelectionSP m_selection;
69
 
 
70
 
        QLabel *m_lbThreshold;
71
 
        KIntNumInput *m_slThreshold;
72
 
        QCheckBox *m_checkUsePattern;
73
 
};
74
 
 
75
 
 
76
 
#include "kis_tool_factory.h"
77
 
 
78
 
class KisToolFillFactory : public KisToolFactory {
79
 
        typedef KisToolFactory super;
80
 
public:
81
 
        KisToolFillFactory(KActionCollection * ac) : super(ac) {};
82
 
        virtual ~KisToolFillFactory(){};
83
 
        
84
 
        virtual KisTool * createTool() { 
85
 
                KisToolFill * t = new KisToolFill(); 
86
 
                Q_CHECK_PTR(t);
87
 
                t -> setup(m_ac); 
88
 
                return t; 
89
 
        }
90
 
        virtual KisID id() { return KisID("fill", i18n("Fill tool")); }
91
 
 
92
 
};
93
 
 
94
 
 
95
 
 
96
 
 
97
 
#endif //__filltool_h__
98