euv-core 0.48.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;

/// 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 (`1 ms` / `1000 Hz`).
pub(crate) const HARMONY_VSYNC_MIN_PERIOD_NS: i64 = 1_000_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;