|
TGUI
0.9.5
|
Base class for the backend. More...
#include <TGUI/Backend.hpp>
Public Member Functions | |
| BackendBase ()=default | |
| Default constructor. | |
| BackendBase (const BackendBase &)=delete | |
| BackendBase & | operator= (const BackendBase &)=delete |
| virtual | ~BackendBase ()=default |
| Virtual destructor. | |
| void | setDestroyOnLastGuiDetatch (bool destroyOnDetatch) |
| Informs the backend whether it should destroy itself when the last Gui is detached from it. | |
| virtual void | attachGui (GuiBase *gui)=0 |
| Informs the backend that a new gui object has been created. | |
| virtual void | detatchGui (GuiBase *gui)=0 |
| Informs the backend that a gui object is being destroyed. | |
| virtual Font | createDefaultFont ()=0 |
| Creates and returns the default font for all widgets. | |
| virtual std::shared_ptr< BackendFontBase > | createFont ()=0 |
| Creates a new font object. | |
| virtual std::shared_ptr< BackendTextBase > | createText ()=0 |
| Creates a new text object. | |
| virtual std::shared_ptr< BackendTextureBase > | createTexture ()=0 |
| Creates a new texture object. | |
| virtual void | setMouseCursorStyle (Cursor::Type type, const std::uint8_t *pixels, Vector2u size, Vector2u hotspot)=0 |
| Changes the look of a certain mouse cursor by using a bitmap. | |
| virtual void | resetMouseCursorStyle (Cursor::Type type)=0 |
| Changes the look of a certain mouse cursor back to the system theme. | |
| virtual void | setMouseCursor (GuiBase *gui, Cursor::Type type)=0 |
| Changes the mouse cursor when the mouse is on top of the window to which the gui is attached. | |
| virtual void | openVirtualKeyboard (const FloatRect &inputRect)=0 |
| Opens the virtual keyboard on Android and iOS. | |
| virtual void | closeVirtualKeyboard ()=0 |
| Closes the virtual keyboard on Android and iOS. | |
| virtual bool | isKeyboardModifierPressed (Event::KeyModifier modifierKey)=0 |
| Checks the state for one of the modifier keys. | |
| virtual void | setClipboard (const String &contents) |
| Changes the contents of the clipboard. | |
| virtual String | getClipboard () const |
| Returns the contents of the clipboard. | |
| 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. | |
Protected Attributes | |
| bool | m_destroyOnLastGuiDetatch = false |
| String | m_clipboardContents |
Base class for the backend.
|
pure virtual |
Informs the backend that a new gui object has been created.
| gui | Newly created gui |
Implemented in tgui::BackendSDL, and tgui::BackendSFML.
|
pure virtual |
Closes the virtual keyboard on Android and iOS.
Implemented in tgui::BackendSDL, and tgui::BackendSFML.
|
pure virtual |
Creates and returns the default font for all widgets.
Implemented in tgui::BackendSDL, and tgui::BackendSFML.
|
pure virtual |
Creates a new font object.
Implemented in tgui::BackendSDL, and tgui::BackendSFML.
|
pure virtual |
Creates a new text object.
Implemented in tgui::BackendSDL, and tgui::BackendSFML.
|
pure virtual |
Creates a new texture object.
Implemented in tgui::BackendSDL, and tgui::BackendSFML.
|
pure virtual |
Informs the backend that a gui object is being destroyed.
| gui | Gui object that is about to be deconstructed |
Implemented in tgui::BackendSDL, and tgui::BackendSFML.
|
virtual |
Returns the contents of the clipboard.
Reimplemented in tgui::BackendSDL, and tgui::BackendSFML.
|
pure virtual |
Checks the state for one of the modifier keys.
| modifierKey | The modifier key of which the state is being queried |
Implemented in tgui::BackendSDL, and tgui::BackendSFML.
|
pure virtual |
Opens the virtual keyboard on Android and iOS.
| inputRect | Part of the screen where the text input is located |
Implemented in tgui::BackendSDL, and tgui::BackendSFML.
|
virtual |
Uses the AssetManager on Android to read a file and return its contents.
| filename | Path to the file to read |
| fileSize | Size of the file, to be filled in by this function if loading succeeds (untouched on failure) |
|
pure virtual |
Changes the look of a certain mouse cursor back to the system theme.
| type | Cursor that should no longer use a custom bitmap |
Implemented in tgui::BackendSDL, and tgui::BackendSFML.
|
virtual |
Changes the contents of the clipboard.
| contents | New contents of the clipboard |
Reimplemented in tgui::BackendSDL, and tgui::BackendSFML.
| void tgui::BackendBase::setDestroyOnLastGuiDetatch | ( | bool | destroyOnDetatch | ) |
Informs the backend whether it should destroy itself when the last Gui is detached from it.
| destroyOnDetatch | Should setBackend(nullptr) be called when there are no more Gui objects left? |
This function will be called with "true" as parameter if the Backend is created by a Gui object.
|
pure virtual |
Changes the mouse cursor when the mouse is on top of the window to which the gui is attached.
| gui | The gui that represents the window for which the mouse cursor should be changed |
| type | Which cursor to use |
Implemented in tgui::BackendSDL, and tgui::BackendSFML.
|
pure virtual |
Changes the look of a certain mouse cursor by using a bitmap.
| type | Cursor that should make use of the bitmap |
| pixels | Pointer to an array with 4*size.x*size.y elements, representing the pixels in 32-bit RGBA format |
| size | Size of the cursor |
| hotspot | Pixel coordinate within the cursor image which will be located exactly at the mouse pointer position |
Implemented in tgui::BackendSDL, and tgui::BackendSFML.
1.9.8