29b58d2183cca4bcc77183148c25ae91ac5f2c53
[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
27 namespace SuperTux {
28
29 /// File system utility functions
30 struct FileSystem
31   {
32     static int faccessible(const std::string& filename);
33     static int fcreatedir(const std::string& relative_dir);
34     static int fwriteable(const std::string& filename);
35     static std::set<std::string> read_directory(const std::string& pathname);
36     static std::set<std::string> dsubdirs(const std::string& rel_path, const std::string& expected_file);
37     static std::set<std::string> dfiles(const std::string& rel_path, const std::string& glob, const std::string& exception_str);
38   };
39
40 /// All you need to get an application up and running
41 struct Setup
42   {
43     static void info(const std::string& _package_name, const std::string& _package_symbol_name, const std::string& _package_version);
44     static void directories(void);
45     static void general(void);
46     static void general_free();
47     static void video(unsigned int screen_w, unsigned int screen_h);
48     static void audio(void);
49     static void joystick(void);
50     static void parseargs(int argc, char * argv[]);
51
52     private:
53     static void video_sdl(unsigned int screen_w, unsigned int screen_h);
54     static void video_gl(unsigned int screen_w, unsigned int screen_h);
55   };
56
57 /// Termination handling
58 struct Termination
59   {
60     static void shutdown(void);
61     static void abort(const std::string& reason, const std::string& details);
62   };
63   
64 } //namespace SuperTux
65
66 #endif /*SUPERTUX_SETUP_H*/
67