veko doc
Self-Contained API Reference • Gradual Types • Capabilities • Wasm Sandbox

ui/shell_mac

lib/ui/shell_mac.vk

lib/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.

signature
MacShortcutSpec = struct { chord str, mods i64, vk i64, mac_vk i64, mac_mods i64, hk_id i64 = ..., label str = ... }
signature
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 = ... }
signature
vk-to-macos-keycode = fn [win_vk i64] i64
signature
mods-to-carbon = fn [win_mods i64] i64
mac-tray-create fn caps: .ffi
signature
mac-tray-create = fn [mut sh MacShellState, delegate_obj i64, tooltip str, icon_canvas any, menu_items block, click_action any] bool
signature
mac-tray-update = fn [mut sh MacShellState, delegate_obj i64, tooltip str, icon_canvas any, menu_items block] bool
signature
mac-tray-remove = fn [mut sh MacShellState]
mac-notify fn caps: .fs .ffi
signature
mac-notify = fn [mut sh MacShellState, title str, body str, tone enum] bool
mac-register-shortcut fn caps: .ffi
signature
mac-register-shortcut = fn [mut sh MacShellState, chord str] any
signature
mac-unregister-shortcut = fn [mut sh MacShellState, chord str] bool
signature
mac-decode-hotkey-id = fn [sh MacShellState, hk_id i64] str
signature
mac-shutdown-shell = fn [mut sh MacShellState]