TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
gui_style.h File Reference

Go to the source code of this file.

Classes

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::Style::States
 A style's states, indexed by ElementState (or by slot number). 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...

Namespaces

namespace  tachyon

Enumerations

enum class  tachyon::VisualColorStyleIndex : uint16_t { tachyon::VisualColorStyleIndex::Invalid = 0 }
 Index into StyleManager's color style pool; Invalid (0) draws nothing (transparent). More...
enum class  tachyon::ElementState : uint8_t {
  tachyon::ElementState::None = 0 , tachyon::ElementState::Active = 1 << 0 , tachyon::ElementState::Hover = 1 << 1 , tachyon::ElementState::Focused = 1 << 2 ,
  tachyon::ElementState::Selected = 1 << 3 , tachyon::ElementState::Selection = 1 << 4 , tachyon::ElementState::Disabled = 1 << 5 , tachyon::ElementState::Invalid = 1 << 6 ,
  tachyon::ElementState::VisualMask = Active | Hover | Focused | Selected | Selection | Disabled
}
 Interaction state bits of an element; they pick the Style::states variant it draws with. More...
enum class  tachyon::FlexDirection : uint8_t { tachyon::FlexDirection::Row , tachyon::FlexDirection::RowReverse , tachyon::FlexDirection::Column , tachyon::FlexDirection::ColumnReverse }
 Main axis of a flex container (CSS: flex-direction). More...
enum class  tachyon::FlexWrap : uint8_t { tachyon::FlexWrap::NoWrap , tachyon::FlexWrap::Wrap , tachyon::FlexWrap::WrapReverse }
 Whether flex items wrap onto more lines (CSS: flex-wrap). More...
enum class  tachyon::AlignItems : uint8_t {
  tachyon::AlignItems::Auto , tachyon::AlignItems::FlexStart , tachyon::AlignItems::FlexEnd , tachyon::AlignItems::Center ,
  tachyon::AlignItems::Stretch
}
 Cross-axis alignment of items (CSS: align-items, align-self). More...
enum class  tachyon::JustifyContent : uint8_t {
  tachyon::JustifyContent::FlexStart , tachyon::JustifyContent::FlexEnd , tachyon::JustifyContent::Center , tachyon::JustifyContent::SpaceBetween ,
  tachyon::JustifyContent::SpaceAround , tachyon::JustifyContent::SpaceEvenly
}
 Main-axis distribution of items (CSS: justify-content; grids also justify-items). More...
enum class  tachyon::AlignContent : uint8_t {
  tachyon::AlignContent::FlexStart , tachyon::AlignContent::FlexEnd , tachyon::AlignContent::Center , tachyon::AlignContent::Stretch ,
  tachyon::AlignContent::SpaceBetween , tachyon::AlignContent::SpaceAround , tachyon::AlignContent::SpaceEvenly
}
 Distributes cross-axis space between wrap lines (align-items aligns within a line). More...
enum class  tachyon::PositionType : uint8_t {
  tachyon::PositionType::Relative , tachyon::PositionType::Anchored , tachyon::PositionType::Absolute , tachyon::PositionType::Fixed ,
  tachyon::PositionType::Centered , tachyon::PositionType::Sticky
}
 How an element is positioned; modeled on CSS position, but set in code, not CSS. More...
enum class  tachyon::Display : uint8_t { tachyon::Display::Flex , tachyon::Display::Grid , tachyon::Display::None }
 How an element lays out its children (CSS: display). More...
enum class  tachyon::Overflow : uint8_t { tachyon::Overflow::Auto , tachyon::Overflow::Hidden , tachyon::Overflow::Visible }
 What happens to content larger than the box (CSS: overflow, overflow-x, overflow-y). More...
enum class  tachyon::Visibility : uint8_t { tachyon::Visibility::Visible , tachyon::Visibility::Collapsed }
 CSS: visibility. More...
enum class  tachyon::IconSide : uint8_t {
  tachyon::IconSide::None = 0 , tachyon::IconSide::Left , tachyon::IconSide::Right , tachyon::IconSide::Top ,
  tachyon::IconSide::Bottom
}
 Where an element's icon sits relative to its text (CSS: -tachyon-icon-side). More...
