25#ifndef TGUI_BACKEND_SFML_HPP
26#define TGUI_BACKEND_SFML_HPP
28#include <TGUI/Config.hpp>
29#if !TGUI_BUILD_AS_CXX_MODULE
30 #include <TGUI/Backend/Window/Backend.hpp>
33#include <TGUI/Backend/Window/SFML/BackendGuiSFML.hpp>
35#include <SFML/Window.hpp>
37#if !TGUI_EXPERIMENTAL_USE_STD_MODULE
38 #include <unordered_map>
44TGUI_IGNORE_DEPRECATED_WARNINGS_START
46TGUI_MODULE_EXPORT
namespace tgui
93#ifndef TGUI_REMOVE_DEPRECATED_CODE
100 TGUI_DEPRECATED(
"Use BackendGui::startTextInput instead") void openVirtualKeyboard(const
FloatRect& inputRect) override;
107 TGUI_DEPRECATED("Use
BackendGui::stopTextInput instead")
void closeVirtualKeyboard() override;
117 TGUI_DEPRECATED(
"Use gui.isKeyboardModifierPressed(modifierKey) instead") TGUI_NODISCARD
bool isKeyboardModifierPressed(
Event::KeyModifier modifierKey) override;
124 void setClipboard(const
String& contents) override;
131 TGUI_NODISCARD
String getClipboard() const override;
133#ifdef TGUI_SYSTEM_ANDROID
142 TGUI_NODISCARD std::unique_ptr<std::uint8_t[]> readFileFromAndroidAssets(
const String& filename, std::size_t& fileSize)
const override;
164 TGUI_NODISCARD std::unique_ptr<sf::Cursor> createSystemCursor(
Cursor::Type type);
169 void updateMouseCursor(
Cursor::Type type, std::unique_ptr<sf::Cursor> cursor);
174 void updateMouseCursor(sf::Window* window,
Cursor::Type type);
181 sf::Window* window =
nullptr;
185 std::unordered_map<const BackendGui*, GuiResources> m_guiResources;
186 std::unordered_map<Cursor::Type, std::unique_ptr<sf::Cursor>> m_mouseCursors;
188 static std::vector<std::unique_ptr<sf::Cursor>> m_leakedCursors;
194TGUI_IGNORE_DEPRECATED_WARNINGS_END
Base class for the Gui.
Definition BackendGui.hpp:47
Definition BackendSFML.hpp:49
void setMouseCursorStyle(Cursor::Type type, const std::uint8_t *pixels, Vector2u size, Vector2u hotspot) override
Changes the look of a certain mouse cursor by using a bitmap.
void setGuiWindow(BackendGui *gui, sf::Window *window)
Informs the backend which window belongs to the gui.
void resetMouseCursorStyle(Cursor::Type type) override
Changes the look of a certain mouse cursor back to the system theme.
void detatchGui(BackendGui *gui) override
Informs the backend that a gui object is being destroyed.
static void cleanupLeakedCursors()
Destroys any leaked cursors.
void setMouseCursor(BackendGui *gui, Cursor::Type type) override
Changes the mouse cursor when the mouse is on top of the window to which the gui is attached.
Base class for the backend.
Definition Backend.hpp:87
Type
List of available cursors.
Definition Cursor.hpp:50
Wrapper class to store strings.
Definition String.hpp:96
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:38