Skip to main content

Crate lingxia_surface

Crate lingxia_surface 

Source
Expand description

lingxia-surface — the platform-agnostic core of the Adaptive Surface Layout model (see docs/draft/adaptive-surface-layout.md).

Pure Rust, no UI: the Surface Graph, its invariants and state transitions, the two-axis derivation into DerivedLayout, and the Host arbitration pure function. Each platform skin binds the DerivedLayout output.

Structs§

DerivedLayout
Shared-core output bound by each platform skin. The pure core view: the resolved sizeClass/forms/bottomOwner and the authoritative layoutTree. The renderable, skin-bindable contract is LayoutPresentationPlan (derived from this graph), not this type.
FloatSpec
Minimal semantics carried only by float surfaces (§1.1).
LayoutPresentationPlan
The stable, complete render contract a skin binds. Unlike the pure-core DerivedLayout, this flattens the graph into the renderable view any skin needs: ordered mains, asides (with edge + preferred size), floats, and the full id-only tree. Derived from the graph so the shared core output isn’t bound to one skin’s needs.
Placement
Placement hint (input). Authoritative layout is the LayoutTree (output).
PlanAside
One aside in the LayoutPresentationPlan: the surface id, the requested edge, and its preferred size. Skins read split_form to decide whether these asides dock beside the main or present full-screen on compact.
PlanFloat
One float in the LayoutPresentationPlan: the surface id plus the render-relevant FloatSpec semantics (anchor, dismiss, modal). Floats are popups above the layout and are never in the tree, so the skin reads this list to know which popups to show and how each behaves. The reconciler is the single authority for float visibility.
Policy
Tunable arbitration policy. Defaults are the spec’s cross-platform defaults.
Surface
One node in the Surface Graph.
SurfaceGraph
One window’s graph. Surfaces are kept in insertion order so that “adjacent main” succession and “oldest aside” replacement are deterministic.
SurfaceManager
One window’s stateful surface driver.

Enums§

Axis
BottomOwner
Who owns the bottom bar in compact.
Decision
Structured outcome of a request (§3.1). A subset of the spec’s full set; mergedIntoTabs lands when tab-grouping is implemented.
Edge
Which edge a surface docks to (asides) or anchors from.
FloatAnchor
How a float surface anchors.
FloatDismiss
How a float surface is dismissed.
LayoutTree
Authoritative layout produced by the Host (output), referencing surfaces only by id. Overlay/float surfaces never appear here.
Role
Relationship of a surface to the main content. The single core abstraction behind every platform skin (window / panel / sheet / tab …).
SizeClass
Available-width band. Aligned to Material breakpoints and computed from the container width, not the physical screen.
SplitForm
How asides (the split axis) render. sheet belongs to float, not here.
SurfaceContent
What a surface shows. Only two kinds: a declared catalog entry (resolved by the host from lingxia.toml) or an ad-hoc web page.
SurfaceOwner
Owner scope: decides when the surface is closed (§5).
SurfaceState
Runtime state of a surface.
SwitcherForm
How the main-switcher renders on this platform/size.

Constants§

DEFAULT_HYSTERESIS
Default hysteresis margin to avoid breakpoint thrashing.

Functions§

arbitrate
Run arbitration. Pure: clones the graph, applies the resolved request, and returns the new graph plus the decision. The result graph is always valid.

Type Aliases§

SurfaceId
Stable identifier of a surface within a graph.