mitsuami_appkit/lib.rs
1//! AppKit (macOS) backend for mitsuami.
2//!
3//! - Containers are flipped `NSView`s that do no layout of their own; the
4//! core positions every child with `setFrame:`.
5//! - Leaf widgets are stock AppKit controls, measured through their cells.
6//! - Escape hatches: [`NativeRender`] for custom widgets, [`NativeView`]
7//! for any `NSView`, and a rasterizer for drawn custom widgets.
8//! - Control actions and delegate callbacks become [`UiEvent`](mitsuami_core::UiEvent)s.
9//! - [`run`] drives the app: a run-loop observer calls [`Ui::tick`](mitsuami_core::Ui::tick)
10//! before the loop sleeps, in all common modes (so live resize relayouts).
11
12#[cfg(target_os = "macos")]
13mod app;
14#[cfg(target_os = "macos")]
15mod backend;
16#[cfg(target_os = "macos")]
17mod classes;
18#[cfg(target_os = "macos")]
19mod custom;
20#[cfg(target_os = "macos")]
21mod services;
22
23#[cfg(target_os = "macos")]
24pub use app::{init_for_tests, run};
25#[cfg(target_os = "macos")]
26pub use backend::{AppKitBackend, AppKitHandle, BackendOptions};
27#[cfg(target_os = "macos")]
28pub use custom::{AppKitCx, Emitter, NativeRender, NativeView, ad_hoc, native};
29#[cfg(target_os = "macos")]
30pub use services::AppKitServices;
31
32// The bindings native renders and native views are written with, at the
33// versions the backend uses.
34#[cfg(target_os = "macos")]
35pub use {objc2, objc2_app_kit, objc2_foundation};