karbon

vqpainter.h
1/* This file is part of the KDE project
2 Copyright (C) 2001, The Karbon Developers
3 Copyright (C) 2002, The Karbon Developers
4
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.
9
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.
14
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., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef __VTQPAINTER_H__
22#define __VTQPAINTER_H__
23
24// qpainter wrapper
25
26#include "vpainter.h"
27#include "tqpointarray.h"
28
29class TQPainter;
30
31class VTQPainter : public VPainter
32{
33public:
34 VTQPainter( TQPaintDevice *target, unsigned int w = 0, unsigned int h = 0 );
35 virtual ~VTQPainter();
36
37 //
38 virtual void resize( unsigned int w, unsigned int h );
39 virtual void begin();
40 virtual void end();
41 virtual void blit( const KoRect & );
42 virtual void clear( const TQColor & );
43 virtual void clear( const KoRect &, const TQColor & ) {}
44
45 // matrix manipulation
46 virtual void setWorldMatrix( const TQWMatrix & );
47 virtual const TQWMatrix worldMatrix();
48 virtual void setZoomFactor( double );
49 virtual double zoomFactor() { return m_zoomFactor; }
50
51 // drawing
52 virtual void moveTo( const KoPoint & );
53 virtual void lineTo( const KoPoint & );
54 virtual void curveTo( const KoPoint &, const KoPoint &, const KoPoint & );
55 virtual void newPath();
56 virtual void strokePath();
57 virtual void fillPath();
58 virtual void setFillRule( VFillRule ) {}
59 virtual void setClipPath() {}
60 virtual void resetClipPath() {}
61
62 // pen + brush
63 virtual void setPen( const VStroke & );
64 virtual void setPen( const TQColor & );
65 virtual void setPen( TQt::PenStyle style );
66 virtual void setBrush( const VFill & );
67 virtual void setBrush( const TQColor & );
68 virtual void setBrush( TQt::BrushStyle style );
69
70 virtual void drawImage( const TQImage &, const TQWMatrix & );
71
72 // stack management
73 virtual void save();
74 virtual void restore();
75
76 // helper
77 virtual void drawNode( const KoPoint& , int );
78 virtual void drawRect( const KoRect & );
79
80 //
81 virtual void setRasterOp( TQt::RasterOp );
82
83 virtual TQPaintDevice *device() { return m_target; }
84
85private:
86 double m_zoomFactor;
87 unsigned int m_index;
88 TQPointArray m_pa;
89 TQPainter *m_painter;
90 TQPaintDevice *m_target;
91 unsigned int m_width;
92 unsigned int m_height;
93};
94
95#endif