Planeshift

pscssetup.h

Go to the documentation of this file.
00001 /*
00002  * cssetup.h - Authored by Elliot Paquette
00003  *
00004  * Copyright (C) 2003 Atomic Blue ([email protected], http://www.atomicblue.org)
00005  *
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation (version 2 of the License)
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017  *
00018  */
00019 // cssetup.h: registers classes from an xml file
00020 //
00022 
00023 #ifndef CSSETUP_HEADER
00024 #define CSSETUP_HEADER
00025 
00026 #include <cstool/initapp.h>
00027 
00028 struct iConfigManager;
00029 struct iConfigFile;
00030 struct iVFS;
00031 struct iObjectRegistry;
00032 
00037 #ifndef PS_VERSION
00038 #define PS_VERSION "0.6.5"
00039 #endif
00040 
00041 #ifndef APPNAME
00042 #define APPNAME "PlaneShift Azure Spirit (" PS_VERSION ")"
00043 #endif
00044 
00045 #ifdef CS_COMPILER_GCC
00046 #define PS_PAUSEEXIT(x) exit(x)
00047 #endif
00048 
00049 
00052 class psCSSetup
00053 {
00054 public:
00055     psCSSetup(int, char**, const char*, const char*);
00056     ~psCSSetup();
00057 
00058     //Initialize CS
00059     iObjectRegistry* InitCS(iReporterListener* customReporter=0);
00060 
00061     iObjectRegistry* GetObjectRegistry()
00062     {
00063         return object_reg;
00064     }
00065 
00066     static iObjectRegistry* object_reg;
00067 
00072     bool AddWindowInformations(const char* Info);
00073 
00079     bool SetIcon(const char* ImageFileLocation);
00080 
00086     bool SetIcon(iImage* Image);
00087 
00088 protected:
00089     //Unused part of initcs.inc, but included - better to than not to
00090     bool InitCSWindow(const char*);
00091 
00092     char* PS_GetFileName(char*);
00093 
00094     void MountUserData();
00095 
00096     int argc;
00097     char** argv;
00098     const char* engineConfigfile;
00099     const char* userConfigfile;
00100 
00101     csRef<iConfigFile>    cfg;
00102     csRef<iConfigManager> configManager;
00103     csRef<iVFS>           vfs;
00104 };
00105 
00108 #endif