|
psychic-ui 0.0.0
|
#include <IconRegistry.hpp>
Public Member Functions | |
| IconRegistry ()=default | |
| IconRegistry (std::initializer_list< std::span< const IconDefinition > > sets) | |
| IconRegistry & | add (const IconDefinition &definition) |
| IconRegistry & | add (std::span< const IconDefinition > set) |
| bool | has (std::string_view name) const |
| std::vector< std::string_view > | names () const |
| std::size_t | size () const |
| const IconShape * | shape (std::string_view name) |
Static Public Member Functions | |
| static IconRegistry & | shared () |
The icons, by name: the bundled sets, then what the application adds.
Path data is parsed once, the first time an icon is drawn, and its paths are kept. An unknown name, or path data that doesn't parse, draws nothing and is reported once on stderr.
|
default |
An empty registry, or one with the given sets, registered in order
| IconRegistry & psychic_ui::IconRegistry::add | ( | const IconDefinition & | definition | ) |
Registers an icon (copying its data), replacing the one of that name if there is one
| IconRegistry & psychic_ui::IconRegistry::add | ( | std::span< const IconDefinition > | set | ) |
Registers every icon of a set
| std::vector< std::string_view > psychic_ui::IconRegistry::names | ( | ) | const |
The names, in registration order
| const IconShape * psychic_ui::IconRegistry::shape | ( | std::string_view | name | ) |
The icon's paths, parsed on first use; nullptr for an unknown name or unparsable data (reported once)
|
static |
The registry Icon and paint::icon draw from, with the bundled sets