euv-core 0.53.0

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
/// Canonical HarmonyOS `module.json5` deviceType string for smartphones.
pub const HARMONY_DEVICE_PHONE: &str = "phone";

/// Canonical HarmonyOS `module.json5` deviceType string for tablets.
pub const HARMONY_DEVICE_TABLET: &str = "tablet";

/// Canonical HarmonyOS `module.json5` deviceType string for PCs / 2-in-1 laptops.
pub const HARMONY_DEVICE_PC_2IN1: &str = "2in1";

/// Canonical HarmonyOS device identifier for foldable displays.
pub const HARMONY_DEVICE_FOLDABLE: &str = "foldable";

/// Canonical HarmonyOS `module.json5` deviceType string for smartwatches/wearables.
pub const HARMONY_DEVICE_WATCH: &str = "wearable";

/// Canonical HarmonyOS `module.json5` deviceType string for Smart TV / Vision displays.
pub const HARMONY_DEVICE_TV: &str = "tv";

/// Canonical HarmonyOS `module.json5` deviceType string for Automotive / Cockpit displays.
pub const HARMONY_DEVICE_AUTOMOTIVE: &str = "car";

/// HarmonyOS ArkUI NDK shared library name exporting `OH_NativeXComponent_*` symbols.
pub const HARMONY_LIB_ACE_NDK: &str = "libace_ndk.z.so";

/// OpenHarmony native window shared library name exporting `OH_NativeWindow_*` symbols.
pub const HARMONY_LIB_NATIVE_WINDOW: &str = "libnative_window.so";

/// OpenHarmony NAPI runtime library name exporting `napi_*` symbols.
pub const HARMONY_LIB_ACE_NAPI: &str = "libace_napi.z.so";

/// OpenHarmony native VSync shared library name exporting `OH_NativeVSync_*` symbols.
pub const HARMONY_LIB_NATIVE_VSYNC: &str = "libnative_vsync.so";

/// OpenHarmony `OH_NativeXComponent` touch down type constant (`OH_NATIVEXCOMPONENT_DOWN`).
pub const HARMONY_TOUCH_DOWN: i32 = 0;

/// OpenHarmony `OH_NativeXComponent` touch up type constant (`OH_NATIVEXCOMPONENT_UP`).
pub const HARMONY_TOUCH_UP: i32 = 1;

/// OpenHarmony `OH_NativeXComponent` touch move type constant (`OH_NATIVEXCOMPONENT_MOVE`).
pub const HARMONY_TOUCH_MOVE: i32 = 2;

/// OpenHarmony `OH_NativeXComponent` touch cancel type constant (`OH_NATIVEXCOMPONENT_CANCEL`).
pub const HARMONY_TOUCH_CANCEL: i32 = 3;

/// OpenHarmony `OHNativeWindow` `SET_BUFFER_GEOMETRY` handle option code.
pub const HARMONY_NW_OPT_SET_BUFFER_GEOMETRY: i32 = 0;

/// OpenHarmony `OHNativeWindow` `GET_BUFFER_GEOMETRY` handle option code.
pub const HARMONY_NW_OPT_GET_BUFFER_GEOMETRY: i32 = 1;

/// OpenHarmony `OHNativeWindow` `SET_FORMAT` handle option code (`PIXEL_FMT_RGBA_8888 = 12`).
pub const HARMONY_NW_OPT_SET_FORMAT: i32 = 3;

/// OpenHarmony `PIXEL_FMT_RGBA_8888` native buffer pixel format code.
pub const HARMONY_PIXEL_FMT_RGBA_8888: i32 = 12;

/// OpenHarmony `OH_NativeXComponent` key code for system Back (`KEYCODE_BACK`).
pub const HARMONY_KEYCODE_BACK: i32 = 2;

/// OpenHarmony `OH_NativeXComponent` key code for D-pad Up (`KEYCODE_DPAD_UP`).
pub const HARMONY_KEYCODE_DPAD_UP: i32 = 2012;

/// OpenHarmony `OH_NativeXComponent` key code for D-pad Down (`KEYCODE_DPAD_DOWN`).
pub const HARMONY_KEYCODE_DPAD_DOWN: i32 = 2013;

/// OpenHarmony `OH_NativeXComponent` key code for D-pad Left (`KEYCODE_DPAD_LEFT`).
pub const HARMONY_KEYCODE_DPAD_LEFT: i32 = 2014;

/// OpenHarmony `OH_NativeXComponent` key code for D-pad Right (`KEYCODE_DPAD_RIGHT`).
pub const HARMONY_KEYCODE_DPAD_RIGHT: i32 = 2015;

