LING71671/moon-egui/src/core does not have a README file

    Widget

    pub(open) trait Widget {
    fn ui(Self, UIContext) -> Response
    }

    Core dispatch trait for first-class widgets that return a Response. Implementing this trait allows any widget to be added to a UIContext via ui.add(widget).

    Event

    pub(all) enum Event {
    Key(Key, Bool, Modifiers)
    TextInput(String)
    PointerWheel(
    Vec2
    )
    } derive(Eq,
    Debug
    )

    FocusManager

    pub struct FocusManager {
    hot_id : Id
    active_id : Id
    focused_id : Id
    prev_focused_id : Id
    lost_focus_id : Id
    pending_lost_focus_id : Id
    focusable_ids : Array[Id]
    wants_capture_mouse : Bool
    prev_wants_capture_mouse : Bool
    } derive(Eq,
    Debug
    )

    Subsystem managing keyboard focus ring, active pointer ownership, and mouse capture.

    FocusManager::active_id

    fn FocusManager::active_id(self : FocusManager) -> Id

    FocusManager::begin_frame

    fn FocusManager::begin_frame(self : FocusManager) -> Unit

    FocusManager::clear_focusable

    fn FocusManager::clear_focusable(self : FocusManager) -> Unit

    FocusManager::end_frame

    fn FocusManager::end_frame(self : FocusManager) -> Unit

    FocusManager::focusable_ids

    fn FocusManager::focusable_ids(self : FocusManager) -> Array[Id]

    FocusManager::focused_id

    fn FocusManager::focused_id(self : FocusManager) -> Id

    FocusManager::has_focus

    fn FocusManager::has_focus(self : FocusManager, id : Id) -> Bool

    FocusManager::hot_id

    fn FocusManager::hot_id(self : FocusManager) -> Id

    FocusManager::lost_focus

    fn FocusManager::lost_focus(self : FocusManager, id : Id) -> Bool

    FocusManager::new

    FocusManager::prev_focused_id

    fn FocusManager::prev_focused_id(self : FocusManager) -> Id

    FocusManager::prev_wants_capture_mouse

    fn FocusManager::prev_wants_capture_mouse(self : FocusManager) -> Bool

    FocusManager::process_tab_traversal

    fn FocusManager::process_tab_traversal(self : FocusManager, shift : Bool) -> Bool

    FocusManager::register_focusable

    fn FocusManager::register_focusable(self : FocusManager, id : Id) -> Unit

    FocusManager::request_focus

    fn FocusManager::request_focus(self : FocusManager, id : Id) -> Bool

    Request focus for id. Returns true if focus was transferred to a new target.

    FocusManager::set_active_id

    fn FocusManager::set_active_id(self : FocusManager, id : Id) -> Unit

    FocusManager::set_focused_id

    fn FocusManager::set_focused_id(self : FocusManager, id : Id) -> Unit

    FocusManager::set_hot_id

    fn FocusManager::set_hot_id(self : FocusManager, id : Id) -> Unit

    FocusManager::set_wants_capture_mouse

    fn FocusManager::set_wants_capture_mouse(self : FocusManager, val : Bool) -> Unit

    FocusManager::surrender_focus

    fn FocusManager::surrender_focus(self : FocusManager, id : Id) -> Unit

    FocusManager::wants_capture_mouse

    fn FocusManager::wants_capture_mouse(self : FocusManager) -> Bool

    pub struct Id {
    val : UInt64
    } derive(Default, Eq, Hash,
    Debug
    )

    Id::combine

    fn Id::combine(self : Id, other : Id) -> Id

    Id::from_int

    fn Id::from_int(val : Int) -> Id

    Id::from_string

    fn Id::from_string(str : String) -> Id

    Id::is_valid

    fn Id::is_valid(self : Id) -> Bool

    Id::new

    fn Id::new(val : UInt64) -> Id

    Id::with_int

    fn Id::with_int(seed : UInt64, index : Int) -> Id

    Id::with_seed

    fn Id::with_seed(seed : UInt64, str : String) -> Id

    Id::with_tag

    fn Id::with_tag(self : Id, tag : String) -> Id

    Id::zero

    fn Id::zero() -> Id

    IdStack

    pub struct IdStack {
    stack : Array[UInt64]
    } derive(Eq,
    Debug
    )

    IdStack::current_seed

    fn IdStack::current_seed(self : IdStack) -> UInt64

    IdStack::derive_id

    fn IdStack::derive_id(self : IdStack, str : String) -> Id

    IdStack::derive_int

    fn IdStack::derive_int(self : IdStack, index : Int) -> Id

    IdStack::new

    fn IdStack::new() -> IdStack

    IdStack::pop

    fn IdStack::pop(self : IdStack) -> Unit

    IdStack::push

    fn IdStack::push(self : IdStack, str : String) -> Unit

    InputState

    pub struct InputState {
    mouse_pos :
    Vec2

    mouse_prev_pos :
    Vec2

    mouse_delta :
    Vec2

    mouse_initialized : Bool
    mouse_down : Bool
    mouse_pressed : Bool
    mouse_released : Bool
    mouse_secondary_down : Bool
    mouse_secondary_pressed : Bool
    mouse_secondary_released : Bool
    scroll_delta :
    Vec2

    dt : Double
    keys_down : Array[Key]
    keys_pressed : Array[Key]
    keys_released : Array[Key]
    consumed_keys : Array[Key]
    text_input : String
    modifiers : Modifiers
    events : Array[Event]
    } derive(Default, Eq,
    Debug
    )

    InputState::consume_key

    fn InputState::consume_key(self : InputState, key : Key) -> Unit

    InputState::dt

    fn InputState::dt(self : InputState) -> Double

    InputState::events

    fn InputState::events(self : InputState) -> Array[Event]

    InputState::is_key_consumed

    fn InputState::is_key_consumed(self : InputState, key : Key) -> Bool

    InputState::key_down

    fn InputState::key_down(self : InputState, key : Key) -> Bool

    InputState::key_pressed

    fn InputState::key_pressed(self : InputState, key : Key) -> Bool

    InputState::key_released

    fn InputState::key_released(self : InputState, key : Key) -> Bool

    InputState::modifiers

    fn InputState::modifiers(self : InputState) -> Modifiers

    InputState::mouse_delta

    InputState::mouse_down

    fn InputState::mouse_down(self : InputState) -> Bool

    InputState::mouse_pos

    InputState::mouse_pressed

    fn InputState::mouse_pressed(self : InputState) -> Bool

    InputState::mouse_released

    fn InputState::mouse_released(self : InputState) -> Bool

    InputState::mouse_secondary_down

    fn InputState::mouse_secondary_down(self : InputState) -> Bool

    InputState::mouse_secondary_pressed

    fn InputState::mouse_secondary_pressed(self : InputState) -> Bool

    InputState::mouse_secondary_released

    fn InputState::mouse_secondary_released(self : InputState) -> Bool

    InputState::new

    fn InputState::new() -> InputState

    InputState::scroll_delta

    InputState::text_input

    fn InputState::text_input(self : InputState) -> String

    InputState::update

    fn InputState::update(self : InputState, raw : RawInput) -> Unit

    Key

    pub(all) enum Key {
    Backspace
    Delete
    Enter
    Escape
    Tab
    Space
    ArrowLeft
    ArrowRight
    ArrowUp
    ArrowDown
    Home
    End
    PageUp
    PageDown
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    P
    Q
    R
    S
    T
    U
    V
    W
    X
    Y
    Z
    Num0
    Num1
    Num2
    Num3
    Num4
    Num5
    Num6
    Num7
    Num8
    Num9
    } derive(Eq, Hash,
    Debug
    )

    LayerManager

    Subsystem managing scissor clipping, foreground overlays, and blocking hit-test rects.

    LayerManager::begin_foreground

    fn LayerManager::begin_foreground(self : LayerManager) -> Unit

    LayerManager::begin_frame

    fn LayerManager::begin_frame(self : LayerManager) -> Unit

    LayerManager::block_hover

    fn LayerManager::block_hover(self : LayerManager, rect :
    Rect
    ) -> Unit

    LayerManager::clip_stack

    LayerManager::current_clip

    LayerManager::draw_list

    LayerManager::end_foreground

    fn LayerManager::end_foreground(self : LayerManager) -> Unit

    LayerManager::fg_draw_list

    LayerManager::is_blocked_by_foreground

    fn LayerManager::is_blocked_by_foreground(self : LayerManager, pt :
    Vec2
    ) -> Bool

    LayerManager::is_foreground

    fn LayerManager::is_foreground(self : LayerManager) -> Bool

    LayerManager::new

    LayerManager::pop_clip

    fn LayerManager::pop_clip(self : LayerManager) -> Unit

    LayerManager::push_clip

    LayerManager::set_draw_list

    LayoutDirection

    pub enum LayoutDirection {
    TopDown
    LeftToRight
    LeftToRightWrapped
    } derive(Eq,
    Debug
    )

    LayoutEngine

    pub struct LayoutEngine {
    layout_stack : Array[LayoutScope]
    cursor :
    Vec2

    available_width : Double
    item_spacing :
    Vec2

    auto_id_counter : Int
    } derive(Eq,
    Debug
    )

    Subsystem managing cursor positioning, layout scopes (TopDown, LeftToRight, Wrapped), available width, and automatic ID sequencing.

    LayoutEngine::available_width

    fn LayoutEngine::available_width(self : LayoutEngine) -> Double

    LayoutEngine::begin_frame

    fn LayoutEngine::begin_frame(self : LayoutEngine, screen_w : Double) -> Unit

    LayoutEngine::current_scope

    fn LayoutEngine::current_scope(self : LayoutEngine) -> LayoutScope?

    LayoutEngine::item_spacing

    LayoutEngine::layout_stack

    fn LayoutEngine::layout_stack(self : LayoutEngine) -> Array[LayoutScope]

    LayoutEngine::new

    LayoutEngine::next_auto_id_counter

    fn LayoutEngine::next_auto_id_counter(self : LayoutEngine) -> Int

    LayoutEngine::pop_scope

    fn LayoutEngine::pop_scope(self : LayoutEngine) -> LayoutScope?

    LayoutEngine::push_scope

    fn LayoutEngine::push_scope(self : LayoutEngine, scope : LayoutScope) -> Unit

    LayoutEngine::set_available_width

    fn LayoutEngine::set_available_width(self : LayoutEngine, w : Double) -> Unit

    LayoutEngine::set_cursor

    LayoutEngine::set_item_spacing

    fn LayoutEngine::set_item_spacing(self : LayoutEngine, spacing :
    Vec2
    ) -> Unit

    LayoutScope

    pub struct LayoutScope {
    dir : LayoutDirection
    start_x : Double
    start_y : Double
    max_cross_size : Double
    current_row_h : Double
    wrap_width : Double
    } derive(Eq,
    Debug
    )

    Memory

    Generic, decoupled immediate-mode widget memory subsystem.

    Stores cross-frame persistent widget state (scroll positions, cursor offsets, toggle states, animation curves) indexed by Id, completely decoupling concrete widgets from the central UIContext struct. Supports tagged sub-keys for multiple properties per widget ID and generational frame-counter pruning to prevent memory leaks in long-running dynamic interfaces.

    Memory::get_bool

    fn Memory::get_bool(self : Memory, id : Id, tag? : String) -> Bool?

    Memory::get_bool_or_default

    fn Memory::get_bool_or_default(self : Memory, id : Id, default : Bool, tag? : String) -> Bool

    Memory::get_double

    fn Memory::get_double(self : Memory, id : Id, tag? : String) -> Double?

    Memory::get_double_or_default

    fn Memory::get_double_or_default(self : Memory, id : Id, default : Double, tag? : String) -> Double

    Memory::get_id

    fn Memory::get_id(self : Memory, id : Id, tag? : String) -> Id?

    Memory::get_int

    fn Memory::get_int(self : Memory, id : Id, tag? : String) -> Int?

    Memory::get_int_or_default

    fn Memory::get_int_or_default(self : Memory, id : Id, default : Int, tag? : String) -> Int

    Memory::get_string

    fn Memory::get_string(self : Memory, id : Id, tag? : String) -> String?

    Memory::get_string_or_default

    fn Memory::get_string_or_default(self : Memory, id : Id, default : String, tag? : String) -> String

    Memory::new

    fn Memory::new() -> Memory

    Memory::prune_stale

    fn Memory::prune_stale(self : Memory, current_frame : Int, ttl_frames : Int) -> Unit

    Memory::remove

    fn Memory::remove(self : Memory, id : Id) -> Unit

    Memory::remove_sub_key

    fn Memory::remove_sub_key(self : Memory, id : Id, tag : String) -> Unit

    Memory::set_bool

    fn Memory::set_bool(self : Memory, id : Id, value : Bool, tag? : String, frame? : Int) -> Unit

    Memory::set_double

    fn Memory::set_double(self : Memory, id : Id, value : Double, tag? : String, frame? : Int) -> Unit

    Memory::set_id

    fn Memory::set_id(self : Memory, id : Id, target : Id, tag? : String, frame? : Int) -> Unit

    Memory::set_int

    fn Memory::set_int(self : Memory, id : Id, value : Int, tag? : String, frame? : Int) -> Unit

    Memory::set_string

    fn Memory::set_string(self : Memory, id : Id, value : String, tag? : String, frame? : Int) -> Unit

    Memory::touch

    fn Memory::touch(self : Memory, id : Id, frame : Int) -> Unit

    Modifiers

    pub struct Modifiers {
    ctrl : Bool
    shift : Bool
    alt : Bool
    meta : Bool
    } derive(Default, Eq,
    Debug
    )

    Modifiers::ctrl

    fn Modifiers::ctrl() -> Modifiers

    Modifiers::new

    fn Modifiers::new(ctrl : Bool, shift : Bool, alt : Bool, meta : Bool) -> Modifiers

    Modifiers::none

    fn Modifiers::none() -> Modifiers

    Modifiers::shift

    fn Modifiers::shift() -> Modifiers

    Painter

    Scoped drawing abstraction that isolates UI widgets from raw global DrawList command queues and enforces local coordinate translation and active scissor clip boundaries.

    Painter::add_bezier_curve

    Render a cubic bezier curve, shifted by the painter's offset.

    Painter::add_circle

    fn Painter::add_circle(self : Painter, center :
    Vec2
    , radius : Double, color :
    Color
    ) -> Unit

    Render a filled circle shifted by the painter's offset.

    Painter::add_circle_stroke

    fn Painter::add_circle_stroke(self : Painter, center :
    Vec2
    , radius : Double, color :
    Color
    , stroke_width : Double) -> Unit

    Render a stroked circle with specified line width, shifted by the painter's offset.

    Painter::add_line

    Render a line segment connecting two endpoints, shifted by the painter's offset.

    Painter::add_linear_gradient

    Render a linear color gradient inside a rectangle, shifted by the painter's offset.

    Painter::add_rect

    fn Painter::add_rect(self : Painter, rect :
    Rect
    , color :
    Color
    , corner_radius : Double) -> Unit

    Render a filled rectangle with optional corner rounding, shifted by the painter's offset.

    Painter::add_rect_stroke

    fn Painter::add_rect_stroke(self : Painter, rect :
    Rect
    , color :
    Color
    , stroke_width : Double, corner_radius : Double) -> Unit

    Render a stroked rectangle with line width and corner rounding, shifted by the painter's offset.

    Painter::add_text

    fn Painter::add_text(self : Painter, pos :
    Vec2
    , text : String, font_size : Double, color :
    Color
    , font_family? : String, font_weight? : Int) -> Unit

    Render text at the specified local position, shifted by the painter's offset.

    Painter::append

    Append another draw list to this painter's target list.

    Painter::clip_rect

    Returns the current active clip rectangle if one is active.

    Painter::offset

    Returns the active drawing coordinate offset.

    Painter::pop_clip

    fn Painter::pop_clip(self : Painter) -> Unit

    Pop the active scissor clipping region from the underlying draw list.

    Painter::push_clip

    fn Painter::push_clip(self : Painter, rect :
    Rect
    ) -> Unit

    Push a scissor clipping region to the underlying draw list.

    Painter::sub_painter

    Create a child painter with an additional local translation offset and optional intersected clip rectangle.

    RawInput

    pub struct RawInput {
    mouse_pos :
    Vec2

    mouse_down : Bool
    scroll_delta :
    Vec2

    dt : Double
    events : Array[Event]
    text_input : String
    modifiers : Modifiers
    mouse_secondary_down : Bool
    } derive(Eq,
    Debug
    )

    RawInput::from_mouse

    fn RawInput::from_mouse(mouse_pos :
    Vec2
    , mouse_down : Bool, mouse_secondary_down? : Bool, dt? : Double) -> RawInput

    RawInput::new

    fn RawInput::new() -> RawInput

    RawInput::with_events

    fn RawInput::with_events(mouse_pos :
    Vec2
    , mouse_down : Bool, scroll_delta :
    Vec2
    , events : Array[Event], text_input : String, modifiers : Modifiers, mouse_secondary_down? : Bool, dt? : Double) -> RawInput

    Full constructor for host drivers: pointer state plus the input events collected during the frame. Key and Event are pub(all), so a host builds the events and passes them in; text_input carries the plain text typed this frame and may be left empty when text arrives as events instead.

    Response

    pub struct Response {
    id : Id
    rect :
    Rect

    hovered : Bool
    clicked : Bool
    pressed : Bool
    dragged : Bool
    has_focus : Bool
    gained_focus : Bool
    lost_focus : Bool
    secondary_clicked : Bool
    } derive(Default, Eq,
    Debug
    )

    Response::clicked

    fn Response::clicked(self : Response) -> Bool

    Response::dragged

    fn Response::dragged(self : Response) -> Bool

    Response::gained_focus

    fn Response::gained_focus(self : Response) -> Bool

    Response::has_focus

    fn Response::has_focus(self : Response) -> Bool

    Response::hovered

    fn Response::hovered(self : Response) -> Bool

    Response::id

    fn Response::id(self : Response) -> Id

    Response::lost_focus

    fn Response::lost_focus(self : Response) -> Bool

    Response::new

    fn Response::new(id : Id, rect :
    Rect
    , hovered : Bool, clicked : Bool, pressed : Bool, dragged : Bool, secondary_clicked? : Bool) -> Response

    Response::pressed

    fn Response::pressed(self : Response) -> Bool

    Response::secondary_clicked

    fn Response::secondary_clicked(self : Response) -> Bool

    Response::with_focus

    fn Response::with_focus(id : Id, rect :
    Rect
    , hovered : Bool, clicked : Bool, pressed : Bool, dragged : Bool, has_focus : Bool, gained_focus : Bool, lost_focus : Bool, secondary_clicked? : Bool) -> Response

    Theme

    pub struct Theme {
    name : String
    bg_app :
    Color

    bg_window :
    Color

    bg_surface :
    Color

    bg_subtle :
    Color

    bg_hover :
    Color

    bg_active :
    Color

    bg_inverse :
    Color

    border_muted :
    Color

    border_default :
    Color

    border_strong :
    Color

    border_focus :
    Color

    text_primary :
    Color

    text_strong :
    Color

    text_body :
    Color

    text_secondary :
    Color

    text_muted :
    Color

    text_disabled :
    Color

    text_inverse :
    Color

    accent_primary :
    Color

    accent_hover :
    Color

    accent_pressed :
    Color

    accent_deep :
    Color

    accent_soft :
    Color

    accent_light :
    Color

    danger :
    Color

    warning :
    Color

    success :
    Color

    shadow :
    Color

    } derive(Eq,
    Debug
    )

    Runtime semantic theme profile holding color slots for all UI elements.

    Theme::high_contrast

    fn Theme::high_contrast() -> Theme

    Returns the high accessibility contrast theme profile.

    Theme::slate_dark

    fn Theme::slate_dark() -> Theme

    Returns the dark slate theme profile.

    Theme::studio_light

    fn Theme::studio_light() -> Theme

    Returns the standard Studio Light porcelain theme.

    UIContext

    pub struct UIContext {
    input : InputState
    id_stack : IdStack
    layout : LayoutEngine
    focus : FocusManager
    layers : LayerManager
    windows : WindowManager
    memory : Memory
    style : WidgetStyle
    theme : Theme
    cursor_icon : String
    time : Double
    frame_counter : Int
    last_caret_activity : Double
    text_measure_cache :
    HashMap
    [(String, Int), Double]
    } derive(Eq,
    Debug
    )

    UIContext::active_id

    fn UIContext::active_id(self : UIContext) -> Id

    UIContext::active_submenu_id

    fn UIContext::active_submenu_id(self : UIContext) -> String

    UIContext::add

    fn[W : Widget] UIContext::add(self : UIContext, widget : W) -> Response

    Add a widget implementing the Widget trait to the current UI container.

    UIContext::advance_cursor

    fn UIContext::advance_cursor(self : UIContext, offset :
    Vec2
    ) -> Unit

    UIContext::allocate_space

    Core space allocator and hit-testing primitive. All existing and custom third-party widgets evaluate interaction through this method.

    UIContext::animate_bool

    fn UIContext::animate_bool(self : UIContext, id : Id, target : Bool, duration : Double) -> Double

    Smooth immediate-mode boolean animation tweening over duration seconds. Returns a scalar factor in [0.0, 1.0] that transitions smoothly when target changes.

    UIContext::animate_float

    fn UIContext::animate_float(self : UIContext, id : Id, target : Double, duration : Double) -> Double

    Smooth immediate-mode float animation tweening towards target over duration seconds.

    UIContext::available_width

    fn UIContext::available_width(self : UIContext) -> Double

    UIContext::begin_foreground

    fn UIContext::begin_foreground(self : UIContext) -> Unit

    UIContext::begin_frame

    fn UIContext::begin_frame(self : UIContext, raw_input : RawInput) -> Unit

    UIContext::block_hover

    fn UIContext::block_hover(self : UIContext, rect :
    Rect
    ) -> Unit

    UIContext::clear_focusable

    fn UIContext::clear_focusable(self : UIContext) -> Unit

    UIContext::clear_text_selection

    fn UIContext::clear_text_selection(self : UIContext, id : Id) -> Unit

    UIContext::current_clip

    UIContext::cursor

    UIContext::cursor_icon

    fn UIContext::cursor_icon(self : UIContext) -> String

    UIContext::draw_list

    UIContext::end_foreground

    fn UIContext::end_foreground(self : UIContext) -> Unit

    UIContext::end_frame

    UIContext::fg_painter

    fn UIContext::fg_painter(self : UIContext) -> Painter

    Return a scoped Painter targeting the deferred foreground overlay layer.

    UIContext::focus

    fn UIContext::focus(self : UIContext) -> FocusManager

    UIContext::focusable_ids

    fn UIContext::focusable_ids(self : UIContext) -> Array[Id]

    UIContext::focused_id

    fn UIContext::focused_id(self : UIContext) -> Id

    UIContext::frame_counter

    fn UIContext::frame_counter(self : UIContext) -> Int

    UIContext::get_scroll_content_height

    fn UIContext::get_scroll_content_height(self : UIContext, id : Id) -> Double

    UIContext::get_scroll_offset

    fn UIContext::get_scroll_offset(self : UIContext, id : Id) -> Double

    UIContext::get_text_cursor_pos

    fn UIContext::get_text_cursor_pos(self : UIContext, id : Id, max_len : Int) -> Int

    UIContext::get_text_selection_anchor

    fn UIContext::get_text_selection_anchor(self : UIContext, id : Id) -> Int?

    UIContext::get_window_pos

    Position of a window, falling back to fallback until the window has been moved for the first time. Windows are dragged by their title bar, so the position is owned by the context rather than passed in by the caller.

    UIContext::has_focus

    fn UIContext::has_focus(self : UIContext, id : Id) -> Bool

    UIContext::horizontal

    fn UIContext::horizontal(self : UIContext, content : (UIContext) -> Unit) -> Unit

    Scoped horizontal layout flow (Left-to-Right). Arranges child widgets side-by-side, tracks the maximum row height, and returns the cursor to the start X position advanced downwards by row height.

    UIContext::horizontal_wrapped

    fn UIContext::horizontal_wrapped(self : UIContext, content : (UIContext) -> Unit, wrap_width? : Double) -> Unit

    Scoped horizontal layout with automatic line wrapping. Arranges child widgets horizontally, wrapping to the next line when the row exceeds wrap_width (defaults to available_width).

    UIContext::hot_id

    fn UIContext::hot_id(self : UIContext) -> Id

    UIContext::input

    fn UIContext::input(self : UIContext) -> InputState

    UIContext::is_caret_visible

    fn UIContext::is_caret_visible(self : UIContext) -> Bool

    UIContext::is_collapsing_open

    fn UIContext::is_collapsing_open(self : UIContext, id : Id, default_open : Bool) -> Bool

    UIContext::is_hovered

    fn UIContext::is_hovered(self : UIContext, rect :
    Rect
    ) -> Bool

    Clip-aware hover test. The pointer hovers rect only when it is inside the rect, inside the active scissor clip, and neither covered by a foreground blocking region nor by a window stacked above the current draw target. Widgets that scroll out of a container or spill outside a window therefore stop responding to the pointer.

    UIContext::item_spacing

    UIContext::label

    fn UIContext::label(self : UIContext, text : String) -> Response

    Render a read-only text label using the active theme's primary text color.

    UIContext::label_colored

    fn UIContext::label_colored(self : UIContext, text : String, color :
    Color
    ) -> Response

    Render a text label with a specified custom color.

    UIContext::layers

    fn UIContext::layers(self : UIContext) -> LayerManager

    UIContext::layout

    fn UIContext::layout(self : UIContext) -> LayoutEngine

    UIContext::lost_focus

    fn UIContext::lost_focus(self : UIContext, id : Id) -> Bool

    UIContext::measure_text

    fn UIContext::measure_text(self : UIContext, text : String, font_size : Double) ->
    Vec2

    UIContext::memory

    fn UIContext::memory(self : UIContext) -> Memory

    UIContext::new

    fn UIContext::new() -> UIContext

    UIContext::next_auto_id

    fn UIContext::next_auto_id(self : UIContext) -> Id

    UIContext::open_combo_id

    fn UIContext::open_combo_id(self : UIContext) -> Id

    UIContext::open_menu_id

    fn UIContext::open_menu_id(self : UIContext) -> Id

    UIContext::painter

    fn UIContext::painter(self : UIContext) -> Painter

    Return a scoped Painter for the active draw target enforcing scissor clipping and offset.

    UIContext::pop_clip

    fn UIContext::pop_clip(self : UIContext) -> Unit

    UIContext::pop_id

    fn UIContext::pop_id(self : UIContext) -> Unit

    UIContext::prev_focused_id

    fn UIContext::prev_focused_id(self : UIContext) -> Id

    UIContext::prune_stale_state

    fn UIContext::prune_stale_state(self : UIContext, ttl_frames : Int) -> Unit

    Prune persistent widget states that have not been active for more than ttl_frames frames.

    UIContext::push_clip

    fn UIContext::push_clip(self : UIContext, rect :
    Rect
    ) -> Unit

    UIContext::push_id

    fn UIContext::push_id(self : UIContext, salt : String) -> Unit

    UIContext::raise_window

    fn UIContext::raise_window(self : UIContext, id : Id) -> Unit

    UIContext::register_focusable

    fn UIContext::register_focusable(self : UIContext, id : Id) -> Unit

    UIContext::request_focus

    fn UIContext::request_focus(self : UIContext, id : Id) -> Unit

    fn UIContext::reset_caret_blink(self : UIContext) -> Unit

    UIContext::separator

    fn UIContext::separator(self : UIContext) -> Unit

    Render a full-width horizontal divider line, or a vertical divider line in horizontal layouts.

    UIContext::set_active_id

    fn UIContext::set_active_id(self : UIContext, id : Id) -> Unit

    UIContext::set_active_submenu_id

    fn UIContext::set_active_submenu_id(self : UIContext, id : String) -> Unit

    UIContext::set_available_width

    fn UIContext::set_available_width(self : UIContext, width : Double) -> Unit

    UIContext::set_cached_text_width

    fn UIContext::set_cached_text_width(self : UIContext, text : String, font_size : Double, width : Double) -> Unit

    UIContext::set_collapsing_open

    fn UIContext::set_collapsing_open(self : UIContext, id : Id, is_open : Bool) -> Unit

    UIContext::set_cursor

    fn UIContext::set_cursor(self : UIContext, pos :
    Vec2
    ) -> Unit

    UIContext::set_cursor_icon

    fn UIContext::set_cursor_icon(self : UIContext, icon : String) -> Unit

    UIContext::set_draw_list

    fn UIContext::set_draw_list(self : UIContext, list :
    DrawList
    ) -> Unit

    UIContext::set_focused_id

    fn UIContext::set_focused_id(self : UIContext, id : Id) -> Unit

    UIContext::set_hot_id

    fn UIContext::set_hot_id(self : UIContext, id : Id) -> Unit

    UIContext::set_item_spacing

    fn UIContext::set_item_spacing(self : UIContext, spacing :
    Vec2
    ) -> Unit

    UIContext::set_open_combo_id

    fn UIContext::set_open_combo_id(self : UIContext, id : Id) -> Unit

    UIContext::set_open_menu_id

    fn UIContext::set_open_menu_id(self : UIContext, id : Id) -> Unit

    UIContext::set_scroll_content_height

    fn UIContext::set_scroll_content_height(self : UIContext, id : Id, height : Double) -> Unit

    UIContext::set_scroll_offset

    fn UIContext::set_scroll_offset(self : UIContext, id : Id, offset : Double) -> Unit

    UIContext::set_style

    fn UIContext::set_style(self : UIContext, style : WidgetStyle) -> Unit

    UIContext::set_text_cursor_pos

    fn UIContext::set_text_cursor_pos(self : UIContext, id : Id, pos : Int) -> Unit

    UIContext::set_text_selection_anchor

    fn UIContext::set_text_selection_anchor(self : UIContext, id : Id, anchor : Int?) -> Unit

    UIContext::set_theme

    fn UIContext::set_theme(self : UIContext, theme : Theme) -> Unit

    UIContext::set_time

    fn UIContext::set_time(self : UIContext, t : Double) -> Unit

    UIContext::set_wants_capture_mouse

    fn UIContext::set_wants_capture_mouse(self : UIContext, capture : Bool) -> Unit

    Explicitly declare that the UI context is capturing pointer input this frame.

    UIContext::set_window_pos

    fn UIContext::set_window_pos(self : UIContext, id : Id, pos :
    Vec2
    ) -> Unit

    UIContext::spacer

    fn UIContext::spacer(self : UIContext, amount : Double) -> Unit

    Insert spacing advancing the cursor along the active layout direction.

    UIContext::style

    fn UIContext::style(self : UIContext) -> WidgetStyle

    UIContext::surrender_focus

    fn UIContext::surrender_focus(self : UIContext, id : Id) -> Unit

    UIContext::theme

    fn UIContext::theme(self : UIContext) -> Theme

    UIContext::time

    fn UIContext::time(self : UIContext) -> Double

    UIContext::vertical

    fn UIContext::vertical(self : UIContext, content : (UIContext) -> Unit) -> Unit

    Scoped vertical layout flow (TopDown).

    UIContext::wants_capture_mouse

    fn UIContext::wants_capture_mouse(self : UIContext) -> Bool

    Returns true if the pointer is currently hovering over or interacting with any UI widget or window.

    UIContext::window_batch

    UIContext::window_z

    fn UIContext::window_z(self : UIContext, id : Id) -> Int

    UIContext::windows

    fn UIContext::windows(self : UIContext) -> WindowManager

    WidgetStyle

    pub struct WidgetStyle {
    scale : Double
    elevation : Double
    control_h_sm : Double
    control_h_md : Double
    control_h_lg : Double
    font_xs : Double
    font_sm : Double
    font_small : Double
    font_normal : Double
    font_large : Double
    font_xl : Double
    spacing_xs : Double
    spacing_sm : Double
    spacing_md : Double
    spacing_lg : Double
    spacing_xl : Double
    item_spacing :
    Vec2

    radius_xs : Double
    radius_sm : Double
    radius_md : Double
    radius_lg : Double
    radius_xl : Double
    caret_blink_interval : Double
    } derive(Eq,
    Debug
    )

    Systemic design tokens holding foundational scales, typography, and elevation metrics.

    WidgetStyle::default

    fn WidgetStyle::default() -> WidgetStyle

    Returns the standard Studio Light porcelain widget style.

    WidgetStyle::scaled

    fn WidgetStyle::scaled(self : WidgetStyle, factor : Double) -> WidgetStyle

    Return a copy of this style with its global scale factor multiplied. Downstream packages cannot mutate WidgetStyle fields directly, so this fluent builder is the supported way to derive density variants.

    WindowManager

    Subsystem managing floating window stacking, dragging, draw batches, and z-ordering.

    WindowManager::active_z

    fn WindowManager::active_z(self : WindowManager) -> Int

    WindowManager::begin_frame

    fn WindowManager::begin_frame(self : WindowManager) -> Unit

    WindowManager::flush_to

    WindowManager::is_occluded

    WindowManager::mark_drawn

    fn WindowManager::mark_drawn(self : WindowManager, id : Id) -> Unit

    WindowManager::new

    WindowManager::prune_stale

    fn WindowManager::prune_stale(self : WindowManager) -> Unit

    WindowManager::raise_window

    fn WindowManager::raise_window(self : WindowManager, id : Id) -> Unit

    WindowManager::record_rect

    fn WindowManager::record_rect(self : WindowManager, rect :
    Rect
    , z : Int) -> Unit

    WindowManager::set_active_z

    fn WindowManager::set_active_z(self : WindowManager, z : Int) -> Unit

    WindowManager::set_pos

    fn WindowManager::set_pos(self : WindowManager, id : Id, pos :
    Vec2
    ) -> Unit

    WindowManager::window_z

    fn WindowManager::window_z(self : WindowManager, id : Id) -> Int

    delete_next_char

    fn delete_next_char(text : String, pos : Int) -> String

    Deletes 1 Unicode scalar at cursor_pos and returns new_text.

    delete_prev_char

    fn delete_prev_char(text : String, pos : Int) -> (String, Int)

    Deletes 1 Unicode scalar before cursor_pos and returns (new_text, new_cursor_pos).

    is_cjk_char

    fn is_cjk_char(code : Int) -> Bool

    Returns true if the character code is in common East Asian / CJK script ranges.

    is_cjk_closing_punct

    fn is_cjk_closing_punct(code : Int) -> Bool

    Returns true if the character code is a closing quotation or punctuation mark that should not start a new line under standard CJK typesetting rules.

    is_leading_surrogate

    fn is_leading_surrogate(code : Int) -> Bool

    Returns true if the UTF-16 code point is a leading surrogate (high surrogate).

    is_trailing_surrogate

    fn is_trailing_surrogate(code : Int) -> Bool

    Returns true if the UTF-16 code point is a trailing surrogate (low surrogate).

    measure_text_size

    fn measure_text_size(text : String, font_size : Double) ->
    Vec2

    next_char_boundary

    fn next_char_boundary(text : String, pos : Int) -> Int

    Returns the safe cursor index stepping forwards by 1 Unicode scalar. If at the start of a UTF-16 surrogate pair, steps forwards by 2 code units.

    prev_char_boundary

    fn prev_char_boundary(text : String, pos : Int) -> Int

    Returns the safe cursor index stepping backwards by 1 Unicode scalar. If preceded by a UTF-16 surrogate pair, steps back by 2 code units.

    string_slice

    fn string_slice(s : String, start : Int, end : Int) -> String

    Safe substring slice clamping start and end within valid string bounds.