WIT package, MoonBit components, Node host and tests (WIP)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
SpriteandClaude Sonnet 5.5 committed 2026-11-24 23:36:35 +00:00
1 parent e5548fc067
commit e0bde1d150
125 files changed
+8681

No files matched your search

@@ -0,0 +1,44 @@
// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
///|
pub(all) enum Edge {
START; END
} derive()
///|
pub fn Edge::ordinal(self : Edge) -> Int {
match self {
START => 0
END => 1
}
}
///|
pub fn Edge::from(self : Int) -> Edge {
match self {
0 => START
1 => END
_ => panic()
}
}
///|
pub(all) struct Slot {
id : String; preferred : @types.Size; min_width : UInt; stretch : Bool; align : Edge
}
///|
pub(all) struct Placement {
id : String; rect : @types.Rect
}
///|
pub(all) struct Layout {
panel : @types.Rect; placements : Array[Placement]
}
///|
/// Decide where the panel sits and where each widget goes.
declare pub fn compute_layout(screen : @types.Size, slots : Array[Slot]) -> Layout
///|
/// Panel background/frame (drawn beneath the widgets), in screen coords.
declare pub fn render_panel(screen : @types.Size, panel : @types.Rect) -> Array[@types.DrawOp]
///|
/// Place a popup of `popup` size for the widget at `anchor`.
declare pub fn popup_position(screen : @types.Size, panel : @types.Rect, anchor : @types.Rect, popup : @types.Size) -> @types.Rect