Skip to main content

Crate oxiui

Crate oxiui 

Source
Expand description

oxiui — Pure-Rust GUI facade.

Default features: ["gpu","egui"] — boots an egui app rendered via wgpu. GPU drivers (Vulkan/Metal/DX12) are OS-provided at runtime; they do NOT appear in cargo tree --edges normal (GOVERNANCE §8 bullet 2).

Headless / ffi-audit path: --no-default-features --features software uses a softbuffer CPU framebuffer; no GPU stack required at build time.

iced backend: Enable with --features iced. The iced backend wires the content closure through oxiui_iced::IcedUiCtx using iced’s retained-mode Elm-style update/view loop. Button clicks from one frame are reflected as ButtonResponse::clicked = true in the next frame’s view call (one-frame latency, inherent to the retained-mode / immediate-mode bridge).

slint backend: Enable with --features slint. The slint backend wires the content closure through oxiui_slint::SlintCtx. In M5, this operates in headless collection mode (no display required). Native window rendering via slint::run_event_loop() is deferred to M6. Note: slint 1.16.1 is GPL-3.0 OR royalty-free OR commercial licensed; only pulled in under this explicit feature gate.

dioxus backend: Enable with --features dioxus. The dioxus backend wires the content closure through oxiui_dioxus::DioxusCtx. In M5, this operates in headless collection mode. The minimal dioxus feature set is used (Pure Rust); the desktop feature (wry/tao/WebKit, C/C++ deps) is excluded.

GOVERNANCE §6 note: The default = ["gpu","egui"] facade deviation from the strict tier-1 default = [] rule is authorized by ADAPTER_PATTERN §3 rule 4 (a zero-feature facade build must select at least one Pure adapter). Parallel precedents: oxicrypto’s default = ["pure"], oxitls’s default = ["pure","webpki-roots"].

§Quick start (egui)

use oxiui::{App, AppConfig};
App::new(AppConfig::new().title("Hello OxiUI"))
    .theme(oxiui::theme::cooljapan_default())
    .content(|ui| {
        ui.heading("Hello, world!");
        if ui.button("Quit").clicked { /* exit logic */ }
    })
    .run()
    .expect("UI error");

§Quick start (iced backend)

use oxiui::{App, AppConfig, Backend};
App::new(AppConfig::new().title("Hello OxiUI (iced)"))
    .theme(oxiui::theme::cooljapan_default())
    .backend(Backend::Iced)
    .content(|ui| {
        ui.heading("Hello from iced!");
        if ui.button("Quit").clicked { std::process::exit(0); }
    })
    .run()
    .expect("UI error");

Or use the standalone example:

cargo run --example hello_iced --features iced -p oxiui

Re-exports§

pub use multiwindow::SecondaryWindow;
pub use dialog::DialogId;
pub use dialog::DialogKind;
pub use dialog::DialogQueue;
pub use dialog::DialogResponse;
pub use menu::Menu;
pub use menu::MenuBar;
pub use menu::MenuBarBuilder;
pub use menu::MenuItem;
pub use runner::EguiRunner;egui
pub use runner::BackendRunner;
pub use runner::LifecycleConfig;
pub use theme_picker::by_name as theme_by_name;
pub use theme_picker::theme_picker;
pub use theme_picker::BUILTIN_THEMES;
pub use tray::TrayConfig;
pub use tray::TrayHandle;
pub use tray::TrayMenuItem;
pub use native_dialog::DialogResult;
pub use native_dialog::MessageLevel;
pub use app_config::AppConfig;
pub use notification::Notification;
pub use notification::NotificationQueue;
pub use command::Command;
pub use command::CommandPalette;

Modules§

app_config
Window configuration builder. AppConfig — window configuration builder for App.
command
Searchable command palette. Searchable command palette.
core
Core type re-exports.
dialog
In-app dialog queue (no OS file picker; Pure Rust).
menu
Native menu bar builder.
multiwindow
Multi-window support.
native_dialog
Native OS file / message dialogs (requires dialogs feature).
notification
In-app toast notification queue. In-app toast notification queue.
prelude
Prelude module — re-exports the most commonly used OxiUI types.
reactive
Fine-grained reactive state primitives.
runner
Pluggable backend runner infrastructure.
solver
Constraint solver types re-exported from oxiui-core.
text
Re-exports from oxiui-core text/font types.
theme
Re-exports of the COOLJAPAN theme constructors.
theme_picker
Built-in theme picker widget.
tray
System tray integration (requires tray feature).

Structs§

App
A builder for an OxiUI application window.
ButtonResponse
Response from a button widget.
Color
RGBA colour value, one u8 per channel: Color(r, g, b, a).
FontSpec
Font specification for UI text.
HotkeyBinding
A single registered hotkey binding.
HotkeyConflict
Error returned when two hotkeys share the same (Modifiers, Key) pair.
HotkeyRegistry
A registry of keyboard hotkey bindings.
Palette
A palette of semantic colours for a UI theme.

Enums§

AppExit
Application exit status.
Backend
Available GUI backend choices for App.
UiError
Errors emitted by the OxiUI stack.

Traits§

Plugin
A plugin that receives lifecycle callbacks from the App event loop.
Theme
A UI theme that provides a colour palette, font specification, and design tokens.
UiCtx
Rendering context passed to every Widget::render call.

Functions§

process_rss_bytes
Approximate current process RSS (resident set size) in bytes.