Krita UI and tool interaction

Boudewijn Rempt boud at valdyas.org
Tue Oct 14 00:11:07 CEST 2003


On Monday 13 October 2003 20:37, Patrick Julien wrote:

> Not even a painter gets passed in?  It would be much nicer if this stuff
> are attributes of the painter, not the actual tools themselves.

No... It's really bare:

class KisToolInterface : public QObject, public KShared {
	Q_OBJECT

public:
	KisToolInterface();
	virtual ~KisToolInterface();

public:
	virtual void paint(QPainter& gc) = 0;
	virtual void paint(QPainter& gc, const QRect& rc) = 0;
	virtual void clear() = 0;
	virtual void clear(const QRect& rc) = 0;

	virtual void setup() = 0;
	virtual void activate() = 0;
	virtual void enter(QEvent *e) = 0;
	virtual void leave(QEvent *e) = 0;
	virtual void mousePress(QMouseEvent *e) = 0;
	virtual void mouseMove(QMouseEvent *e) = 0;
	virtual void mouseRelease(QMouseEvent *e) = 0;
        virtual void tabletEvent(QTabletEvent *e) = 0;
	virtual void keyPress(QKeyEvent *e) = 0;
	virtual void keyRelease(QKeyEvent *e) = 0;

	virtual void setCursor(const QCursor& cursor) = 0;
	virtual void cursor(QWidget *w) const = 0;
	virtual KDialog *options() = 0;
	
	virtual void save(KisToolMementoSP memento) = 0;
	virtual void restore(KisToolMementoSP memento) = 0;

public slots:
	virtual void activateSelf() = 0;

private:
	KisToolInterface(const KisToolInterface&);
	KisToolInterface& operator=(const KisToolInterface&);
};




More information about the kimageshop mailing list