Skip to main content

Module components

Module components 

Source
Expand description

ECS component primitives.

Hierarchy components ChildOf and Children are re-exported from bevy_ecs::hierarchy via crate::prelude.

Structs§

A11yAnnouncement
One-shot live-region announcement. Drained by the a11y translation system each tick and emitted as a transient AccessKit node so screen readers speak the string and immediately forget it.
A11yAnnouncementQueue
Queue of pending one-shot announcements. Resource form of A11yAnnouncement used by scripts (Rhai announce(msg, "polite")) that have no entity handle.
A11yContextMenuRequests
Queue of entities the assistive tech requested context menus for.
A11yDescription
Accessible description (aria-description). Distinct from A11yLabel; screen readers announce label first, then description.
A11yLabel
Accessible label (aria-label). Distinct from TextContent so prose markup does not collide with visible body text.
A11yLevel
Hierarchy level for headings (1..6) and tree items (depth from root).
A11yRelations
Cross-entity accessibility relations. Mirrors GTK 4 GtkAccessibleRelation.
A11yRootLabel
Optional human-readable label for the AccessKit tree root.
A11yScrollIntoViewRequests
Queue of entities the assistive tech requested be scrolled into view.
A11ySetSize
Position-in-set metadata for list / tree / grid items.
A11yState
Boolean accessibility state flags.
A11yValue
Bounded numeric value carrier (slider / progress / spin). The From<&SliderValue> for A11yValue impl converts existing SliderValue state without callers having to set both.
BindChecked
Two-way binding for <toggle bind-checked="signal">.
BindDisabled
One-way binding for <button bind-disabled="signal"> (any tag).
BindParentChecked
Parent-entity toggle binding: bind-checked="$parent.field". Stub component; consumer lands in the follow-up commit.
BindParentText
Parent-entity text binding: bind-text="$parent.field". The follow-up consumer walks one ChildOf step up the tree and reads the named field from the parent’s per-entity property bag.
BindParentValue
Parent-entity slider-value binding: bind-value="$parent.field". Stub component; consumer lands in the follow-up commit.
BindScroll
Two-way binding for <scroll bind-scroll="signal"> (W6 T6).
BindSelfChecked
Per-entity toggle binding: bind-checked="$self.field". Stub component; consumer lands in the follow-up commit.
BindSelfText
Per-entity text binding: bind-text="$self.field" lowers to this marker. The follow-up consumer reads the named field from the owning entity’s ArrayItem (or other per-entity property bag) each tick and writes it into TextContent. The field name is stored as Arc<str> and shared across instances that bind the same field.
BindSelfValue
Per-entity slider-value binding: bind-value="$self.field". Stub component; consumer lands in the follow-up commit.
BindText
Binds this entity’s TextContent to a named entry in crate::signals::Signals; markup bind-text="counter".
BindValue
Two-way binding for <slider bind-value="signal">.
Border
Solid border paint record stored on Visuals::border. Supports border-style: solid with per-side widths (including 0 = no border on that side) and optional per-side colors.
CaretBlink
Caret blink phase, shared main-world resource (W2 text-editing core).
CaretWidth
Per-entity override for CARET_WIDTH_PX (caret-width CSS property). Split off as its own tiny component for the same reason as PasswordCharacter. Absent => CARET_WIDTH_PX. Only meaningful on <input> / <textarea>.
Color
RGBA color, each channel in [0, 1].
DefaultLayoutDirection
Default writing direction for the application root. The resolve_layout_direction system uses this when the root entity has no explicit LayoutDirection. It defaults to LayoutDirection::Ltr and nothing sets it from the locale today, so a right-to-left app still needs dir="rtl" in its markup.
DirtyA11y
Marker: this entity’s accessibility-relevant state changed.
DirtyLayout
Marker: this entity’s layout (or one of its ancestors’) has changed.
Disabled
Marker: user input is rejected on this entity.
DocumentOrder
Spawn-order tiebreak for focus cycling. bevy_ecs 0.19’s Entity: Ord is a niche-optimized row-index comparison, not a spawn-order one - for entities recycled through a freed ECS row, a later-spawned entity can sort before an earlier one. lumenc::spawn assigns this from a monotonic per-document counter as it walks the parsed tree in markup order, so entities with equal TabIndex cycle in the order they appear in the source, not in whatever order their table rows landed.
DropHovered
Marker: an in-app drag is currently hovering this DropTarget and its payload is acceptable. Maintained each tick by lumen-os-dnd’s drag-gesture tracker while a drag is active, removed the moment the pointer leaves or the drag ends. Drives the :drag-over pseudo-class (HTML5 DnD dragover parity) so the hovered drop zone can light up via design tokens.
DropTarget
Marker: this entity accepts file drops.
Edges
Per-edge length values (padding, margin, border). Physical edges (left / right / top / bottom) carry the authored values; the optional *_inline_* / *_block_* fields override them per writing direction (W5.5 - CSS Logical Properties Level 1 subset).
FocusBoundary
Tab-navigation boundary. While the carrier is visible (no Visible component or [Visible(true)]), Tab / Shift-Tab cycling stays within its descendants. Applied by <dialog> to trap focus; cycling tolerates nested visible boundaries by keeping focus inside the active one.
Gap
CSS gap / row-gap / column-gap - per-axis spacing between adjacent rows / columns of a flex or grid container (W5.9). The previous single-scalar gap: f32 is reachable via Gap::from(value) for back-compat with existing call sites.
GridTemplate
CSS Grid template - explicit grid-template-rows + -columns track lists (W5.9). Implicit-grid sizing is taffy’s default behaviour for cells placed past the explicit grid.
ImageBlob
Type-erased blob sidecar for an image render entity.
ImageComponent
An image with a backing GPU texture (uploaded asynchronously).
ImeState
In-progress IME composition state.
InlineStyle
Per-element inline style overrides: the DOM element.style layer. Stored as ordered (property, value) pairs so a later write wins and iteration is deterministic. The runtime CSS re-apply reads this LAST (highest cascade tier, above the stylesheet), mirroring how inline style beats author rules in the browser. set_style/style_get/style_remove mutate it; computed_style reflects it after the cascade.
Lang
BCP-47 language tag (e.g. "en-US", "ar-EG"). Drives text shaping (cosmic_text::Attrs::language), AccessKit (Node::set_language), and locale-aware formatters.
LumenAttributes
Generic attribute overflow map for element attributes that have no typed component of their own (role, data-*, aria-*, custom attrs). The dynamic DOM API’s set_attr/get_attr/remove_attr route KNOWN attrs (src, id, class, text, …) to their typed components and everything else here. Attribute names are stored verbatim; values are strings.
LumenClasses
Class list assigned in markup via class="a b c". Apps test membership with LumenClasses::has("tile"). Storage is Vec<Arc<str>> so repeated class names share one allocation; cloning performs only Arc bumps.
LumenId
Stable string id assigned in markup via id="...". Apps query Query<(Entity, &LumenId)> and match by name.
LumenTag
Markup tag name (tile, label, button, …) retained on entities that carry a class / id, so the runtime can rebuild a minimal selector target and re-run the CSS cascade in place on a theme / media flip (see lumenc’s reapply_computed_styles). Only attached to selector-reachable entities to keep archetype churn off the plain layout containers that no rule can name.
MemoryBudget
Per-cache memory caps in megabytes, honoured by per-tick LRU eviction across the image, shape, scene-fragment, and GPU-texture caches. Each cache exposes bytes_used and evict_until(target_bytes); a shared system reduces the live total below the cap. Defaults target desktop-class machines; override via lumen.toml [perf].
Opacity
Alpha multiplier applied to every drawn aspect of this entity (background fill, gradient, image, SVG, text, shadow, outline).
PasswordCharacter
Per-entity override for PASSWORD_MASK_CHAR (password-character CSS property). Split off as its own tiny component - rather than a field on TextInputPaint - so adding it never touches that component’s existing struct literals elsewhere in the tree (same reasoning as TextInputPaint’s own doc comment). Absent => PASSWORD_MASK_CHAR. Only meaningful on <input> / <textarea>.
PendingA11yUpdate
Latest AccessKit tree update produced by the sync_a11y_tree system.
RelayoutBoundary
Marker indicating that the entity’s size is fully determined by parent-imposed constraints (a <scroll> clip box, fixed width/height, or explicit layout-boundary attribute).
ResolvedDirection
Cascade output written by resolve_layout_direction. Either LayoutDirection::Ltr or LayoutDirection::Rtl - never LayoutDirection::Auto (the resolver folded the inheritance chain). Downstream consumers (layout backend, text shaper, AccessKit) read this instead of walking the hierarchy themselves.
RootWindowEntity
Window-root entity used by the a11y tree as the AccessKit tree root.
Selected
Marker: this entity is the currently-selected member of a single-selection group (active tab button today; dropdown current-value button later). Maintained by the owning primitive’s sync system - inserted on the active member, removed from siblings.
ShadowSpec
Shadow record stored on Visuals::shadows.
SliderValue
Bounded scalar state for <slider> entities. value is held in [min, max]; the runtime emits on_slider(id, value) on drag or track click.
Style
Framework-internal style record. Smaller and renderer-agnostic compared with taffy::Style; the layout impl crate translates it into its backend type. New fields require a corresponding dirty_mask bit allocation in lumen/src/style_mask.rs.
StyleManager
Color-scheme arbiter mirroring AdwStyleManager. Combines the app’s stated intent (scheme) with the last-seen OS preference (system_dark) to produce a single boolean (effective_dark) used by the rest of the pipeline.
SvgPayload
Type-erased payload sidecar for an SVG render entity.
TabIndex
Tab navigation order. Lower values focus first. Negative = not in tab chain.
TextBlockOrigin
Published vertical origin of an entity’s text block (see text_block_top).
TextContent
Text payload for text-bearing entities. Stored as its own component so high-frequency keystroke mutation does not bump change detection on the cold TextStyle fields.
TextInput
Marker: this entity is an editable text input.
TextInputPaint
Optional caret + selected-glyph paint overrides for a text input, split from TextStyle so they can be added without touching every TextStyle struct literal in the tree. Sourced from the caret-color / selection-text-color CSS properties by the reconciler; absent => the renderer falls back (caret takes the text fill, selected glyphs keep their fill on the translucent highlight).
TextInputScroll
Per-input content scroll offset that keeps the caret visible inside the field box (W2 text-editing core).
TextStyle
Text style record carrying fill color, size, family/weight, alignment, wrap policy, and optional max-line cap. TextContent is stored separately so keystrokes do not bump change detection on these cold fields. Default: near-white at 16px, weight 400, platform sans-serif, left-aligned, no wrap, unbounded lines.
TitleBarDraggable
Marker: presses on this entity (and hit-bubbled descendants) trigger a native window drag. Authored by the <title-bar drag> region; the window backend sets WindowDragRequest and calls winit::Window::drag_window().
Toggleable
On/off state for <toggle> entities. Click flips checked and the runtime emits on_toggle(id, checked).
Transform
Layout-resolved absolute position and size in logical pixels.
Validation
Form-field validation rules attached when <input>, <toggle>, or <slider> declares required / pattern / min / max. The validate_inputs system in lumen-primitives recomputes Self::is_valid from the entity’s content and mirrors the result into the valid:<id> reactive signal.
Visible
Render gate. When present and set to false, every extract fn skips the entity (no rect, text, image, outline, or shadow), while layout still allocates space for it.
Visuals
Visual record for one rect: optional fill (solid or gradient), uniform corner radius, and stacked shadows.
WindowDragRequest
Window-backend request to begin a native window drag on the next tick. Populated by the input layer on a press over a TitleBarDraggable entity; consumed and cleared by lumen-window-winit.
ZIndex
CSS z-index - paint-order override among siblings. Higher values paint later (on top). Missing component = auto (0, document order). Consumed by render_world::build_parent_map, which stable-sorts each entity’s child list by (z_index, document order) before assigning pre-order paint ranks - so an element with a higher z-index (and its whole subtree) paints above its siblings, matching CSS stacking behaviour within one parent stacking context.

