TGUI  0.9.1
Global.hpp
1 //
3 // TGUI - Texus' Graphical User Interface
4 // Copyright (C) 2012-2021 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 <TGUI/Filesystem.hpp>
35 #include <cstdint>
36 #include <string>
37 #include <memory>
38 
39 #ifdef TGUI_DEBUG
40  #include <iostream>
41 #endif
42 
44 
46 namespace tgui
47 {
51  TGUI_API void setGlobalTextSize(unsigned int textSize);
52 
53 
57  TGUI_API unsigned int getGlobalTextSize();
58 
59 
63  TGUI_API void setDoubleClickTime(Duration duration);
64 
65 
70 
71 
79  TGUI_API void setResourcePath(const Filesystem::Path& path);
80 
81 
89  TGUI_API void setResourcePath(const String& path);
90 
91 
99  TGUI_API const Filesystem::Path& getResourcePath();
100 
101 
105  TGUI_API void setEditCursorBlinkRate(Duration blinkRate);
106 
107 
112 
113 
124  std::unique_ptr<std::uint8_t[]> readFileToMemory(const String& filename, std::size_t& fileSize);
125 
126 
128 }
129 
131 
132 #endif // TGUI_GLOBAL_HPP
133 
Wrapper for durations.
Definition: Duration.hpp:52
Object to represent paths on a filesystem.
Definition: Filesystem.hpp:56
Wrapper class to store strings.
Definition: String.hpp:74
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:36
TGUI_API void setDoubleClickTime(Duration duration)
Sets the double-click time for the mouse.
TGUI_API void setGlobalTextSize(unsigned int textSize)
Sets the default text size for all widgets created after calling the function.
TGUI_API void setEditCursorBlinkRate(Duration blinkRate)
Changes the blink rate of the cursor in edit fields such as EditBox and TextArea.
TGUI_API void setResourcePath(const Filesystem::Path &path)
Sets a new resource path.
TGUI_API Duration getDoubleClickTime()
Retrieves the double-click time for the mouse.
TGUI_API Duration getEditCursorBlinkRate()
Returns the blink rate of the cursor in edit fields such as EditBox and TextArea.
std::unique_ptr< std::uint8_t[]> readFileToMemory(const String &filename, std::size_t &fileSize)
Opens a file and reads its contents into memory.
TGUI_API const Filesystem::Path & getResourcePath()
Returns the resource path.
TGUI_API unsigned int getGlobalTextSize()
Retrieves the default text size used for all new widgets.