LavaUI docs

LavaUI

2261 declarations · 882 documented

LavaUI

  • AgentHost struct

    Callbacks the host app provides so the server stays UI-framework-agnostic.

  • AgentIdentifiedView struct

    Attaches a stable agent id to the content's root layout box.

  • AgentServer class
  • Alignment struct

    A point in a box: one horizontal choice and one vertical one.

  • AmbientLight3D struct
  • Angle3D struct
  • Animatable protocol

    A value that can be interpolated between two endpoints.

  • Animated struct

    A property that moves toward a target over time.

  • AnimationCurve enum
  • AnimationDriver enum

    Steps every node with animation in flight, once per frame.

  • AnyView struct

    A view whose type is decided at run time.

  • AnyViewNode protocol
  • AppSettings enum

    Cross-platform, file-backed key/value settings for LavaUI apps.

  • ArenaFrameSink class

    Publishes frames into a DrawArena for a renderer in another process.

  • BackdropBridge enum

    Compositor frost behind a popup. LavaUI cannot see the desktop, so a client fills this in; a windowed app leaves it nil and .backdropBlur samples this window's own framebuffer instead.

  • Bindable struct

    Projects bindings out of a reference-type model: $model.property.

  • Binding struct

    A two-way reference to a value owned somewhere else.

  • BodyRecomputable protocol

    A retained node that can re-evaluate its own body in place, using whatever view value it already holds — no new value from a parent is needed, because nothing about that value changed; only some @State/@Observable property it reads did, and that storage is a reference type living outside the struct, so it is already current. CompositeNode is the only conformer; the protocol exists so ViewInvalidation can hold a dirty node without depending on its generic view type.

  • BookshelfLayout3D struct

    Two stacks of books around a face-on cover: neighbours stand on the shelf at a steep yaw so a sliver of their front is still readable, and the focused item turns to face the camera.

  • BorderStyle struct

    A stroke on a view's own edge, lying inside its layout rect.

  • Box3D struct
  • BoxRegistrationView struct

    Attaches something to the content's root layout box — the shape .onDrop and .onFileDrag share, factored out once there were more of them.

  • Button struct

    A clickable control whose hover and press feedback is owned by the renderer.

  • ButtonStyle struct

    Colours and metrics for a Button.

  • Camera3D struct
  • CameraControls3D struct
  • Canvas struct

    Custom-drawn control: Yoga sizes the box; the app emits draw commands.

  • CanvasFrame struct

    Absolute layout box handed to a custom paint callback (window pixels).

  • CanvasGesture struct

    One pointer event delivered to a Canvas's onGesture.

  • CanvasGesturePhase enum

    A phase in a Canvas pointer gesture — a press, its drag, and its release.

  • CaretAffinity enum

    Which side of a wrap boundary a caret belongs to.

  • CaretBlink enum

    Caret blink, expressed as a phase rather than a timer.

  • CatalogLayout3D struct

    A reusable album/poster shelf that adds depth and fans neighboring items around a focused cover while keeping the unfocused catalog in one row.

  • CatalogPose3D struct
  • ClickCounter enum

    Multi-click detection. Kept here rather than in the field so any control can share one notion of what counts as a double click.

  • ClipboardBridge enum

    Indirection so LavaUI views can reach the clipboard without every view carrying an Editor reference. The app installs this once at startup.

  • CodeStyle struct

    Style palette for EditorView. Rules carry style indices; this maps them to colours, so a theme change restyles code without touching any rule.

  • Color struct

    sRGB colour with alpha. Components are what a colour picker shows — Color(r: 0.5, g: 0, b: 0) is #800000, and that is what reaches the screen. Nothing between here and the attachment applies a transfer function: the whole 2D pipeline works on these encoded values. See docs/colour-and-blending.md.

  • ColorPicker struct

    Saturation–value square, hue strip, hex, and an optional alpha slider.

  • ComboBox struct

    A closed field showing the current choice, and a dropdown of the rest.

  • ComboBoxItem struct

    One row of a ComboBox.

  • ComposedOverlayView struct

    A base view with content drawn over it, taking no layout space.

  • ContentScale struct

    Discrete UI text scale — bitmap fonts re-raster at fixed pixel sizes so Yoga measure and FreeType glyphs stay pixel-aligned (no GPU scale of atlas coverage).

  • ContentScaleShortcuts enum

    Default chord: Ctrl+Shift + = / - / 0 (and numpad).

  • CursorBridge enum

    Where the pointer image is actually set.

  • CursorShape enum

    The pointer image over a view.

  • DecorationUnderline enum

    Underline drawn beneath a decorated range. wavy is built from short zigzag segments — there is no dedicated curve primitive, and a handful of line() calls per decorated span is cheap enough not to need one.

  • DiagnosticSeverity enum

    How urgently an EditorDecoration should read — supplies a default color and gutter glyph so a caller can skip both and just say what kind of thing this is.

  • DiagramHost struct
  • Dimension enum

    Maps onto Yoga's width/height states (not a single -1 sentinel).

  • DirectionalLight3D struct
  • Divider struct

    A hairline rule separating content.

  • DividerAxis enum
  • DividerStyle struct

    Colour and metrics for a Divider.

  • DragBridge enum

    How a view starts an OS drag.

  • DragChipImage struct

    A drag chip: views laid out and emitted into a draw list of their own.

  • DragGesturePhase enum
  • DragGestureValue struct
  • DrawKind enum
  • DrawList class

    Reused arena: draw commands plus the shaped glyphs they reference. Shaping itself is cached per line on UIFont, so re-emission is cheap.

  • DrawState struct

    View-local state whose changes only require re-emitting pixels.

  • DropBridge enum

    Where the paths for a .fileDrop come from.

  • DropRouter enum

    Routes an OS drag-and-drop to whichever node it landed on. The node under the drop point is resolved the same way hover is (hitTestHover); unlike hover, this is a one-shot lookup at the moment the drop event arrives, not a continuously tracked position.

  • DropTargetView struct

    Registers perform as the drop handler for the content's root layout box.

  • Edge struct

    Which sides of a box a layout inset applies to.

  • EdgeInsets struct

    Per-edge inset around a view's content.

  • Editor class

    This used to wrap a flat canvas::swiftEditor* free-function API (a SwiftEditor* opaque handle passed to every call) because Swift's C++ interop wouldn't import Engine as a class at the time. That's no longer true: Engine has a proper move constructor (pimpl'd, non-copyable) and imports cleanly, so this now just holds one and calls its methods directly — no OpaquePointer, no strdup/free, no manually building char** arrays for tree/property lists.

  • EditorController class

    A code editor: line-number gutter, current-line highlight, rule-based syntax colouring, and find-match highlighting.

  • EditorDecoration struct

    A diagnostic attached to a range of EditorView's bound text.

  • EditorPosition struct

    Where an editor was left: what it was scrolled to, and what was selected.

  • EditorProbe enum

    Where an editor's time goes on a large buffer, opt-in via LAVA_EDITOR_PROBE=1.

  • EditorView struct
  • EitherView struct

    if / else — fragment (no flex wrapper). Identity is on the branch node.

  • EmptyView struct
  • EngineFrameSink class

    The engine's own per-window buffers: what every windowed app uses, and the default for any DrawList built against an Editor.

  • Environment enum

    Scope stack for EnvironmentValues.

  • EnvironmentModifiedView struct

    Wraps content with an environment override active for its own mount/reconcile call — i.e. for its whole subtree, not just its own node. Delegates entirely to content's node; this adds no Yoga node.

  • EnvironmentValues struct

    Values that flow down the view tree, defaulting to Theme.current / FontStore.default at the root and overridable for a subtree via .theme(_:) / .font(_:) — those globals are the environment's defaults now, not the only way to set a value.

  • Expand struct

    Disclosure control: chevron + title in a rounded outline, content below when open.

  • ExpandStyle struct

    Colours and metrics for an Expand disclosure.

  • FileDialog enum

    Native "open"/"save" file picker.

  • FileDrag enum

    When a press on a .onFileDrag view becomes a drag.

  • FileDragSourceView struct

    Registers the content's root layout box as something files can be dragged out of.

  • FlexDirection enum
  • FocusManager enum

    Which node currently receives keyboard input.

  • FocusRingStyle enum

    How a focused text field draws its attention ring.

  • FontFallback struct

    A fallback face named rather than loaded.

  • FontHinting enum

    How a face is fitted to the pixel grid on its way to the atlas.

  • FontRasterFlags struct

    Hinting selection plus flags, packed the way canvas::RasterFlags reads it. Bits outside the ones defined here are refused by the renderer rather than ignored, so this type is the only supported way to build the word.

  • FontStore enum

    Default UI font when Text does not specify one.

  • ForEach struct

    Variable-length children with explicit key identity. Fragment: children splice into the parent (inherits row/column). No buildArray — plain for in builders is intentionally unsupported.

  • ForEach3D struct
  • FrameBuffers struct

    Where the frame being built actually lives.

  • FrameCapacity struct

    Element counts for one frame — used both for "how much fits" and for "how much was written", because those two are compared constantly and one type makes the comparison a line rather than four.

  • FrameScheduler enum

    When the frame loop should next wake up.

  • FrameSink protocol

    Where a DrawList writes its frame, and who it hands the frame to.

  • FrameTasks enum

    Work deferred until the current frame is on screen.

  • GPUResourceHost protocol

    Who names the things that live on a GPU.

  • Gradient struct

    A two-stop linear ramp, for .background(_:).

  • HighlightRule struct

    A pattern-to-style mapping, applied per line.

  • HighlightSpan struct

    A styled character range within one line.

  • HorizontalAlignment enum

    Horizontal placement of content inside a box larger than it.

  • HoverState enum

    Which node the pointer is over.

  • HSplitView struct

    Two side-by-side panes with a draggable divider between them.

  • HStack struct
  • Image struct

    Raster image laid out as a Yoga leaf and drawn as a textured quad.

  • ImageContentMode enum

    How the source bitmap maps into the layout box.

  • ImageStore enum

    Path → UIImage cache with a VRAM budget, async decode, and LRU eviction.

  • ImageTurn enum

    A quarter turn applied to an image as it is decoded.

  • ImportedMenu enum

    Turning a flattened DBusMenu import into a MenuModel.

  • ImportedMenuItem struct

    One row of a menu imported from another application.

  • InputEvent struct

    One polled event from Editor.pollInputEvent.

  • InputEventKind enum

    Mirrors canvas::InputEventKind.

  • InvalidationLevel enum

    How much of the pipeline a change actually invalidates.

  • KeyAction enum

    Key action (GLFW). Packaged as Float in InputEvent.x for Key events.

  • KeyCode enum

    Physical key codes (GLFW numbering).

  • KeyEvent struct

    A key transition, decoded from the raw engine event.

  • KeyMods enum
  • KeyShortcut struct

    Keyboard shortcut attached to a menu item.

  • KeyShortcutModifier struct

    Modifier flags for KeyShortcut, resolved to GLFW-style KeyMods bits.

  • LavaApp enum

    Reusable window/input/invalidation/render loop, so a second LavaUI executable is a main.swift of a dozen lines instead of a copy of HelloWorldApp's ~350.

  • LavaResources enum

    SwiftPM resource bundle for LavaUI defaults (fonts).

  • LavaWindow class

    One window's worth of the frame loop: its layout tree, its draw arena, its slice of framework state, and the input → invalidate → body → layout → emit → present pipeline that connects them.

  • LayeredView struct

    A base view with a layer drawn behind it (.underlay { }) or over it (.overlayLayer { }), covering its box and taking no layout space and no input.

  • LayoutFrame struct
  • LayoutHost class

    Owns the retained root and runs Yoga layout.

  • LazyVGrid struct

    A vertically scrolling grid that mounts only the cells the viewport shows.

  • LazyVStack struct

    A vertically scrolling list that mounts only the rows the viewport shows.

  • LineIndex struct

    Where each logical line sits, in characters and (optionally) in bytes.

  • MainQueue enum

    Work handed to the main thread from another one.

  • MarkdownDocument struct

    Display text with Markdown delimiters removed and styles mapped to character offsets in that display text.

  • MarkdownParser enum

    A deliberately compact Markdown parser for model responses.

  • MarkdownSpan struct
  • MarkdownSpanStyle enum

    Semantic styles emitted by the small Markdown parser.

  • MarkdownStyle struct
  • MarkdownView struct

    Read-only Markdown rendered as one wrapping, character-styled text leaf.

  • Material3D struct
  • Menu struct

    One top-level menu ("File", "Edit") or a nested submenu.

  • MenuActionTable struct

    Closures keyed by MenuID. Not Equatable — compared only by key set in tests.

  • MenuBackendKind enum

    Which code path owns the menubar.

  • MenuBar struct

    Root menubar description.

  • MenuBarBuilder enum
  • MenuBarStrip struct

    Top-level titles in a fixed-height strip; each opens a dropdown overlay.

  • MenuBarStyle struct

    How a menubar strip and its dropdowns look.

  • MenuBuilder enum
  • MenuChromeRoot struct

    Wraps app content with an in-window menu strip when model is non-empty.

  • MenuContent enum
  • MenuController class

    Owns the last resolved menubar and dispatches activations.

  • MenuDropdownPanel struct

    Popup body for one top-level menu (items, separators, nested submenus).

  • MenuEntry enum
  • MenuHost class

    App-level menubar owner: retains MenuController and the active backend.

  • MenuIcon struct

    Picture for a top-level menu title.

  • MenuID struct

    Stable identity for a menu or menu item across rebuilds.

  • MenuItem struct
  • MenuItemModel struct
  • MenuKeyMods enum

    Modifier bitfield used by KeyShortcut. Same values as GLFW / LavaUI KeyMods.

  • MenuModel struct
  • MenuNode struct
  • MenuSeparator struct
  • ModifiedView struct

    A view wearing a style.

  • NodeID struct

    Stable identity for a retained node (lifetime of the node object).

  • NotificationInfo struct

    One live desktop notification, as the server holds it.

  • Notifications class

    Desktop notifications, from the panel's side: what is on screen right now, and what a click on it does.

  • OptionalView struct

    Non-exhaustive if — fragment (no flex wrapper).

  • OverlayAlignment enum

    Content drawn above everything, anchored to the view that presents it.

  • OverlayAnchor typealias

    Where composed overlay content sits inside its base view's box.

  • OverlayFrame struct

    A detached overlay's resolved frame in window coordinates.

  • OverlayPlacement struct

    Placement policy for a detached overlay.

  • OverlayPlacementContext struct

    Geometry available when placing a detached overlay.

  • OverlayStyle struct

    Styling for the floating surface an overlay draws on.

  • OverlayView struct

    content.overlay(isPresented:) { ... }

  • PanelMenu class

    The global menu, from a panel's side: the focused window's menu, imported over DBusMenu and turned into the same MenuModel an app's own menubar is.

  • PerfCounters enum

    Process-wide counters for work the frame pipeline did.

  • Plane3D struct
  • PointerButton enum

    Modifier bitfield (GLFW mods). Which mouse button an event came from.

  • PointerCapture enum

    Routes pointer motion to whichever node started a drag.

  • PointerState enum

    Last known window-space pointer position, updated on every .mouseMove.

  • PrimitiveMount protocol

    Required retained-tree construction for primitives. No default.

  • PrimitiveView protocol

    Marker for views that own content directly (Body == Never).

  • Reflection3DStyle struct
  • Scene3D struct
  • SceneAnimationFlags struct

    Which properties a animateNode call is stating. Mirrors canvas::SceneAnimationFlags.

  • SceneNodeFlags struct

    Bits in a beginNode command's color field. Mirrors canvas::SceneNodeFlags.

  • SceneNodeIdentity enum

    Hands each view node the compact id the scene graph addresses it by.

  • SceneScrollFlags struct

    Bits in a scrollNode command's color field. Mirrors canvas::SceneScrollFlags.

  • ScreenCapture enum

    A picture of the whole screen, for the one app that needs one.

  • ScreenshotBridge enum

    Where a screenshot comes from.

  • ScrollAxis enum
  • ScrollBridge enum

    Where a wheel notch goes when nothing in the view tree wanted it.

  • ScrollRouter enum

    Wheel routing. The node under the pointer receives the wheel, focused or not — that is what every desktop app does, and it means scrolling a panel does not steal focus from a field.

  • ScrollView struct

    A clipped, scrollable container.

  • Shadow3DStyle struct
  • ShapedGlyph struct

    A shaped glyph, plus which face has to draw it.

  • ShapedRun struct

    A shaped line plus the two mappings text editing needs.

  • Slider struct

    A draggable value in a range.

  • SliderStyle struct

    Colours and metrics for a Slider.

  • SoftWrap enum

    Greedy line breaking.

  • Spacer struct
  • SpatialAnimation struct
  • SpatialElement struct
  • SpatialGroup3D struct
  • SplitStyle struct

    Colours and metrics for a split divider.

  • StackAlignment enum

    Cross-axis placement of children in an HStack or VStack.

  • StackStyle struct
  • State struct

    A source of truth owned by a view, surviving that view being rebuilt.

  • StatefulLexer protocol

    A lexer whose highlighting for line N depends on what came before it — the gap a per-line HighlightRule list cannot close: a block comment or a string that opens on one line and closes on another.

  • StateStorage class

    The value that actually persists across view rebuilds.

  • StatusNotifierItemInfo struct

    One StatusNotifierItem as the panel sees it after a poll.

  • StatusNotifierTray class

    System tray host: owns org.kde.StatusNotifierWatcher and surfaces items for a panel strip.

  • SyntaxHighlighter struct

    Applies rules to a line and resolves overlaps by priority — or, if built from a StatefulLexer instead, threads that lexer's state line to line.

  • Text struct

    Text label primitive — Phase 4: Yoga measure via canvas::Font + layout cache.

  • TextEdit struct

    One reversible edit: replace a range of the buffer with new text.

  • TextEditingState struct

    Selection and caret for a single editable string.

  • TextField struct

    Single-line editable text.

  • TextLayoutCache class

    Keyed on (text, font, quantized width, mode). Yoga measure is chatty; this is the main Phase 4 perf lever.

  • TextSearch struct

    Find-in-buffer: match locations plus which one is current.

  • Theme struct

    Semantic styling tokens.

  • Toggle struct

    A boolean switch with an animated knob.

  • ToggleStyle struct

    Colours and metrics for a Toggle.

  • Transform3D struct
  • Transition struct

    How a view animates as it appears and disappears.

  • TransitionView struct

    content.transition(...)

  • TupleView struct

    Heterogeneous children from a multi-statement @ViewBuilder block. Fragment: expands into the parent flex container (not a Yoga box).

  • UIFont class

    Swift-facing typeface handle. Wraps canvas::Font (FreeType + HarfBuzz).

  • UIImage class

    GPU texture handle for LavaUI Image views.

  • UndoStack struct

    Undo/redo history for a single buffer.

  • Vector3 struct
  • VerticalAlignment enum

    Vertical placement of content inside a box larger than it.

  • View protocol

    A declarative UI description.

  • View3D protocol
  • View3DBuilder enum
  • ViewBuilder enum
  • ViewInvalidation enum

    "Something changed; do at least this much work again."

  • ViewStyle struct

    Style a modifier pushes onto a node.

  • VisualLayout struct

    Where each visual row begins and ends, in character offsets over the whole buffer.

  • VSplitView struct

    Two stacked panes with a draggable divider between them.

  • VStack struct
  • WidgetProfiler enum

    Per-widget paint cost, opt-in via LAVAUI_PROFILE=1.

  • WindowBackdrop enum

    What a window paints behind its content, before anything in the tree.

  • WindowBridge enum

    Where a window's chrome sends the verbs it cannot perform itself.

  • WindowControlButton struct

    One window control, for chrome that places them apart — a close button in one corner of an overlay and nothing else at all.

  • WindowControlKind enum

    Which control. Three, because these are the three a window manager offers, and an app inventing a fourth would be inventing a window state nothing else in the desktop understands.

  • WindowControls struct

    The three controls as one cluster, in the order this desktop puts them.

  • WindowControlsStyle struct

    Colours and metrics for a control cluster.

  • WindowDragArea struct

    Makes a view's empty space a place the window can be dragged by.

  • WindowID struct

    Identifies one window of an Editor.

  • WindowScope class

    The per-window half of LavaUI's framework state.