|
| bool | morph::ui::isIconName (std::string_view name) |
| | Whether name is an icon name: [a-z][a-z0-9.-]{0,63}.
|
| std::string_view | morph::ui::iconGlyph (std::string_view name) |
| | The glyph a text renderer draws for a framework icon name.
|
| std::optional< double > | morph::ui::detail::numberOf (Json const &json) |
| | A number of a JSON value.
|
| Json const * | morph::ui::detail::memberOf (Json::object_t const &object, std::string_view name) |
| | A member of a JSON object.
|
| std::optional< double > | morph::ui::detail::pixelsOf (Json const &json) |
| | A DTCG dimension value in px.
|
| std::optional< Rgba > | morph::ui::detail::hexColor (std::string_view text) |
| | Reads #rgb, #rrggbb or #rrggbbaa.
|
| std::optional< std::uint8_t > | morph::ui::detail::channelOf (double const value) |
| | A channel from 0 to 1, as 8 bits.
|
| std::optional< std::string_view > | morph::ui::detail::aliasOf (std::string_view text) |
| | Whether a string is an alias, {a.b}.
|
| bool | morph::ui::detail::holdsAlias (Json const &json) |
| | Whether a value holds an alias anywhere.
|
| std::optional< std::string > | morph::ui::detail::checkTokenValue (std::string_view type, Json const &value) |
| | Whether a resolved value has its type's shape.
|
| std::optional< Rgba > | morph::ui::colorOf (Json const &json) |
| | Reads a colour value: #rgb, #rrggbb, #rrggbbaa, or the DTCG 2025.10 object, by its hex or by its srgb components (0 to 1) and alpha.
|
| std::optional< std::string > | morph::ui::detail::checkMeasure (std::string_view type, Json const &value) |
| | Checks a dimension or a duration: an object of a number value and a known unit.
|
| std::optional< std::string > | morph::ui::detail::checkFontFamily (Json const &value) |
| | Checks a fontFamily: a name, or a non-empty list of names.
|
| std::optional< std::string > | morph::ui::detail::checkFontWeight (Json const &value) |
| | Checks a fontWeight: 1 to 1000, or a DTCG weight name.
|
| std::optional< std::string > | morph::ui::detail::checkShadow (Json const &value) |
| | Checks a shadow: an object of a color and the dimensions offsetX, offsetY, blur and spread, or a non-empty list of them.
|
| std::string | morph::ui::detail::joined (std::initializer_list< std::string_view > parts) |
| | Joins text, for a refusal built inside a loop.
|
| std::expected< std::string, std::string > | morph::ui::detail::declaredType (Json::object_t const &object, std::string_view where, std::string const &inherited) |
| | The $type an object declares, or the one it inherits.
|
| std::optional< std::string > | morph::ui::detail::readToken (std::string const &path, Json::object_t const &object, Json const &value, std::string const &type, TokenSet &out) |
| | Reads one token into out.
|
| std::optional< std::string > | morph::ui::detail::checkMemberName (std::string const &prefix, std::string const &name) |
| | Refuses a member name a token file may not have.
|
| std::optional< std::string > | morph::ui::detail::readGroup (Json::object_t const &group, std::string const &prefix, std::string const &inherited, TokenSet &out) |
| | Reads the tokens of one group into out.
|
| std::optional< std::string > | morph::ui::detail::readThemeMap (Json::object_t const &index, std::string_view key, std::map< std::string, std::string, std::less<> > &out) |
| | Reads a map of name to file id from a theme index.
|
| std::optional< std::string > | morph::ui::detail::readIcons (Json::object_t const &index, std::map< std::string, std::string, std::less<> > &out) |
| | Reads a theme index's icons: an object of icon name (isIconName) to icon file id, at most kMaxThemeIcons names.
|
| bool | morph::ui::isThemeIndex (std::string_view text) |
| | Whether a theme file is a theme index rather than a token file: its top level has a string vocab.
|
| std::expected< TokenSet, std::string > | morph::ui::parseTokens (std::string_view text) |
| | Parses a DTCG 2025.10 token file.
|
| std::expected< TokenSet, std::string > | morph::ui::resolveTokens (std::vector< TokenSet const * > const &layers) |
| | Layers token files, later ones winning per path, and resolves every alias.
|
| std::expected< ThemeIndex, std::string > | morph::ui::parseThemeIndex (std::string_view text) |
| | Parses a theme index: {"vocab": "ui-theme/1", "base": id, "dark": id, …, "density": {...},
"surfaces": {...}, "icons": {...}}.
|
| std::expected< TokenSet, std::string > | morph::ui::resolveTheme (ThemeIndex const &index, TokenFileLookup const &files, std::string_view variant, std::string_view density, std::string_view surface) |
| | Resolves one combination of a theme: base, then the variant, the density and the surface, each optional.
|
| std::optional< std::string > | morph::ui::checkTheme (ThemeIndex const &index, TokenFileLookup const &files) |
| | Checks that every combination of a theme resolves: each variant (or none), density (or none) and surface (or none) over base.
|
| std::optional< ThemeShadow > | morph::ui::detail::shadowOf (Json const &json) |
| | A checked shadow value as a ThemeShadow; of a list of layers, the first.
|
| std::vector< std::string > | morph::ui::detail::familiesOf (Json const &json) |
| | A checked fontFamily value as its names, in order: one name, or a list of them.
|
| Token const * | morph::ui::detail::tokenAt (TokenSet const &resolved, std::string_view path) |
| | A resolved theme's token at a path.
|
| std::vector< std::string > | morph::ui::detail::familyValue (ThemeTokenSpec const &spec, Token const *found) |
| | A font.family token's value: the theme's names when it has the token as a fontFamily, else the default.
|
| ThemeValues | morph::ui::themeValues (TokenSet const &resolved={}) |
| | Fills the closed ui-theme/1 set from a resolved theme.
|
|
| constexpr std::string_view | morph::ui::kThemeVocabulary = "ui-theme/1" |
| | The vocabulary of a theme index.
|
| constexpr std::size_t | morph::ui::kMaxThemeTokens = 16384 |
| | The most tokens one token file may hold.
|
| constexpr std::size_t | morph::ui::kMaxThemeVariants = 16 |
| | The most variants, densities or surfaces a theme index may list, each.
|
| constexpr std::size_t | morph::ui::kMaxThemeIcons = 256 |
| | The most names a theme index's icon set may hold.
|
| constexpr std::array< std::string_view, 11 > | morph::ui::kFrameworkIcons |
| | The icon names the built-in components draw: an empty state without an icon of its own, a banner's tone, a chevron that opens and closes, a close button, and a date input's calendar. A bundle's icon set replaces any of them by name.
|
| constexpr std::size_t | morph::ui::kMaxAliasChain = 64 |
| | The longest chain of aliases a token may resolve through.
|
| constexpr double | morph::ui::detail::kPixelsPerRem = 16.0 |
| | How many px a rem is: the default root font size, which the renderers do not change.
|
| constexpr std::array< std::string_view, 13 > | morph::ui::detail::kKnownTokenTypes |
| | The types the client checks; a token of another $type the client still knows is accepted unchecked.
|
| constexpr std::array< std::string_view, 18 > | morph::ui::detail::kFontWeights |
| | The named font weights of DTCG.
|
| constexpr std::array< ThemeTokenSpec, 40 > | morph::ui::kThemeTokens |
| | The closed ui-theme/1 token set, with the MorphUi defaults: the colour roles, the opacity and the spacing scale (space.0 to space.5, one per spacing step) the built-in components read, and the semantic sets (ok, warn, err, info with bg, border and dot).
|
Theme tokens (ui-theme/1, spec 6 §6): DTCG 2025.10 token files read and checked, layered into a variant, their aliases resolved, and the closed ui-theme/1 set filled from them with its defaults. No toolkit: the Qt Quick renderer applies the result (qt_quick::applyTheme).
Specified in docs/spec/ui/theme.md.
Definition in file theme.hpp.