kivio
plugin.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "plugin.h"
00020 #include "tool_select.h"
00021
00022 #include "kivio_view.h"
00023
00024 #include <kinstance.h>
00025 #include <kiconloader.h>
00026
00027
00028
00029
00030 K_EXPORT_COMPONENT_FACTORY( libkivioselecttool, SelectToolFactory )
00031
00032 KInstance* SelectToolFactory::s_global = 0;
00033
00034 SelectToolFactory::SelectToolFactory( QObject* parent, const char* name )
00035 : KLibFactory( parent, name )
00036 {
00037 s_global = new KInstance("kivio");
00038 }
00039
00040 SelectToolFactory::~SelectToolFactory()
00041 {
00042 delete s_global;
00043 }
00044
00045 QObject* SelectToolFactory::createObject( QObject* parent, const char*, const char*, const QStringList& )
00046 {
00047 if ( !parent->inherits("KivioView") )
00048 return 0;
00049
00050 QObject *obj = new SelectTool( (KivioView*)parent );
00051 return obj;
00052 }
00053
00054 KInstance* SelectToolFactory::global()
00055 {
00056 return s_global;
00057 }
00058 #include "plugin.moc"
|