Sign in

    wzzc-dev/moui/backend/common/lifecycle does not have a README file

    EmbeddedHostLifecyclePhase

    pub enum EmbeddedHostLifecyclePhase {
    Idle
    Resumed
    SurfaceAttached
    Exited
    } derive(Eq,
    Debug
    )

    Logical lifecycle phase owned by MoUI for an embedded host.

    EmbeddedHostLifecyclePhase::equal

    EmbeddedHostLifecyclePhase::not_equal

    EmbeddedHostSurface

    pub struct EmbeddedHostSurface {
    handle : UInt64
    metrics :
    SurfaceMetrics

    generation : Int
    } derive(Eq,
    Debug
    )

    Surface identity crossing the physical window adapter boundary. The generation is created here; embedded transport has its own session generation and must never mint a surface epoch.

    EmbeddedHostSurface::equal

    EmbeddedHostSurface::not_equal

    EmbeddedLifecycle

    pub struct EmbeddedLifecycle {
    phase : EmbeddedHostLifecyclePhase
    generation : Int
    surface : EmbeddedHostSurface?
    primary_window :
    WindowId
    ?
    exit_intent : Int?
    }

    The embedded lifecycle adapter shared by Android, iOS, and HarmonyOS. It has no native queue and no event-loop handle; those remain in wzzc-dev/window. It owns only MoUI logical phase, surface generation, primary-window identity, detach semantics, and application exit intent.

    EmbeddedLifecycle::attach_surface

    EmbeddedLifecycle::detach_surface

    EmbeddedLifecycle::exit_intent

    fn EmbeddedLifecycle::exit_intent(self : EmbeddedLifecycle) -> Int?

    EmbeddedLifecycle::new

    EmbeddedLifecycle::phase

    EmbeddedLifecycle::primary_window

    EmbeddedLifecycle::register_window

    EmbeddedLifecycle::request_exit

    fn EmbeddedLifecycle::request_exit(self : EmbeddedLifecycle, code : Int) -> EmbeddedWindowHostAction

    EmbeddedLifecycle::resize_surface

    EmbeddedLifecycle::resumed

    EmbeddedLifecycle::surface

    EmbeddedLifecycle::surface_generation

    fn EmbeddedLifecycle::surface_generation(self : EmbeddedLifecycle) -> Int

    EmbeddedLifecycle::suspended

    EmbeddedLifecycle::unregister_window

    EmbeddedWindowHostAction

    pub enum EmbeddedWindowHostAction {
    Resumed
    CanCreateSurfaces
    SurfaceAttached(EmbeddedHostSurface)
    SurfaceDetached(Int)
    DestroySurfaces
    Suspended
    Exit(Int)
    } derive(Eq,
    Debug
    )

    EmbeddedWindowHostAction::equal

    EmbeddedWindowHostAction::not_equal

    PlatformWindowBinding

    pub(all) struct PlatformWindowBinding {
    platform_id :
    WindowId

    host_id :
    WindowId

    } derive(Eq,
    Debug
    )

    PlatformWindowBinding::equal

    PlatformWindowBinding::not_equal

    PlatformWindowMap

    pub struct PlatformWindowMap {
    bindings : Array[PlatformWindowBinding]
    }

    PlatformWindowMap::bind

    PlatformWindowMap::count

    fn PlatformWindowMap::count(self : PlatformWindowMap) -> Int

    PlatformWindowMap::is_empty

    fn PlatformWindowMap::is_empty(self : PlatformWindowMap) -> Bool

    PlatformWindowMap::lookup_platform

    PlatformWindowMap::new

    PlatformWindowMap::remove_platform

    WindowActions

    pub struct WindowActions {
    queue : WindowRequestQueue
    }

    App-facing capability for requesting host-managed windows.

    The platform host owns draining the queue, resolving scenes, and creating native windows. Apps describe the scene they want to open and can enqueue lifecycle requests (close / focus / set_primary) by @backend_host.WindowId. Requests remain fire-and-forget on the shared queue; hosts record completions on the queue when they drain it.

    WindowActions::close

    Request that the host close the window identified by id.

    WindowActions::focus

    Request that the host focus the window identified by id.

    WindowActions::minimize

    Request that the host minimize the window identified by id.

    WindowActions::new

    WindowActions::open

    fn WindowActions::open(self : WindowActions, title~ : String, scene? :
    WindowScene
    , metrics~ :
    SurfaceMetrics
    , primary? : Bool) -> Unit

    WindowActions::queue

    Shared request queue used by the host entrypoint. Prefer the typed helpers below from app code; entrypoints may pass this queue into AppBuilder::window_requests.

    WindowActions::resize

    Request a resize for the window identified by id.

    WindowActions::set_primary

    Request that the host treat id as the primary window.

    WindowActions::show

    Request that the host show the window identified by id.

    WindowActions::unavailable

    fn WindowActions::unavailable() -> WindowActions

    WindowCommands

    pub struct WindowCommands {
    queue : WindowRequestQueue
    }

    WindowCommands::close

    WindowCommands::completed_count

    fn WindowCommands::completed_count(self : WindowCommands) -> Int

    WindowCommands::drain_to_registry

    WindowCommands::focus

    WindowCommands::is_empty

    fn WindowCommands::is_empty(self : WindowCommands) -> Bool

    WindowCommands::minimize

    WindowCommands::new

    WindowCommands::open

    fn WindowCommands::open(self : WindowCommands, title~ : String, scene? :
    WindowScene
    , metrics~ :
    SurfaceMetrics
    , primary? : Bool) -> Unit

    WindowCommands::open_window

    WindowCommands::pending_count

    fn WindowCommands::pending_count(self : WindowCommands) -> Int

    WindowCommands::queue

    WindowCommands::set_primary

    WindowCommands::show

    WindowLifecycle

    pub struct WindowLifecycle {
    // private fields
    }

    Logical host-window owner. It intentionally contains no renderer, image, input-session, or service-bridge state.

    WindowLifecycle::active_runtime_slot

    fn WindowLifecycle::active_runtime_slot(self : WindowLifecycle) -> WindowRuntimeSlot?

    WindowLifecycle::apply_host_event

    WindowLifecycle::attach_surface

    WindowLifecycle::begin_close

    WindowLifecycle::bind_platform_window

    fn WindowLifecycle::bind_platform_window(self : WindowLifecycle, platform_id~ :
    WindowId
    , window_id~ :
    WindowId
    ) -> Bool

    WindowLifecycle::detach_surface

    WindowLifecycle::drain_window_requests

    WindowLifecycle::exit_intent

    fn WindowLifecycle::exit_intent(self : WindowLifecycle) -> Int?

    WindowLifecycle::finish_close

    WindowLifecycle::lookup_window

    WindowLifecycle::open_resolution

    WindowLifecycle::register_primary_runtime_slot

    WindowLifecycle::register_runtime_slot

    fn WindowLifecycle::register_runtime_slot(self : WindowLifecycle, slot : WindowRuntimeSlot) -> Bool

    WindowLifecycle::request_exit

    fn WindowLifecycle::request_exit(self : WindowLifecycle, code : Int) -> Unit

    WindowLifecycle::rollback_window_record

    fn WindowLifecycle::rollback_window_record(self : WindowLifecycle, id :
    WindowId
    ) -> Unit

    WindowLifecycle::runtime_slot_lookup

    WindowLifecycle::runtime_slots

    WindowLifecycle::runtime_slots_empty

    fn WindowLifecycle::runtime_slots_empty(self : WindowLifecycle) -> Bool

    WindowLifecycle::surface_actions

    WindowLifecycle::surface_generation

    fn WindowLifecycle::surface_generation(self : WindowLifecycle) -> Int

    WindowLifecycle::sync_runtime_slot

    fn WindowLifecycle::sync_runtime_slot(self : WindowLifecycle, id :
    WindowId
    ) -> Unit

    WindowLifecycle::sync_runtime_slots

    fn WindowLifecycle::sync_runtime_slots(self : WindowLifecycle) -> Unit

    WindowLifecycle::unbind_platform_window

    WindowLifecycle::window_registry

    fn WindowLifecycle::window_registry(self : WindowLifecycle) -> WindowRegistry

    WindowOpenResolution

    pub(all) enum WindowOpenResolution {
    OpenResolved(WindowResolvedOpen)
    OpenRejected(String)
    }

    WindowRegistry

    pub struct WindowRegistry {
    next_value : Int
    records : Array[
    WindowRecord
    ]
    }

    WindowRegistry::apply_host_event

    WindowRegistry::close

    WindowRegistry::focus

    WindowRegistry::focused_window

    WindowRegistry::minimize

    WindowRegistry::new

    WindowRegistry::open_window_count

    fn WindowRegistry::open_window_count(self : WindowRegistry) -> Int

    WindowRegistry::open_windows

    WindowRegistry::primary_window

    WindowRegistry::remove_closed

    fn WindowRegistry::remove_closed(self : WindowRegistry) -> Int

    WindowRegistry::request_close

    WindowRegistry::set_primary

    WindowRegistry::show

    WindowRequestQueue

    WindowRequestQueue::close_window

    WindowRequestQueue::completed_count

    fn WindowRequestQueue::completed_count(self : WindowRequestQueue) -> Int

    WindowRequestQueue::focus_window

    WindowRequestQueue::is_empty

    fn WindowRequestQueue::is_empty(self : WindowRequestQueue) -> Bool

    WindowRequestQueue::minimize_window

    WindowRequestQueue::new

    WindowRequestQueue::open_window

    fn WindowRequestQueue::open_window(self : WindowRequestQueue, title~ : String, scene? :
    WindowScene
    , metrics~ :
    SurfaceMetrics
    , primary? : Bool) -> Unit

    WindowRequestQueue::pending_count

    fn WindowRequestQueue::pending_count(self : WindowRequestQueue) -> Int

    WindowRequestQueue::push

    WindowRequestQueue::requests

    Erase queue storage behind the root backend request protocol.

    WindowRequestQueue::resize_window

    WindowRequestQueue::set_primary_window

    WindowRequestQueue::show_window

    WindowRequestQueue::subscribe_completed

    fn WindowRequestQueue::subscribe_completed(self : WindowRequestQueue, handle : (
    WindowRequestCompletion
    ) -> Unit) -> (() -> Unit)

    Observe request completions without consuming the diagnostic completion queue. The returned callback removes the observer.

    WindowRuntimeSlot

    WindowRuntimeSlot::from_resolved_open

    fn WindowRuntimeSlot::from_resolved_open(resolved : WindowResolvedOpen, schedule_redraw~ : () -> Unit) -> WindowRuntimeSlot

    WindowRuntimeSlot::new

    WindowRuntimeSlots

    pub struct WindowRuntimeSlots {
    slots : Array[WindowRuntimeSlot]
    }

    WindowRuntimeSlots::apply_host_event

    WindowRuntimeSlots::count

    fn WindowRuntimeSlots::count(self : WindowRuntimeSlots) -> Int

    WindowRuntimeSlots::focused_slot

    WindowRuntimeSlots::insert

    fn WindowRuntimeSlots::insert(self : WindowRuntimeSlots, slot : WindowRuntimeSlot) -> Bool

    WindowRuntimeSlots::insert_from_registry

    WindowRuntimeSlots::is_empty

    fn WindowRuntimeSlots::is_empty(self : WindowRuntimeSlots) -> Bool

    WindowRuntimeSlots::new

    WindowRuntimeSlots::open_slots

    WindowRuntimeSlots::primary_slot

    WindowRuntimeSlots::remove_closed

    fn WindowRuntimeSlots::remove_closed(self : WindowRuntimeSlots) -> Int

    WindowRuntimeSlots::sync_from_registry

    fn WindowRuntimeSlots::sync_from_registry(self : WindowRuntimeSlots, registry : WindowRegistry, id :
    WindowId
    ) -> Bool

    WindowRuntimeSlots::sync_open_from_registry

    fn WindowRuntimeSlots::sync_open_from_registry(self : WindowRuntimeSlots, registry : WindowRegistry) -> Int

    WindowRuntimeSlots::sync_record

    WindowSceneResolution

    pub(all) enum WindowSceneResolution {
    SceneResolved(WindowSceneInstance)
    SceneRejected(String)
    }

    WindowSceneResolver

    WindowSceneResolver::unavailable

    fn WindowSceneResolver::unavailable(reason? : String) -> WindowSceneResolver

    WindowSlot

    pub struct WindowSlot[W, X] {
    host_id :
    WindowId

    window : W
    extra : X
    }

    Shared platform resource slot. Platform-id mapping belongs exclusively to the lifecycle owner; this table is keyed only by the backend window id. The generic extra carries platform-private per-window state (Linux client decorations, Unit elsewhere).

    WindowSlot::new

    fn[W, X] WindowSlot::new(host_id~ :
    WindowId
    , window~ : W, extra~ : X) -> WindowSlot[W, X]

    WindowSlot::set_extra

    fn[W, X] WindowSlot::set_extra(self : WindowSlot[W, X], extra~ : X) -> Unit

    Replace the platform-private per-window state (Linux client decorations).

    WindowSlotMap

    pub struct WindowSlotMap[W, X] {
    slots : Array[WindowSlot[W, X]]
    }

    Ordered backend-id resource registry with duplicate rejection.

    WindowSlotMap::insert

    fn[W, X] WindowSlotMap::insert(self : WindowSlotMap[W, X], slot : WindowSlot[W, X]) -> Bool

    WindowSlotMap::lookup_host

    fn[W, X] WindowSlotMap::lookup_host(self : WindowSlotMap[W, X], host_id :
    WindowId
    ) -> WindowSlot[W, X]?

    WindowSlotMap::new

    fn[W, X] WindowSlotMap::new() -> WindowSlotMap[W, X]

    WindowSlotMap::remove_host

    fn[W, X] WindowSlotMap::remove_host(self : WindowSlotMap[W, X], host_id :
    WindowId
    ) -> WindowSlot[W, X]?

    WindowSurfaceActions

    pub(all) struct WindowSurfaceActions {
    focus : () -> Unit
    request_resize : (
    SurfaceMetrics
    ) ->
    SurfaceMetrics

    sync_observed_resize : (
    SurfaceMetrics
    ) ->
    SurfaceMetrics

    set_minimized : (Bool) -> Unit
    set_visible : (Bool) -> Unit
    request_redraw : () -> Unit
    request_ime_update : (
    TextInputSessionAction
    ) -> Unit
    set_drag_region : (
    Rect
    ?) -> Unit
    drop : () -> Unit
    native_view_handle : () -> UInt64?
    dispose_platform_views : () -> Unit
    }

    Platform projection owned by the logical window lifecycle. The closures carry native effects; frame, image, input, and service state remain in their dedicated owners.

    WindowSurfaceActions::new

    fn WindowSurfaceActions::new(focus~ : () -> Unit, request_resize~ : (
    SurfaceMetrics
    ) ->
    SurfaceMetrics
    , sync_observed_resize~ : (
    SurfaceMetrics
    ) ->
    SurfaceMetrics
    , set_minimized~ : (Bool) -> Unit, set_visible~ : (Bool) -> Unit, request_redraw~ : () -> Unit, request_ime_update~ : (
    TextInputSessionAction
    ) -> Unit, set_drag_region? : (
    Rect
    ?) -> Unit, drop~ : () -> Unit, native_view_handle~ : () -> UInt64?, dispose_platform_views~ : () -> Unit) -> WindowSurfaceActions

    drain_to_runtime_slots

    resolve_open_request

    Resolve a runtime scene and register its backend window atomically.