|
TachyonUI 0.1.0
High-performance UI for building tools.
|
Themes, styles, colors and gradients. More...
Namespaces | |
| namespace | tachyon::ColorConvert::detail |
Classes | |
| struct | tachyon::GradientHandle |
| Handle to a reference-counted GradientManager atlas slot. More... | |
| struct | tachyon::AtlasLocation |
| Where a handle's texels are in the atlas. More... | |
| class | tachyon::GradientManager |
| The atlas that the colors of color styles are baked into: pages of 2D textures, one row per gradient, with solid and 2..4-color blocks packed into shared rows. More... | |
| struct | tachyon::BoxEdges |
| Per-side values of the box model (margin, padding, border widths). More... | |
| struct | tachyon::BoxCorners |
| Per-corner values (border radius). More... | |
| struct | tachyon::BoxShadow |
| One CSS box-shadow layer, outside the border box. More... | |
| struct | tachyon::EdgeInset |
| Per-side offsets of a positioned element (CSS: top, right, bottom, left), in pixels. More... | |
| struct | tachyon::FlexProperties |
| Flexbox properties: the container's (direction, wrap, alignment, gap) and the item's own (grow, shrink, basis). More... | |
| struct | tachyon::GridTrack |
| Size of one grid column or row (CSS: -tachyon-grid-column-track / -row-track). More... | |
| struct | tachyon::GridAxisProperties |
| A grid item's placement and track request along one axis, plus the container's gap. More... | |
| struct | tachyon::GridProperties |
| Grid container and item properties. More... | |
| struct | tachyon::LayoutData |
| Flex / grid properties and CSS sizes of a style. Sizes are in CSS px in a Style. More... | |
| class | tachyon::ColorStyle |
| A fill: solid color, gradient or texture, as used for backgrounds, borders, text and icons. More... | |
| class | tachyon::VisualColorStyle |
| GPU form of a ColorStyle, uploaded as is: the gradient is baked into an atlas slot that colorUV / gradientPage point at. More... | |
| struct | tachyon::StyleState |
| The visual properties of one element state (normal, :hover, :active, ...). More... | |
| struct | tachyon::Style |
| A complete style, as parsed from CSS or built in code: layout properties plus the visual properties of each state, in CSS px. More... | |
| struct | tachyon::LayoutStyle |
| The layout part of a registered Style, in pixels; shared by every style with the same values. More... | |
| struct | tachyon::VisualShadow |
| A BoxShadow in pixels with its color registered. No color is no shadow. More... | |
| struct | tachyon::VisualShadowStyle |
| What a state draws on the CPU only: its shadows and its opacity. More... | |
| struct | tachyon::VisualBoxStyle |
| The box part of one state of a registered Style, in pixels; uploaded to the GPU as is (32 bytes). More... | |
| struct | tachyon::VisualTextStyle |
| The text part of one state of a registered Style, in pixels. More... | |
| struct | tachyon::ColorStop |
| Color stops for gradients. More... | |
| struct | tachyon::Gradient |
| Up to kMaxStops color stops plus an angle and interpolation color space. More... | |
| struct | tachyon::TextOverride |
| Per-element text overrides for StyleManager::WithTextOverride. More... | |
| class | tachyon::StyleManager |
| Bakes serializable Styles into deduplicated runtime layout/visual styles; a StyleRef holds indices into the (possibly shared) pools. More... | |
| struct | tachyon::StyleRef |
| A registered style, as StyleManager::Register returns it: indices into the shared style pools, cheap to copy. More... | |
| struct | tachyon::ParseError |
| A problem found while parsing a style sheet; the parser skips the bad part and goes on. More... | |
| struct | tachyon::CustomProperty |
| A resolved CSS custom property (:root { --name: value; }): a color, 1..4 numbers or a box-shadow. More... | |
| struct | tachyon::FontFace |
| One @font-face rule. Faces sharing a family name form one family. More... | |
| struct | tachyon::ChildStyles |
| A class's styles for where an element is among its parent's children, from its :first-child, :last-child and :only-child rules (box properties only). More... | |
| struct | tachyon::StyleSheet |
| A parsed style sheet: named styles, custom properties and font faces. More... | |
| struct | tachyon::LanguageTag |
| A BCP 47 language tag ("ja", "zh-Hant", "ko-KR") stored inline, so text styles stay plain values. More... | |
| class | tachyon::TextLayoutStyle |
| How a text block is laid out in its box; shared by all states of a Style. More... | |
| class | tachyon::TextDecoration |
| One text decoration line (underline, overline, ...). More... | |
| class | tachyon::TextStyle |
| What text is measured and laid out from: font, metrics and decoration lines. More... | |
| struct | tachyon::ControlStyles |
| Default control styles. More... | |
| class | tachyon::GUITheme |
| The library's styles, icons and theme metrics, the defaults the controls draw with. More... | |
Typedefs | |
| using | tachyon::VisualBoxStyleStates = VisualBoxStyle[Style::kStateCount] |
| A box style's variants, one per visual element state (Style::kStateCount). | |
| using | tachyon::VisualTextStyleStates = VisualTextStyle[Style::kStateCount] |
| A text style's variants, one per visual element state (Style::kStateCount). | |
Functions | |
| float | tachyon::ColorConvert::SRGBToLinear (float c) |
| float | tachyon::ColorConvert::LinearToSRGB (float c) |
| void | tachyon::ColorConvert::RGBtoHSV (float r, float g, float b, float &h, float &s, float &v) |
| std::array< float, 3 > | tachyon::ColorConvert::HSVtoRGB (float h, float s, float v) |
| void | tachyon::ColorConvert::RGBtoHSL (float r, float g, float b, float &h, float &s, float &l) |
| std::array< float, 3 > | tachyon::ColorConvert::HSLtoRGB (float h, float s, float l) |
| void | tachyon::ColorConvert::RGBtoLab (float r, float g, float b, float &L, float &a, float &bOut) |
| std::array< float, 3 > | tachyon::ColorConvert::LabToRGB (float L, float a, float b) |
| void | tachyon::ColorConvert::RGBtoOklab (float r, float g, float b, float &L, float &a, float &bOut) |
| std::array< float, 3 > | tachyon::ColorConvert::OklabToRGB (float L, float a, float b) |
| tachyon::TACHYON_ENUM_OPERATORS (AnchorPlacement) | |
| constexpr AnchorPlacementAxis | tachyon::FlipAxis (AnchorPlacementAxis p) |
| Mirrors a placement: Min <-> Max; Center and None are unchanged. | |
| constexpr AnchorPlacementAxis | tachyon::GetHorizontalAxis (AnchorPlacement p) |
| Horizontal part of an AnchorPlacement. | |
| constexpr AnchorPlacementAxis | tachyon::GetVerticalAxis (AnchorPlacement p) |
| Vertical part of an AnchorPlacement. | |
| constexpr AnchorPlacement | tachyon::MakeAnchorPlacement (AnchorPlacementAxis h, AnchorPlacementAxis v) |
| Combines a horizontal and a vertical placement. | |
| StyleSheet | tachyon::ParseStyleSheet (std::string_view source) |
| Parses a theme's CSS (the subset TachyonUI supports, see docs/css.md) into a StyleSheet. | |
| FontID | tachyon::FontIDFromName (std::string_view familyName) |
| Case-insensitive, like CSS family names. Returns FontID::Invalid for an empty name. | |
Variables | |
| constexpr int | tachyon::kMaxBoxShadows = 2 |
| CSS box-shadow layers per state; the first is drawn on top. | |
| constexpr int | tachyon::kMaxTextShadows = kMaxBoxShadows |
| CSS text-shadow layers per state; the first is drawn on top. | |
Themes, styles, colors and gradients.
See CSS and theming for the CSS the themes are written in.
#include <gui_core/style/gui_style_manager.h>
A box style's variants, one per visual element state (Style::kStateCount).
#include <gui_core/style/gui_style_manager.h>
A text style's variants, one per visual element state (Style::kStateCount).
|
strong |
#include <gui_core/style/gui_style.h>
Index into StyleManager's color style pool; Invalid (0) draws nothing (transparent).
| Enumerator | |
|---|---|
| Invalid | |
|
strong |
#include <gui_core/style/gui_style.h>
Interaction state bits of an element; they pick the Style::states variant it draws with.
|
strong |
#include <gui_core/style/gui_style.h>
Main axis of a flex container (CSS: flex-direction).
| Enumerator | |
|---|---|
| Row | Horizontal, left to right. |
| RowReverse | Horizontal, right to left. |
| Column | Vertical, top to bottom. |
| ColumnReverse | Vertical, bottom to top. |
|
strong |
#include <gui_core/style/gui_style.h>
Whether flex items wrap onto more lines (CSS: flex-wrap).
| Enumerator | |
|---|---|
| NoWrap | Single line. |
| Wrap | Multi-line. |
| WrapReverse | Multi-line, reversed. |
|
strong |
#include <gui_core/style/gui_style.h>
Cross-axis alignment of items (CSS: align-items, align-self).
|
strong |
#include <gui_core/style/gui_style.h>
Main-axis distribution of items (CSS: justify-content; grids also justify-items).
| Enumerator | |
|---|---|
| FlexStart | Pack to start. |
| FlexEnd | Pack to end. |
| Center | Pack to center. |
| SpaceBetween | Space between items. |
| SpaceAround | Space around items. |
| SpaceEvenly | Equal space between all items. |
|
strong |
#include <gui_core/style/gui_style.h>
Distributes cross-axis space between wrap lines (align-items aligns within a line).
Only applies when flex-wrap != NoWrap.
|
strong |
#include <gui_core/style/gui_style.h>
How an element is positioned; modeled on CSS position, but set in code, not CSS.
| Enumerator | |
|---|---|
| Relative | in flow, offset from its natural position |
| Anchored | placed relative to another element (AnchorPlacement) |
| Absolute | out of flow in content space; scrolls with the parent |
| Fixed | out of flow in overlay space; doesn't scroll with the parent |
| Centered | centered in the parent |
| Sticky | in flow like Relative, clamped to the parent's scroll viewport edge |
|
strong |
#include <gui_core/style/gui_style.h>
How an element lays out its children (CSS: display).
| Enumerator | |
|---|---|
| Flex | Flexbox container. |
| Grid | Grid container. |
| None | Not rendered, removed from layout. |
|
strong |
#include <gui_core/style/gui_style.h>
What happens to content larger than the box (CSS: overflow, overflow-x, overflow-y).
| Enumerator | |
|---|---|
| Auto | Content clipped, scrollbars shown when needed. |
| Hidden | Content clipped, no scrollbars. |
| Visible | Content not clipped. |
|
strong |
#include <gui_core/style/gui_style.h>
CSS: visibility.
| Enumerator | |
|---|---|
| Visible | Rendered normally. |
| Collapsed | Not rendered, removed from layout. |
|
strong |
#include <gui_core/style/gui_style.h>
Where an element's icon sits relative to its text (CSS: -tachyon-icon-side).
| Enumerator | |
|---|---|
| None | |
| Left | |
| Right | |
| Top | |
| Bottom | |
|
strong |
#include <gui_core/style/gui_style.h>
Where an anchored element sits relative to its target: one horizontal and one vertical AnchorPlacementAxis value, one per nibble.
Outside = beyond the target's edge, Inside = within it, Center* = centered on that edge.
|
strong |
#include <gui_core/style/gui_style.h>
Anchor placement along one axis; the 4-bit value of one AnchorPlacement nibble.
|
strong |
#include <gui_core/style/gui_style.h>
Line breaks around an item in a wrapping flex container (CSS: break-after).
|
strong |
#include <gui_core/style/gui_style.h>
Mouse cursor shown over an element (CSS: cursor).
|
strong |
#include <gui_core/style/gui_style.h>
How a ColorStyle paints a shape.
Gradient types sample the gradient ramp along a coordinate that the style's transformation and animSpeed move.
| Enumerator | |
|---|---|
| SolidColor | the first stop's color |
| StretchedTexture | Style::textureIndex stretched over the box. |
| RepeatedTexture | Style::textureIndex tiled at its pixel size. |
| LinearGradient | ramp along an axis (CSS: linear-gradient) |
| CircularAngularGradient | ramp by distance from the center |
| EllipsoidAngularGradient | ramp by distance from the center, relative to the box size |
| RadialGradient | ramp by angle around the center (CSS: radial-gradient) |
| InterpolatedTriangle | three colors blended by vertex weights |
| InterpolatedBox | four corner colors blended across the box |
| SDFGradient | ramp by depth inside the shape: 0 on its edge, 1 at its deepest point (a box's middle, a stroke's center line, a triangle's incenter); the transformation's first row maps it (t = x.x * depth + x.z), so the identity runs the ramp edge to middle |
|
strong |
#include <gui_core/style/gui_style.h>
How a style's hover and pressed backgrounds are made.
| Enumerator | |
|---|---|
| None | as the CSS gives them |
| Content | the state's text color over its background: 8% hovered, 14% pressed |
|
strong |
#include <gui_core/style/gui_style_gradient.h>
Kind of Gradient.
None marks an empty gradient; the shape a color style draws comes from ColorStyle::type.
| Enumerator | |
|---|---|
| None | |
| Linear | |
| Radial | |
|
strong |
#include <gui_core/style/gui_style_gradient.h>
The space gradient stops are interpolated in.
| Enumerator | |
|---|---|
| sRGB | the default, as CSS |
| LinearRGB | |
| HSL | |
| HSV | |
| Lab | CIE Lab, perceptual. |
| Oklab | perceptual |
|
strong |
#include <gui_core/style/gui_style_manager.h>
Units of a style's metrics: CSS pixels (scaled to the UI) or final pixels.
| Enumerator | |
|---|---|
| Css | |
| Pixels | |
|
strong |
#include <gui_core/style/gui_style_ref.h>
Index into StyleManager's layout style pool; Invalid (0) = none.
| Enumerator | |
|---|---|
| Invalid | |
|
strong |
#include <gui_core/style/gui_style_ref.h>
Index into StyleManager's visual box style pool; Invalid (0) = none.
| Enumerator | |
|---|---|
| Invalid | |
|
strong |
#include <gui_core/style/gui_style_ref.h>
Index into StyleManager's visual text style pool; Invalid (0) = none.
| Enumerator | |
|---|---|
| Invalid | |
|
strong |
#include <gui_core/style/gui_style_text.h>
Handle for text registered with the text system (ITextSystem::RegisterText and friends).
| Enumerator | |
|---|---|
| Invalid | |
|
strong |
#include <gui_core/style/gui_style_text.h>
Handle for an icon registered with ITextSystem::RegisterIconFromSVG / RegisterIconFromSVGFile.
| Enumerator | |
|---|---|
| Invalid | |
|
strong |
#include <gui_core/style/gui_style_text.h>
Handle for a font family registered with ITextSystem::RegisterFontFamily().
Derived from the family name, so styles can name a family before it is registered. Use FontID::Invalid for the default / family-based font selection.
| Enumerator | |
|---|---|
| Invalid | |
|
strong |
#include <gui_core/style/gui_style_text.h>
Writing direction of text (CSS: direction).
| Enumerator | |
|---|---|
| Auto | inferred from the text |
| LeftToRight | |
| RightToLeft | |
|
strong |
#include <gui_core/style/gui_style_text.h>
How text wraps in its box (CSS: text-wrap).
|
strong |
#include <gui_core/style/gui_style_text.h>
Alignment of text in its box (CSS: text-align, -tachyon-vertical-text-align).
|
strong |
#include <gui_core/style/gui_style_text.h>
Font baseline that text aligns on (TextLayoutStyle::baseline).
|
strong |
#include <gui_core/style/gui_style_text.h>
Line style of a TextDecoration.
| Enumerator | |
|---|---|
| Solid | solid line |
| Double | double line |
| Dotted | dotted line |
| Dashed | dashed line |
| Wavy | wavy line |
|
strong |
#include <gui_core/style/gui_style_text.h>
Generic font family, used when TextStyle::fontId names no registered family.
| Enumerator | |
|---|---|
| Default | the text system's default family |
| Emoji | emoji; assigned to emoji automatically |
| SansSerif | sans-serif |
| Serif | serif |
| Monospace | monospace |
| Math | math |
|
strong |
#include <gui_core/style/gui_style_text.h>
Font weight (CSS: font-weight); the CSS weight is in parentheses.
|
strong |
#include <gui_core/style/gui_style_text.h>
Font slant (CSS: font-style).
| Enumerator | |
|---|---|
| Normal | upright |
| Italic | italic |
| Oblique | oblique |
|
strong |
#include <gui_core/style/gui_style_text.h>
Font width (CSS: font-stretch); the width factor is in parentheses.
|
strong |
#include <gui_core/style/gui_style_text.h>
How TextStyle::lineHeight is read.
| Enumerator | |
|---|---|
| Normal | the font's metrics; lineHeight is ignored |
| MetricsRelative | a multiple of the font's metric line height |
| FontSizeRelative | a multiple of the font size |
| Absolute | the value itself |
|
strong |
#include <gui_core/style/gui_style_text.h>
Font metrics that bound a line for vertical alignment (CSS: -tachyon-vertical-trim).
| Enumerator | |
|---|---|
| Default | ascender to descender; leaves room for accents |
| CapToBaseline | cap height to baseline; tight, visually centered for widgets |
|
strong |
#include <gui_core/style/gui_style_text.h>
Word wrapping mode of TextLayoutStyle::wrapMode.
The text system doesn't read it; wrapping is set by TextLayoutStyle::textWrapping (TextWrap).
| Enumerator | |
|---|---|
| None | single line |
| Normal | break at word boundaries |
| BreakWord | break within words when needed |
|
strong |
#include <gui_core/style/gui_style_text.h>
What happens to text that doesn't fit its box (CSS: text-overflow).
| Enumerator | |
|---|---|
| Clip | clip the text |
| Ellipsis | end with "..." |
|
strong |
#include <gui_core/style/gui_style_text.h>
The decoration lines of a TextStyle; indexes StyleState::decorationColors.
| Enumerator | |
|---|---|
| Under | |
| Bottom | |
| Over | |
| Through | |
|
inline |
#include <gui_core/style/gui_color_conversions.h>
|
inline |
#include <gui_core/style/gui_color_conversions.h>
|
inline |
#include <gui_core/style/gui_color_conversions.h>
|
inline |
#include <gui_core/style/gui_color_conversions.h>
|
inline |
#include <gui_core/style/gui_color_conversions.h>
|
inline |
#include <gui_core/style/gui_color_conversions.h>
|
inline |
#include <gui_core/style/gui_color_conversions.h>
|
inline |
#include <gui_core/style/gui_color_conversions.h>
|
inline |
#include <gui_core/style/gui_color_conversions.h>
|
inline |
#include <gui_core/style/gui_color_conversions.h>
| tachyon::TACHYON_ENUM_OPERATORS | ( | AnchorPlacement | ) |
#include <gui_core/style/gui_style.h>
|
constexpr |
#include <gui_core/style/gui_style.h>
Mirrors a placement: Min <-> Max; Center and None are unchanged.
|
constexpr |
#include <gui_core/style/gui_style.h>
Horizontal part of an AnchorPlacement.
|
constexpr |
#include <gui_core/style/gui_style.h>
Vertical part of an AnchorPlacement.
|
constexpr |
#include <gui_core/style/gui_style.h>
Combines a horizontal and a vertical placement.
| StyleSheet tachyon::ParseStyleSheet | ( | std::string_view | source | ) |
#include <gui_core/style/gui_style_sheet.h>
Parses a theme's CSS (the subset TachyonUI supports, see docs/css.md) into a StyleSheet.
Errors don't stop it: a bad declaration or rule is skipped and reported in StyleSheet::errors, and the rest is parsed.
| FontID tachyon::FontIDFromName | ( | std::string_view | familyName | ) |
#include <gui_core/style/gui_style_text.h>
Case-insensitive, like CSS family names. Returns FontID::Invalid for an empty name.
|
inlineconstexpr |
#include <gui_core/style/gui_style.h>
CSS box-shadow layers per state; the first is drawn on top.
|
inlineconstexpr |
#include <gui_core/style/gui_style.h>
CSS text-shadow layers per state; the first is drawn on top.