kivio_screen_painter.h
1/*
2 * Kivio - Visual Modelling and Flowcharting
3 * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program 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
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19#ifndef KIVIO_SCREEN_PAINTER_H
20#define KIVIO_SCREEN_PAINTER_H
21
22#include "kivio_painter.h"
23
24#include <tqfont.h>
25#include <tqpainter.h>
26#include <tqpixmap.h>
27
28class KivioPoint;
29
30
31class KivioScreenPainter : public KivioPainter
32{
33protected:
34 TQPainter *m_pPainter;
35 float m_transX, m_transY;
36 int m_rotation;
37
38public:
39 KivioScreenPainter();
40 KivioScreenPainter(TQPainter* painter);
41 virtual ~KivioScreenPainter();
42
43 virtual bool start( TQPaintDevice * );
44 virtual bool stop();
45
46 TQPainter *painter() { return m_pPainter; }
47 void setPainter(TQPainter* p) { m_pPainter = p; }
48
49 /*\
50 |*|
51 |*| PRIMITIVE IMPLEMENTATIONS
52 |*|
53 |*|
54 \*/
55 void drawLine( float, float, float, float );
56 void drawArc( float, float, float, float, float, float );
57
58 void drawBezier( TQPointArray & );
59
60 void drawRect( float, float, float, float );
61 void fillRect( float, float, float, float );
62
63 void drawRoundRect( float, float, float, float, float, float );
64 void fillRoundRect( float, float, float, float, float, float );
65
66 void drawPie( float, float, float, float, float, float );
67 void fillPie( float, float, float, float, float, float );
68
69 void drawChord( float, float, float, float, float, float );
70 void fillChord( float, float, float, float, float, float );
71
72 void drawEllipse( float, float, float, float );
73 void fillEllipse( float, float, float, float );
74
75 void drawLineArray( TQPtrList<KivioPoint> * );
76
77
78 void drawPolyline( TQPtrList<KivioPoint> * );
79 void drawPolygon( TQPtrList<KivioPoint> * );
80
81 void drawPolyline( TQPointArray & );
82 void drawPolygon( TQPointArray & );
83 void drawLineArray( TQPointArray & );
84
85 void drawClosedPath( TQPtrList<KivioPoint> * );
86 void drawOpenPath( TQPtrList<KivioPoint> * );
87
88 void setFont( const TQFont & );
89 void drawText( int x, int y, int w, int h, int tf,
90 const TQString &str );
91 virtual TQRect boundingRect( int, int, int, int, int, const TQString & );
92
93 void drawPixmap( float, float, const TQPixmap & );
94
95 void drawHandle( float, float, int );
96 virtual void drawSelectionBox( const TQRect& );
97
98 virtual void saveState();
99 virtual void restoreState();
100 virtual void setTranslation(float, float);
101 virtual void translateBy(float, float);
102 virtual void setRotation(int);
103 virtual void rotateBy(int);
104 virtual int rotation();
105
106 virtual void setWorldMatrix(TQWMatrix, bool);
107};
108
109#endif
110
111