/// OpenHarmony `OH_NativeXComponent` key code for D-pad Center / OK (`KEYCODE_DPAD_CENTER`).
pub const HARMONY_KEYCODE_DPAD_CENTER: i32 = 2016;

/// OpenHarmony `OH_NativeXComponent` key code for Tab (`KEYCODE_TAB`).
pub const HARMONY_KEYCODE_TAB: i32 = 2049;

/// OpenHarmony `OH_NativeXComponent` key code for Space (`KEYCODE_SPACE`).
pub const HARMONY_KEYCODE_SPACE: i32 = 2050;

/// OpenHarmony `OH_NativeXComponent` key code for Enter (`KEYCODE_ENTER`).
pub const HARMONY_KEYCODE_ENTER: i32 = 2054;

/// OpenHarmony `OH_NativeXComponent` key code for Backspace (`KEYCODE_DEL`).
pub const HARMONY_KEYCODE_DEL: i32 = 2055;

/// OpenHarmony `OH_NativeXComponent` key code for Forward Delete (`KEYCODE_FORWARD_DEL`).
pub const HARMONY_KEYCODE_FORWARD_DEL: i32 = 2071;

/// OpenHarmony `OH_NativeXComponent` key code for Escape (`KEYCODE_ESCAPE`).
pub const HARMONY_KEYCODE_ESCAPE: i32 = 2070;

/// OpenHarmony `AbilityConstant.MemoryLevel.MEMORY_LEVEL_MODERATE`.
pub const HARMONY_MEMORY_MODERATE: i32 = 0;

/// OpenHarmony `AbilityConstant.MemoryLevel.MEMORY_LEVEL_LOW`.
pub const HARMONY_MEMORY_LOW: i32 = 1;

/// OpenHarmony `AbilityConstant.MemoryLevel.MEMORY_LEVEL_CRITICAL`.
pub const HARMONY_MEMORY_CRITICAL: i32 = 2;

/// OpenHarmony `OH_NativeXComponent` mouse press action (`OH_NATIVEXCOMPONENT_MOUSE_PRESS`).
pub const HARMONY_MOUSE_PRESS: i32 = 1;

/// OpenHarmony `OH_NativeXComponent` mouse release action (`OH_NATIVEXCOMPONENT_MOUSE_RELEASE`).
pub const HARMONY_MOUSE_RELEASE: i32 = 2;

/// OpenHarmony `OH_NativeXComponent` mouse move action (`OH_NATIVEXCOMPONENT_MOUSE_MOVE`).
pub const HARMONY_MOUSE_MOVE: i32 = 3;

/// OpenHarmony `OH_NativeXComponent` mouse cancel action (`OH_NATIVEXCOMPONENT_MOUSE_CANCEL`).
pub const HARMONY_MOUSE_CANCEL: i32 = 4;

/// OpenHarmony `OH_NativeXComponent` primary left mouse button (`OH_NATIVEXCOMPONENT_LEFT_BUTTON`).
pub const HARMONY_MOUSE_BUTTON_LEFT: i32 = 1;

/// OpenHarmony `OH_NativeXComponent` secondary right mouse button (`OH_NATIVEXCOMPONENT_RIGHT_BUTTON`).
pub const HARMONY_MOUSE_BUTTON_RIGHT: i32 = 2;

/// OpenHarmony `OH_NativeXComponent` middle scroll-wheel mouse button (`OH_NATIVEXCOMPONENT_MIDDLE_BUTTON`).
pub const HARMONY_MOUSE_BUTTON_MIDDLE: i32 = 4;

/// OpenHarmony `OH_NativeXComponent` first numeric digit key code (`KEY_0`).
pub const HARMONY_KEYCODE_0: i32 = 2000;

/// OpenHarmony `OH_NativeXComponent` last numeric digit key code (`KEY_9`).
pub const HARMONY_KEYCODE_9: i32 = 2009;

/// OpenHarmony `OH_NativeXComponent` first Latin letter key code (`KEY_A`).
pub const HARMONY_KEYCODE_A: i32 = 2017;

/// OpenHarmony `OH_NativeXComponent` last Latin letter key code (`KEY_Z`).
pub const HARMONY_KEYCODE_Z: i32 = 2042;

/// OpenHarmony `OH_NativeXComponent` left Alt key code (`KEY_ALT_LEFT`).
pub const HARMONY_KEYCODE_ALT_LEFT: i32 = 2045;

/// OpenHarmony `OH_NativeXComponent` right Alt key code (`KEY_ALT_RIGHT`).
pub const HARMONY_KEYCODE_ALT_RIGHT: i32 = 2046;

/// OpenHarmony `OH_NativeXComponent` left Shift key code (`KEY_SHIFT_LEFT`).
pub const HARMONY_KEYCODE_SHIFT_LEFT: i32 = 2047;

