corundum_framework/lib.rs
1//! `corundum-framework` — a single-dependency facade over the crates the sapphire apps and
2//! asteria share.
3//!
4//! Depend on this one crate and turn on the features you need; each feature re-exports a
5//! `corundum-framework-*` crate as a module, the same way sapphire-framework's facade does.
6//! The default is the part without egui, for the crates without a window (a server, a CLI);
7//! an app turns on `gui`.
8//!
9//! ```toml
10//! # A desktop app:
11//! corundum-framework = { version = "0.1", features = ["eframe", "serde"] }
12//! # The same app on an Android phone:
13//! corundum-framework = { version = "0.1", features = ["android", "serde"] }
14//! ```
15//!
16//! ## Modules (feature-gated)
17//!
18//! | feature | module | crate |
19//! |---|---|---|
20//! | `platform` (default) | [`platform`] | `corundum-framework-platform`: the app's directories, the system's languages, the JNI / Objective-C bridging |
21//! | `gui` | [`gui`] | `corundum-framework-gui`: the shell, theme, fonts, icons and translations (brings `platform`) |
22//! | `eframe` | `gui::window::run`, [`eframe`] | `corundum-framework-gui` with its `eframe` feature: a desktop window started the same way for every app |
23//! | `android` | `gui::window::run_android`, [`eframe`] | `corundum-framework-gui` with its `android` feature: the window on an Android phone (brings `eframe`) |
24//! | `serde` | `gui::look`, `gui::store` | `Serialize` / `Deserialize` on the gui's theme and language settings, and `store`: the look in effect and the rail's order, kept on the device in a TOML file and put back before the first frame |
25
26#[cfg(feature = "platform")]
27pub use corundum_framework_platform as platform;
28
29#[cfg(feature = "gui")]
30pub use corundum_framework_gui as gui;
31
32// The egui the components are built against, at the top as well: an app that depends on
33// this facade alone renders with this one.
34#[cfg(feature = "gui")]
35pub use corundum_framework_gui::egui;
36
37// The eframe the window runs on, for the app's `eframe::App`; `android` brings `eframe`.
38#[cfg(feature = "eframe")]
39pub use corundum_framework_gui::eframe;