The Battle for Wesnoth  1.15.12+dev
settings.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2007 - 2018 by Mark de Wever <koraq@xs4all.nl>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /**
16  * @file
17  * This file contains the settings handling of the widget library.
18  */
19 
20 #pragma once
21 
22 #include "gui/auxiliary/tips.hpp"
23 #include "tstring.hpp"
24 
25 #include <string>
26 #include <vector>
27 
28 namespace gui2
29 {
30 
31 class gui_definition;
32 class game_tip;
33 
34 /** Do we wish to use the new library or not. */
35 extern bool new_widgets;
36 
37 /** This namespace contains the 'global' settings. */
38 namespace settings
39 {
40 /**
41  * The screen resolution and pixel pitch should be available for all widgets since
42  * their drawing method might depend on it.
43  */
44 extern unsigned screen_width;
45 extern unsigned screen_height;
46 extern unsigned screen_pitch_microns; /* Pixel pitch in microns */
47 
48 /**
49  * The offset between the left edge of the screen and the gamemap.
50  */
51 extern unsigned gamemap_x_offset;
52 
53 /**
54  * The size of the map area, if not available equal to the screen
55  * size.
56  */
57 extern unsigned gamemap_width;
58 extern unsigned gamemap_height;
59 
60 /** These are copied from the active gui. */
61 extern unsigned popup_show_delay;
62 extern unsigned popup_show_time;
63 extern unsigned help_show_time;
64 extern unsigned double_click_time;
65 extern unsigned repeat_button_repeat_time;
66 
67 extern std::string sound_button_click;
68 extern std::string sound_toggle_button_click;
69 extern std::string sound_toggle_panel_click;
70 extern std::string sound_slider_adjust;
71 
73 
74 extern std::vector<game_tip> tips;
75 
76 /**
77  * Update the size of the screen variables in settings.
78  *
79  * Before a window gets build the screen sizes need to be updated. This
80  * function does that. It's only done when no other window is active, if
81  * another window is active it already updates the sizes with it's resize
82  * event.
83  */
85 }
86 
87 } // namespace gui2
bool new_widgets
Do we wish to use the new library or not.
Definition: settings.cpp:24
unsigned double_click_time
Definition: settings.cpp:39
std::vector< game_tip > tips
Definition: settings.cpp:49
std::string sound_button_click
Definition: settings.cpp:42
unsigned gamemap_width
The size of the map area, if not available equal to the screen size.
Definition: settings.cpp:33
std::string sound_slider_adjust
Definition: settings.cpp:45
Generic file dialog.
Definition: field-fwd.hpp:22
unsigned repeat_button_repeat_time
Definition: settings.cpp:40
t_string has_helptip_message
Definition: settings.cpp:47
unsigned gamemap_height
Definition: settings.cpp:34
unsigned screen_pitch_microns
Definition: settings.cpp:30
Contains the general settings which have a default.
unsigned gamemap_x_offset
The offset between the left edge of the screen and the gamemap.
Definition: settings.cpp:31
unsigned popup_show_time
Definition: settings.cpp:37
unsigned screen_width
The screen resolution and pixel pitch should be available for all widgets since their drawing method ...
Definition: settings.cpp:28
std::string sound_toggle_panel_click
Definition: settings.cpp:44
unsigned popup_show_delay
These are copied from the active gui.
Definition: settings.cpp:36
unsigned screen_height
Definition: settings.cpp:29
std::string sound_toggle_button_click
Definition: settings.cpp:43
void update_screen_size_variables()
Update the size of the screen variables in settings.
Definition: settings.cpp:51
unsigned help_show_time
Definition: settings.cpp:38