chalk

kis_canvas_subject.h
1/*
2 * Copyright (c) 2003 Patrick Julien <freak@codepimps.org>
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_CANVAS_SUBJECT_H_
20#define KIS_CANVAS_SUBJECT_H_
21
22#include "kis_types.h"
23#include "kis_id.h"
24
25class KisDoc;
26class KisBrush;
29class KisGradient;
30class KisPattern;
32class KisToolControllerInterface;
33class KisUndoAdapter;
34class KisProgressDisplayInterface;
36class TQWidget;
37class TQCursor;
38class KisColor;
39class KoPaletteManager;
40class KisProfile;
41class KisPaintOpSettings;
42class KisPerspectiveGridManager;
43
53
54public:
56 virtual ~KisCanvasSubject() {};
57
58public:
59
65 virtual void attach(KisCanvasObserver *observer) = 0;
66
71 virtual void detach(KisCanvasObserver *observer) = 0;
72
77 virtual void notifyObservers() = 0;
78
82 virtual KisImageSP currentImg() const = 0;
83
87 virtual KisColor bgColor() const = 0;
88
94 virtual void setBGColor(const KisColor& c) = 0;
95
99 virtual KisColor fgColor() const = 0;
100
106 virtual void setFGColor(const KisColor& c) = 0;
107
111 virtual float HDRExposure() const = 0;
112
118 virtual void setHDRExposure(float exposure) = 0;
119
123 virtual KisBrush *currentBrush() const = 0;
124
128 virtual KisPattern *currentPattern() const = 0;
129
133 virtual KisGradient *currentGradient() const = 0;
134
138 virtual KisID currentPaintop() const = 0;
139
143 virtual const KisPaintOpSettings *currentPaintopSettings() const = 0;
144
148 virtual double zoomFactor() const = 0;
149
154 virtual KisUndoAdapter *undoAdapter() const = 0;
155
160
162 virtual KisToolControllerInterface *toolController() const = 0;
163
165 virtual KisDoc * document() const = 0;
166
168 virtual KisProgressDisplayInterface *progressDisplay() const = 0;
169
172
174 virtual KoPaletteManager * paletteManager() = 0;
175
180 virtual KisProfile * monitorProfile() = 0;
181
185 virtual KisPerspectiveGridManager* perspectiveGridManager() = 0;
186private:
188 KisCanvasSubject& operator=(const KisCanvasSubject&);
189};
190
191#endif // KIS_CANVAS_SUBJECT_H_
192
Interface for classes that implement a canvas; i.e., a widget where KisImages are painted onto.
This is the base interface plugins use to implement the Observer design pattern.
KisCanvasSubject is part of the Observer pattern.
virtual double zoomFactor() const =0
virtual float HDRExposure() const =0
virtual void setHDRExposure(float exposure)=0
Set the exposure value.
virtual void setFGColor(const KisColor &c)=0
Set the foreground or painting color.
virtual KisUndoAdapter * undoAdapter() const =0
retrieve the undo adapater – there is one undo adapter per document, and it collects all transactions
virtual KisDoc * document() const =0
XXX: Remove this method.
virtual KisPattern * currentPattern() const =0
virtual const KisPaintOpSettings * currentPaintopSettings() const =0
virtual KisToolControllerInterface * toolController() const =0
XXX: Remove this method.
virtual KisGradient * currentGradient() const =0
virtual KisProgressDisplayInterface * progressDisplay() const =0
XXX: Remove this method.
virtual void setBGColor(const KisColor &c)=0
Set the background color.
virtual KisColor fgColor() const =0
virtual KisPerspectiveGridManager * perspectiveGridManager()=0
Get the perspective grid manager.
virtual KoPaletteManager * paletteManager()=0
XXX: Remove this method.
virtual KisCanvasController * canvasController() const =0
virtual void detach(KisCanvasObserver *observer)=0
From now on, the specified observer will no longer be informed of changes.
virtual KisColor bgColor() const =0
virtual KisProfile * monitorProfile()=0
Get the profile that this view uses to display itself on he monitor.
virtual KisImageSP currentImg() const =0
virtual KisBrush * currentBrush() const =0
virtual KisSelectionManager * selectionManager()=0
XXX: Remove this method.
virtual void attach(KisCanvasObserver *observer)=0
From now on, the observer will be notified of changes in brush, foreground color, background color,...
virtual void notifyObservers()=0
Calling this method will notify all observers.
virtual KisID currentPaintop() const =0
A KisColor describes a color in a certain colorspace.
Definition kis_color.h:33
Chalk has a large number of extensible resources.
Definition kis_id.h:57
The paintop factory is responsible for creating paintops of the specified class.
The selection manager is responsible selections and the clipboard.