25#ifndef TGUI_BACKEND_SDL_HPP
26#define TGUI_BACKEND_SDL_HPP
28#include <TGUI/extlibs/IncludeSDL.hpp>
29#include <TGUI/Backend/Window/SDL/BackendGuiSDL.hpp>
30#include <TGUI/Backend/Window/Backend.hpp>
32#include <unordered_map>
37TGUI_IGNORE_DEPRECATED_WARNINGS_START
91#ifndef TGUI_REMOVE_DEPRECATED_CODE
98 TGUI_DEPRECATED(
"Use BackendGui::startTextInput instead") void
openVirtualKeyboard(const FloatRect& inputRect) override;
115 TGUI_DEPRECATED(
"Use gui.isKeyboardModifierPressed(modifierKey) instead") TGUI_NODISCARD
bool isKeyboardModifierPressed(
Event::KeyModifier modifierKey) override;
131#ifdef TGUI_SYSTEM_ANDROID
149 TGUI_NODISCARD SDL_Cursor* createSystemCursor(
Cursor::Type type);
154 void updateMouseCursorStyle(
Cursor::Type type, SDL_Cursor* cursor);
159 void updateShownMouseCursor(SDL_Window* window,
Cursor::Type type);
166 SDL_Window* window =
nullptr;
170 std::unordered_map<const BackendGui*, GuiResources> m_guiResources;
171 std::unordered_map<Cursor::Type, SDL_Cursor*> m_mouseCursors;
173#if defined(TGUI_SYSTEM_LINUX) && defined(TGUI_USE_X11) && (SDL_MAJOR_VERSION < 3) && defined(SDL_VIDEO_DRIVER_X11)
174 bool m_customCursorX11 =
false;
181TGUI_IGNORE_DEPRECATED_WARNINGS_END
Base class for the Gui.
Definition BackendGui.hpp:45
Definition BackendSDL.hpp:42
void resetMouseCursorStyle(Cursor::Type type) override
Changes the look of a certain mouse cursor back to the system theme.
void closeVirtualKeyboard() override
Closes the virtual keyboard on Android and iOS.
bool isKeyboardModifierPressed(Event::KeyModifier modifierKey) override
Checks the state for one of the modifier keys.
void detatchGui(BackendGui *gui) override
Informs the backend that a gui object is being destroyed.
void setClipboard(const String &contents) override
Changes the contents of the clipboard.
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.
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.
String getClipboard() const override
Returns the contents of the clipboard.
~BackendSDL() override
Destructor.
void openVirtualKeyboard(const FloatRect &inputRect) override
Opens the virtual keyboard on Android and iOS.
void setGuiWindow(BackendGui *gui, SDL_Window *window)
Informs the backend which window belongs to the gui.
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