|
ZenitUI
Retained-mode C++20 UI framework
|
Base node types (Layout, TLayout), per-instance context (UIContext), units, input, Drag & Drop, cursors, and scrolling. More...
Namespaces | |
| namespace | ZenitUI::Colors |
| Named color constants. | |
| namespace | ZenitUI::Key |
| Global viewport metrics, updated once per frame from the platform. | |
Classes | |
| struct | ZenitUI::Vec2 |
| 2D vector with component-wise arithmetic. More... | |
| struct | ZenitUI::Vec3 |
| 3D vector. More... | |
| struct | ZenitUI::Vec4 |
| 4D vector with an implicit w = 1 default. More... | |
| struct | ZenitUI::Rect |
| Axis-aligned rectangle in screen coordinates. More... | |
| struct | ZenitUI::EdgeInsets |
| Four-sided edge inset (used for padding, margin, borders). More... | |
| struct | ZenitUI::Color |
| 8-bit-per-channel RGBA color, non-premultiplied. More... | |
| struct | ZenitUI::Vertex2D |
| Interleaved 2D vertex passed to IRenderer::drawGeometry. More... | |
| struct | ZenitUI::TextureHandle |
| Opaque handle to a GPU/software texture owned by the asset provider. More... | |
| struct | ZenitUI::FontHandle |
| Opaque handle to a font loaded by TextEngine. More... | |
| struct | ZenitUI::EffectHandle |
| Opaque handle to a shader/effect owned by the asset provider. More... | |
| struct | ZenitUI::TargetHandle |
| Opaque handle to an off-screen render target. More... | |
| struct | ZenitUI::NineSlice |
| Nine-slice inset values for scalable textures. More... | |
| struct | ZenitUI::Transform2D |
| 2D affine transform stored as pivot + translate + rotation + scale. More... | |
| class | ZenitUI::FontStack |
| Ordered list of font family names to try, first match wins. More... | |
| struct | ZenitUI::ButtonState |
| Per-button state snapshot for the current frame. More... | |
| struct | ZenitUI::PointerState |
| Pointer position, wheel delta, and per-button state for one frame. More... | |
| struct | ZenitUI::ModifierState |
| Keyboard modifier snapshot. More... | |
| struct | ZenitUI::InputEvents |
| One frame's worth of keyboard input. More... | |
| struct | ZenitUI::InputController |
| Stateless per-node input dispatcher. More... | |
| struct | ZenitUI::NodeState |
| Per-frame interaction flags derived from pointer / keyboard state. More... | |
| struct | ZenitUI::NodeConfig |
| Static configuration bits: interaction behaviour, render behaviour. More... | |
| struct | ZenitUI::NodeInternal |
| Transient bookkeeping bits used by the layout / style / culling passes. More... | |
| struct | ZenitUI::DragHandlers |
| Lazily allocated Drag & Drop callbacks owned by Layout (§5.22). More... | |
| class | ZenitUI::Layout |
| The base node type: tree, style, layout, input, scroll, render. More... | |
| class | ZenitUI::TLayout< Derived, Base > |
| CRTP base for components that want fluent builders and a static create() factory. More... | |
| struct | ZenitUI::ScrollController |
| Per-node overflow, scrolling and scrollbar state machine. More... | |
| struct | ZenitUI::ScrollState |
| Offset, bounds, velocity and drag anchors for one scroll container. More... | |
| class | ZenitUI::SmallVector< T, N > |
A vector whose first N elements live inside the object. More... | |
| struct | ZenitUI::FontMetrics |
| Scaled vertical metrics for a font at a given logical pixel size. More... | |
| struct | ZenitUI::TextMeasureSpec |
| Typographic parameters governing shaping and measurement. More... | |
| struct | ZenitUI::TextLayoutOptions |
| Wrapping, truncation, and whitespace options for TextEngine::layout. More... | |
| struct | ZenitUI::ShapedGlyph |
| Single shaped glyph positioned along a laid-out line. More... | |
| struct | ZenitUI::TextLine |
| One visual line produced by TextEngine::layout. More... | |
| struct | ZenitUI::TextLayout |
| Complete laid-out text block ready for sizing, hit-testing, and rendering. More... | |
| struct | ZenitUI::TextAtlasStats |
| Diagnostic counters for the dynamic FreeType glyph atlas. More... | |
| class | ZenitUI::TextEngine |
| Per-context font store, HarfBuzz shaper, FreeType glyph atlas, and layout engine. More... | |
| class | ZenitUI::IRenderer |
| Abstract 2D rendering backend. More... | |
| class | ZenitUI::IPlatform |
| Abstract windowing, timing, input, and clipboard backend. More... | |
| class | ZenitUI::IAssetProvider |
| Abstract name-based lookup and runtime lifecycle for textures and shaders. More... | |
| struct | ZenitUI::RenderStats |
| Per-frame and live render-target / filter counters (Proposal 9, Step 0). More... | |
| class | ZenitUI::TargetPool |
| Shared, bucket-sized render-target pool owned by UIContext (§4.9 Step c). More... | |
| struct | ZenitUI::DragPayload |
| Opaque user payload carried during an active drag-and-drop operation. More... | |
| struct | ZenitUI::ActiveDrag |
| Per-context state tracking a pending or active drag operation. More... | |
| struct | ZenitUI::UIContext |
| Per-instance UI context: backends, theme, text engine, frame state, and routing. More... | |
| struct | ZenitUI::Value |
| 8-byte tagged length expression: More... | |
Enumerations | |
| enum class | ZenitUI::MouseButton : uint8_t { Left , Right , Middle , Count } |
| Mouse buttons tracked by the input system. More... | |
| enum class | ZenitUI::Align : uint8_t { Align::Auto , Align::Start , Align::Center , Align::End , Align::Stretch } |
| Cross-axis alignment for flex items and content. More... | |
| enum class | ZenitUI::Justify : uint8_t { Justify::Start , Justify::Center , Justify::End , Justify::SpaceBetween } |
| Main-axis distribution for flex containers. More... | |
| enum class | ZenitUI::Feature { Feature::Effects , Feature::NestedTargets , Feature::TargetSubRect } |
| Optional renderer capabilities queried via IRenderer::supports. More... | |
| enum class | ZenitUI::ShaderLanguage { ShaderLanguage::None , ShaderLanguage::GLSL330 , ShaderLanguage::GLSL300ES , ShaderLanguage::SPIRV , ShaderLanguage::HLSL , ShaderLanguage::MSL , ShaderLanguage::WGSL } |
| Shading language consumed by an IRenderer that supports Feature::Effects. More... | |
| enum class | ZenitUI::BlendMode { BlendMode::Alpha , BlendMode::Premultiplied , BlendMode::Replace } |
| Color-blending mode used by IRenderer draw calls. More... | |
| enum class | ZenitUI::LayoutType : uint8_t { LayoutType::Stack , LayoutType::Vertical , LayoutType::Horizontal , LayoutType::Grid } |
| Positioning strategy applied to a Layout node's direct children. More... | |
| enum class | ZenitUI::UIState : uint8_t { UIState::Idle , UIState::Hover , UIState::Pressed , UIState::Disabled } |
| Interaction state computed per node and consumed by the style resolver to select pseudo-class overlays. More... | |
| enum class | ZenitUI::CursorShape : uint8_t { CursorShape::Auto , CursorShape::Default , CursorShape::Pointer , CursorShape::Text , CursorShape::Move , CursorShape::Grab , CursorShape::Grabbing , CursorShape::ResizeEW , CursorShape::ResizeNS , CursorShape::ResizeNESW , CursorShape::ResizeNWSE , CursorShape::NotAllowed , CursorShape::Crosshair , CursorShape::Wait } |
| Standard OS cursor shapes requested via ZStyle cursor: and IPlatform::setCursor. More... | |
| enum class | ZenitUI::TextDirection : uint8_t { TextDirection::Auto , TextDirection::LTR , TextDirection::RTL } |
| Inline / layout writing direction for Bidi text and RTL layout mirroring (§6.2). More... | |
| enum class | Unit : int8_t { Auto = -1 , Number = 0 , Pixel = 1 , Percent = 2 , VW = 3 , VH = 4 , PW = 5 , PH = 6 } |
| enum class | ValueOp : uint8_t { None , Add , Sub , Mul , Div , Min , Max , Clamp , Round , Floor , Ceil , Mod } |
Functions | |
| Vec2 | ZenitUI::operator+ (Vec2 a, Vec2 b) |
| Vec2 | ZenitUI::operator- (Vec2 a, Vec2 b) |
| Vec2 | ZenitUI::operator* (Vec2 a, float k) |
| Vec2 | ZenitUI::applyTransform (const Transform2D &t, Vec2 p) |
| Apply a Transform2D to a point. | |
| Vec2 | ZenitUI::applyInverseTransform (const Transform2D &t, Vec2 p) |
| Invert a Transform2D and apply it to a point. | |
| bool | ZenitUI::nodeMatchesAtom (const Layout *node, SimpleSelector::Kind kind, const std::string &name, const std::vector< std::pair< SimpleSelector::Kind, std::string > > &extras, bool reqHover, bool reqPressed, bool reqFocus, bool reqDisabled, bool reqChecked) |
| bool | ZenitUI::nodeMatchesSimple (const Layout *node, const SimpleSelector &ss) |
true if node matches the primary selector, all extras, and none of its :not() clauses. | |
| const Layout * | ZenitUI::previousStyleSibling (const Layout *node) |
Return the immediately preceding non-sentinel sibling of node, or nullptr. | |
| bool | ZenitUI::matchSelectorChainAt (const std::vector< SimpleSelector > &chain, size_t idx, const Layout *node) |
| bool | ZenitUI::ruleMatches (const ThemeRule &r, const Layout *node, Vec2 viewport) |
true if node matches the full rule selector chain ( , >, +, ~, :not()). | |
| Value | ZenitUI::Auto () noexcept |
| Value | ZenitUI::Px (float p) noexcept |
| Value | ZenitUI::Percent (float p) noexcept |
| Value | ZenitUI::VW (float p) noexcept |
| Value | ZenitUI::VH (float p) noexcept |
| Value | ZenitUI::PW (float p) noexcept |
| Value | ZenitUI::PH (float p) noexcept |
| Value | ZenitUI::Num (float p) noexcept |
Base node types (Layout, TLayout), per-instance context (UIContext), units, input, Drag & Drop, cursors, and scrolling.
Every UI element is a std::shared_ptr<ZenitUI::Layout>. Always allocate nodes through TLayout<Derived>::create() or std::make_shared<Layout> so shared_from_this() is valid.
Key concepts:
Live examples: 02_layout_flex · 15_grid_dashboard · 09_drag_drop · 10_overlays_cursors · 13_i18n_rtl
|
strong |
|
strong |
Color-blending mode used by IRenderer draw calls.
|
strong |
Standard OS cursor shapes requested via ZStyle cursor: and IPlatform::setCursor.
|
strong |
Optional renderer capabilities queried via IRenderer::supports.
Backends that only implement core 2D drawing can return false for all features; ZenitUI will skip shader and off-screen layer passes gracefully. See Writing a Custom Backend for details.
|
strong |
|
strong |
Positioning strategy applied to a Layout node's direct children.
Determines how Layout::measure, Layout::arrange and the flex-flow helpers interpret their children.
|
strong |
Mouse buttons tracked by the input system.
Count is the sentinel.
|
strong |
Shading language consumed by an IRenderer that supports Feature::Effects.
|
strong |
|
strong |
Interaction state computed per node and consumed by the style resolver to select pseudo-class overlays.
The state is recomputed every frame in InputController::computeNextState. Transitions between states drive the :hover, :pressed and :disabled pseudo-classes in the theme stylesheet.
| Enumerator | |
|---|---|
| Idle | No interaction is active. |
| Hover | Pointer is currently over the node. |
| Pressed | A pointer button is held down on the node. |
| Disabled | The node is logically disabled (config.enabled == 0). |
|
inline |
Invert a Transform2D and apply it to a point.
Used by hit-testing: given the pointer position in destination space, recover the position in the transform's local space.
|
inline |
Apply a Transform2D to a point.
| t | The transform. |
| p | Point in the transform's local space. |