The TDevelop Generic Shell
This library contains the Shell - a profile-based implementation of TDevelop plugin architecture.
Link with: -lkdevshell
Include path: -I$(kde_includes)/tdevelop/shell
Creating an application using generic shell
TDevelop platform applications can use generic shell as a ready to use implementation of TDevelop plugin architecture.
This is done by creating application main.cpp file and ShellExtension subclass. Example:
- main.cpp for "myapp" application: #include <config.h>#include <tdeaboutdata.h>#include <tdeapplication.h>#include <tdecmdlineargs.h>#include <tdelocale.h>#include <dcopclient.h>#include <splashscreen.h>#include <toplevel.h>#include <plugincontroller.h>#include <partcontroller.h>#include <core.h>#include <projectmanager.h>#include <newmainwindow.h>#include "myappextension.h"static TDECmdLineOptions options[] ={{ "profile <profile>", I18N_NOOP("Profile to load"), 0 },{ 0,0,0 }};int main(int argc, char *argv[]){static const char description[] = I18N_NOOP("My Application");TDEAboutData aboutData("myapp", I18N_NOOP("My Application"),VERSION, description, TDEAboutData::License_GPL,I18N_NOOP("(c) 1999-2004, MyApp developers"),"", "http://www.myapp.org");aboutData.addAuthor("Me", I18N_NOOP("Creator"), "me@myapp.org");TDECmdLineArgs::init(argc, argv, &aboutData);TDECmdLineArgs::addCmdLineOptions( options );TDEApplication app;MyAppExtension::init();QPixmap pm;pm.load(locate("data", "myapp/pics/myapp-splash.png"));SplashScreen * splash = new SplashScreen( pm );splash->show();app.processEvents();TQObject::connect(PluginController::getInstance(), TQ_SIGNAL(loadingPlugin(const TQString &)),splash, TQ_SLOT(showMessage(const TQString &)));splash->message( i18n( "Loading Settings" ) );TopLevel::getInstance()->loadSettings();PluginController::getInstance()->loadInitialPlugins();splash->message( i18n( "Starting GUI" ) );if (mw)mw->enableShow();TopLevel::getInstance()->main()->show();Core::getInstance()->doEmitCoreInitialized();delete splash;kapp->dcopClient()->registerAs("myapp");return app.exec();}static KDevMainWindow * getInstance()Get a pointer to the single KDevTopLevel object.Definition toplevel.cpp:18
- Shell extension for "myapp" application: public:static void init(){s_instance = new MyAppExtension();}virtual TQString xmlFile(){return "myappui.rc";}virtual TQString defaultProfile(){return "MyApp";}protected:KDevAssistantExtension();};virtual TQString xmlFile()=0Reimplement to return the name of KXMLGUI resource file for an application.virtual void createGlobalSettingsPage(KDialogBase *dlg)=0Reimplement to create global settings page in the dialog dlg.virtual TQString defaultProfile()=0Reimplement to set a default profile for the shell.virtual void acceptGlobalSettingsPage(KDialogBase *dlg)=0Reimplement to perform actions when the global settings page in the dialog dlg is accepted (user clic...
Trinity API Reference