Offers many utilities to deal with the components, specialized for its windowing system. More...
Public Member Functions | |
ComponentUtils () noexcept | |
virtual | ~ComponentUtils () |
virtual nkMaths::Rectangle | getComponentSize (const Component *component)=0 |
virtual nkMaths::Rectangle | getScreenDimensions ()=0 |
virtual nkMaths::Point | getComponentCoordFromScreenCoord (const Component *component, nkMaths::Point screenCoord)=0 |
virtual nkMaths::Point | getScreenCoordFromComponentCoord (const Component *component, nkMaths::Point componentCoord)=0 |
virtual nkMaths::Rectangle | getComponentDimensions (const Component *component)=0 |
virtual void | setComponentPosition (Component *component, float x, float y)=0 |
virtual void | setComponentSize (Component *component, float width, float height)=0 |
virtual void | setComponentDimensions (Component *component, float x, float y, float width, float height)=0 |
virtual bool | getComponentVisibility (const Component *component)=0 |
virtual void | setComponentVisibility (Component *component, bool visibleOrNot)=0 |
virtual bool | isComponentEnabled (const Component *component)=0 |
virtual void | setComponentEnabled (Component *component, bool enabledOrNot)=0 |
virtual void | setComponentFocus (Component *component)=0 |
virtual bool | isComponentInForeground (const Component *component)=0 |
virtual void | setComponentInForeground (Component *component)=0 |
virtual void | setComponentLabel (Component *component, nkMemory::StringView label)=0 |
virtual void | updateComponent (Component *component)=0 |
virtual void | freezeComponentPainting (Component *component, bool value)=0 |
virtual nkImages::Image | paintToImage (Component *component, bool withFrame)=0 |
virtual nkMaths::Point | getCursorPosition ()=0 |
virtual void | setCursorPosition (nkMaths::Point absPos)=0 |
virtual nkMemory::BufferCast< nkMemory::String > | getAvailableFontFaces ()=0 |
virtual nkMemory::BufferCast< unsigned int > | getCharactersWidth (nkMemory::BufferView< char > characters, Font *font)=0 |
Offers many utilities to deal with the components, specialized for its windowing system.
|
noexcept |
Constructor.
|
virtual |
Destructor.
|
pure virtual |
component | The component to check for. |
|
pure virtual |
|
pure virtual |
Converts component relative coordinates to absolute coordinates on screen.
component | The component to work with. |
screenCoord | The absolute coordinates to convert, in pixels. |
|
pure virtual |
Converts absolute screen coordinates to relative coordinates within a component.
component | The component to work with. |
componentCoord | The absolute coordinates to convert, in pixels. |
|
pure virtual |
component | The component to check for. |
|
pure virtual |
Sets the position of the component.
component | The component to work on. |
x | The x coordinate, in pixels, within the parent component. |
y | The y coordinate, in pixels, within the parent component. |
|
pure virtual |
Sets a component's size.
component | The component to work on. |
width | The width in pixels. |
height | The height in pixels. |
|
pure virtual |
Sets a component's dimensions.
component | The component to work on. |
x | The x position, in pixels, within its parent. |
y | The y position, in pixels, within its parent. |
width | The width in pixels. |
height | The height in pixels. |
|
pure virtual |
component | The component to check. |
|
pure virtual |
Sets a component's visibility status.
component | The component to work on. |
visibleOrNot | Whether the component should be visible (true) or not (false). |
|
pure virtual |
component | The component to check. |
|
pure virtual |
Allows to enable or disable a component.
component | The component to work on. |
enabledOrNot | Whether the component should be enabled (true) or not (false). |
|
pure virtual |
Sets the focus to a component.
component | The component to set the focus to. |
|
pure virtual |
component | The component to check for. |
|
pure virtual |
Sets a component to the foreground.
component | The component to bring to the foreground. |
|
pure virtual |
Sets a component's label.
component | The target component. |
label | The label to set. |
|
pure virtual |
Forces the update of a component.
component | The component to update. |
|
pure virtual |
Prevents a component from being painted or updated.
component | The component to freeze. |
value | Whether to freeze it (true) or not (false). |
|
pure virtual |
Allows to paint a component into an image.
component | The component to paint. |
withFrame | Whether the component's frame should also be painted (true) or not (false). |
|
pure virtual |
|
pure virtual |
Sets the cursor position, on screen.
absPos | The absolute position, in pixels, the cursor should move to. |
|
pure virtual |
Abstraction of the font face retrieval method. For more information, see FontUtils::getAvailableFontFaces().
|
pure virtual |
Abstraction of the character width method. For more information, see FontUtils::getCharactersWidth().
characters | An array of the characters to retrieve the width from. |
font | The font to use for width retrieval. If left to nullptr, will use the default font. |