karbon

vpainterfactory.cpp
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// painter factory
22
23#include "vpainterfactory.h"
24#include "vkopainter.h"
25#include "vqpainter.h"
26
27VPainterFactory::VPainterFactory()
28{
29 m_painter = 0L;
30 m_editpainter = 0L;
31}
32
33VPainterFactory::~VPainterFactory()
34{
35 delete m_painter;
36 delete m_editpainter;
37}
38
39VPainter *
40VPainterFactory::painter()
41{
42 return m_painter;
43}
44
45void
46VPainterFactory::setPainter( TQPaintDevice *target, int w, int h )
47{
48 if( m_painter )
49 delete m_painter;
50 m_painter = new VKoPainter( target, w, h );
51}
52
53VPainter *
54VPainterFactory::editpainter()
55{
56 return m_editpainter;
57}
58
59void
60VPainterFactory::setEditPainter( TQPaintDevice *target, int w, int h )
61{
62 if( m_editpainter )
63 delete m_editpainter;
64 m_editpainter = new VTQPainter( target, w, h );
65}
66
67void
68VPainterFactory::setWireframePainter( TQPaintDevice *target, int w, int h )
69{
70 if( m_painter )
71 delete m_painter;
72 m_painter = new VTQPainter( target, w, h );
73}
74