/// OpenHarmony `OH_NativeXComponent` right Shift key code (`KEY_SHIFT_RIGHT`).
pub const HARMONY_KEYCODE_SHIFT_RIGHT: i32 = 2048;

/// OpenHarmony `OH_NativeXComponent` Page Up key code (`KEY_PAGE_UP`).
pub const HARMONY_KEYCODE_PAGE_UP: i32 = 2068;

/// OpenHarmony `OH_NativeXComponent` Page Down key code (`KEY_PAGE_DOWN`).
pub const HARMONY_KEYCODE_PAGE_DOWN: i32 = 2069;

/// OpenHarmony `OH_NativeXComponent` left Control key code (`KEY_CTRL_LEFT`).
pub const HARMONY_KEYCODE_CTRL_LEFT: i32 = 2072;

/// OpenHarmony `OH_NativeXComponent` right Control key code (`KEY_CTRL_RIGHT`).
pub const HARMONY_KEYCODE_CTRL_RIGHT: i32 = 2073;

/// OpenHarmony `OH_NativeXComponent` left Meta/Super key code (`KEY_META_LEFT`).
pub const HARMONY_KEYCODE_META_LEFT: i32 = 2076;

/// OpenHarmony `OH_NativeXComponent` right Meta/Super key code (`KEY_META_RIGHT`).
pub const HARMONY_KEYCODE_META_RIGHT: i32 = 2077;

/// OpenHarmony `OH_NativeXComponent` Home key code (`KEY_MOVE_HOME`).
pub const HARMONY_KEYCODE_MOVE_HOME: i32 = 2081;

/// OpenHarmony `OH_NativeXComponent` End key code (`KEY_MOVE_END`).
pub const HARMONY_KEYCODE_MOVE_END: i32 = 2082;

/// OpenHarmony `@ohos.multimodalInput.pointer` default arrow pointer style ID.
pub const HARMONY_POINTER_STYLE_DEFAULT: i32 = 0;

/// OpenHarmony `@ohos.multimodalInput.pointer` hand pointing link pointer style ID.
pub const HARMONY_POINTER_STYLE_HAND_POINTING: i32 = 6;

/// OpenHarmony `@ohos.multimodalInput.pointer` text I-beam cursor style ID.
pub const HARMONY_POINTER_STYLE_TEXT_CURSOR: i32 = 10;

/// OpenHarmony `@ohos.multimodalInput.pointer` vertical resize pointer style ID.
pub const HARMONY_POINTER_STYLE_NORTH_SOUTH: i32 = 11;

/// OpenHarmony `@ohos.multimodalInput.pointer` horizontal resize pointer style ID.
pub const HARMONY_POINTER_STYLE_WEST_EAST: i32 = 12;

/// OpenHarmony `@ohos.multimodalInput.pointer` crosshair precision pointer style ID.
pub const HARMONY_POINTER_STYLE_CROSSHAIR: i32 = 18;

/// OpenHarmony `@ohos.multimodalInput.pointer` move/drag pointer style ID.
pub const HARMONY_POINTER_STYLE_MOVE: i32 = 22;

/// OpenHarmony `@ohos.multimodalInput.pointer` forbidden/not-allowed pointer style ID.
pub const HARMONY_POINTER_STYLE_FORBIDDEN: i32 = 25;

/// OpenHarmony `@ohos.multimodalInput.pointer` open-hand grab pointer style ID.
pub const HARMONY_POINTER_STYLE_HAND_OPEN: i32 = 26;

/// OpenHarmony `@ohos.multimodalInput.pointer` closed-hand grabbing pointer style ID.
pub const HARMONY_POINTER_STYLE_HAND_GRABBING: i32 = 27;

/// Alias accepted by `HarmonyDeviceType::from_str_id` for HarmonyOS PC / 2-in-1 desktops.
pub(crate) const HARMONY_ALIAS_PC: &str = "pc";

/// Alias accepted by `HarmonyDeviceType::from_str_id` for HarmonyOS PC desktop builds.
pub(crate) const HARMONY_ALIAS_HARMONY_PC: &str = "harmony-pc";

/// Alias accepted by `HarmonyDeviceType::from_str_id` for desktop form factor.
pub(crate) const HARMONY_ALIAS_DESKTOP: &str = "desktop";

/// Alias accepted by `HarmonyDeviceType::from_str_id` for smartwatch devices.
pub(crate) const HARMONY_ALIAS_WATCH: &str = "watch";

/// Alias accepted by `HarmonyDeviceType::from_str_id` for Smart TV / Vision displays.
pub(crate) const HARMONY_ALIAS_VISION: &str = "vision";

