Tycho UI — Flutter-inspired pure-MoonBit declarative UI framework (three trees, Signals, single-pass BoxConstraints, GestureArena, virtualized ListView) over tycho_2d & tycho
fn AnimationController::new(initial? : Float, duration_sec? : Double, curve? : Curve) -> AnimationControllerpub struct AppRunner {
dev : Device
renderer : Renderer2D
tree : UiTree
arena : GestureArena
controllers : Array[AnimationController]
inspector_enabled : Bool
// private fields
}fn AppRunner::pump_frame(self : AppRunner, width : Float, height : Float, dt_sec? : Double) -> DisplayListfn BoxConstraints::new(min_width? : Float, max_width? : Float, min_height? : Float, max_height? : Float) -> BoxConstraintspub struct BuildContext {
// private fields
}pub struct Computed[T] {
// private fields
}pub(all) enum Curve {
Linear
EaseIn
EaseOut
EaseInOut
CubicBezier(Float, Float, Float, Float)
Spring(Float, Float, Float)
}fn DecoratedProps::new(fill? : Color, shader? : Shader2D, border_color? : Color, border_width? : Float, radius? : Float, tl? : Float, tr? : Float, br? : Float, bl? : Float, shadow_blur? : Float, shadow_dx? : Float, shadow_dy? : Float, shadow_color? : Color) -> DecoratedPropspub struct FocusManager {
// private fields
}fn FocusManager::bind_shortcut(self : FocusManager, key : Int, mods : Int, action : () -> Unit) -> Unitpub struct FocusNode {
id : Int
focused : Signal[Bool]
can_request_focus : Bool
on_key : (Int, Int) -> Bool?
}pub(all) struct FrameStats {
build_ms : Double
layout_ms : Double
paint_ms : Double
gpu_ms : Double
element_count : Int
render_count : Int
}pub struct GestureArena {
// private fields
}fn GestureArena::handle_down(self : GestureArena, pointer : Int, pos : Point, hits : Array[HitTestEntry]) -> Unitfn GestureArena::handle_scroll(_self : GestureArena, hits : Array[HitTestEntry], dx : Float, dy : Float) -> Unitfn GestureArena::handle_up(self : GestureArena, pointer : Int, _pos : Point, still_inside_tap : Bool) -> Unitpub(all) struct GestureCallbacks {
on_tap : () -> Unit?
on_drag_start : (Point) -> Unit?
on_drag_update : (Point, Point) -> Unit?
on_drag_end : () -> Unit?
on_scroll : (Float, Float) -> Unit?
on_mouse_enter : () -> Unit?
on_mouse_exit : () -> Unit?
on_hover : (Point) -> Unit?
cursor : CursorShape?
}pub(all) enum IconKind {
Check
Close
Add
Search
Menu
ArrowBack
ArrowForward
ChevronDown
Star
Settings
Info
Warning
}pub struct NavigatorController {
stack : Signal[Array[RouteEntry]]
transition : AnimationController
}fn NavigatorController::new(initial_name : String, initial_builder : (BuildContext) -> Widget) -> NavigatorControllerfn NavigatorController::push(self : NavigatorController, name : String, route_builder : (BuildContext) -> Widget) -> Unitfn NavigatorController::replace(self : NavigatorController, name : String, route_builder : (BuildContext) -> Widget) -> Unitfn OverlayController::insert(self : OverlayController, entry_builder : (BuildContext) -> Widget) -> Intpub struct RenderNode {
// private fields
}fn RenderNode::debug_draw_bounds(self : RenderNode, canvas : Canvas, origin? : Point, depth? : Int) -> Unitpub(all) struct RichSpan {
text : String
size : Float?
color : Color?
bold : Bool
italic : Bool
underline : Bool
}pub(all) struct SemanticsNode {
id : Int
role : SemanticsRole
label : String
bounds : Rect
focused : Bool
children : Array[SemanticsNode]
}pub struct Signal[T] {
// private fields
}pub struct SignalAttachment {
// private fields
}pub(all) struct ThemeData {
colors : ColorScheme
font : FontFace
radius_sm : Float
radius_md : Float
radius_lg : Float
}fn WidgetTester::new(root : Widget, width? : Float, height? : Float, theme? : ThemeData) -> WidgetTesterfn WidgetTester::render_to_texture(self : WidgetTester, renderer : Renderer2D, target : Texture, clear_color? : Color) -> Unit raise RhiErrorfn animated_padding(key? : Key, pad : EdgeInsets, duration_sec? : Double, curve? : Curve, child : Widget) -> Widgetfn column(key? : Key, main_axis? : MainAxisAlignment, cross_axis? : CrossAxisAlignment, main_size? : MainAxisSize, gap? : Float, children : Array[Widget]) -> Widgetfn container(key? : Key, width? : Float, height? : Float, pad? : EdgeInsets, decoration? : DecoratedProps, alignment? : Alignment, child? : Widget) -> Widgetfn filled_button(key? : Key, label : String, on_pressed : () -> Unit, color? : Color, pad? : EdgeInsets) -> Widgetfn list_view_builder(key? : Key, item_count : Int, item_extent : Float, controller : ScrollController, item_builder : (BuildContext, Int) -> Widget) -> Widgetfn mouse_region(key? : Key, on_enter? : () -> Unit, on_exit? : () -> Unit, on_hover? : (Point) -> Unit, cursor? : CursorShape, child : Widget) -> Widgetfn outlined_button(key? : Key, label : String, on_pressed : () -> Unit, pad? : EdgeInsets) -> Widgetfn row(key? : Key, main_axis? : MainAxisAlignment, cross_axis? : CrossAxisAlignment, main_size? : MainAxisSize, gap? : Float, children : Array[Widget]) -> Widgetfn scrollbar(key? : Key, controller : ScrollController, thickness? : Float, child : Widget) -> Widgetfn single_child_scroll_view(key? : Key, controller? : ScrollController, direction? : Axis, child : Widget) -> Widgetfn text_button(key? : Key, label : String, on_pressed : () -> Unit, color? : Color, pad? : EdgeInsets) -> Widgetfn text_field(key? : Key, controller : TextController, placeholder? : String, width? : Float, font_size? : Float) -> WidgetInstall
Download zipTycho UI — Flutter-inspired pure-MoonBit declarative UI framework (three trees, Signals, single-pass BoxConstraints, GestureArena, virtualized ListView) over tycho_2d & tycho