Enums§

A11yLive
Live-region politeness. Drives accesskit::Live on the carrier.
A11yRole
Explicit accessibility role override. Maps to [accesskit::Role] through the From<A11yRole> for accesskit::Role impl in lumen-a11y-accesskit.
AlignContent
CSS align-content values - distribution of flex lines / grid tracks along the cross axis.
BoxSizing
CSS box-sizing values.
ColorScheme
App-side intent for color-scheme resolution; mirrors libadwaita’s AdwColorScheme.
Display
CSS display value. Selects the layout algorithm for the element’s children (W5.9).
EchoMode
How a text input renders its content - Qt’s QLineEdit::EchoMode.
Fill
Fill brush variants for a Visuals rect.
FlexAlign
Cross-axis alignment.
FlexDirection
Flexbox main-axis direction. Includes the logical *Reverse variants so the layout backend can flip the inline axis when ResolvedDirection is LayoutDirection::Rtl (W5.5).
FlexJustify
Main-axis distribution.
FlexWrap
CSS flex-wrap values.
ImageFit
How an image fits its layout rectangle; mirrors CSS object-fit. Defaults to Self::Fill (stretch to the entity’s Transform.size).
LayoutDirection
Per-entity layout direction (CSS direction). Tri-state:
Length
One-dimensional length specifier.
LineHeightSpec
Resolved CSS line-height: either a multiplier of the element’s font size (unitless, e.g. line-height: 1.5) or an absolute value in logical pixels (line-height: 24px).
Overflow
CSS overflow values.
Position
CSS position values.
TextAlign
Horizontal text alignment inside the entity’s content rectangle, stored inside TextStyle and ExtractedText. Defaults to Self::Start (left in left-to-right reading order).
TextWrap
Text wrap policy stored inside TextStyle and ExtractedText. Defaults to Self::None (no wrap, overflow clips). Mirrors CSS white-space: nowrap (None), word-wrap: break-word (Word), and a CJK-style glyph-level break (Glyph).
TrackSize
One track in a grid template - CSS Grid L1 subset.

