AtlatestRepositorysigil-ui
1
# macOS drawing adapter3
See [combined Mac qualification](macos-qualification.md) for the reproducible4
prebuilt font/window/UI fixture, configurable Linux gates and packet procedure.6
sigil-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. Existing8
`appkit-*` names in `(sigil ui appkit)` remain available: open/close,9
geometry, dispatch, clipboard, fullscreen, canvas/UI/overlay presentation10
and the event loop. The host owns all windows, input, child views,11
clipboard state and scheduling; this package owns rasterization and UI state.13
Sizes and input coordinates are logical pixels. Canvas extents and explicit14
damage rectangles are device pixels. UI damage is scaled once before host15
presentation. Empty damage does not submit a frame. Presentation snapshots16
the host generation, and a UI associated with an older generation or a17
different window is refused. Recreate the UI after resize/scale changes.18
The native host copies the pixel and optional A8 alpha planes.20
`appkit-run!` delegates to the host loop. During nested AppKit tracking,21
its paint callback repaints already realized display items at current22
geometry. It does not rerun components, update application state or dispatch23
browser work. The application step runs in the outer event loop. All native24
host calls stay on the process main thread.26
Native embedding adapters include sigil-window's `native/appkit-host.h` and27
use `sigil_window_appkit_*` symbols. Host tokens are numeric identities, not28
NSWindow/NSView pointers. The old sigil-ui SUI geometry/key records are not29
binary-compatible with the new SW records; rebuild FFI layouts and callback30
conversions together. Host ABI and callback ownership are documented by31
sigil-window in `docs/appkit-abi.md`.33
The UI package contains no Objective-C source or framework link flags.34
Its Darwin native sources are raster.c, png.c and surface-unavailable.c;35
AppKit native sources come from sigil-window. Named darwin-arm64 and36
darwin-amd64 configurations use Zig 0.16.0 and macOS 15.0. A complete demo37
also depends on its font backend: the currently released CoreText backend38
still needs a separate SDK-free migration. Do not mistake host/UI object39
builds for proof that the full demo or an application core cross-builds.41
For cross-build dependency resolution with Sigil 0.24.8, supply target42
features before the manifest is loaded, as well as selecting the named43
configuration. The manifest uses these features to select sigil-window:45
```text46
SIGIL_FEATURES=cross,darwin sigil deps install47
SIGIL_FEATURES=cross,darwin sigil build -c darwin-arm6448
SIGIL_FEATURES=cross,windows sigil build -c windows-amd6449
```51
Use the matching features during Windows dependency installation too.52
Linux builds use the default host features and exclude sigil-window.54
The former Objective-C host fixtures have moved to sigil-window's C native55
host and Sigil conformance fixtures. Use its sealed `qualify.sgl` packet on56
an arm64 Mac to validate the Linux-built host executables. This replaces57
the retired services-check/embedding-check/tracking-check/resize-check58
paths in build-macos-demo.sgl. Active menus, native fullscreen animation,59
outline text and browser integration need separate behavior qualification.61
The drawing adapter's host-boundary checks run on Linux without a display:63
```text64
sigil -L test/appkit-host-stub test/check-appkit-adapter.sgl65
```67
The controlled host verifies buffer/alpha forwarding, damage validation,68
window ownership and generation refusal. It does not stand in for native69
AppKit behavior. The legacy `(sigil ui appkit wait)` module forwards to70
sigil-window's scheduler implementation.