Skip to main content

lumen_core/
lib.rs

1//! Lumen UI framework core crate.
2//!
3//! - Owns the tick loop, [`command`] queue, ECS components, and the two ECS worlds (main + render). See [`render_world`] for the cross-world flow.
4//! - Backend traits are marker types; concrete backends register systems via [`app::Plugin`].
5//! - Hierarchy uses [`bevy_ecs::hierarchy::ChildOf`] and [`bevy_ecs::hierarchy::Children`], re-exported from [`prelude`].
6
7#![forbid(unsafe_code)]
8#![warn(missing_docs)]
9
10pub mod app;
11pub mod command;
12pub mod components;
13pub mod i18n;
14pub mod input;
15pub mod introspect;
16pub mod nav;
17pub mod net_capture;
18pub mod node;
19pub mod node_ir;
20pub mod palette;
21pub mod property_store;
22pub mod render_world;
23pub mod signals;
24pub mod text_events;
25pub mod text_model;
26pub mod tick;
27pub mod traits;
28pub mod window_state;
29
30/// Crate prelude re-exporting the common types. Glob-import with `use lumen_core::prelude::*;`.
31pub mod prelude {
32    pub use crate::app::{App, AppError, EventLoopWaker, Plugin, PluginMetadata};
33    pub use crate::command::{
34        Command, CommandHandlerFn, CommandQueue, CommandQueueOverflow, CommandRegistry,
35        apply_property_commands,
36    };
37    #[allow(deprecated)]
38    pub use crate::components::OsTheme;
39    pub use crate::components::{
40        A11yAnnouncement, A11yAnnouncementQueue, A11yContextMenuRequests, A11yDescription,
41        A11yLabel, A11yLevel, A11yLive, A11yRelations, A11yRole, A11yRootLabel,
42        A11yScrollIntoViewRequests, A11ySetSize, A11yState, A11yValue, AlignContent, BindChecked,
43        BindDisabled, BindParentChecked, BindParentText, BindParentValue, BindSelfChecked,
44        BindSelfText, BindSelfValue, BindText, BindValue, Border, BoxSizing, CaretBlink, Color,
45        ColorScheme, DefaultLayoutDirection, DirtyA11y, DirtyLayout, Disabled, DocumentOrder,
46        DropHovered, DropTarget, Edges, Fill, FlexAlign, FlexDirection, FlexJustify, FlexWrap,
47        FocusBoundary, ImageBlob, ImageComponent, ImageFit, ImeState, Lang, LayoutDirection,
48        Length, LumenClasses, LumenId, LumenTag, MemoryBudget, Opacity, Overflow,
49        PendingA11yUpdate, Position, RelayoutBoundary, ResolvedDirection, RootWindowEntity,
50        Selected, ShadowSpec, SliderValue, Style, StyleManager, SvgPayload, TabIndex, TextAlign,
51        TextContent, TextInput, TextInputPaint, TextInputScroll, TextStyle, TextWrap,
52        TitleBarDraggable, Toggleable, Transform, Validation, Visible, Visuals, WindowDragRequest,
53        ZIndex, apply_bind_parent_checked, apply_bind_parent_text, apply_bind_parent_value,
54        apply_bind_self_checked, apply_bind_self_text, apply_bind_self_value, hidden_via_ancestors,
55        resolve_layout_direction,
56    };
57    pub use crate::input::{
58        ClickEvent, CursorRequest, CursorShape, DoubleClickEvent, DragEndEvent, DragMoveEvent,
59        DragStartEvent, EscapePressCancel, FileDropped, FileHoverCancelled, FileHovered,
60        FocusTracker, Focused, FocusedKey, Hovered, ImeEvent, ImeRequest, Key, KeyPressed,
61        KeyReleased, LongPressEvent, Modifiers, ModifiersState, MouseWheel, NamedKey,
62        PointerButton, PointerLeft, PointerMoved, PointerPressed, PointerReleased, PointerState,
63        Pressed, SCROLLBAR_MARGIN, SCROLLBAR_MIN_THUMB, SCROLLBAR_THICKNESS,
64        SCROLLBAR_THICKNESS_THIN, Scroll, ScrollAxis, ScrollOffset, ScrollbarAxisPick,
65        ScrollbarDrag, ScrollbarGeometry, ScrollbarInteraction, ScrollbarMetrics, ScrollbarPart,
66        ScrollbarState, ScrollbarStyle, ScrollbarWidthMode, ShowContextMenu, TextInputCommitted,
67        horizontal_scrollbar, vertical_scrollbar,
68    };
69    pub use crate::nav::{NavOp, navigate as nav_navigate, request as nav_request};
70    pub use crate::node::{
71        DomIndex, DomRecord, NodeHandle, NodeHandles, dom_index_snapshot, intern_node,
72        publish_dom_index, resolve_node,
73    };
74    pub use crate::node_ir::{
75        Affine2, ClipShape, DrawEntry, Node, PreviousScene, RetainedScene,
76        transform_extracted_to_nodes,
77    };
78    pub use crate::palette::Palette;
79    pub use crate::property_store::{
80        BindingId, ListenerId, Property, PropertyCell, PropertyKey, PropertyStore, PropertyValue,
81        clear_property_store_dirty,
82    };
83    pub use crate::render_world::{
84        AnimationsActive, Brush, ExtractFn, ExtractSchedule, ExtractSet, ExtractedClipBox,
85        ExtractedImage, ExtractedOutline, ExtractedRect, ExtractedScrollbar, ExtractedShadow,
86        ExtractedText, FrameDamage, FrameDirty, Rect, Render, RenderStage, ScrollbarDrawRect,
87        SurfaceCapture, SurfaceFrame, Viewport,
88    };
89    #[allow(deprecated)]
90    pub use crate::signals::Signals;
91    pub use crate::signals::{
92        ArrayItem, ArraySignals, ExternalMutation, apply_text_bindings, drain_external_signals,
93        init_external_signals, push_external_array, push_external_clear, push_external_signal,
94        push_textinput_to_signal,
95    };
96    pub use crate::text_events::{
97        Anchor, AppliedKind, CursorMotion, ImeSurroundingRequested, ImeSurroundingResponse,
98        MoveMode, RejectReason, TextEditApplied, TextEditRejected, TextEditRequest, TextEditSet,
99    };
100    pub use crate::text_model::{
101        Affinity, Bias, ImePreedit, MarkId, TagKind, TextBuffer, TextBufferKind, TextCursor,
102        TextEditable, TextMark, TextPos, TextTagRange,
103    };
104    pub use crate::tick::{Tick, TickStage};
105    pub use crate::traits::{
106        A11yBackend, Bindable, LayoutEngine, Renderer, Spawn, Timer, WindowBackend,
107    };
108
109    // Re-export the bevy_ecs hierarchy components used across the crate.
110    pub use bevy_ecs::hierarchy::{ChildOf, Children};
111    pub use bevy_ecs::prelude::*;
112}