1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
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; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef GLK_CONF_H
24 #define GLK_CONF_H
25 
26 #include "glk/glk_types.h"
27 #include "glk/fonts.h"
28 #include "glk/windows.h"
29 
30 namespace Glk {
31 
32 /**
33  * Engine configuration
34  */
35 class Conf {
36 private:
37 	/**
38 	 * Get a string
39 	 */
40 	void get(const Common::String &key, Common::String &field, const char *defaultVal = nullptr);
41 
42 	/**
43 	 * Get a color
44 	 */
45 	void get(const Common::String &key, uint &color, const byte *defaultColor);
46 
47 	/**
48 	 * Get a font name into a font Id
49 	 */
50 	void get(const Common::String &key, FACES &field, FACES defaultFont);
51 
52 	/**
53 	 * Get a numeric value
54 	 */
55 	void get(const Common::String &key, int &field, int defaultVal = 0);
56 
57 	/**
58 	 * Get a numeric value
59 	 */
60 	void get(const Common::String &key, bool &field, bool defaultVal = false);
61 
62 	/**
63 	 * Get a double
64 	 */
65 	void get(const Common::String &key, double &field, double defaultVal = 0.0);
66 
67 	/**
68 	 * Parse a color
69 	 */
70 	uint parseColor(const Common::String &str);
71 public:
72 	MonoFontInfo _monoInfo;
73 	PropFontInfo _propInfo;
74 	int _cols, _rows;
75 	int _lockCols, _lockRows;
76 	int _wMarginX, _wMarginY;
77 	int _wMarginSaveX, _wMarginSaveY;
78 	int _wPaddingX, _wPaddingY;
79 	int _wBorderX, _wBorderY;
80 	int _tMarginX, _tMarginY;
81 	double _gamma;
82 	uint _borderColor, _borderSave;
83 	uint _windowColor, _windowSave;
84 	int _lcd;
85 	int _scrollWidth;
86 	uint _scrollBg, _scrollFg;
87 	bool _graphics;
88 	bool _sound;
89 	bool _speak;
90 	bool _speakInput;
91 	Common::String _speakLanguage;
92 	int _styleHint;
93 	bool _safeClicks;
94 	WindowStyle _tStyles[style_NUMSTYLES];
95 	WindowStyle _gStyles[style_NUMSTYLES];
96 	WindowStyle _tStylesDefault[style_NUMSTYLES];
97 	WindowStyle _gStylesDefault[style_NUMSTYLES];
98 
99 	int _imageW, _imageH;
100 public:
101 	/**
102 	 * Constructor
103 	 */
104 	Conf(InterpreterType interpType);
105 };
106 
107 extern Conf *g_conf;
108 
109 } // End of namespace Glk
110 
111 #endif
112