kivio_painter.cpp
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#include "kivio_fill_style.h"
20#include "kivio_line_style.h"
21#include "kivio_painter.h"
22#include "kivio_point.h"
23
24KivioPainter::KivioPainter()
25 : m_pFillStyle(NULL)
26{
27 m_pFillStyle = new KivioFillStyle();
28 m_pLineStyle = new KivioLineStyle();
29}
30
31KivioPainter::~KivioPainter()
32{
33 if( m_pFillStyle )
34 {
35 delete m_pFillStyle;
36 m_pFillStyle = NULL;
37 }
38
39 if( m_pLineStyle )
40 {
41 delete m_pLineStyle;
42 m_pLineStyle = NULL;
43 }
44}
45
46
47void KivioPainter::setFGColor( const TQColor &c )
48{
49 m_pLineStyle->setColor(c);
50}
51
52TQColor KivioPainter::fgColor() const
53{
54 return m_pLineStyle->color();
55}
56
57float KivioPainter::lineWidth() const
58{
59 return m_pLineStyle->width();
60}
61
62void KivioPainter::setLineWidth( const float &f )
63{
64 m_pLineStyle->setWidth(f);
65}
66
67void KivioPainter::setLineStyle( KivioLineStyle *pStyle )
68{
69 pStyle->copyInto( m_pLineStyle );
70}
71
72void KivioPainter::setFillStyle( KivioFillStyle * s )
73{
74 s->copyInto( m_pFillStyle );
75}