Converted many char*s to std::strings. This is providing more safety from buffer...
[supertux.git] / lib / app / setup.h
1 //  $Id$
2 //
3 //  SuperTux -  A Jump'n Run
4 //  Copyright (C) 2000 Bill Kendrick <bill@newbreedsoftware.com>
5 //
6 //  This program is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU General Public License
8 //  as published by the Free Software Foundation; either version 2
9 //  of the License, or (at your option) any later version.
10 //
11 //  This program is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 //  GNU General Public License for more details.
15 //
16 //  You should have received a copy of the GNU General Public License
17 //  along with this program; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
20 #ifndef SUPERTUX_SETUP_H
21 #define SUPERTUX_SETUP_H
22
23 #include <vector>
24 #include <set>
25 #include <string>
26 #include "../gui/menu.h"
27 #include "../special/base.h"
28
29 namespace SuperTux {
30
31 /// File system utility functions
32 struct FileSystem
33   {
34     static int faccessible(const std::string& filename);
35     static int fcreatedir(const std::string& relative_dir);
36     static int fwriteable(const std::string& filename);
37     static std::set<std::string> read_directory(const std::string& pathname);
38     static std::set<std::string> dsubdirs(const std::string& rel_path, const std::string& expected_file);
39     static std::set<std::string> dfiles(const std::string& rel_path, const std::string& glob, const std::string& exception_str);
40   };
41
42 /// All you need to get an application up and running
43 struct Setup
44   {
45     static void info(const std::string& _package_name, const std::string& _package_symbol_name, const std::string& _package_version);
46     static void directories(void);
47     static void general(void);
48     static void general_free();
49     static void video(unsigned int screen_w, unsigned int screen_h);
50     static void audio(void);
51     static void joystick(void);
52     static void parseargs(int argc, char * argv[]);
53
54     private:
55     static void video_sdl(unsigned int screen_w, unsigned int screen_h);
56     static void video_gl(unsigned int screen_w, unsigned int screen_h);
57   };
58
59 /// Termination handling
60 struct Termination
61   {
62     static void shutdown(void);
63     static void abort(const std::string& reason, const std::string& details);
64   };
65   
66 } //namespace SuperTux
67
68 #endif /*SUPERTUX_SETUP_H*/
69