|
TachyonUI 1.1.0
High-performance UI for building tools.
|
A parsed style sheet: named styles, custom properties and font faces. More...
#include <gui_core/style/gui_style_sheet.h>
Public Member Functions | |
| bool | HasErrors () const |
| True when parsing reported any error. | |
| const Style * | GetStyle (std::string_view name) const |
| The style of a class name (without the '.'); nullptr when not defined. | |
| const CustomProperty * | GetCustomProperty (std::string_view name) const |
| A custom property by name (with the leading "--"); nullptr when not defined. | |
| const CustomPropertyInfo * | GetPropertyInfo (std::string_view name) const |
| The @property rule's facts for a custom property (with the leading "--"); nullptr when it has none. | |
Public Attributes | |
| std::unordered_map< std::string, Style > | styles |
| keyed by class name, without the '. | |
| std::unordered_map< std::string, ChildStyles > | childStyles |
| The classes with :first-child / :last-child / :only-child rules; register them with StyleManager::RegisterWithChildStyles. | |
| std::unordered_map< std::string, CustomProperty > | customProperties |
| keyed by name including the leading "--" | |
| std::vector< CustomPropertyInfo > | propertyInfos |
| What the @property rules say about the custom properties, in source order; a second rule for a name replaces the first in its place. | |
| std::vector< std::string > | colorVariables |
| The custom properties whose colors the styles use, numbered from 1 in this order: ColorStyle::variable of a color taken from var(--name) is its number. | |
| std::vector< FontFace > | fontFaces |
| in source order | |
| Style | baseStyle |
| what * rules set; styles start from it | |
| std::vector< ParseError > | errors |
| in the order found | |
A parsed style sheet: named styles, custom properties and font faces.
Register a style with StyleManager::Register to use it.
|
inline |
True when parsing reported any error.
| const Style * tachyon::StyleSheet::GetStyle | ( | std::string_view | name | ) | const |
The style of a class name (without the '.'); nullptr when not defined.
| const CustomProperty * tachyon::StyleSheet::GetCustomProperty | ( | std::string_view | name | ) | const |
A custom property by name (with the leading "--"); nullptr when not defined.
| const CustomPropertyInfo * tachyon::StyleSheet::GetPropertyInfo | ( | std::string_view | name | ) | const |
The @property rule's facts for a custom property (with the leading "--"); nullptr when it has none.
| std::unordered_map<std::string, Style> tachyon::StyleSheet::styles |
keyed by class name, without the '.
'
| std::unordered_map<std::string, ChildStyles> tachyon::StyleSheet::childStyles |
The classes with :first-child / :last-child / :only-child rules; register them with StyleManager::RegisterWithChildStyles.
| std::unordered_map<std::string, CustomProperty> tachyon::StyleSheet::customProperties |
keyed by name including the leading "--"
| std::vector<CustomPropertyInfo> tachyon::StyleSheet::propertyInfos |
What the @property rules say about the custom properties, in source order; a second rule for a name replaces the first in its place.
| std::vector<std::string> tachyon::StyleSheet::colorVariables |
The custom properties whose colors the styles use, numbered from 1 in this order: ColorStyle::variable of a color taken from var(--name) is its number.
| std::vector<FontFace> tachyon::StyleSheet::fontFaces |
in source order
| Style tachyon::StyleSheet::baseStyle |
what * rules set; styles start from it
| std::vector<ParseError> tachyon::StyleSheet::errors |
in the order found