euv-core 0.48.1

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
/// All supported execution targets across Web, Mobile, Tablet, Desktop, HarmonyOS, Wearables, Mini-Programs, QuickApps, Terminal, and Headless.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum PlatformKind {
    /// Browser WebAssembly platform using HTML5 Canvas / WebGL2 / WebGPU.
    Web,
    /// Android native platform using Android NDK (`ANativeWindow` / `AInput` / Vulkan / GLES).
    Android,
    /// iOS phone native platform using UIKit / CoreGraphics / Metal.
    Ios,
    /// iPadOS tablet native platform using UIKit / Stage Manager / Apple Pencil / Metal.
    IpadOs,
    /// macOS desktop native platform using Cocoa AppKit / CoreGraphics / Metal.
    MacOs,
    /// Windows desktop native platform using Win32 / GDI32 / DWM / Direct3D.
    Windows,
    /// Linux desktop native platform using X11 / Wayland / Vulkan.
    Linux,
    /// HarmonyOS / OpenHarmony native platform using ArkUI XComponent / `OHNativeWindow` / NAPI / EGL / Vulkan.
    HarmonyOs,
    /// Smart wearable / smartwatch platform (Wear OS, watchOS, HarmonyOS Watch, HyperOS/Vela, ZeppOS).
    Wearable,
    /// Super-app Mini-Program runtime (WeChat, Alipay, Douyin, Baidu, QQ, Kuaishou, HarmonyOS Atomic Service).
    MiniApp,
    /// QuickApp Alliance and Huawei QuickApp native-like runtime.
    QuickApp,
    /// Interactive PTY Terminal TUI platform using character cell grid and ANSI/VT escapes.
    Terminal,
    /// Non-interactive static/pipe CLI platform writing clean UTF-8 output with exit code propagation.
    TerminalCli,
    /// Deterministic offscreen headless platform for automated parity tests and benchmarks.
    #[default]
    Headless,
}

/// Physical device form factor used for adaptive layout and input affordances.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum DeviceFormFactor {
    /// Multi-window desktop workstation or 2-in-1 PC.
    #[default]
    Desktop,
    /// Large-screen touch + stylus + optional keyboard tablet (e.g. iPadOS, HarmonyOS Tablet).
    Tablet,
    /// Compact handheld phone (iOS / Android / HarmonyOS Phone).
    Phone,
    /// Dual-state foldable mobile/tablet display with hinge transition support.
    Foldable,
    /// Compact wrist wearable / smartwatch display (round, squircle, or rectangular).
    Watch,
    /// Living-room Smart TV / Vision display driven by 10-foot focus and remote D-pad.
    Tv,
    /// In-vehicle cockpit / automotive infotainment display.
    Automotive,
    /// Super-app Mini-Program or QuickApp container with capsule navigation chrome.
    MiniProgram,
    /// Web browser viewport.
    Browser,
    /// Interactive PTY terminal or non-interactive CLI pipe.
    Terminal,
    /// Offscreen headless test host.
    Headless,
}

/// Zero-dependency ABI-stable native OS window handle for GPU surface creation.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub enum RawWindowHandle {
    /// macOS AppKit handle carrying `(ns_window, ns_view, ca_metal_layer)` pointers.
    AppKit {
        /// Pointer to `NSWindow`.
        ns_window: usize,
        /// Pointer to `NSView`.
        ns_view: usize,
        /// Pointer to `CAMetalLayer`.
        metal_layer: usize,
    },
    /// iOS / iPadOS UIKit handle carrying `(ui_window, ui_view, ca_metal_layer, is_ipad)`.
    UiKit {
        /// Pointer to `UIWindow`.
        ui_window: usize,
        /// Pointer to `UIView`.
        ui_view: usize,
        /// Pointer to `CAMetalLayer`.
        metal_layer: usize,
        /// True when running on iPadOS tablet idiom.
        is_ipad: bool,
    },
    /// Windows Win32 handle carrying `(hwnd, hinstance)`.
    Win32 {
        /// Win32 `HWND` window handle.
        hwnd: usize,
        /// Win32 `HINSTANCE` module handle.
        hinstance: usize,
    },
    /// Linux X11 Xlib handle carrying `(window, display)`.
    Xlib {
        /// X11 `Window` identifier.
        window: u64,
        /// X11 `Display*` pointer.
        display: usize,
    },
    /// Linux Wayland handle carrying `(wl_surface, wl_display)`.
    Wayland {
        /// Pointer to `wl_surface`.
        surface: usize,
        /// Pointer to `wl_display`.
        display: usize,
    },
    /// Android NDK handle carrying `ANativeWindow*`.
    AndroidNdk {
        /// Pointer to `ANativeWindow`.
        native_window: usize,
    },
    /// HarmonyOS / OpenHarmony ArkUI XComponent surface carrying `(OHNativeWindow*, OH_NativeXComponent*)`.
    HarmonyXComponent {
        /// Pointer to `OHNativeWindow`.
        native_window: usize,
        /// Pointer to `OH_NativeXComponent`.
        xcomponent: usize,
    },
    /// Smartwatch native surface handle carrying `(native_handle, vendor_tag)`.
    WearableSurface {
        /// Opaque vendor surface handle pointer.
        native_handle: usize,
        /// Encoded `WearableVendor` discriminant tag.
        vendor_tag: u8,
    },
    /// Web browser canvas element identifier.
    WebCanvas {
        /// Canvas registration identifier.
        canvas_id: u32,
    },
    /// Mini-Program or QuickApp canvas handle carrying `(canvas_id, vendor_tag)`.
    MiniAppCanvas {
        /// Host canvas registration identifier.
        canvas_id: u32,
        /// Encoded host vendor tag.
        vendor_tag: u8,
    },
    /// Terminal PTY file descriptor or console handle.
    TerminalPty {
        /// Underlying terminal file descriptor (`0`/`1` on Unix, console handle low bits on Windows).
        fd: i32,
        /// True when attached to an interactive TTY/PTY rather than a pipe.
        is_tty: bool,
    },
    /// Offscreen headless surface with no OS window handle.
    #[default]
    Headless,
}