Constants§

CARET_WIDTH_PX
Default text-input caret stroke width, in logical pixels (caret-width CSS property). The single Rust fallback, used when no CaretWidth override is present; render paths scale this by the active DPR themselves.
DEFAULT_LINE_HEIGHT_MULTIPLIER
Default CSS line-height: normal multiplier - the single Rust fallback used wherever no line-height value reaches the layout / shaping / paint path. Common browsers use ~1.2; Lumen matches that. This is the sole line-height ratio in the codebase; text_block_top and text_baseline_in_line take the resolved line height (see resolve_line_height) rather than re-deriving it from size_px and a hardcoded factor, so an authored CSS line-height moves the text block and baseline the same way it moves everything else.
PASSWORD_MASK_CHAR
Default glyph substituted for each scalar under EchoMode::Password: U+2022 BULLET, the platform password convention Qt and the web use. This is the single Rust fallback, used when no PasswordCharacter override is present; the CSS password-character property authors that override per skin.

Functions§

apply_bind_parent_checked
No-op consumer stub for BindParentChecked. See apply_bind_self_text.
apply_bind_parent_text
No-op consumer stub for BindParentText. See apply_bind_self_text.
apply_bind_parent_value
No-op consumer stub for BindParentValue. See apply_bind_self_text.
apply_bind_self_checked
No-op consumer stub for BindSelfChecked. See apply_bind_self_text.
apply_bind_self_text
No-op consumer stub for BindSelfText. Registered so plugin scheduling can already wire it in; the follow-up commit populates the query and reads from the per-entity property bag. Today this is a pure no-op to keep the system graph stable without behavioural change.
apply_bind_self_value
No-op consumer stub for BindSelfValue. See apply_bind_self_text.
hidden_via_ancestors
Shared hidden-check for every path that must honour visibility (spec section 17.4: one visibility story). True when entity or any ancestor is hidden by either mechanism:
resolve_layout_direction
Resolve every entity’s LayoutDirection (defaulting to LayoutDirection::Auto when the component is absent) against its ancestor chain and stamp the answer into ResolvedDirection.
resolve_line_height
Resolve a possibly-absent CSS line-height against size_px, falling back to DEFAULT_LINE_HEIGHT_MULTIPLIER (line-height: normal) when no value was authored. The single fallback-consumption point every line-height-aware call site outside this module should route through, rather than re-deriving size_px * 1.2 locally.
text_baseline_in_line
Baseline offset of a line from the top of its own line box, in logical pixels. Centers the cap height (a size_px-derived font metric) inside the resolved line_height (see resolve_line_height).
text_block_top
Offset from the inner content box top to the top of the FIRST line box, in logical pixels. line_height is the resolved CSS line height (see resolve_line_height) - the caller passes resolve_line_height(style.line_height, size_px) so an authored line-height moves the block origin the same way it moves the line box.

Type Aliases§

OsThemeDeprecated
Backwards-compatible alias for the pre-W4.6 OsTheme resource. New code should use StyleManager directly; the alias keeps existing call sites that still read or write is_dark compiling through the Deref / DerefMut shim on the legacy wrapper.