Planeshift
pscssetup.h
Go to the documentation of this file.
1 /*
2  * cssetup.h - Authored by Elliot Paquette
3  *
4  * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 // cssetup.h: registers classes from an xml file
20 //
22 
23 #ifndef CSSETUP_HEADER
24 #define CSSETUP_HEADER
25 
26 #include <cstool/initapp.h>
27 
28 struct iConfigManager;
29 struct iConfigFile;
30 struct iVFS;
31 struct iObjectRegistry;
32 
37 #ifndef PS_VERSION
38 #define PS_VERSION "0.6.5"
39 #endif
40 
41 #ifndef APPNAME
42 #define APPNAME "PlaneShift Azure Spirit (" PS_VERSION ")"
43 #endif
44 
45 #ifdef CS_COMPILER_GCC
46 #define PS_PAUSEEXIT(x) exit(x)
47 #endif
48 
49 
52 class psCSSetup
53 {
54 public:
55  psCSSetup(int, char**, const char*, const char*);
56  ~psCSSetup();
57 
58  //Initialize CS
59  iObjectRegistry* InitCS(iReporterListener* customReporter=0);
60 
61  iObjectRegistry* GetObjectRegistry()
62  {
63  return object_reg;
64  }
65 
66  static iObjectRegistry* object_reg;
67 
72  bool AddWindowInformations(const char* Info);
73 
79  bool SetIcon(const char* ImageFileLocation);
80 
86  bool SetIcon(iImage* Image);
87 
88 protected:
89  //Unused part of initcs.inc, but included - better to than not to
90  bool InitCSWindow(const char*);
91 
92  char* PS_GetFileName(char*);
93 
94  void MountUserData();
95 
96  int argc;
97  char** argv;
98  const char* engineConfigfile;
99  const char* userConfigfile;
100 
101  csRef<iConfigFile> cfg;
102  csRef<iConfigManager> configManager;
103  csRef<iVFS> vfs;
104 };
105 
108 #endif
iObjectRegistry * GetObjectRegistry()
Definition: pscssetup.h:61
A helper class to setup Crystal Space and mount some dirs.
Definition: pscssetup.h:52
csRef< iConfigFile > cfg
Definition: pscssetup.h:101
csRef< iConfigManager > configManager
Definition: pscssetup.h:102
const char * engineConfigfile
Definition: pscssetup.h:98
bool AddWindowInformations(const char *Info)
Adds additional informations wraped in [] to the title bar.
bool InitCSWindow(const char *)
int argc
Definition: pscssetup.h:96
iObjectRegistry * InitCS(iReporterListener *customReporter=0)
char ** argv
Definition: pscssetup.h:97
bool SetIcon(const char *ImageFileLocation)
Sets an icon for the main window using a file name.
char * PS_GetFileName(char *)
static iObjectRegistry * object_reg
Definition: pscssetup.h:66
csRef< iVFS > vfs
Definition: pscssetup.h:103
void MountUserData()
psCSSetup(int, char **, const char *, const char *)
const char * userConfigfile
Definition: pscssetup.h:99