25#ifndef TGUI_BACKEND_SFML_HPP
26#define TGUI_BACKEND_SFML_HPP
28#include <TGUI/Config.hpp>
29#include <TGUI/Backend/Window/Backend.hpp>
30#include <TGUI/Backend/Window/SFML/BackendGuiSFML.hpp>
32#include <SFML/Window.hpp>
34#include <unordered_map>
39TGUI_IGNORE_DEPRECATED_WARNINGS_START
88#ifndef TGUI_REMOVE_DEPRECATED_CODE
95 TGUI_DEPRECATED(
"Use BackendGui::startTextInput instead") void
openVirtualKeyboard(const FloatRect& inputRect) override;
112 TGUI_DEPRECATED(
"Use gui.isKeyboardModifierPressed(modifierKey) instead") TGUI_NODISCARD
bool isKeyboardModifierPressed(
Event::KeyModifier modifierKey) override;
128#ifdef TGUI_SYSTEM_ANDROID
159 TGUI_NODISCARD std::unique_ptr<sf::Cursor> createSystemCursor(
Cursor::Type type);
164 void updateMouseCursor(
Cursor::Type type, std::unique_ptr<sf::Cursor> cursor);
169 void updateMouseCursor(sf::Window* window,
Cursor::Type type);
176 sf::Window* window =
nullptr;
180 std::unordered_map<const BackendGui*, GuiResources> m_guiResources;
181 std::unordered_map<Cursor::Type, std::unique_ptr<sf::Cursor>> m_mouseCursors;
183 static std::vector<std::unique_ptr<sf::Cursor>> m_leakedCursors;
189TGUI_IGNORE_DEPRECATED_WARNINGS_END
Base class for the Gui.
Definition BackendGui.hpp:45
Definition BackendSFML.hpp:44
void setClipboard(const String &contents) override
Changes the contents of the clipboard.
bool isKeyboardModifierPressed(Event::KeyModifier modifierKey) override
Checks the state for one of the modifier keys.
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.
String getClipboard() const override
Returns the contents of the clipboard.
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.
virtual std::unique_ptr< std::uint8_t[]> readFileFromAndroidAssets(const String &filename, std::size_t &fileSize) const
Uses the AssetManager on Android to read a file and return its contents.
Backend()=default
Default constructor.
Type
List of available cursors.
Definition Cursor.hpp:48
@ Arrow
Arrow cursor (default)
Definition Cursor.hpp:49
Wrapper class to store strings.
Definition String.hpp:94
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:36