Files
2026-11-24 23:36:35 +00:00

45 lines
1.1 KiB
MoonBit

// 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