class
Tessell::Kit::Root
- Tessell::Kit::Root
- Reference
- Object
Defined in:
tessell/kit/root.crConstructors
Instance Method Summary
- #a11y : A11y::Builder
- #a11y_emit(sink : Array(A11y::Node)) : Int32
- #advance_time(now_ms : Int64) : Nil
- #animate_composite(key : UI::UiKey, start_ms : Int64, opacity_from : Float32 = 1.0_f32, opacity_to : Float32 = 1.0_f32, tx_from : Float32 = 0.0_f32, tx_to : Float32 = 0.0_f32, ty_from : Float32 = 0.0_f32, ty_to : Float32 = 0.0_f32, scale_from : Float32 = 1.0_f32, scale_to : Float32 = 1.0_f32, duration_ms : Int64 = 300_i64, delay_ms : Int64 = 0_i64, easing : Proc(Float32, Float32) = ->Anim::Easing.linear(Float32), owner : Component | Nil = nil) : Anim::Track
- #animations_active? : Bool
-
#apply_hook : Proc(Nil) | Nil
宿主回调缝:UI.apply 中途调用(重入模拟/未来列表 bind 的挂点)。 回调里触发 root.build 会被延迟为二段提交。
-
#apply_hook=(apply_hook : Proc(Nil) | Nil)
宿主回调缝:UI.apply 中途调用(重入模拟/未来列表 bind 的挂点)。 回调里触发 root.build 会被延迟为二段提交。
- #build : Nil
- #build_warnings : Array(String)
-
#cancel_anim_owner(owner : Component) : Int32
owner(组件)dispose 收口:取消其名下全部轨。
- #cancel_composite(key : UI::UiKey) : Bool
- #close_all_overlays : Nil
- #close_overlay(entry : OverlayEntry) : Bool
- #component_for_node(target : Node) : Component | Nil
- #content : Component
- #context : Context
- #debug_info : DebugInfo | Nil
-
#debug_info=(info : DebugInfo | Nil) : Nil
帧调试 overlay(issue #11):宿主每帧塞入 DebugInfo,F1 开关显示。
- #debug_overlay : DebugOverlay
-
#decl_count : Int32
观测面(issue #36 计数口径):当前声明批大小——合成动画稳态下 逐帧不变(不重建声明),供 spec 计数断言使用。
-
#each_component(& : Component -> Nil) : Nil
遍历当前全部挂载组件(含 overlay,issue #59 TestDriver selector 用)。
-
#focus(component : Component) : Bool
程序化聚焦:组件必须已经 build 过(Root#build 建立了 Node 映射)。
- #focused_component : Component | Nil
-
#handle(event : Tessell::Input::Event, modifiers : Modifiers | Nil = nil) : Bool
核心事件入口。优先使用 Event 自带的 modifiers;显式参数用于旧调用点。
- #hover_component : Component | Nil
- #layout(width : Float32, height : Float32) : Nil
- #layout(viewport : Rect) : Nil
- #metrics : TextMetrics
- #node : Node
- #open_dialog(dialog : Dialog) : OverlayEntry
- #overlay_host : OverlayHost
- #paint(painter : Painter) : Nil
- #pool : UI::Pool
- #router : Tessell::Input::Router
-
#scale=(value : Float32) : Nil
DPI/缩放变更(issue #30):Context#scale= 联动清文本测量缓存后对 当前 viewport 重排。组件树、焦点、编辑状态全部保留——宿主跨屏 拖动/缩放时调用本方法,而不是重建 Root(重建会丢焦点与编辑态)。
- #theme : Theme
- #theme=(theme : Theme) : Nil
-
#tick_animations(clock : Anim::Clock) : Bool
推进一帧:闭式采样 + 写入 Node 合成态(变更标 CompositeOnly)。 返回是否仍有活动动画(宿主据此决定下一帧是否请求)。
Constructor Detail
Instance Method Detail
宿主回调缝:UI.apply 中途调用(重入模拟/未来列表 bind 的挂点)。 回调里触发 root.build 会被延迟为二段提交。
宿主回调缝:UI.apply 中途调用(重入模拟/未来列表 bind 的挂点)。 回调里触发 root.build 会被延迟为二段提交。
帧调试 overlay(issue #11):宿主每帧塞入 DebugInfo,F1 开关显示。
遍历当前全部挂载组件(含 overlay,issue #59 TestDriver selector 用)。
程序化聚焦:组件必须已经 build 过(Root#build 建立了 Node 映射)。
核心事件入口。优先使用 Event 自带的 modifiers;显式参数用于旧调用点。
DPI/缩放变更(issue #30):Context#scale= 联动清文本测量缓存后对 当前 viewport 重排。组件树、焦点、编辑状态全部保留——宿主跨屏 拖动/缩放时调用本方法,而不是重建 Root(重建会丢焦点与编辑态)。
推进一帧:闭式采样 + 写入 Node 合成态(变更标 CompositeOnly)。 返回是否仍有活动动画(宿主据此决定下一帧是否请求)。