1
/* This file is part of the KDE project
2
Copyright (C) 2001, The Karbon Developers
3
Copyright (C) 2002, The Karbon Developers
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
Boston, MA 02111-1307, USA.
22
#ifndef __VPAINTER_H__
23
#define __VPAINTER_H__
25
// painter abstraction
27
#include <qnamespace.h>
29
#include <vfillrule.h>
47
VPainter( QPaintDevice *, unsigned int /*w*/ = 0, unsigned int /*h*/ = 0 ) {};
48
virtual ~VPainter() {};
51
virtual void resize( unsigned int w, unsigned int h ) = 0;
52
virtual void begin() = 0;
53
virtual void end() = 0;
54
virtual void blit( const KoRect & ) = 0;
55
virtual void clear( const QColor & ) = 0;
56
virtual void clear( const KoRect &, const QColor & ) = 0;
58
// matrix manipulation
59
virtual void setWorldMatrix( const QWMatrix & ) = 0;
60
virtual const QWMatrix worldMatrix() = 0;
61
virtual void setZoomFactor( double ) = 0;
62
virtual double zoomFactor() { return 1.0; }
65
virtual void moveTo( const KoPoint & ) = 0;
66
virtual void lineTo( const KoPoint & ) = 0;
67
virtual void curveTo( const KoPoint &, const KoPoint &, const KoPoint & ) = 0;
68
virtual void newPath() = 0;
69
virtual void strokePath() = 0;
70
virtual void fillPath() = 0;
71
virtual void setFillRule( VFillRule ) = 0;
72
virtual void setClipPath() = 0;
73
virtual void resetClipPath() = 0;
76
virtual void drawNode( const KoPoint& , int ) {}
77
virtual void drawRect( const KoRect & ) {}
78
virtual void drawRect( double, double, double, double ) {}
81
virtual void setPen( const VStroke & ) = 0;
82
// compatibility, use VPen/VBrush later ?
83
virtual void setPen( const QColor & ) = 0;
84
virtual void setPen( Qt::PenStyle style ) = 0;
85
virtual void setBrush( const VFill & ) = 0;
86
virtual void setBrush( const QColor & ) = 0;
87
virtual void setBrush( Qt::BrushStyle style ) = 0;
89
virtual void drawImage( const QImage &, const QWMatrix & ) {}
92
virtual void save() = 0;
93
virtual void restore() = 0;
95
// we have to see how this fits in
96
virtual void setRasterOp( Qt::RasterOp ) = 0;
99
virtual QPaintDevice *device() = 0;