karbon

vpainterfactory.cc

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001, The Karbon Developers
00003    Copyright (C) 2002, The Karbon Developers
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 // painter factory
00022 
00023 #include "vpainterfactory.h"
00024 #include "vkopainter.h"
00025 #include "vqpainter.h"
00026 
00027 VPainterFactory::VPainterFactory()
00028 {
00029     m_painter = 0L;
00030     m_editpainter = 0L;
00031 }
00032 
00033 VPainterFactory::~VPainterFactory()
00034 {
00035     delete m_painter;
00036     delete m_editpainter;
00037 }
00038 
00039 VPainter *
00040 VPainterFactory::painter()
00041 {
00042     return m_painter;
00043 }
00044 
00045 void
00046 VPainterFactory::setPainter( QPaintDevice *target, int w, int h )
00047 {
00048     if( m_painter )
00049         delete m_painter;
00050     m_painter = new VKoPainter( target, w, h );
00051 }
00052 
00053 VPainter *
00054 VPainterFactory::editpainter()
00055 {
00056     return m_editpainter;
00057 }
00058 
00059 void
00060 VPainterFactory::setEditPainter( QPaintDevice *target, int w, int h )
00061 {
00062     if( m_editpainter )
00063         delete m_editpainter;
00064     m_editpainter = new VQPainter( target, w, h );
00065 }
00066 
00067 void
00068 VPainterFactory::setWireframePainter( QPaintDevice *target, int w, int h )
00069 {
00070     if( m_painter )
00071         delete m_painter;
00072     m_painter = new VQPainter( target, w, h );
00073 }
00074 
KDE Home | KDE Accessibility Home | Description of Access Keys