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