/// Alias accepted by `HarmonyDeviceType::from_str_id` for automotive cockpit targets.
pub(crate) const HARMONY_ALIAS_AUTOMOTIVE: &str = "automotive";

/// Native action key emitted when HarmonyOS PC/Tablet window title changes.
pub(crate) const HARMONY_ACTION_WINDOW_TITLE: &str = "harmony_window_title";

/// Native action key emitted when HarmonyOS PC cursor pointer style changes.
pub(crate) const HARMONY_ACTION_CURSOR: &str = "harmony_cursor";

/// Native action key emitted when HarmonyOS PC/Tablet window mode changes.
pub(crate) const HARMONY_ACTION_WINDOW_MODE: &str = "harmony_window_mode";

/// Native action key emitted when HarmonyOS PC window decorations toggle.
pub(crate) const HARMONY_ACTION_DECORATIONS: &str = "harmony_decorations";

/// Native action key emitted when HarmonyOS PC window always-on-top toggles.
pub(crate) const HARMONY_ACTION_ALWAYS_ON_TOP: &str = "harmony_always_on_top";

/// Native action key emitted when HarmonyOS IME visibility toggles.
pub(crate) const HARMONY_ACTION_IME: &str = "ime";

/// Native action argument enabling an ArkTS host feature.
pub(crate) const HARMONY_ACTION_ARG_SHOW: &str = "show";

/// Native action argument disabling an ArkTS host feature.
pub(crate) const HARMONY_ACTION_ARG_HIDE: &str = "hide";

/// Native action argument indicating boolean true state.
pub(crate) const HARMONY_ACTION_ARG_ON: &str = "on";

/// Native action argument indicating boolean false state.
pub(crate) const HARMONY_ACTION_ARG_OFF: &str = "off";

/// Default HarmonyOS phone top status bar inset in logical vp.
pub(crate) const HARMONY_PHONE_SAFE_TOP_VP: f32 = 38.0;

/// Default HarmonyOS phone bottom navigation indicator inset in logical vp.
pub(crate) const HARMONY_PHONE_SAFE_BOTTOM_VP: f32 = 28.0;

/// Default HarmonyOS TV overscan safe margin in logical vp.
pub(crate) const HARMONY_TV_OVERSCAN_VP: f32 = 24.0;

/// Default HarmonyOS automotive status/dock safe inset in logical vp.
pub(crate) const HARMONY_CAR_DOCK_VP: f32 = 44.0;

/// Default initial route path for HarmonyOS UIAbility sessions.
pub(crate) const HARMONY_DEFAULT_ROUTE: &str = "/";

/// Default HarmonyOS XComponent surface identifier.
pub(crate) const HARMONY_DEFAULT_XCOMPONENT_ID: &str = "euv_xcomponent";

/// Minimum valid VSync frame interval in nanoseconds (`100 us` duplicate-timestamp floor; no artificial Hz ceiling).
pub(crate) const HARMONY_VSYNC_MIN_PERIOD_NS: i64 = 100_000;

/// Maximum valid VSync frame interval in nanoseconds (`100 ms` / `10 Hz`).
pub(crate) const HARMONY_VSYNC_MAX_PERIOD_NS: i64 = 100_000_000;

/// Error message when `OHNativeWindow` surface buffer request or flush fails.
#[cfg(target_env = "ohos")]
pub(crate) const ERR_HARMONY_SURFACE_POST: &str = "harmony OHNativeWindow buffer post failed";

/// Registered `OH_NativeVSync` channel identifier string.
#[cfg(target_env = "ohos")]
pub(crate) const HARMONY_VSYNC_NAME: &str = "euv_harmony_vsync";

/// Sync fence `poll(2)` wait timeout in milliseconds before falling back to write.
#[cfg(target_env = "ohos")]
pub(crate) const HARMONY_FENCE_POLL_TIMEOUT_MS: i32 = 16;

/// POSIX `POLLIN` flag for waiting on an acquire sync fence FD.
#[cfg(target_env = "ohos")]
pub(crate) const HARMONY_POLLIN: i16 = 0x0001;

/// POSIX `PROT_READ | PROT_WRITE` mapping flags for `OhBufferHandle::fd`.
#[cfg(target_env = "ohos")]
pub(crate) const HARMONY_PROT_READ_WRITE: i32 = 0x3;

/// POSIX `MAP_SHARED` mapping flag for `OhBufferHandle::fd`.
#[cfg(target_env = "ohos")]
pub(crate) const HARMONY_MAP_SHARED: i32 = 0x1;

/// Sentinel `MAP_FAILED` address (`(void*)-1`) returned by `mmap(2)`.
#[cfg(target_env = "ohos")]
pub(crate) const HARMONY_MAP_FAILED: usize = usize::MAX;