diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 47d455dd55be855e4cc691c32f687f723d9247ee (patch) | |
tree | 52e236aaa2576bdb3840ebede26619692fed6d7d /kpovmodeler/pmfactory.cpp | |
download | tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.tar.gz tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpovmodeler/pmfactory.cpp')
-rw-r--r-- | kpovmodeler/pmfactory.cpp | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/kpovmodeler/pmfactory.cpp b/kpovmodeler/pmfactory.cpp new file mode 100644 index 00000000..4a3631ae --- /dev/null +++ b/kpovmodeler/pmfactory.cpp @@ -0,0 +1,102 @@ +/* +************************************************************************** + description + -------------------- + copyright : (C) 2000-2002 by Andreas Zehender + email : zehender@kde.org +************************************************************************** + +************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +**************************************************************************/ + + +#include <klocale.h> +#include <kinstance.h> +#include <kaboutdata.h> + +#include "pmfactory.h" +#include "pmpart.h" +#include "pmdebug.h" +#include "version.h" + +extern "C" +{ + void* init_libkpovmodelerpart( ) + { + return new PMFactory( ); + } +} + +static const char description[] = I18N_NOOP( "Modeler for POV-Ray Scenes" ); + +KInstance* PMFactory::s_instance = 0L; +KAboutData* PMFactory::s_aboutData = 0L; + +PMFactory::PMFactory( ) +{ + kdDebug( ) << "PMFactory::PMFactory( )\n"; +} + +PMFactory::~PMFactory( ) +{ + if( s_instance ) + delete s_instance; + if( s_aboutData ) + delete s_aboutData; + + s_instance = 0L; + s_aboutData = 0L; +} + +KParts::Part* PMFactory::createPartObject( QWidget* parentWidget, + const char* widgetName, + QObject* parent, const char* name, + const char* classname, + const QStringList& /*args*/ ) +{ + kdDebug( ) << "PMFactory: Created new part\n"; + + bool readwrite = !( ( strcmp( classname, "Browser/View" ) == 0 ) + || ( strcmp( classname, "KParts::ReadOnlyPart" ) == 0 ) ); + + KParts::ReadWritePart *part = new PMPart( parentWidget, widgetName, + parent, name, readwrite ); + + return part; +} + +KInstance* PMFactory::instance( ) +{ + if( !s_instance ) + s_instance = new KInstance( aboutData( ) ); + return s_instance; +} + +const KAboutData* PMFactory::aboutData( ) +{ + if( !s_aboutData ) + { + s_aboutData = + new KAboutData( "kpovmodeler", I18N_NOOP( "KPovModeler" ), + KPOVMODELER_VERSION, description, + KAboutData::License_GPL, "(c) 2001-2006, Andreas Zehender" ); + s_aboutData->addAuthor( "Andreas Zehender", 0, + "zehender@kde.org", "http://www.azweb.de" ); + s_aboutData->addAuthor( "Luis Passos Carvalho", I18N_NOOP( "Textures" ), + "lpassos@mail.telepac.pt" ); + s_aboutData->addAuthor( "Leon Pennington", I18N_NOOP( "POV-Ray 3.5 objects" ), + "leon@leonscape.co.uk" ); + s_aboutData->addAuthor( "Philippe Van Hecke", I18N_NOOP( "Some graphical objects" ), + "lephiloux@tiscalinet.be" ); + s_aboutData->addAuthor( "Leonardo Skorianez", I18N_NOOP( "Some graphical objects" ), + "skorianez@bol.com.br" ); + } + return s_aboutData; +} +#include "pmfactory.moc" |