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