26#ifndef TGUI_BACKEND_SFML_HPP
27#define TGUI_BACKEND_SFML_HPP
29#include <TGUI/Config.hpp>
30#if TGUI_BUILD_AS_CXX_MODULE
33 #include <TGUI/Backend/Window/Backend.hpp>
36#include <TGUI/Backend/Window/SFML/BackendGuiSFML.hpp>
38#include <SFML/Window.hpp>
40#if !TGUI_EXPERIMENTAL_USE_STD_MODULE
41 #include <unordered_map>
47TGUI_MODULE_EXPORT
namespace tgui
137#ifdef TGUI_SYSTEM_ANDROID
146 TGUI_NODISCARD std::unique_ptr<std::uint8_t[]> readFileFromAndroidAssets(
const String& filename, std::size_t& fileSize)
const override;
169 TGUI_NODISCARD std::unique_ptr<sf::Cursor> createSystemCursor(
Cursor::Type type);
175 void updateMouseCursor(
Cursor::Type type, std::unique_ptr<sf::Cursor> cursor);
181 void updateMouseCursor(sf::Window* window,
Cursor::Type type);
189 sf::Window* window =
nullptr;
193 std::unordered_map<BackendGui*, GuiResources> m_guiResources;
194 std::unordered_map<Cursor::Type, std::unique_ptr<sf::Cursor>> m_mouseCursors;
196 static std::vector<std::unique_ptr<sf::Cursor>> m_leakedCursors;
Base class for the Gui.
Definition BackendGui.hpp:48
Definition BackendSFML.hpp:50
void setClipboard(const String &contents) override
Changes the contents of the clipboard.
TGUI_NODISCARD bool isKeyboardModifierPressed(Event::KeyModifier modifierKey) override
Checks the state for one of the modifier keys.
TGUI_NODISCARD String getClipboard() const override
Returns the contents of the clipboard.
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.
void openVirtualKeyboard(const FloatRect &inputRect) override
Opens the virtual keyboard on Android and iOS.
static void cleanupLeakedCursors()
Destroys any leaked cursors.
void closeVirtualKeyboard() override
Closes the virtual keyboard on Android and iOS.
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:91
Type
List of available cursors.
Definition Cursor.hpp:51
Wrapper class to store strings.
Definition String.hpp:101
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:39
KeyModifier
Modifiers keys.
Definition Event.hpp:158