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