Each pill now shows the icon the app's .desktop file names (Icon=), looked up in the freedesktop icon themes, instead of the letter tile. The tile stays as the fallback for windows with no app id, no desktop file or no icon the host can read. - WIT: a new `icons` capability (`app-icon(app-id) -> u32`, a handle, never a path or pixels) and an `image(image-op)` draw op (appended, so existing modules keep their ABI). taskbar-widget and plasmoid-host import `icons`. Host raster gains `load-image(path)` and a `draw-image` op; the plasmoids host gets an icons table (6: app id, handle). - Compositor (shell/icons.mbt): window app id -> desktop file (resolve_app_id, so StartupWMClass and last-dotted-part matches work) -> Icon= -> theme lookup (XDG data dirs, ~/.icons, flatpak exports; hicolor, Adwaita, breeze; 48/64/32 px PNG first, then scalable SVG when the host can draw it, then other sizes, then /usr/share/pixmaps). Absolute Icon= paths are used as they are. Results are cached per app id; the table is published only when a module imports `icons`. - wasm host (host-wasm): PNG via the png crate, SVG via resvg (rendered sharp at each size), PNGs area-averaged to the drawn size; loads cached by path. - Native build: a small PNG decoder (compositor/renderer/png.mbt: inflate + filters, 1-16 bit, palettes with tRNS) and the Image op in the software renderer. SVG-only icons fall back to the tile there. The wasmer stub serves `icons.app-icon` from the same table. - Tests: PNG decoder fixtures (all filters, fixed/dynamic/stored blocks, palette), image scaling and drawing, icon lookup order, Icon= parsing, task module icon-or-tile (native and wasmtime), host raster PNG+SVG loading and drawing. Checked end to end with the wasm host: foot's hicolor icon shows on its pill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hhmtDt52EjaW8jevGU
This commit is contained in:
53 files changed
+2284
-473
No files matched your search
@@ -0,0 +1,3 @@
|
||||
App icons. The host finds the app's .desktop file (by desktop id or StartupWMClass), reads its
|
||||
Icon= key and looks it up in the freedesktop icon themes; the widget only gets a handle to draw
|
||||
with a `draw-op.image`, never a path or pixels.
|
||||
@@ -0,0 +1,14 @@
|
||||
// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
|
||||
|
||||
///|
|
||||
fn wasmImportAppIcon(p0 : Int, p1 : Int) -> Int = "chandra:desktop/icons@0.1.0" "app-icon"
|
||||
|
||||
///|
|
||||
extern "wasm" fn mbt_ffi_free(position : Int) =
|
||||
#|(func (param i32) local.get 0 call $moonbit.decref)
|
||||
|
||||
///|
|
||||
#owned(str)
|
||||
extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int =
|
||||
#|(func (param i32) (result i32) local.get 0)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
warnings = "-44"
|
||||
@@ -0,0 +1,14 @@
|
||||
// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
|
||||
///|
|
||||
/// The icon of the app whose windows carry `app-id`, or 0 when the host has none (draw your
|
||||
/// own stand-in then).
|
||||
pub fn app_icon(app_id : String) -> UInt {
|
||||
|
||||
let ptr = mbt_ffi_str2ptr(app_id)
|
||||
let result : Int = wasmImportAppIcon(ptr, app_id.length());
|
||||
let ret = (result).reinterpret_as_uint()
|
||||
mbt_ffi_free(ptr)
|
||||
return ret
|
||||
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ pub(all) enum DrawOp {
|
||||
Text(TextOp)
|
||||
PushClip(Rect)
|
||||
PopClip
|
||||
Image(ImageOp)
|
||||
}
|
||||
|
||||
pub(all) struct FillRectOp {
|
||||
@@ -54,6 +55,11 @@ pub(all) struct FillRectOp {
|
||||
radius : UInt32
|
||||
}
|
||||
|
||||
pub(all) struct ImageOp {
|
||||
rect : Rect
|
||||
image : UInt32
|
||||
}
|
||||
|
||||
pub(all) enum InputEvent {
|
||||
PointerMove(Point)
|
||||
PointerDown(Point)
|
||||
|
||||
@@ -66,6 +66,12 @@ pub(all) struct TextOp {
|
||||
origin : Point; text : String; style : TextStyle
|
||||
}
|
||||
///|
|
||||
/// An image the host holds, scaled to fill `rect`. `image` is a handle a capability handed
|
||||
/// out (`icons.app-icon`); 0 or an unknown handle draws nothing.
|
||||
pub(all) struct ImageOp {
|
||||
rect : Rect; image : UInt
|
||||
}
|
||||
///|
|
||||
/// The render-list vocabulary. Components never touch pixels: they return
|
||||
/// a list of these in their own local coordinate space (origin top-left),
|
||||
/// and the host/compositor translates, clips and rasterises them.
|
||||
@@ -77,6 +83,7 @@ pub(all) enum DrawOp {
|
||||
Text(TextOp)
|
||||
PushClip(Rect)
|
||||
PopClip
|
||||
Image(ImageOp)
|
||||
}
|
||||
///|
|
||||
pub(all) enum InputEvent {
|
||||
|
||||
@@ -189,6 +189,10 @@ pub fn render(handle : UInt, box : @types.Size) -> Array[@types.DrawOp] {
|
||||
|
||||
@types.DrawOp::PopClip
|
||||
}
|
||||
7 => {
|
||||
|
||||
@types.DrawOp::Image(@types.ImageOp::{rect : @types.Rect::{x : mbt_ffi_load32((iter_base) + 4), y : mbt_ffi_load32((iter_base) + 8), w : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint(), h : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, image : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()})
|
||||
}
|
||||
_ => panic()
|
||||
}
|
||||
|
||||
@@ -245,6 +249,10 @@ pub fn popup(handle : UInt) -> PopupSurface? {
|
||||
|
||||
@types.DrawOp::PopClip
|
||||
}
|
||||
7 => {
|
||||
|
||||
@types.DrawOp::Image(@types.ImageOp::{rect : @types.Rect::{x : mbt_ffi_load32((iter_base) + 4), y : mbt_ffi_load32((iter_base) + 8), w : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint(), h : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()}, image : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()})
|
||||
}
|
||||
_ => panic()
|
||||
}
|
||||
|
||||
@@ -307,7 +315,8 @@ pub fn on_event(handle : UInt, on_popup : Bool, event : @types.InputEvent) -> Bo
|
||||
/// Row tables, as built by compositor/wasm: a LE u32 row count, then per row each field as a LE
|
||||
/// i32 ('i') or a LE u32 byte length + UTF-8 ('s'). `which`: 0 apps (sssss: id name comment
|
||||
/// category glyph), 1 windows (isii: id title focused minimized), 2 layouts (s), 3 modules
|
||||
/// (sssi: id name path loaded), 4 instances (sss: slot module name), 5 wallpapers (s), 6 session settings (s).
|
||||
/// (sssi: id name path loaded), 4 instances (sss: slot module name), 5 wallpapers (s), 6 session
|
||||
/// settings (s), 7 icons (si: app id, raster image handle from `raster.load-image`) served by `icons.app-icon`.
|
||||
pub fn publish_table(which : UInt, rows : FixedArray[Byte]) -> Unit {
|
||||
|
||||
let ptr = mbt_ffi_bytes2ptr(rows)
|
||||
|
||||
@@ -6,6 +6,9 @@ fn wasmImportCapture(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int)
|
||||
///|
|
||||
fn wasmImportRelease(p0 : Int) = "chandra:host/raster@0.1.0" "release"
|
||||
|
||||
///|
|
||||
fn wasmImportLoadImage(p0 : Int, p1 : Int) -> Int = "chandra:host/raster@0.1.0" "load-image"
|
||||
|
||||
///|
|
||||
fn wasmImportSubmit(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int, p7 : Int, p8 : Int, p9 : Int, p10 : Int, p11 : Int, p12 : Int) = "chandra:host/raster@0.1.0" "submit"
|
||||
|
||||
@@ -15,10 +18,6 @@ fn wasmImportReadFrame(p0 : Int) = "chandra:host/raster@0.1.0" "read-frame"
|
||||
///|
|
||||
fn wasmImportExportMemfd() -> Int = "chandra:host/raster@0.1.0" "export-memfd"
|
||||
|
||||
///|
|
||||
extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) =
|
||||
#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8)
|
||||
|
||||
///|
|
||||
extern "wasm" fn mbt_ffi_free(position : Int) =
|
||||
#|(func (param i32) local.get 0 call $moonbit.decref)
|
||||
@@ -30,15 +29,6 @@ extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int =
|
||||
#| local.tee 1 i32.const 0 call $moonbit.init_array8
|
||||
#| local.get 1)
|
||||
|
||||
///|
|
||||
#owned(str)
|
||||
extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int =
|
||||
#|(func (param i32) (result i32) local.get 0)
|
||||
|
||||
///|
|
||||
extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int =
|
||||
#|(func (param i32) (result i32) local.get 0 i32.load)
|
||||
|
||||
///|
|
||||
extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] =
|
||||
#|(func (param i32) (param i32) (result i32)
|
||||
@@ -50,3 +40,16 @@ extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] =
|
||||
extern "wasm" fn mbt_ffi_store32(offset : Int, value : Int) =
|
||||
#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store)
|
||||
|
||||
///|
|
||||
#owned(str)
|
||||
extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int =
|
||||
#|(func (param i32) (result i32) local.get 0)
|
||||
|
||||
///|
|
||||
extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int =
|
||||
#|(func (param i32) (result i32) local.get 0 i32.load)
|
||||
|
||||
///|
|
||||
extern "wasm" fn mbt_ffi_store8(offset : Int, value : Int) =
|
||||
#|(func (param i32) (param i32) local.get 0 local.get 1 i32.store8)
|
||||
|
||||
@@ -10,6 +10,11 @@ fn wasmImportRelease(p0 : Int) -> Unit {
|
||||
abort("wasm-only host import")
|
||||
}
|
||||
|
||||
///|
|
||||
fn wasmImportLoadImage(p0 : Int, p1 : Int) -> Int {
|
||||
abort("wasm-only host import")
|
||||
}
|
||||
|
||||
///|
|
||||
fn wasmImportSubmit(p0 : Int, p1 : Int, p2 : Int, p3 : Int, p4 : Int, p5 : Int, p6 : Int, p7 : Int, p8 : Int, p9 : Int, p10 : Int, p11 : Int, p12 : Int) -> Unit {
|
||||
abort("wasm-only host import")
|
||||
@@ -25,11 +30,6 @@ fn wasmImportExportMemfd() -> Int {
|
||||
abort("wasm-only host import")
|
||||
}
|
||||
|
||||
///|
|
||||
fn mbt_ffi_store8(offset : Int, value : Int) -> Unit {
|
||||
abort("wasm-only")
|
||||
}
|
||||
|
||||
///|
|
||||
fn mbt_ffi_free(position : Int) -> Unit {
|
||||
abort("wasm-only")
|
||||
@@ -40,6 +40,16 @@ fn mbt_ffi_malloc(size : Int) -> Int {
|
||||
abort("wasm-only")
|
||||
}
|
||||
|
||||
///|
|
||||
fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] {
|
||||
abort("wasm-only")
|
||||
}
|
||||
|
||||
///|
|
||||
fn mbt_ffi_store32(offset : Int, value : Int) -> Unit {
|
||||
abort("wasm-only")
|
||||
}
|
||||
|
||||
///|
|
||||
fn mbt_ffi_str2ptr(str : String) -> Int {
|
||||
abort("wasm-only")
|
||||
@@ -51,11 +61,6 @@ fn mbt_ffi_load32(offset : Int) -> Int {
|
||||
}
|
||||
|
||||
///|
|
||||
fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] {
|
||||
abort("wasm-only")
|
||||
}
|
||||
|
||||
///|
|
||||
fn mbt_ffi_store32(offset : Int, value : Int) -> Unit {
|
||||
fn mbt_ffi_store8(offset : Int, value : Int) -> Unit {
|
||||
abort("wasm-only")
|
||||
}
|
||||
@@ -29,6 +29,11 @@ pub(all) struct Label {
|
||||
x : Int; y : Int; text : String; size : Int; color : Color; align : Byte; bold : Bool; mono : Bool
|
||||
}
|
||||
///|
|
||||
/// An image from `load-image`, scaled to fill `area`.
|
||||
pub(all) struct Picture {
|
||||
area : Rect; image : UInt
|
||||
}
|
||||
///|
|
||||
pub(all) enum Op {
|
||||
FillRect(Fill)
|
||||
StrokeRect(Stroke)
|
||||
@@ -37,6 +42,7 @@ pub(all) enum Op {
|
||||
DrawText(Label)
|
||||
PushClip(Rect)
|
||||
PopClip
|
||||
DrawImage(Picture)
|
||||
}
|
||||
///|
|
||||
/// A toplevel: its decoration (drawn at `geometry` minus the insets), then its client surface.
|
||||
@@ -66,13 +72,25 @@ pub fn release(id : UInt) -> Unit {
|
||||
|
||||
wasmImportRelease((id).reinterpret_as_int());
|
||||
|
||||
}
|
||||
///|
|
||||
/// Decode the PNG or SVG file at `path` into a host image (an app icon), for `draw-image`.
|
||||
/// Loading the same path again returns the same handle. 0 when it can't be read or decoded.
|
||||
pub fn load_image(path : String) -> UInt {
|
||||
|
||||
let ptr = mbt_ffi_str2ptr(path)
|
||||
let result : Int = wasmImportLoadImage(ptr, path.length());
|
||||
let ret = (result).reinterpret_as_uint()
|
||||
mbt_ffi_free(ptr)
|
||||
return ret
|
||||
|
||||
}
|
||||
///|
|
||||
/// Draw a frame into the host framebuffer.
|
||||
pub fn submit(f : Frame) -> Unit {
|
||||
let cleanup_list : Array[Int] = []
|
||||
|
||||
let (lowered, lowered8, lowered9) = match ((f).wallpaper) {
|
||||
let (lowered, lowered9, lowered10) = match ((f).wallpaper) {
|
||||
None => {
|
||||
|
||||
((0), 0, 0)
|
||||
@@ -173,6 +191,16 @@ pub fn submit(f : Frame) -> Unit {
|
||||
PopClip => {
|
||||
mbt_ffi_store8((iter_base) + 0, (6))
|
||||
|
||||
()
|
||||
}
|
||||
DrawImage(payload8) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (7))
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload8).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload8).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload8).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload8).area).h)
|
||||
mbt_ffi_store32((iter_base) + 20, ((payload8).image).reinterpret_as_int())
|
||||
|
||||
()
|
||||
}
|
||||
}
|
||||
@@ -184,28 +212,14 @@ pub fn submit(f : Frame) -> Unit {
|
||||
}
|
||||
}
|
||||
|
||||
let address18 = mbt_ffi_malloc(((f).background).length() * 32);
|
||||
for index19 = 0; index19 < ((f).background).length(); index19 = index19 + 1 {
|
||||
let iter_elem : Op = ((f).background)[(index19)]
|
||||
let iter_base = address18 + (index19 * 32);
|
||||
let address20 = mbt_ffi_malloc(((f).background).length() * 32);
|
||||
for index21 = 0; index21 < ((f).background).length(); index21 = index21 + 1 {
|
||||
let iter_elem : Op = ((f).background)[(index21)]
|
||||
let iter_base = address20 + (index21 * 32);
|
||||
|
||||
match iter_elem {
|
||||
FillRect(payload10) => {
|
||||
FillRect(payload11) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (0))
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload10).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload10).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload10).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload10).area).h)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload10).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload10).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload10).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload10).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload10).radius)
|
||||
|
||||
()
|
||||
}
|
||||
StrokeRect(payload11) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (1))
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload11).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload11).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload11).area).w)
|
||||
@@ -214,80 +228,104 @@ pub fn submit(f : Frame) -> Unit {
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload11).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload11).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload11).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload11).width)
|
||||
mbt_ffi_store32((iter_base) + 28, (payload11).radius)
|
||||
mbt_ffi_store32((iter_base) + 24, (payload11).radius)
|
||||
|
||||
()
|
||||
}
|
||||
DrawLine(payload12) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (2))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload12).x0)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload12).y0)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload12).x1)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload12).y1)
|
||||
StrokeRect(payload12) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (1))
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload12).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload12).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload12).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload12).area).h)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload12).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload12).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload12).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload12).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload12).width)
|
||||
mbt_ffi_store32((iter_base) + 28, (payload12).radius)
|
||||
|
||||
()
|
||||
}
|
||||
DrawCircle(payload13) => {
|
||||
DrawLine(payload13) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (2))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload13).x0)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload13).y0)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload13).x1)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload13).y1)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload13).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload13).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload13).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload13).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload13).width)
|
||||
|
||||
()
|
||||
}
|
||||
DrawCircle(payload14) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (3))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload13).cx)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload13).cy)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload13).radius)
|
||||
mbt_ffi_store8((iter_base) + 16, (((payload13).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 17, (((payload13).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 18, (((payload13).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 19, (((payload13).color).a).to_int())
|
||||
mbt_ffi_store8((iter_base) + 20, (if (payload13).filled { 1 } else { 0 }))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload14).cx)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload14).cy)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload14).radius)
|
||||
mbt_ffi_store8((iter_base) + 16, (((payload14).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 17, (((payload14).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 18, (((payload14).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 19, (((payload14).color).a).to_int())
|
||||
mbt_ffi_store8((iter_base) + 20, (if (payload14).filled { 1 } else { 0 }))
|
||||
|
||||
()
|
||||
}
|
||||
DrawText(payload14) => {
|
||||
DrawText(payload15) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (4))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload14).x)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload14).y)
|
||||
mbt_ffi_store32((iter_base) + 4, (payload15).x)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload15).y)
|
||||
|
||||
let ptr15 = mbt_ffi_str2ptr((payload14).text)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload14).text.length())
|
||||
mbt_ffi_store32((iter_base) + 12, ptr15)
|
||||
mbt_ffi_store32((iter_base) + 20, (payload14).size)
|
||||
mbt_ffi_store8((iter_base) + 24, (((payload14).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 25, (((payload14).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 26, (((payload14).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 27, (((payload14).color).a).to_int())
|
||||
mbt_ffi_store8((iter_base) + 28, ((payload14).align).to_int())
|
||||
mbt_ffi_store8((iter_base) + 29, (if (payload14).bold { 1 } else { 0 }))
|
||||
mbt_ffi_store8((iter_base) + 30, (if (payload14).mono { 1 } else { 0 }))
|
||||
cleanup_list.push(ptr15)
|
||||
let ptr16 = mbt_ffi_str2ptr((payload15).text)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload15).text.length())
|
||||
mbt_ffi_store32((iter_base) + 12, ptr16)
|
||||
mbt_ffi_store32((iter_base) + 20, (payload15).size)
|
||||
mbt_ffi_store8((iter_base) + 24, (((payload15).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 25, (((payload15).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 26, (((payload15).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 27, (((payload15).color).a).to_int())
|
||||
mbt_ffi_store8((iter_base) + 28, ((payload15).align).to_int())
|
||||
mbt_ffi_store8((iter_base) + 29, (if (payload15).bold { 1 } else { 0 }))
|
||||
mbt_ffi_store8((iter_base) + 30, (if (payload15).mono { 1 } else { 0 }))
|
||||
cleanup_list.push(ptr16)
|
||||
|
||||
()
|
||||
}
|
||||
PushClip(payload16) => {
|
||||
PushClip(payload17) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (5))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload16).x)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload16).y)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload16).w)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload16).h)
|
||||
mbt_ffi_store32((iter_base) + 4, (payload17).x)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload17).y)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload17).w)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload17).h)
|
||||
|
||||
()
|
||||
}
|
||||
PopClip => {
|
||||
mbt_ffi_store8((iter_base) + 0, (6))
|
||||
|
||||
()
|
||||
}
|
||||
DrawImage(payload19) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (7))
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload19).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload19).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload19).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload19).area).h)
|
||||
mbt_ffi_store32((iter_base) + 20, ((payload19).image).reinterpret_as_int())
|
||||
|
||||
()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let address30 = mbt_ffi_malloc(((f).windows).length() * 48);
|
||||
for index31 = 0; index31 < ((f).windows).length(); index31 = index31 + 1 {
|
||||
let iter_elem : Window = ((f).windows)[(index31)]
|
||||
let iter_base = address30 + (index31 * 48);
|
||||
let address33 = mbt_ffi_malloc(((f).windows).length() * 48);
|
||||
for index34 = 0; index34 < ((f).windows).length(); index34 = index34 + 1 {
|
||||
let iter_elem : Window = ((f).windows)[(index34)]
|
||||
let iter_base = address33 + (index34 * 48);
|
||||
mbt_ffi_store32((iter_base) + 0, ((iter_elem).geometry).x)
|
||||
mbt_ffi_store32((iter_base) + 4, ((iter_elem).geometry).y)
|
||||
mbt_ffi_store32((iter_base) + 8, ((iter_elem).geometry).w)
|
||||
@@ -297,217 +335,237 @@ pub fn submit(f : Frame) -> Unit {
|
||||
mbt_ffi_store32((iter_base) + 24, (iter_elem).inset_bottom)
|
||||
mbt_ffi_store32((iter_base) + 28, (iter_elem).inset_left)
|
||||
|
||||
let address28 = mbt_ffi_malloc(((iter_elem).deco).length() * 32);
|
||||
for index29 = 0; index29 < ((iter_elem).deco).length(); index29 = index29 + 1 {
|
||||
let iter_elem : Op = ((iter_elem).deco)[(index29)]
|
||||
let iter_base = address28 + (index29 * 32);
|
||||
let address31 = mbt_ffi_malloc(((iter_elem).deco).length() * 32);
|
||||
for index32 = 0; index32 < ((iter_elem).deco).length(); index32 = index32 + 1 {
|
||||
let iter_elem : Op = ((iter_elem).deco)[(index32)]
|
||||
let iter_base = address31 + (index32 * 32);
|
||||
|
||||
match iter_elem {
|
||||
FillRect(payload20) => {
|
||||
FillRect(payload22) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (0))
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload20).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload20).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload20).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload20).area).h)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload20).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload20).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload20).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload20).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload20).radius)
|
||||
|
||||
()
|
||||
}
|
||||
StrokeRect(payload21) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (1))
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload21).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload21).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload21).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload21).area).h)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload21).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload21).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload21).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload21).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload21).width)
|
||||
mbt_ffi_store32((iter_base) + 28, (payload21).radius)
|
||||
|
||||
()
|
||||
}
|
||||
DrawLine(payload22) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (2))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload22).x0)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload22).y0)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload22).x1)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload22).y1)
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload22).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload22).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload22).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload22).area).h)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload22).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload22).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload22).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload22).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload22).width)
|
||||
mbt_ffi_store32((iter_base) + 24, (payload22).radius)
|
||||
|
||||
()
|
||||
}
|
||||
DrawCircle(payload23) => {
|
||||
StrokeRect(payload23) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (1))
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload23).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload23).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload23).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload23).area).h)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload23).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload23).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload23).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload23).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload23).width)
|
||||
mbt_ffi_store32((iter_base) + 28, (payload23).radius)
|
||||
|
||||
()
|
||||
}
|
||||
DrawLine(payload24) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (2))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload24).x0)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload24).y0)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload24).x1)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload24).y1)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload24).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload24).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload24).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload24).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload24).width)
|
||||
|
||||
()
|
||||
}
|
||||
DrawCircle(payload25) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (3))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload23).cx)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload23).cy)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload23).radius)
|
||||
mbt_ffi_store8((iter_base) + 16, (((payload23).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 17, (((payload23).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 18, (((payload23).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 19, (((payload23).color).a).to_int())
|
||||
mbt_ffi_store8((iter_base) + 20, (if (payload23).filled { 1 } else { 0 }))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload25).cx)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload25).cy)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload25).radius)
|
||||
mbt_ffi_store8((iter_base) + 16, (((payload25).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 17, (((payload25).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 18, (((payload25).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 19, (((payload25).color).a).to_int())
|
||||
mbt_ffi_store8((iter_base) + 20, (if (payload25).filled { 1 } else { 0 }))
|
||||
|
||||
()
|
||||
}
|
||||
DrawText(payload24) => {
|
||||
DrawText(payload26) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (4))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload24).x)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload24).y)
|
||||
|
||||
let ptr25 = mbt_ffi_str2ptr((payload24).text)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload24).text.length())
|
||||
mbt_ffi_store32((iter_base) + 12, ptr25)
|
||||
mbt_ffi_store32((iter_base) + 20, (payload24).size)
|
||||
mbt_ffi_store8((iter_base) + 24, (((payload24).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 25, (((payload24).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 26, (((payload24).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 27, (((payload24).color).a).to_int())
|
||||
mbt_ffi_store8((iter_base) + 28, ((payload24).align).to_int())
|
||||
mbt_ffi_store8((iter_base) + 29, (if (payload24).bold { 1 } else { 0 }))
|
||||
mbt_ffi_store8((iter_base) + 30, (if (payload24).mono { 1 } else { 0 }))
|
||||
cleanup_list.push(ptr25)
|
||||
|
||||
()
|
||||
}
|
||||
PushClip(payload26) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (5))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload26).x)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload26).y)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload26).w)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload26).h)
|
||||
|
||||
let ptr27 = mbt_ffi_str2ptr((payload26).text)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload26).text.length())
|
||||
mbt_ffi_store32((iter_base) + 12, ptr27)
|
||||
mbt_ffi_store32((iter_base) + 20, (payload26).size)
|
||||
mbt_ffi_store8((iter_base) + 24, (((payload26).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 25, (((payload26).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 26, (((payload26).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 27, (((payload26).color).a).to_int())
|
||||
mbt_ffi_store8((iter_base) + 28, ((payload26).align).to_int())
|
||||
mbt_ffi_store8((iter_base) + 29, (if (payload26).bold { 1 } else { 0 }))
|
||||
mbt_ffi_store8((iter_base) + 30, (if (payload26).mono { 1 } else { 0 }))
|
||||
cleanup_list.push(ptr27)
|
||||
|
||||
()
|
||||
}
|
||||
PushClip(payload28) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (5))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload28).x)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload28).y)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload28).w)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload28).h)
|
||||
|
||||
()
|
||||
}
|
||||
PopClip => {
|
||||
mbt_ffi_store8((iter_base) + 0, (6))
|
||||
|
||||
()
|
||||
}
|
||||
DrawImage(payload30) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (7))
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload30).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload30).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload30).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload30).area).h)
|
||||
mbt_ffi_store32((iter_base) + 20, ((payload30).image).reinterpret_as_int())
|
||||
|
||||
()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
mbt_ffi_store32((iter_base) + 36, ((iter_elem).deco).length())
|
||||
mbt_ffi_store32((iter_base) + 32, address28)
|
||||
mbt_ffi_store32((iter_base) + 32, address31)
|
||||
mbt_ffi_store8((iter_base) + 40, (if (iter_elem).fullscreen { 1 } else { 0 }))
|
||||
mbt_ffi_store32((iter_base) + 44, ((iter_elem).surface).reinterpret_as_int())
|
||||
cleanup_list.push(address28)
|
||||
cleanup_list.push(address31)
|
||||
|
||||
}
|
||||
|
||||
let address40 = mbt_ffi_malloc(((f).panel).length() * 32);
|
||||
for index41 = 0; index41 < ((f).panel).length(); index41 = index41 + 1 {
|
||||
let iter_elem : Op = ((f).panel)[(index41)]
|
||||
let iter_base = address40 + (index41 * 32);
|
||||
let address44 = mbt_ffi_malloc(((f).panel).length() * 32);
|
||||
for index45 = 0; index45 < ((f).panel).length(); index45 = index45 + 1 {
|
||||
let iter_elem : Op = ((f).panel)[(index45)]
|
||||
let iter_base = address44 + (index45 * 32);
|
||||
|
||||
match iter_elem {
|
||||
FillRect(payload32) => {
|
||||
FillRect(payload35) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (0))
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload32).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload32).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload32).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload32).area).h)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload32).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload32).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload32).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload32).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload32).radius)
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload35).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload35).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload35).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload35).area).h)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload35).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload35).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload35).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload35).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload35).radius)
|
||||
|
||||
()
|
||||
}
|
||||
StrokeRect(payload33) => {
|
||||
StrokeRect(payload36) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (1))
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload33).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload33).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload33).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload33).area).h)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload33).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload33).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload33).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload33).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload33).width)
|
||||
mbt_ffi_store32((iter_base) + 28, (payload33).radius)
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload36).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload36).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload36).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload36).area).h)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload36).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload36).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload36).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload36).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload36).width)
|
||||
mbt_ffi_store32((iter_base) + 28, (payload36).radius)
|
||||
|
||||
()
|
||||
}
|
||||
DrawLine(payload34) => {
|
||||
DrawLine(payload37) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (2))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload34).x0)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload34).y0)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload34).x1)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload34).y1)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload34).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload34).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload34).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload34).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload34).width)
|
||||
mbt_ffi_store32((iter_base) + 4, (payload37).x0)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload37).y0)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload37).x1)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload37).y1)
|
||||
mbt_ffi_store8((iter_base) + 20, (((payload37).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 21, (((payload37).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 22, (((payload37).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 23, (((payload37).color).a).to_int())
|
||||
mbt_ffi_store32((iter_base) + 24, (payload37).width)
|
||||
|
||||
()
|
||||
}
|
||||
DrawCircle(payload35) => {
|
||||
DrawCircle(payload38) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (3))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload35).cx)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload35).cy)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload35).radius)
|
||||
mbt_ffi_store8((iter_base) + 16, (((payload35).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 17, (((payload35).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 18, (((payload35).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 19, (((payload35).color).a).to_int())
|
||||
mbt_ffi_store8((iter_base) + 20, (if (payload35).filled { 1 } else { 0 }))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload38).cx)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload38).cy)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload38).radius)
|
||||
mbt_ffi_store8((iter_base) + 16, (((payload38).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 17, (((payload38).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 18, (((payload38).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 19, (((payload38).color).a).to_int())
|
||||
mbt_ffi_store8((iter_base) + 20, (if (payload38).filled { 1 } else { 0 }))
|
||||
|
||||
()
|
||||
}
|
||||
DrawText(payload36) => {
|
||||
DrawText(payload39) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (4))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload36).x)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload36).y)
|
||||
mbt_ffi_store32((iter_base) + 4, (payload39).x)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload39).y)
|
||||
|
||||
let ptr37 = mbt_ffi_str2ptr((payload36).text)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload36).text.length())
|
||||
mbt_ffi_store32((iter_base) + 12, ptr37)
|
||||
mbt_ffi_store32((iter_base) + 20, (payload36).size)
|
||||
mbt_ffi_store8((iter_base) + 24, (((payload36).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 25, (((payload36).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 26, (((payload36).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 27, (((payload36).color).a).to_int())
|
||||
mbt_ffi_store8((iter_base) + 28, ((payload36).align).to_int())
|
||||
mbt_ffi_store8((iter_base) + 29, (if (payload36).bold { 1 } else { 0 }))
|
||||
mbt_ffi_store8((iter_base) + 30, (if (payload36).mono { 1 } else { 0 }))
|
||||
cleanup_list.push(ptr37)
|
||||
let ptr40 = mbt_ffi_str2ptr((payload39).text)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload39).text.length())
|
||||
mbt_ffi_store32((iter_base) + 12, ptr40)
|
||||
mbt_ffi_store32((iter_base) + 20, (payload39).size)
|
||||
mbt_ffi_store8((iter_base) + 24, (((payload39).color).r).to_int())
|
||||
mbt_ffi_store8((iter_base) + 25, (((payload39).color).g).to_int())
|
||||
mbt_ffi_store8((iter_base) + 26, (((payload39).color).b).to_int())
|
||||
mbt_ffi_store8((iter_base) + 27, (((payload39).color).a).to_int())
|
||||
mbt_ffi_store8((iter_base) + 28, ((payload39).align).to_int())
|
||||
mbt_ffi_store8((iter_base) + 29, (if (payload39).bold { 1 } else { 0 }))
|
||||
mbt_ffi_store8((iter_base) + 30, (if (payload39).mono { 1 } else { 0 }))
|
||||
cleanup_list.push(ptr40)
|
||||
|
||||
()
|
||||
}
|
||||
PushClip(payload38) => {
|
||||
PushClip(payload41) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (5))
|
||||
mbt_ffi_store32((iter_base) + 4, (payload38).x)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload38).y)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload38).w)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload38).h)
|
||||
mbt_ffi_store32((iter_base) + 4, (payload41).x)
|
||||
mbt_ffi_store32((iter_base) + 8, (payload41).y)
|
||||
mbt_ffi_store32((iter_base) + 12, (payload41).w)
|
||||
mbt_ffi_store32((iter_base) + 16, (payload41).h)
|
||||
|
||||
()
|
||||
}
|
||||
PopClip => {
|
||||
mbt_ffi_store8((iter_base) + 0, (6))
|
||||
|
||||
()
|
||||
}
|
||||
DrawImage(payload43) => {
|
||||
mbt_ffi_store8((iter_base) + 0, (7))
|
||||
mbt_ffi_store32((iter_base) + 4, ((payload43).area).x)
|
||||
mbt_ffi_store32((iter_base) + 8, ((payload43).area).y)
|
||||
mbt_ffi_store32((iter_base) + 12, ((payload43).area).w)
|
||||
mbt_ffi_store32((iter_base) + 16, ((payload43).area).h)
|
||||
mbt_ffi_store32((iter_base) + 20, ((payload43).image).reinterpret_as_int())
|
||||
|
||||
()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let address42 = mbt_ffi_malloc(((f).popups).length() * 20);
|
||||
for index43 = 0; index43 < ((f).popups).length(); index43 = index43 + 1 {
|
||||
let iter_elem : Popup = ((f).popups)[(index43)]
|
||||
let iter_base = address42 + (index43 * 20);
|
||||
let address46 = mbt_ffi_malloc(((f).popups).length() * 20);
|
||||
for index47 = 0; index47 < ((f).popups).length(); index47 = index47 + 1 {
|
||||
let iter_elem : Popup = ((f).popups)[(index47)]
|
||||
let iter_base = address46 + (index47 * 20);
|
||||
mbt_ffi_store32((iter_base) + 0, ((iter_elem).area).x)
|
||||
mbt_ffi_store32((iter_base) + 4, ((iter_elem).area).y)
|
||||
mbt_ffi_store32((iter_base) + 8, ((iter_elem).area).w)
|
||||
@@ -515,11 +573,11 @@ pub fn submit(f : Frame) -> Unit {
|
||||
mbt_ffi_store32((iter_base) + 16, ((iter_elem).surface).reinterpret_as_int())
|
||||
|
||||
}
|
||||
wasmImportSubmit((f).width, (f).height, lowered, lowered8, lowered9, address18, ((f).background).length(), address30, ((f).windows).length(), address40, ((f).panel).length(), address42, ((f).popups).length());
|
||||
mbt_ffi_free(address18)
|
||||
mbt_ffi_free(address30)
|
||||
mbt_ffi_free(address40)
|
||||
mbt_ffi_free(address42)
|
||||
wasmImportSubmit((f).width, (f).height, lowered, lowered9, lowered10, address20, ((f).background).length(), address33, ((f).windows).length(), address44, ((f).panel).length(), address46, ((f).popups).length());
|
||||
mbt_ffi_free(address20)
|
||||
mbt_ffi_free(address33)
|
||||
mbt_ffi_free(address44)
|
||||
mbt_ffi_free(address46)
|
||||
|
||||
cleanup_list.each(mbt_ffi_free)
|
||||
|
||||
|
||||
Reference in new issue
Block a user