File: main.cpp

package info (click to toggle)
korelib 0.0.1-8
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,788 kB
  • ctags: 1,918
  • sloc: sh: 8,555; cpp: 3,989; makefile: 633; ansic: 65
file content (52 lines) | stat: -rw-r--r-- 1,406 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

#include <iostream.h>
#include <kore/kore.h>
#include <kore/version.h>
#include <kore/kernel.h>
#include <kore/servicemanager.h>
#include <kore/modulemanager.h>
#include <kore/pluginloader.h>
#include <kore/plugin.h>

using namespace kore;

/**
 * Main Kore application.
 * It loads and starts the Kernel
 */
int main(int argc, char* argv[]) {
/*  KApplication app(argc,argv,"");

  if (app.isRestored())
    {
      RESTORE( App );
    }
  else 
    {
      App*  = new App( "" );
      ->show();
    }
  return app.exec();
*/
//    Kernel::instance()->init();
    cout << Kernel::instance()->info()->name() << " v" << (*(Kernel::instance()->info()->version())) << endl;
    PluginLoader* loader = dynamic_cast<PluginLoader*> (Kernel::instance()->serviceManager()->registeredProvider("Kore/Kernel/Plugin Loader"));
    Plugin* plugin = loader->openPlugin("koretest");
    if( plugin )
    {
        ModuleManager* mm = dynamic_cast<ModuleManager*> (Kernel::instance()->serviceManager()->registeredProvider("Kore/Kernel/Module Manager"));
        if( mm )
            mm->registerModule(plugin);
        cout << plugin->info()->name() << " v" << (*(plugin->info()->version())) << endl;
        if( mm )
            mm->unregisterModule(plugin);
        loader->closePlugin(plugin);
    }
    else
	cout << "<-- " << loader->lastError() << " -->" << endl;
    delete Kernel::instance();
    return 0;
}