ui/shell_mac
lib/ui/shell_mac.vklib/ui/shell_mac.vk
Pure-Veko macOS Desktop Shell integration (Slice 3):
NSStatusItem Tray, UNUserNotificationCenter / NSUserNotificationCenter, Canvas->NSImage, & Carbon Global Hotkeys.
- Zero top-level mut globals: all state lives in MacShellState.
- Calls ffi/* builtins directly inside tiny local helpers (no use [ffi]) so consumers work under .ui.
- Deterministic headless simulator mode when sh.headless is true, VEKO_HEADLESS=1, or non-macOS.
MacShortcutSpec = struct { chord str, mods i64, vk i64, mac_vk i64, mac_mods i64, hk_id i64 = ..., label str = ... }
MacShellState = struct { headless bool = ..., status_item i64 = ..., tray_active bool = ..., tooltip str = ..., menu_items block = ..., click_action any = ..., shortcuts map = ..., id_to_chord map = ..., hk_refs map = ..., next_hk_id i64 = ..., sim_notifications block = ... }
vk-to-macos-keycode = fn [win_vk i64] i64
mods-to-carbon = fn [win_mods i64] i64
mac-tray-create = fn [mut sh MacShellState, delegate_obj i64, tooltip str, icon_canvas any, menu_items block, click_action any] bool
mac-tray-update = fn [mut sh MacShellState, delegate_obj i64, tooltip str, icon_canvas any, menu_items block] bool
mac-tray-remove = fn [mut sh MacShellState]
mac-notify = fn [mut sh MacShellState, title str, body str, tone enum] bool
mac-register-shortcut = fn [mut sh MacShellState, chord str] any
mac-unregister-shortcut = fn [mut sh MacShellState, chord str] bool
mac-decode-hotkey-id = fn [sh MacShellState, hk_id i64] str
mac-shutdown-shell = fn [mut sh MacShellState]