frust_shell_desktop/lib.rs
1//! Desktop preview shell **and shared desktop core**: the primary dev-loop
2//! platform embedding, and the cross-platform half every per-OS desktop shell
3//! crate builds on.
4//!
5//! Wraps winit 0.30's [`ApplicationHandler`](winit::application::ApplicationHandler)
6//! event loop around the Frust render stack (`frust-render` + `frust-engine`), so a
7//! `cargo run` opens the app in a native window with a sub-second rebuild loop
8//! and no mobile toolchain. The facade crate (`frust`) drives this via
9//! [`run_desktop`] (zero-config) or [`run_desktop_with`] (with the app's
10//! [`DesktopConfig`] identity and a per-OS [`DesktopExtensions`] set — see the
11//! [`extensions`] module for the hook contract).
12
13mod app_handler;
14mod cache;
15pub mod config;
16pub mod extensions;
17mod logger;
18mod platform_view;
19mod render;
20
21pub use app_handler::{run_desktop, run_desktop_with};
22pub use config::{DEFAULT_APP_NAME, DesktopConfig, IconData, MenuItemSpec, MenuRole, MenuSpec};
23pub use extensions::{CloseAction, DesktopEventLoopBuilder, DesktopExtensions, NoExtensions};
24
25/// The desktop event loop's user-event type, `pub` only so
26/// [`DesktopEventLoopBuilder`] (the builder-stage hook's parameter) can name
27/// it. `#[doc(hidden)]` keeps it out of published docs — the same escape
28/// [`paced_wake`] uses. [`PasteText`] rides along for the same reason and no
29/// other: it is the payload of that type's clipboard-answer variant (the text
30/// the clipboard worker thread read), and a variant carrying a type the crate
31/// root cannot name is a lint, not an API.
32#[doc(hidden)]
33pub use app_handler::{PasteText, ShellUserEvent};
34
35/// Pure, winit-free decision logic behind `ShellHandler`'s paced-wake
36/// mechanism (see the module's own docs). `run_desktop`/`ShellHandler` are
37/// this crate's only real public surface — this module is `pub` purely so
38/// `tests/paced_wake_integration.rs` can drive it as a black box with a fake
39/// advancing clock; `#[doc(hidden)]` keeps it out of published docs.
40#[doc(hidden)]
41pub mod paced_wake;