chalk

kis_canvas_controller.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_CONTROLLER_H_
20#define KIS_CANVAS_CONTROLLER_H_
21
22#include <tqglobal.h>
23#include <tqpoint.h>
24#include <tqrect.h>
25#include "kis_types.h"
26
27class TQWidget;
28class KisTool;
29class KisRect;
30class KisPoint;
31class KisCanvas;
32class KisInputDevice;
33
40public:
42 virtual ~KisCanvasController() {};
43
44public:
45
49 virtual KisCanvas *kiscanvas() const = 0;
50
51
55 virtual TQ_INT32 horzValue() const = 0;
56
60 virtual TQ_INT32 vertValue() const = 0;
61
68 virtual void scrollTo(TQ_INT32 x, TQ_INT32 y) = 0;
69
73 virtual void updateCanvas() = 0;
74
75
80 virtual void updateCanvas(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) = 0;
81
86 virtual void updateCanvas(const TQRect& rc) = 0;
87
91 virtual void zoomIn() = 0;
92
99 virtual void zoomIn(TQ_INT32 x, TQ_INT32 y) = 0;
100
104 virtual void zoomOut() = 0;
105
106
113 virtual void zoomOut(TQ_INT32 x, TQ_INT32 y) = 0;
114
122 virtual void zoomAroundPoint(double x, double y, double zf) = 0;
123
129 virtual void zoomTo(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) = 0;
130
136 virtual void zoomTo(const TQRect& r) = 0;
137
143 virtual void zoomTo(const KisRect& r) = 0;
144
155 virtual TQPoint viewToWindow(const TQPoint& pt) = 0;
156 virtual KisPoint viewToWindow(const KisPoint& pt) = 0;
157 virtual TQRect viewToWindow(const TQRect& rc) = 0;
158 virtual KisRect viewToWindow(const KisRect& rc) = 0;
159 virtual void viewToWindow(TQ_INT32 *x, TQ_INT32 *y) = 0;
160
164 virtual TQPoint windowToView(const TQPoint& pt) = 0;
165 virtual KisPoint windowToView(const KisPoint& pt) = 0;
166 virtual TQRect windowToView(const TQRect& rc) = 0;
167 virtual KisRect windowToView(const KisRect& rc) = 0;
168 virtual void windowToView(TQ_INT32 *x, TQ_INT32 *y) = 0;
169
177 virtual TQCursor setCanvasCursor(const TQCursor & cursor) = 0;
178
186 virtual void setInputDevice(KisInputDevice inputDevice) = 0;
187
191 virtual KisInputDevice currentInputDevice() const = 0;
192
193
194private:
196 KisCanvasController& operator=(const KisCanvasController&);
197};
198
199#endif // KIS_CANVAS_CONTROLLER_H_
200
Interface for classes that implement a canvas; i.e., a widget where KisImages are painted onto.
virtual TQPoint viewToWindow(const TQPoint &pt)=0
Conversion functions from view coordinates to image coordinates.
virtual TQ_INT32 vertValue() const =0
virtual void zoomTo(const KisRect &r)=0
Make the rect defined by x, y, w and h visible, zooming in or out as necessary.
virtual TQPoint windowToView(const TQPoint &pt)=0
Conversion functions from image coordinates to view coordinates.
virtual void zoomOut(TQ_INT32 x, TQ_INT32 y)=0
Decrease the zoomlevel one step and make sure that x,y is the center point of the view.
virtual TQCursor setCanvasCursor(const TQCursor &cursor)=0
Set the cursor shown when the pointer is over the canvas widget to the specified cursor.
virtual void zoomOut()=0
Decrease the zoomlevel one step.
virtual KisInputDevice currentInputDevice() const =0
virtual void zoomIn()=0
Increase the zoomlevel one step.
virtual void updateCanvas()=0
Tell all of the canvas to repaint itself.
virtual void setInputDevice(KisInputDevice inputDevice)=0
Set the active input device to the specified input device, This could be a mouse, a stylus,...
virtual void updateCanvas(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)=0
Tell the canvas to repaint the rectangle defined by x, y, w and h.
virtual void zoomAroundPoint(double x, double y, double zf)=0
To centre the view on the given point with the given zoom factor.
virtual void zoomTo(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)=0
Make the rect defined by x, y, w and h visible, zooming in or out as necessary.
virtual void zoomTo(const TQRect &r)=0
Make the rect defined by x, y, w and h visible, zooming in or out as necessary.
virtual void scrollTo(TQ_INT32 x, TQ_INT32 y)=0
Sets the horizontal and vertical scrollbars to the specified values.
virtual void zoomIn(TQ_INT32 x, TQ_INT32 y)=0
Increase the zoomlevel one step and make sure that x,y is the center point of the view.
virtual void updateCanvas(const TQRect &rc)=0
Tell the canvas repaint the specified rectangle.
virtual TQ_INT32 horzValue() const =0
virtual KisCanvas * kiscanvas() const =0
A double-based point class that can return it's coordinates approximated to integers.
Definition kis_point.h:28
A double-based rect class that can return a TQRect that encloses the KisRect.
Definition kis_rect.h:29