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 document_tabs;
24#[cfg(target_os = "macos")]
25mod header;
26#[cfg(target_os = "macos")]
27mod keys;
28#[cfg(target_os = "macos")]
29mod list;
30#[cfg(target_os = "macos")]
31mod locale;
32#[cfg(target_os = "macos")]
33mod number_field;
34#[cfg(target_os = "macos")]
35mod popover;
36#[cfg(target_os = "macos")]
37mod radio;
38#[cfg(target_os = "macos")]
39mod services;
40#[cfg(target_os = "macos")]
41mod sidebar;
42#[cfg(target_os = "macos")]
43mod split_view;
44#[cfg(target_os = "macos")]
45mod suggestions;
46#[cfg(target_os = "macos")]
47mod surface;
48#[cfg(target_os = "macos")]
49mod tabs;
50#[cfg(target_os = "macos")]
51mod text_area;
52#[cfg(target_os = "macos")]
53mod toolbar;
54#[cfg(target_os = "macos")]
55mod tweak;
56
57#[cfg(target_os = "macos")]
58pub use app::{init_for_tests, run};
59#[cfg(target_os = "macos")]
60pub use backend::{AppKitBackend, AppKitHandle, BackendOptions};
61#[cfg(target_os = "macos")]
62pub use custom::{AppKitCx, Emitter, NativeRender, NativeView, ad_hoc, native};
63#[cfg(target_os = "macos")]
64pub use number_field::NumberField;
65#[cfg(target_os = "macos")]
66pub use services::AppKitServices;
67#[cfg(target_os = "macos")]
68pub use tweak::{Tweakable, tweak, tweak_with};
69
70// The bindings native renders and native views are written with, at the
71// versions the backend uses.
72#[cfg(target_os = "macos")]
73pub use {objc2, objc2_app_kit, objc2_foundation};