AtlatestRepositorysigil-ui
1# macOS drawing adapter
2
3See [combined Mac qualification](macos-qualification.md) for the reproducible
4prebuilt font/window/UI fixture, configurable Linux gates and packet procedure.
5
6sigil-ui 0.2.6 draws into sigil-window 0.2.0's SDK-free AppKit host.
7`(sigil ui window)` selects the AppKit adapter on Darwin. Existing
8`appkit-*` names in `(sigil ui appkit)` remain available: open/close,
9geometry, dispatch, clipboard, fullscreen, canvas/UI/overlay presentation
10and the event loop. The host owns all windows, input, child views,
11clipboard state and scheduling; this package owns rasterization and UI state.
13Sizes and input coordinates are logical pixels. Canvas extents and explicit
14damage rectangles are device pixels. UI damage is scaled once before host
15presentation. Empty damage does not submit a frame. Presentation snapshots
16the host generation, and a UI associated with an older generation or a
17different window is refused. Recreate the UI after resize/scale changes.
18The native host copies the pixel and optional A8 alpha planes.
20`appkit-run!` delegates to the host loop. During nested AppKit tracking,
21its paint callback repaints already realized display items at current
22geometry. It does not rerun components, update application state or dispatch
23browser work. The application step runs in the outer event loop. All native
24host calls stay on the process main thread.
26Native embedding adapters include sigil-window's `native/appkit-host.h` and
27use `sigil_window_appkit_*` symbols. Host tokens are numeric identities, not
28NSWindow/NSView pointers. The old sigil-ui SUI geometry/key records are not
29binary-compatible with the new SW records; rebuild FFI layouts and callback
30conversions together. Host ABI and callback ownership are documented by
31sigil-window in `docs/appkit-abi.md`.
33The UI package contains no Objective-C source or framework link flags.
34Its Darwin native sources are raster.c, png.c and surface-unavailable.c;
35AppKit native sources come from sigil-window. Named darwin-arm64 and
36darwin-amd64 configurations use Zig 0.16.0 and macOS 15.0. A complete demo
37also depends on its font backend: the currently released CoreText backend
38still needs a separate SDK-free migration. Do not mistake host/UI object
39builds for proof that the full demo or an application core cross-builds.
41For cross-build dependency resolution with Sigil 0.24.8, supply target
42features before the manifest is loaded, as well as selecting the named
43configuration. The manifest uses these features to select sigil-window:
45```text
46SIGIL_FEATURES=cross,darwin sigil deps install
47SIGIL_FEATURES=cross,darwin sigil build -c darwin-arm64
48SIGIL_FEATURES=cross,windows sigil build -c windows-amd64
49```
51Use the matching features during Windows dependency installation too.
52Linux builds use the default host features and exclude sigil-window.
54The former Objective-C host fixtures have moved to sigil-window's C native
55host and Sigil conformance fixtures. Use its sealed `qualify.sgl` packet on
56an arm64 Mac to validate the Linux-built host executables. This replaces
57the retired services-check/embedding-check/tracking-check/resize-check
58paths in build-macos-demo.sgl. Active menus, native fullscreen animation,
59outline text and browser integration need separate behavior qualification.
61The drawing adapter's host-boundary checks run on Linux without a display:
63```text
64sigil -L test/appkit-host-stub test/check-appkit-adapter.sgl
65```
67The controlled host verifies buffer/alpha forwarding, damage validation,
68window ownership and generation refusal. It does not stand in for native
69AppKit behavior. The legacy `(sigil ui appkit wait)` module forwards to
70sigil-window's scheduler implementation.