|
initapp.h00001 /* 00002 Copyright (C) 1998-2001 by Jorrit Tyberghein 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CSINITAPP_H__ 00020 #define __CSINITAPP_H__ 00021 00022 #include "cstypes.h" 00023 #include "iutil/evdefs.h" 00024 00025 struct iObjectRegistry; 00026 struct iEvent; 00027 struct iEventHandler; 00028 struct iEventQueue; 00029 struct iPluginManager; 00030 struct iVirtualClock; 00031 struct iCommandLineParser; 00032 struct iConfigManager; 00033 00034 // Utility macros to select what plugins you want to have loaded. 00035 #define CS_REQUEST_PLUGIN(Name,Interface) \ 00036 Name, #Interface, iSCF::SCF->GetInterfaceID(#Interface), VERSION_##Interface 00037 #define CS_REQUEST_END \ 00038 NULL 00039 #define CS_REQUEST_VFS \ 00040 CS_REQUEST_PLUGIN("crystalspace.kernel.vfs", iVFS) 00041 #define CS_REQUEST_FONTSERVER \ 00042 CS_REQUEST_PLUGIN("crystalspace.font.server.default", iFontServer) 00043 #define CS_REQUEST_IMAGELOADER \ 00044 CS_REQUEST_PLUGIN("crystalspace.graphic.image.io.multiplex", iImageIO) 00045 #define CS_REQUEST_SOFTWARE3D \ 00046 CS_REQUEST_PLUGIN("crystalspace.graphics3d.software",iGraphics3D) 00047 #define CS_REQUEST_OPENGL3D \ 00048 CS_REQUEST_PLUGIN("crystalspace.graphics3d.opengl", iGraphics3D) 00049 #define CS_REQUEST_ENGINE \ 00050 CS_REQUEST_PLUGIN("crystalspace.engine.3d", iEngine) 00051 #define CS_REQUEST_LEVELLOADER \ 00052 CS_REQUEST_PLUGIN("crystalspace.level.loader", iLoader) 00053 #define CS_REQUEST_REPORTER \ 00054 CS_REQUEST_PLUGIN("crystalspace.utilities.reporter", iReporter) 00055 #define CS_REQUEST_REPORTERLISTENER \ 00056 CS_REQUEST_PLUGIN("crystalspace.utilities.stdrep", iStandardReporterListener) 00057 #define CS_REQUEST_CONSOLEOUT \ 00058 CS_REQUEST_PLUGIN("crystalspace.console.output.simple", iConsoleOutput) 00059 00063 typedef bool (*csEventHandlerFunc) (iEvent&); 00064 00070 class csInitializer 00071 { 00072 public: 00090 static iObjectRegistry* CreateEnvironment(int argc, char const* const argv[]); 00091 00096 static bool InitializeSCF (); 00097 00103 static iObjectRegistry* CreateObjectRegistry (); 00104 00111 static iPluginManager* CreatePluginManager (iObjectRegistry*); 00112 00119 static iEventQueue* CreateEventQueue (iObjectRegistry*); 00120 00127 static iVirtualClock* CreateVirtualClock (iObjectRegistry*); 00128 00134 static iCommandLineParser* CreateCommandLineParser ( 00135 iObjectRegistry*, int argc, char const* const argv[]); 00136 00142 static iConfigManager* CreateConfigManager (iObjectRegistry*); 00143 00150 static bool CreateInputDrivers (iObjectRegistry*); 00151 00160 static bool SetupConfigManager (iObjectRegistry*, const char* configName, 00161 const char *ApplicationID = "Noname"); 00162 00173 static bool RequestPlugins (iObjectRegistry*, ...); 00174 00179 static bool OpenApplication (iObjectRegistry*); 00180 00184 static void CloseApplication (iObjectRegistry*); 00185 00194 static bool SetupEventHandler ( 00195 iObjectRegistry*, iEventHandler*, unsigned int eventmask); 00196 00203 static bool SetupEventHandler ( 00204 iObjectRegistry*, csEventHandlerFunc, unsigned int eventmask = 00205 CSMASK_Nothing | 00206 CSMASK_Broadcast | 00207 CSMASK_MouseUp | 00208 CSMASK_MouseDown | 00209 CSMASK_MouseMove | 00210 CSMASK_KeyDown | 00211 CSMASK_KeyUp | 00212 CSMASK_MouseClick | 00213 CSMASK_MouseDoubleClick | 00214 CSMASK_JoystickMove | 00215 CSMASK_JoystickDown | 00216 CSMASK_JoystickUp); 00217 00223 static void DestroyApplication (iObjectRegistry*); 00224 }; 00225 00226 #endif // __CSINITAPP_H__ Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000 |