Sign in

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

    InputState

    pub(all) struct InputState {
    focused : Bool
    modifiers :
    KeyModifiers

    contract :
    HostInputContract

    }

    Shared mutable input state. Platform packages keep raw event decoding and feed normalized facts through this common owner.

    InputState::blur

    fn InputState::blur(self : InputState) -> Unit

    InputState::coordinate_policy

    InputState::focus

    fn InputState::focus(self : InputState) -> Unit

    InputState::focus_event

    fn InputState::focus_event(self : InputState, focused~ : Bool, pointer_cancel_position? :
    Point
    ?) ->
    Event
    ?

    InputState::insert_text

    fn InputState::insert_text(self : InputState, text : String) ->
    Event
    ?

    InputState::keyboard_event

    fn InputState::keyboard_event(self : InputState, key~ : String, text? : String?, pressed? : Bool, repeat? : Bool) ->
    Event
    ?

    InputState::set_modifiers

    fn InputState::set_modifiers(self : InputState, modifiers :
    KeyModifiers
    ) -> Unit

    PlatformSurfaceLifecycle

    pub(all) enum PlatformSurfaceLifecycle {
    Detached
    Attached(
    SurfaceMetrics
    )
    } derive(Eq,
    Debug
    )

    Neutral surface lifecycle state shared by window-hosted and desktop adapters. Platform packages keep the native surface handles and own their attach/detach callbacks; the bridge owns only the logical lifecycle state.

    PlatformSurfaceLifecycle::detach

    PlatformSurfaceLifecycle::equal

    PlatformSurfaceLifecycle::not_equal

    SurfaceState

    pub(all) struct SurfaceState {
    metrics :
    SurfaceMetrics

    owns_surface : Bool
    can_reconfigure : Bool
    }

    Shared mutable surface metrics owner.

    SurfaceState::logical_size

    SurfaceState::new

    fn SurfaceState::new(metrics~ :
    SurfaceMetrics
    , owns_surface? : Bool, can_reconfigure? : Bool) -> SurfaceState

    TextInputImeRequestDiagnostics

    pub(all) struct TextInputImeRequestDiagnostics {
    focused : Bool
    text_length : Int
    text_utf8_length : Int
    cursor : Int
    anchor : Int
    cursor_utf8 : Int
    anchor_utf8 : Int
    cursor_is_grapheme_boundary : Bool
    anchor_is_grapheme_boundary : Bool
    candidate_anchor :
    Rect

    has_surrounding_text : Bool
    surrounding_text_utf8_length : Int
    surrounding_text : String?
    } derive(Eq, ToJson,
    Debug
    )

    TextInputImeRequestDiagnostics::not_equal

    TextInputImeRequestDiagnostics::to_json

    TextInputImeStateKey

    pub struct TextInputImeStateKey {
    focused : Bool
    text : String
    caret : Int
    selection :
    TextRange
    ?
    composition : String?
    composition_cursor :
    TextRange
    ?
    caret_rect :
    Rect

    }

    Identity of the text-input state the cached IME diagnostics describe. The text is compared by object identity (physical_equal), never by value: the runtime's input text is an immutable string, so an unchanged frame re-observes the same object while every edit materializes a new one. A content comparison here would itself scan megabytes on every frame.

    TextInputSession

    pub(all) struct TextInputSession {
    enabled : Bool
    last_request :
    ImeRequestData
    ?
    last_capabilities :
    ImeCapabilities
    ?
    last_diagnostics : TextInputImeRequestDiagnostics?
    last_state : TextInputImeStateKey?
    }

    TextInputSession::last_diagnostics

    TextInputSession::new

    TextInputSessionAction

    TextInputSessionAction::equal

    TextInputSessionAction::not_equal

    TransformedWindowEvent

    pub(all) enum TransformedWindowEvent {
    DispatchHostEvent(
    Event
    )
    WindowRedrawRequired
    CloseRequested
    PlatformSpecific
    }

    Result of transforming a cross-platform WindowEvent.

    WindowInputState

    pub struct WindowInputState {
    // private fields
    }

    Window input owner for cross-platform subscriptions and the active IME session. Raw native decoding remains in concrete backends.

    WindowInputState::last_diagnostics

    core_size_to_window_surface_size

    fn core_size_to_window_surface_size(size :
    Size
    ) ->
    Size

    element_state_pressed

    fn element_state_pressed(state :
    ElementState
    ) -> Bool

    element_state_to_pointer_phase

    host_metrics_to_dpi_size

    key_event_name

    fn key_event_name(event :
    KeyEvent
    ) -> String

    key_event_text

    fn key_event_text(event :
    KeyEvent
    ) -> String?

    make_surface_metrics

    Compute @core.SurfaceMetrics from a physical size and scale factor. Convenience wrapper for callers that need the metrics outside of the event transformer.

    mouse_button_to_core

    fn mouse_button_to_core(button :
    MouseButton
    ) -> Int?

    mouse_scroll_delta_to_host

    named_key_name

    fn named_key_name(key :
    NamedKey
    ) -> String

    normalize_pointer_position

    fn normalize_pointer_position(position :
    PhysicalPositionF64
    , scale_factor~ : Double) ->
    Point

    Cross-platform handler for pointer position normalization. Every platform normalizes native pointer positions to logical coordinates for the runtime.

    physical_position_to_core

    fn physical_position_to_core(position :
    PhysicalPositionF64
    , scale_factor? : Double) ->
    Point

    physical_size_to_core

    surface_metrics_from_physical

    fn surface_metrics_from_physical(size :
    PhysicalSize
    , scale_factor? : Double) ->
    SurfaceMetrics

    text_input_ime_request_data

    text_input_ime_request_diagnostics

    transform_cross_platform_event

    fn transform_cross_platform_event(event :
    WindowEvent
    , scale_factor~ : Double, surface_size? :
    PhysicalSize
    ?) -> TransformedWindowEvent

    Transform a cross-platform WindowEvent that carries no platform- specific payload. Events that require native decode (pointer, keyboard, IME, drag, modifiers) return PlatformSpecific — the caller's platform-local handler should process them directly via @backend_host.window_event_to_host_event.

    The event payload is authoritative for resize and scale changes. The optional arguments remain for adapters that also track an observed native surface, but are deliberately ignored for those variants so stale external state cannot overwrite the callback payload.

    window_event_is_context_menu_button

    fn window_event_is_context_menu_button(event :
    WindowEvent
    ) -> Bool

    window_event_is_context_menu_trigger

    fn window_event_is_context_menu_trigger(event :
    WindowEvent
    ) -> Bool

    window_event_to_host

    window_event_to_host_with_modifiers

    fn window_event_to_host_with_modifiers(event :
    WindowEvent
    , last_pointer :
    Point
    , modifiers :
    KeyModifiers
    , scale_factor? : Double, blur_to_cancel? : Bool) ->
    Event
    ?

    window_theme_to_color_scheme