TGUI  0.9-beta
tgui::BackendBase Class Referenceabstract

Base class for the backend. More...

#include <TGUI/Backend.hpp>

Public Member Functions

 BackendBase ()=default
 Default constructor.
 
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. More...
 
virtual void attachGui (GuiBase *gui)=0
 Informs the backend that a new gui object has been created. More...
 
virtual void detatchGui (GuiBase *gui)=0
 Informs the backend that a gui object is being destroyed. More...
 
virtual Font createDefaultFont ()=0
 Creates and returns the default font for all widgets. More...
 
virtual std::shared_ptr< BackendFontBasecreateFont ()=0
 Creates a new font object. More...
 
virtual std::shared_ptr< BackendTextBasecreateText ()=0
 Creates a new text object. More...
 
virtual std::shared_ptr< BackendTextureBasecreateTexture ()=0
 Creates a new texture object. More...
 
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. More...
 
virtual void resetMouseCursorStyle (Cursor::Type type)=0
 Changes the look of a certain mouse cursor back to the system theme. More...
 
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. More...
 
virtual void openVirtualKeyboard (const FloatRect &inputRect)=0
 Opens the virtual keyboard on Android and iOS. More...
 
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. More...
 
virtual void setClipboard (const String &contents)
 Changes the contents of the clipboard. More...
 
virtual String getClipboard () const
 Returns the contents of the clipboard. More...
 

Detailed Description

Base class for the backend.

Member Function Documentation

◆ attachGui()

virtual void tgui::BackendBase::attachGui ( GuiBase gui)
pure virtual

Informs the backend that a new gui object has been created.

Parameters
guiNewly created gui

◆ createDefaultFont()

virtual Font tgui::BackendBase::createDefaultFont ( )
pure virtual

Creates and returns the default font for all widgets.

Returns
Default font

◆ createFont()

virtual std::shared_ptr<BackendFontBase> tgui::BackendBase::createFont ( )
pure virtual

Creates a new font object.

Returns
Font that is specific to the backend

◆ createText()

virtual std::shared_ptr<BackendTextBase> tgui::BackendBase::createText ( )
pure virtual

Creates a new text object.

Returns
Text that is specific to the backend

◆ createTexture()

virtual std::shared_ptr<BackendTextureBase> tgui::BackendBase::createTexture ( )
pure virtual

Creates a new texture object.

Returns
Texture that is specific to the backend

◆ detatchGui()

virtual void tgui::BackendBase::detatchGui ( GuiBase gui)
pure virtual

Informs the backend that a gui object is being destroyed.

Parameters
guiGui object that is about to be deconstructed

◆ getClipboard()

virtual String tgui::BackendBase::getClipboard ( ) const
virtual

Returns the contents of the clipboard.

Returns
Clipboard contents

◆ isKeyboardModifierPressed()

virtual bool tgui::BackendBase::isKeyboardModifierPressed ( Event::KeyModifier  modifierKey)
pure virtual

Checks the state for one of the modifier keys.

Parameters
modifierKeyThe modifier key of which the state is being queried
Returns
Whether queries modifier key is being pressed

◆ openVirtualKeyboard()

virtual void tgui::BackendBase::openVirtualKeyboard ( const FloatRect inputRect)
pure virtual

Opens the virtual keyboard on Android and iOS.

Parameters
inputRectPart of the screen where the text input is located

◆ resetMouseCursorStyle()

virtual void tgui::BackendBase::resetMouseCursorStyle ( Cursor::Type  type)
pure virtual

Changes the look of a certain mouse cursor back to the system theme.

Parameters
typeCursor that should no longer use a custom bitmap

◆ setClipboard()

virtual void tgui::BackendBase::setClipboard ( const String contents)
virtual

Changes the contents of the clipboard.

Parameters
contentsNew contents of the clipboard

◆ setDestroyOnLastGuiDetatch()

void tgui::BackendBase::setDestroyOnLastGuiDetatch ( bool  destroyOnDetatch)

Informs the backend whether it should destroy itself when the last Gui is detached from it.

Parameters
destroyOnDetatchShould 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.

◆ setMouseCursor()

virtual void tgui::BackendBase::setMouseCursor ( GuiBase gui,
Cursor::Type  type 
)
pure virtual

Changes the mouse cursor when the mouse is on top of the window to which the gui is attached.

Parameters
guiThe gui that represents the window for which the mouse cursor should be changed
typeWhich cursor to use

◆ setMouseCursorStyle()

virtual void tgui::BackendBase::setMouseCursorStyle ( Cursor::Type  type,
const std::uint8_t *  pixels,
Vector2u  size,
Vector2u  hotspot 
)
pure virtual

Changes the look of a certain mouse cursor by using a bitmap.

Parameters
typeCursor that should make use of the bitmap
pixelsPointer to an array with 4*size.x*size.y elements, representing the pixels in 32-bit RGBA format
sizeSize of the cursor
hotspotPixel coordinate within the cursor image which will be located exactly at the mouse pointer position

The documentation for this class was generated from the following file: