Manages the recorded cursors living in the component. More...
Public Member Functions | |
System * | getSystem () const |
Cursor * | createOrRetrieve (nkMemory::StringView name) |
Cursor * | record (nkMemory::StringView name, nkMemory::UniquePtr< Cursor > resource) |
Cursor * | get (nkMemory::StringView name) const |
Cursor * | getByIndex (unsigned int index) const |
void | rename (nkMemory::StringView currentName, nkMemory::StringView newName) |
void | erase (nkMemory::StringView name) |
nkMemory::UniquePtr< Cursor > | relinquish (nkMemory::StringView name) |
void | setActiveCursor (Cursor *cursor) |
Manages the recorded cursors living in the component.
System* nkWinUi::CursorManager::getSystem | ( | ) | const |
Cursor* nkWinUi::CursorManager::createOrRetrieve | ( | nkMemory::StringView | name | ) |
Creates (if unavailable) or retrieves (if available) a resource attached to passed name.
name | The name, aka identifier, of the resource to create or retrieve. |
Cursor* nkWinUi::CursorManager::record | ( | nkMemory::StringView | name, |
nkMemory::UniquePtr< Cursor > | 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. |
Cursor* nkWinUi::CursorManager::get | ( | nkMemory::StringView | name | ) | const |
Returns a resource attached to a name, if available.
name | The name of the resource that should be retrieved. |
Cursor* nkWinUi::CursorManager::getByIndex | ( | unsigned int | index | ) | const |
Returns the resource at given index, if available.
index | The index of the resource to retrieve. |
void nkWinUi::CursorManager::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::CursorManager::erase | ( | nkMemory::StringView | name | ) |
Erases a resource. Memory attached to it will be freed.
name | The name identifying the resource to erase. |
nkMemory::UniquePtr<Cursor> nkWinUi::CursorManager::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. |
void nkWinUi::CursorManager::setActiveCursor | ( | Cursor * | cursor | ) |
Sets the active cursor.
cursor | The cursor to activate and use. |