Skip to main content

Crate oxiui_core

Crate oxiui_core 

Source
Expand description

oxiui-core — Pure-Rust UI core traits and types.

Zero external dependencies. Adapters (oxiui-egui, oxiui-render-wgpu, …) implement the traits defined here; the oxiui facade wires them together.

In addition to the immediate-mode trait surface (UiCtx, Widget, …) the crate provides foundational building blocks consumed across the stack:

  • geometryPoint, Size, Rect, Insets, Constraints.
  • eventsMouseButton, Modifiers, Key, ScrollDelta.
  • tree — a retained WidgetTree with stable ids and hit testing.
  • layout — a single-line flexbox solver (FlexLayout).

Re-exports§

pub use anim::Animator;
pub use anim::Easing;
pub use anim::Spring;
pub use anim::Transition;
pub use cache::LayoutCache;
pub use color_space::contrast_ratio;
pub use color_space::ContrastWarning;
pub use color_space::Hsla;
pub use color_space::LinearRgba;
pub use color_space::Oklcha;
pub use color_space::PaletteBuilder;
pub use color_space::WcagLevel;
pub use diff::diff;
pub use diff::DiffOp;
pub use dispatch::DispatchEvent;
pub use dispatch::EventDispatcher;
pub use dispatch::EventHandler;
pub use dispatch::HandlerCtx;
pub use dispatch::Phase;
pub use events::GestureKind;
pub use events::Key;
pub use events::KeyboardEvent;
pub use events::Modifiers;
pub use events::MouseButton;
pub use events::MouseEvent;
pub use events::PhysicalKey;
pub use events::Propagation;
pub use events::ScrollDelta;
pub use events::TouchEvent;
pub use focus::FocusManager;
pub use geometry::Constraints;
pub use geometry::Insets;
pub use geometry::Point;
pub use geometry::Rect;
pub use geometry::Size;
pub use grid::compute_grid;
pub use grid::GridItem;
pub use grid::GridLine;
pub use grid::GridPlacement;
pub use grid::GridSpan;
pub use grid::GridTemplate;
pub use grid::TrackSizing;
pub use layout::AlignContent;
pub use layout::AlignItems;
pub use layout::FlexDirection;
pub use layout::FlexItem;
pub use layout::FlexLayout;
pub use layout::FlexWrap;
pub use layout::JustifyContent;
pub use paint::DrawCommand;
pub use paint::DrawList;
pub use paint::RenderBackend;
pub use reactive::Computed;
pub use reactive::ReactiveError;
pub use reactive::ReactiveRuntime;
pub use reactive::Signal;
pub use response::CheckboxResponse;
pub use response::DropdownResponse;
pub use response::SliderResponse;
pub use response::TextInputResponse;
pub use response::WidgetResponse;
pub use scheduler::Debounce;
pub use scheduler::Scheduler;
pub use scheduler::Throttle;
pub use scheduler::TimerId;
pub use solver::Constraint;
pub use solver::Expression;
pub use solver::RelOp;
pub use solver::Solver;
pub use solver::SolverError;
pub use solver::Strength;
pub use solver::Term;
pub use solver::Variable;
pub use style::Border;
pub use style::BorderStyle;
pub use style::CursorShape;
pub use style::Margin;
pub use style::Padding;
pub use text_style::TextStyle;
pub use tree::WidgetId;
pub use tree::WidgetIdAllocator;
pub use tree::WidgetNode;
pub use tree::WidgetTree;
pub use widget_ext::ClipboardProvider;
pub use widget_ext::DragData;
pub use widget_ext::DragSource;
pub use widget_ext::DropEffect;
pub use widget_ext::DropTarget;
pub use widget_ext::WidgetExt;

Modules§

anim
Easing curves, spring physics, and a transition animator.
cache
Layout memoization keyed by (WidgetId, input Size, content hash).
color_space
Colour-space conversions and palette construction/validation.
diff
Widget-tree diffing: turn an old tree into a new one with a minimal op set.
dispatch
Event dispatch with W3C-style capture and bubble phases.
events
Input event types: mouse buttons, keyboard keys, and modifier state.
focus
Keyboard focus management over a WidgetTree.
geometry
2-D geometry primitives used across the OxiUI stack.
grid
CSS Grid Level 1 layout engine.
layout
Flexbox layout engine — single-line and multi-line (wrapping).
paint
Draw-command buffer and render-backend abstraction for OxiUI.
reactive
Reactive primitives: Signal<T> and Computed<T> with automatic dependency tracking, topological dirty propagation, and cycle detection.
response
Response structs returned by the extended UiCtx widgets.
scheduler
Frame-aligned callback scheduling plus debounce/throttle helpers.
solver
Pure-Rust Cassowary linear constraint solver.
style
Spacing and decoration styling primitives.
text_style
Text rendering style for labels and headings.
tree
Retained widget-tree data structure with stable IDs and hit testing.
widget_ext
Widget combinators and the clipboard / drag-and-drop / cursor abstractions.

Structs§

ButtonResponse
Response from a button widget.
Color
RGBA colour value, one u8 per channel: Color(r, g, b, a).
FontFeature
An OpenType feature tag toggle, e.g. "liga" on, "tnum" on.
FontSpec
Font specification for UI text.
Palette
A palette of semantic colours for a UI theme.
RichTextSpan
A styled text span for use with UiCtx::rich_text.

Enums§

Axis
Layout axis.
FontStyle
The slant style of a font face.
UiError
Errors emitted by the OxiUI stack.
UiEvent
Events that the UI backend can emit.

Traits§

EventSink
An event sink that accepts UI events for processing.
Layout
A layout strategy that controls how children are arranged.
Theme
A UI theme that provides a colour palette and font specification.
UiCtx
Rendering context passed to every Widget::render call.
Widget
A UI widget that can render itself into a UiCtx.