Skip to main content

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//! - Lists are view-based `NSTableView`s whose cells are the core's row hosts.
7//! - Escape hatches: [`tweak`] for raw settings of built-in controls,
8//!   [`NativeRender`] for custom widgets, [`NativeView`] for any `NSView`,
9//!   and a rasterizer for drawn custom widgets.
10//! - Control actions and delegate callbacks become [`UiEvent`](mitsuami_core::UiEvent)s.
11//! - [`run`] drives the app: a run-loop observer calls [`Ui::tick`](mitsuami_core::Ui::tick)
12//!   before the loop sleeps, in all common modes (so live resize relayouts).
13
14#[cfg(target_os = "macos")]
15mod app;
16#[cfg(target_os = "macos")]
17mod backend;
18#[cfg(target_os = "macos")]
19mod classes;
20#[cfg(target_os = "macos")]
21mod custom;
22#[cfg(target_os = "macos")]
23mod keys;
24#[cfg(target_os = "macos")]
25mod list;
26#[cfg(target_os = "macos")]
27mod locale;
28#[cfg(target_os = "macos")]
29mod number_field;
30#[cfg(target_os = "macos")]
31mod radio;
32#[cfg(target_os = "macos")]
33mod services;
34#[cfg(target_os = "macos")]
35mod sidebar;
36#[cfg(target_os = "macos")]
37mod surface;
38#[cfg(target_os = "macos")]
39mod tabs;
40#[cfg(target_os = "macos")]
41mod text_area;
42#[cfg(target_os = "macos")]
43mod toolbar;
44#[cfg(target_os = "macos")]
45mod tweak;
46
47#[cfg(target_os = "macos")]
48pub use app::{init_for_tests, run};
49#[cfg(target_os = "macos")]
50pub use backend::{AppKitBackend, AppKitHandle, BackendOptions};
51#[cfg(target_os = "macos")]
52pub use custom::{AppKitCx, Emitter, NativeRender, NativeView, ad_hoc, native};
53#[cfg(target_os = "macos")]
54pub use number_field::NumberField;
55#[cfg(target_os = "macos")]
56pub use services::AppKitServices;
57#[cfg(target_os = "macos")]
58pub use tweak::{Tweakable, tweak, tweak_with};
59
60// The bindings native renders and native views are written with, at the
61// versions the backend uses.
62#[cfg(target_os = "macos")]
63pub use {objc2, objc2_app_kit, objc2_foundation};