teksilo_core/window.rs
1// SPDX-License-Identifier: MPL-2.0
2// SPDX-FileCopyrightText: 2026 FernTech
3
4//! Window identity and per-window state.
5//!
6//! [`TeksiloWindowId`] is the opaque, `Copy` id allocated by the app-level
7//! window manager and threaded through every public API that needs to
8//! refer to a specific window (modal parents, cross-window focus,
9//! close requests, …).
10//!
11//! [`WindowState`] carries the reactive, signal-bound surface for a
12//! single window — placement, title, size, position, focus, etc. App
13//! code writes to these signals to push state to the OS; OS-originated
14//! changes write back into the same signals via `*_from_os` setters
15//! guarded by `WindowStateInner::applying_from_os`, so observers that
16//! propagate writes to the OS do not re-loop.
17//!
18//! [`WindowCommand`] is the private queue element produced by those
19//! observers; the app-level window manager drains it once per tick and
20//! translates each command into a winit call.
21
22pub mod command;
23pub mod config;
24pub mod decorations;
25pub mod icon;
26pub mod id;
27pub mod menubar_dispatcher;
28pub mod ops;
29pub mod placement;
30pub mod state;
31
32pub use command::{UserAttentionKind, WindowCommand};
33pub use config::{
34 CloseBlockedCallback, CloseGuard, CloseResponse, ModalConfig, PostRootBuilder, RootBuilder,
35 SizeToContent, WindowConfig, WindowRemovedCallback, WindowRemovedEvent,
36};
37pub use decorations::DecorationsMode;
38pub use icon::WindowIcon;
39pub use id::TeksiloWindowId;
40pub use menubar_dispatcher::{
41 MenubarAction, MenubarDispatcher, MenubarGuard, MenubarKeyEvent, MenubarReveal,
42};
43pub use ops::{NoopWindowOps, WindowOps};
44pub use placement::WindowPlacement;
45pub use state::WindowState;