enum class  tachyon::AnchorPlacement : uint8_t {
  tachyon::AnchorPlacement::None = 0 , tachyon::AnchorPlacement::OutsideLeft = (1 << 0) , tachyon::AnchorPlacement::CenterLeft = (2 << 0) , tachyon::AnchorPlacement::InsideLeft = (3 << 0) ,
  tachyon::AnchorPlacement::CenterHorz = (4 << 0) , tachyon::AnchorPlacement::InsideRight = (5 << 0) , tachyon::AnchorPlacement::CenterRight = (6 << 0) , tachyon::AnchorPlacement::OutsideRight = (7 << 0) ,
  tachyon::AnchorPlacement::HorizontalMask = (0xF << 0) , tachyon::AnchorPlacement::OutsideTop = (1 << 4) , tachyon::AnchorPlacement::CenterTop = (2 << 4) , tachyon::AnchorPlacement::InsideTop = (3 << 4) ,
  tachyon::AnchorPlacement::CenterVert = (4 << 4) , tachyon::AnchorPlacement::InsideBottom = (5 << 4) , tachyon::AnchorPlacement::CenterBottom = (6 << 4) , tachyon::AnchorPlacement::OutsideBottom = (7 << 4) ,
  tachyon::AnchorPlacement::VerticalMask = (0xF << 4) , tachyon::AnchorPlacement::CenterCenter = CenterHorz | CenterVert , tachyon::AnchorPlacement::InsideTopLeft = InsideTop | InsideLeft , tachyon::AnchorPlacement::InsideTopRight = InsideTop | InsideRight ,
  tachyon::AnchorPlacement::InsideBottomLeft = InsideBottom | InsideLeft , tachyon::AnchorPlacement::InsideBottomRight = InsideBottom | InsideRight , tachyon::AnchorPlacement::OutsideTopLeft = OutsideTop | OutsideLeft , tachyon::AnchorPlacement::OutsideTopRight = OutsideTop | OutsideRight ,
  tachyon::AnchorPlacement::OutsideBottomLeft = OutsideBottom | OutsideLeft , tachyon::AnchorPlacement::OutsideBottomRight = OutsideBottom | OutsideRight
}
 Where an anchored element sits relative to its target: one horizontal and one vertical AnchorPlacementAxis value, one per nibble. More...
enum class  tachyon::AnchorPlacementAxis : uint8_t {
  tachyon::AnchorPlacementAxis::None = 0 , tachyon::AnchorPlacementAxis::OutsideMin = 1 , tachyon::AnchorPlacementAxis::CenterMin = 2 , tachyon::AnchorPlacementAxis::InsideMin = 3 ,
  tachyon::AnchorPlacementAxis::Center = 4 , tachyon::AnchorPlacementAxis::InsideMax = 5 , tachyon::AnchorPlacementAxis::CenterMax = 6 , tachyon::AnchorPlacementAxis::OutsideMax = 7
}
 Anchor placement along one axis; the 4-bit value of one AnchorPlacement nibble. More...
enum class  tachyon::BreakBehavior : uint8_t { tachyon::BreakBehavior::Auto , tachyon::BreakBehavior::Always , tachyon::BreakBehavior::Before , tachyon::BreakBehavior::Avoid }
 Line breaks around an item in a wrapping flex container (CSS: break-after). More...
enum class  tachyon::MouseCursor : uint8_t {
  tachyon::MouseCursor::Default , tachyon::MouseCursor::Text , tachyon::MouseCursor::Wait , tachyon::MouseCursor::Crosshair ,
  tachyon::MouseCursor::Pointer , tachyon::MouseCursor::ColResize , tachyon::MouseCursor::RowResize , tachyon::MouseCursor::EwResize ,
  tachyon::MouseCursor::NsResize , tachyon::MouseCursor::NwseResize , tachyon::MouseCursor::NeswResize , tachyon::MouseCursor::Move ,
  tachyon::MouseCursor::NotAllowed , tachyon::MouseCursor::None
}
 Mouse cursor shown over an element (CSS: cursor). More...
enum class  tachyon::ColorType : uint16_t {
  tachyon::ColorType::SolidColor = 0 , tachyon::ColorType::StretchedTexture = 1 , tachyon::ColorType::RepeatedTexture = 2 , tachyon::ColorType::LinearGradient = 3 ,
  tachyon::ColorType::CircularAngularGradient = 4 , tachyon::ColorType::EllipsoidAngularGradient = 5 , tachyon::ColorType::RadialGradient = 6 , tachyon::ColorType::InterpolatedTriangle = 7 ,
  tachyon::ColorType::InterpolatedBox = 8 , tachyon::ColorType::SDFGradient = 9
}
 How a ColorStyle paints a shape. More...
enum class  tachyon::StateLayer : uint8_t { tachyon::StateLayer::None , tachyon::StateLayer::Content }
 How a style's hover and pressed backgrounds are made. More...

Functions

 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.

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.