class
Tessell::A11y::Builder
- Tessell::A11y::Builder
- Reference
- Object
Defined in:
tessell/a11y/tree.crConstructors
Instance Method Summary
-
#build(root : Tessell::Node, sink : Array(A11y::Node)) : Nil
DFS 先序遍历 retained 树,向复用 sink 追加 A11y::Node。 调用方/内部约定:每次 build 前先 clear sink(本方法内部也 clear,保证复用)。
-
#build(root : Nil, sink : Array(A11y::Node)) : Nil
J1: 空树 → sink 空
-
#focused?(node : Tessell::Node) : Bool
焦点实时查询:与 build 内 focused 同源,供 UI.a11y_emit 复用。
- #meta_for(id : UInt64) : Meta | Nil
-
#remove_meta(id : UInt64) : Bool
删除指定节点的旁挂元数据,返回是否存在并已删除。 UI.apply 在节点被移除时必须调用,避免 id 复用(object_id)残留旧语义。
- #set_meta(id : UInt64, role : Role = Role::Group, name : String = "", value : String = "", focusable : Bool = false, enabled : Bool = true, children_count : Int32 | Nil = nil, scroll_offset : Int32 = 0, row : Int32 | Nil = nil, col : Int32 | Nil = nil, row_count : Int32 | Nil = nil, col_count : Int32 | Nil = nil, row_index_text : String | Nil = nil, col_index_text : String | Nil = nil, selected : Bool | Nil = nil, active : Bool | Nil = nil, first_visible_index : Int32 | Nil = nil) : Nil
Constructor Detail
Instance Method Detail
DFS 先序遍历 retained 树,向复用 sink 追加 A11y::Node。 调用方/内部约定:每次 build 前先 clear sink(本方法内部也 clear,保证复用)。
def remove_meta(id : UInt64) : Bool
#
删除指定节点的旁挂元数据,返回是否存在并已删除。 UI.apply 在节点被移除时必须调用,避免 id 复用(object_id)残留旧语义。
def set_meta(id : UInt64, role : Role = Role::Group, name : String = "", value : String = "", focusable : Bool = false, enabled : Bool = true, children_count : Int32 | Nil = nil, scroll_offset : Int32 = 0, row : Int32 | Nil = nil, col : Int32 | Nil = nil, row_count : Int32 | Nil = nil, col_count : Int32 | Nil = nil, row_index_text : String | Nil = nil, col_index_text : String | Nil = nil, selected : Bool | Nil = nil, active : Bool | Nil = nil, first_visible_index : Int32 | Nil = nil) : Nil
#