The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
settings.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2007 - 2025
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
24#include "tstring.hpp"
25
26#include <chrono>
27#include <string>
28#include <vector>
29
30namespace gui2
31{
32
33
34/** Do we wish to use the new library or not. */
35extern bool new_widgets;
36
37/** This namespace contains the 'global' settings. */
38namespace 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 */
44extern unsigned screen_width;
45extern unsigned screen_height;
46
47/**
48 * The offset between the left edge of the screen and the gamemap.
49 */
50extern unsigned gamemap_x_offset;
51
52/**
53 * The size of the map area, if not available equal to the screen
54 * size.
55 */
56extern unsigned gamemap_width;
57extern unsigned gamemap_height;
58
59/** These are copied from the active gui. */
60extern std::chrono::milliseconds popup_show_delay;
61extern std::chrono::milliseconds popup_show_time;
62extern std::chrono::milliseconds help_show_time;
63extern std::chrono::milliseconds double_click_time;
64extern std::chrono::milliseconds repeat_button_repeat_time;
65
66extern std::string sound_button_click;
67extern std::string sound_toggle_button_click;
68extern std::string sound_toggle_panel_click;
69extern std::string sound_slider_adjust;
70
72
73extern std::vector<game_tip> tips;
74
75/**
76 * Update the size of the screen variables in settings.
77 *
78 * Before a window gets build the screen sizes need to be updated. This
79 * function does that. It's only done when no other window is active, if
80 * another window is active it already updates the sizes with it's resize
81 * event.
82 */
84}
85
86} // namespace gui2
t_string has_helptip_message
Definition settings.cpp:55
unsigned screen_width
The screen resolution and pixel pitch should be available for all widgets since their drawing method ...
Definition settings.cpp:27
std::vector< game_tip > tips
Definition settings.cpp:57
std::chrono::milliseconds double_click_time
The interval between two clicks to be detected as double click.
Definition settings.cpp:44
std::string sound_slider_adjust
Definition settings.cpp:53
std::string sound_toggle_button_click
Definition settings.cpp:51
std::chrono::milliseconds popup_show_delay
Delay before a popup shows.
Definition settings.cpp:38
unsigned screen_height
Definition settings.cpp:28
unsigned gamemap_x_offset
The offset between the left edge of the screen and the gamemap.
Definition settings.cpp:29
unsigned gamemap_height
Definition settings.cpp:32
std::string sound_button_click
Definition settings.cpp:50
std::chrono::milliseconds popup_show_time
Definition settings.cpp:39
std::chrono::milliseconds help_show_time
Definition settings.cpp:40
std::string sound_toggle_panel_click
Definition settings.cpp:52
unsigned gamemap_width
The size of the map area, if not available equal to the screen size.
Definition settings.cpp:31
void update_screen_size_variables()
Update the size of the screen variables in settings.
Definition settings.cpp:59
std::chrono::milliseconds repeat_button_repeat_time
How much a repeating button need to be held before the action repeats.
Definition settings.cpp:48
Generic file dialog.
bool new_widgets
Do we wish to use the new library or not.
Definition settings.cpp:23
Contains the general settings which have a default.