Manages the themes within the component. More...
Public Member Functions | |
System * | getSystem () const |
Theme * | getActiveTheme () const |
void | setActiveTheme (Theme *theme) |
Theme * | createOrRetrieve (nkMemory::StringView name) |
Theme * | record (nkMemory::StringView name, nkMemory::UniquePtr< Theme > resource) |
Theme * | get (nkMemory::StringView name) const |
Theme * | getByIndex (unsigned int index) const |
void | rename (nkMemory::StringView currentName, nkMemory::StringView newName) |
void | erase (nkMemory::StringView name) |
nkMemory::UniquePtr< Theme > | relinquish (nkMemory::StringView name) |
Manages the themes within the component.
A Manager is always responsible for the resources allocated using it.
System* nkWinUi::ThemeManager::getSystem | ( | ) | const |
Theme* nkWinUi::ThemeManager::getActiveTheme | ( | ) | const |
void nkWinUi::ThemeManager::setActiveTheme | ( | Theme * | theme | ) |
Sets the active theme to use within the component.
theme | The theme to use when drawing the windows in the component. |
Theme* nkWinUi::ThemeManager::createOrRetrieve | ( | nkMemory::StringView | name | ) |
Creates if unavailable, or retrieve if available, a theme.
name | The name of the theme to retrieve. |
Theme* nkWinUi::ThemeManager::record | ( | nkMemory::StringView | name, |
nkMemory::UniquePtr< Theme > | resource | ||
) |
Records an already existing resource in the manager, passing its ownership around.
name | The name under which the resource should be recorded. |
resource | The resource to record. |
Theme* nkWinUi::ThemeManager::get | ( | nkMemory::StringView | name | ) | const |
Request for a theme attached to a name.
name | The name of the theme wanted. |
Theme* nkWinUi::ThemeManager::getByIndex | ( | unsigned int | index | ) | const |
Returns the resource at given index, if available.
index | The index of the resource to retrieve. |
void nkWinUi::ThemeManager::rename | ( | nkMemory::StringView | currentName, |
nkMemory::StringView | newName | ||
) |
Renames a resource.
currentName | The name of the resource to rename. |
newName | The name to reassign to the resource. |
void nkWinUi::ThemeManager::erase | ( | nkMemory::StringView | name | ) |
Erases a resource. Memory attached to it will be freed.
name | The name identifying the resource to erase. |
nkMemory::UniquePtr<Theme> nkWinUi::ThemeManager::relinquish | ( | nkMemory::StringView | name | ) |
Requests the manager to relinquish the ownership of a resource and pass it around.
name | The name of the recorded resource to relinquish. |