TGUI  0.9-dev
Global.hpp
1 //
3 // TGUI - Texus' Graphical User Interface
4 // Copyright (C) 2012-2020 Bruno Van de Velde (vdv_b@tgui.eu)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24 
25 #ifndef TGUI_GLOBAL_HPP
26 #define TGUI_GLOBAL_HPP
27 
29 
30 #include <TGUI/Config.hpp>
31 #include <TGUI/Exception.hpp>
32 #include <TGUI/Duration.hpp>
33 #include <TGUI/Font.hpp>
34 #include <cstdint>
35 #include <string>
36 #include <memory>
37 
38 #ifdef TGUI_DEBUG
39  #include <iostream>
40 #endif
41 
43 
45 namespace tgui
46 {
50  TGUI_API void setGlobalTextSize(unsigned int textSize);
51 
52 
56  TGUI_API unsigned int getGlobalTextSize();
57 
58 
62  TGUI_API void setGlobalFont(const Font& font);
63 
64 
70  TGUI_API Font getGlobalFont();
71 
72 
77  TGUI_API const std::shared_ptr<sf::Font>& getInternalGlobalFont();
78 
79 
83  TGUI_API void setDoubleClickTime(Duration duration);
84 
85 
89  TGUI_API Duration getDoubleClickTime();
90 
91 
100  TGUI_API void setResourcePath(const String& path);
101 
102 
111  TGUI_API const String& getResourcePath();
112 
113 
116  // Checks if two floats are equal, with regard to a small epsilon margin.
118  TGUI_API bool compareFloats(float x, float y);
119 
120 
122 }
123 
125 
126 #endif // TGUI_GLOBAL_HPP
127 
TGUI_API Duration getDoubleClickTime()
Retrieves the double-click time for the mouse.
TGUI_API void setResourcePath(const String &path)
Sets a new resource path.
TGUI_API Font getGlobalFont()
Retrieves the default font used for all new widgets.
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:35
TGUI_API void setGlobalTextSize(unsigned int textSize)
Sets the default text size for all widgets created after calling the function.
TGUI_API void setDoubleClickTime(Duration duration)
Sets the double-click time for the mouse.
const TGUI_API String & getResourcePath()
Returns the resource path.
TGUI_API unsigned int getGlobalTextSize()
Retrieves the default text size used for all new widgets.
TGUI_API void setGlobalFont(const Font &font)
Sets the default font used by widgets.