ferroui_winui/lib.rs
1//! ferroui-winui
2//!
3//! The framework's content inside a WinUI 3 (Windows App SDK) application:
4//! [`FerroSwapChainPanel`], a `SwapChainPanel` the content renders into
5//! through a composition swap chain of the Windows backend, with pointer,
6//! keyboard and text input, cursors, drag and drop and automation.
7//!
8//! The design, the bindings, the threads and how it is tested are in
9//! `docs/porting/winui.md`. The crate compiles on every host; what calls the
10//! system is compiled for Windows only (`cfg(windows)`), and the logic that
11//! maps values (keys, cursors, control types, pointer events, text) is
12//! compiled, and tested, everywhere.
13//!
14//! An application initialises the Windows App SDK ([`WindowsAppSdk`]), sets
15//! the framework up with the Windows backend and its ANGLE rendering mode
16//! (the swap chain of the panel is created on ANGLE's Direct3D 11 device),
17//! runs the XAML application ([`XamlApplication::start`]) and, from its
18//! launch, puts a panel into a window of WinUI with the content it shows.
19//! Once `Application.Start` has returned and the bootstrap is shut down, it
20//! ends the process with [`end_process`], as the runtime of the reference
21//! ends it (docs/porting/winui.md, section 7.7).
22
23#![cfg_attr(not(windows), allow(dead_code))]
24
25#[macro_use]
26pub mod interop;
27
28mod automation;
29mod ferro_swap_chain_panel;
30mod process_end;
31mod win_ui_cursor_factory;
32mod win_ui_drag_source;
33mod win_ui_key_interop;
34mod win_ui_text_input_method;
35mod windows_app_sdk;
36mod xaml_application;
37
38#[cfg(windows)]
39pub use ferro_swap_chain_panel::FerroSwapChainPanel;
40pub use windows_app_sdk::{parse_major_minor, WindowsAppSdkOptions};
41#[cfg(windows)]
42pub use process_end::{end_process, process_threads};
43#[cfg(windows)]
44pub use windows_app_sdk::WindowsAppSdk;
45#[cfg(windows)]
46pub use xaml_application::{XamlApplication, XamlGrid, XamlWindow};