00001 /* 00002 * $Id: kernel.h 677 2009-01-26 08:10:25Z misek $ 00003 * 00004 * Description : One line description of file. 00005 * Author : Vaclav Kyba <mail/Jabber: vaseo1@gmail.com> <ICQ: 98576293> 00006 * 00007 * Purpose : 00008 * Long description of what the file is for. 00009 */ 00010 00011 00012 #ifndef __KERNEL__H__ 00013 #define __KERNEL__H__ 00014 #include <wx/app.h> 00015 #include <wx/filename.h> 00016 #include "environment.h" 00017 #include "interpreter.h" 00018 #include "scenemanager.h" 00019 #include "mainwindow.h" 00020 #include "eventhandler.h" 00021 00022 #define KERNEL Kernel::Instance() 00023 00024 namespace VRUT 00025 { 00026 class IOManager; 00027 class RenderManager; 00028 class ManipulatorManager; 00029 class GeneralManager; 00030 00032 class Kernel 00033 { 00034 public: 00035 typedef std::deque<wxString> ModuleNamesList; 00036 00037 protected: 00039 static Kernel * instance; 00041 MainWindow * mainWindow; 00043 EventHandler * eventHandler; 00045 wxThreadIdType mainThreadID; 00047 bool initialized; 00049 bool exiting; 00051 ModuleNamesList preferedModules; 00053 ModuleNamesList forbiddenModules; 00054 00056 Kernel(MainWindow * window); 00058 Kernel(const Kernel &); 00059 00060 public: 00062 Environment environment; 00064 Interpreter interpreter; 00066 IOManager * ioManager; 00068 RenderManager * renderManager; 00070 ManipulatorManager * manipManager; 00072 SceneManager * sceneManager; 00074 GeneralManager * generalManager; 00075 00077 static Kernel * Instantiate(MainWindow * window); 00079 static Kernel * Instance() { return instance; } 00081 void Release(); 00083 ~Kernel(); 00084 00086 bool IsInitialized() const 00087 { 00088 return initialized; 00089 } 00091 bool IsExiting() const 00092 { 00093 return exiting; 00094 } 00096 wxThreadIdType GetMainThreadID() const 00097 { 00098 return mainThreadID; 00099 } 00101 MainWindow * GetMainWindow() const 00102 { 00103 return mainWindow; 00104 } 00106 EventHandler * GetMessageSink() const 00107 { 00108 return eventHandler; 00109 } 00111 Module * GetModule(const MODULE_ID & id) const; 00113 void ReleaseModule(const MODULE_ID & id); 00115 std::vector<wxFileName> GetAvailableModules() const; 00117 bool Initialize(); 00123 bool GetModules(std::vector<std::pair<Module *, MODULE_INSTANCE_ID> > * moduleList, const wxString & moduleName, MODULE_INSTANCE_ID instanceID = MODULE_INSTANCE_ID_NONE); 00126 void PreferModule(const wxString & libName); 00128 const ModuleNamesList * GetPreferedModules() const 00129 { 00130 return &preferedModules; 00131 } 00133 void ForbidModule(const wxString & libName); 00135 bool IsForbidden(const wxString & libName) const; 00136 }; 00137 }; 00138 00139 #endif
1.5.5