8 #ifndef SSG_GUIMANAGER_HPP_ 9 #define SSG_GUIMANAGER_HPP_ 11 #include <SFML/Graphics.hpp> 12 #include <SFML/System/Mutex.hpp> 13 #include <SFML/System/Lock.hpp> 19 #include "HaveContextMenu.hpp" 20 #include "TextLabel.hpp" 36 sf::Vector2u fullScreenSize;
39 sf::ContextSettings settings;
43 DebugRectangle(
const sf::RectangleShape& rect,
size_t ttl,
const sf::RenderTarget* target,
size_t uid):
55 sf::RectangleShape rect;
58 const sf::RenderTarget* target;
67 sf::Vector2f mp = sf::Vector2f(0.f,0.f),
68 bool pressLeft =
false,
69 bool pressRight =
false,
70 bool aboveHover =
false 72 static void draw(sf::RenderTarget& target,
const sf::RenderStates& states);
73 static size_t drawDebugRectangle(
74 const sf::RectangleShape& rect,
76 const sf::RenderTarget* target =
nullptr 78 static void clearDebugRectangles();
79 static bool removeDebugRectangle(
size_t uid);
80 static void addDialog(
const std::shared_ptr<Element>& dialog);
81 static void addWindow(
const std::shared_ptr<Element>& window);
82 static bool removeDialog(
const sf::String& name);
83 static bool removeWindow(
const sf::String& name);
84 static bool removeDialog(
const Element*
id);
85 static bool removeWindow(
const Element*
id);
86 static bool dialogExist(
const sf::String& name);
87 static bool windowExist(
const sf::String& name);
88 static size_t dialogCount();
89 static size_t windowCount();
90 static std::pair<size_t, size_t> count();
91 static bool& getWindowFocus(sf::Window* windowPtr);
92 static void setMainWindow(sf::Window* value);
93 static sf::Mutex& getMainWindowMutex();
94 static bool setActiveMainWindow(
bool active);
95 static void closeApplication();
96 static void closeWindow(sf::Window* windowPtr);
97 static bool toggleFullscreen(sf::RenderWindow& rw,
bool failSafe =
true);
98 static bool recreateWindow(sf::RenderWindow& rw,
bool failSafe =
true);
100 static void setFramerateLimit(sf::Window* rw,
size_t limit);
101 static void setVerticalSync(sf::Window* rw,
bool sync);
102 static bool setFullScreenResolution(sf::Window* rw, sf::Vector2u size);
103 static sf::VideoMode nextFullScreenMode(sf::RenderWindow& rw);
104 static sf::VideoMode previousFullScreenMode(sf::RenderWindow& rw);
105 static void windowReposition(sf::RenderWindow& rw);
106 static std::shared_ptr<sf::RenderWindow> createWindow(
108 sf::ContextSettings settings = sf::ContextSettings()
110 static void showTooltip(
const HaveHover*,
const sf::String& text, sf::Vector2f position);
111 static void hideTooltip(
const HaveHover*);
112 static Panel& getTooltipPanel();
114 static sf::String getMainWindowTitle();
115 static sf::Vector2i getWindowDrift();
116 static void setMaxTooltipWidth(
float value);
120 static bool mainWindowInit(sf::RenderWindow& rw);
122 static void initTooltipLabel();
124 static bool closeApplicationFlag;
125 static float maxTooltipWidth;
126 static sf::Window* mainWindow;
127 static sf::Mutex mainWindowMutex;
128 static std::vector<std::shared_ptr<Element>> dialogs;
129 static std::vector<std::shared_ptr<Element>> windows;
130 static std::vector<DebugRectangle> debugRectangles;
131 static std::vector<const Element*> destroyedDialogs;
132 static std::set<sf::Window*> closedWindows;
133 static std::vector<std::shared_ptr<Element>> newDialogs;
134 static Panel referenceElement;
135 static Panel tooltipPanel;
137 static std::map<const sf::Window*, WindowParameters> windowMap;
138 static const HaveHover* lastTooltipOwner;
139 static sf::Vector2i windowDrift;
Definition: GUIManager.hpp:42
Definition: TextLabel.hpp:26
Definition: HaveHover.hpp:16
Definition: GUIManager.hpp:22
Definition: Element.hpp:22
Definition: GUIManager.hpp:63