//! The console's screens and their shared contract. Each screen owns its focus state //! and rendering; the [`crate::shell::Shell`] owns the stack, the transitions, the //! chrome, and the overlays — a screen never draws its own background or hint bar, so //! every screen animates and reads identically. pub(crate) mod add_host; pub(crate) mod home; pub(crate) mod library; pub(crate) mod pair; pub(crate) mod settings; use crate::glyphs::Hint; use crate::library::LibraryShared; use crate::model::{ConsoleCmd, HostRow}; use crate::theme::Fonts; use pf_client_core::gamepad::{MenuEvent, MenuPulse}; use pf_client_core::{gamepad::PadInfo, trust}; use skia_safe::{Canvas, Rect}; /// What a screen draws over (the shell crossfades between them on push/pop). #[derive(Clone, Copy, PartialEq, Eq)] pub(crate) enum Bg { /// The living mesh aurora (home, library). Aurora, /// The quiet indigo form backdrop (settings, add-host, pair). Form, } /// Everything a screen may read while handling input or rendering. Settings are /// mutable — the settings screen edits and persists them in place. pub(crate) struct Ctx<'a> { pub hosts: &'a [HostRow], /// The one live library model slot (the screen on top of the stack owns it). pub library: &'a LibraryShared, pub settings: &'a mut trust::Settings, pub pads: &'a [PadInfo], /// Steam Deck: never draw our keyboard — Steam's types via SDL text input. pub deck: bool, /// The name the HOST stores this client under when pairing (the machine's /// hostname, resolved by the binary). pub device_name: &'a str, /// The shell clock, seconds (spinners, pulses). pub t: f64, } /// A host a screen wants to start a session on (the shell turns this into an /// `OverlayAction::Launch` + the connecting overlay). pub(crate) struct ConnectIntent { pub addr: String, pub port: u16, pub fp_hex: String, /// Library title id (`None` streams the desktop). pub launch: Option, /// What the connecting card says (host or game title). pub title: String, } pub(crate) enum Nav { Push(Box), /// Pop this screen; popping the root quits the console. Pop, } /// Everything a screen's input handling may ask of the shell, collected per event and /// applied AFTER the dispatch (no re-entrant stack mutation). #[derive(Default)] pub(crate) struct Outbox { pub nav: Option