Add layout module: Tile | Float toggle widget for the panel
CI / test (push) Failing after 1m5s

Two-segment switch over the layout-control capability: click flips tiling <-> floating
(monocle goes to floating). Includes generated bindings and an updated wasm test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-25 00:39:32 -08:00
1 parent 82cac8a915
commit 95a21a0b84
16 files changed
+721 -12

No files matched your search

@@ -0,0 +1 @@
The window manager's layout mode (tiling / monocle / floating).
@@ -0,0 +1,33 @@
// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
///|
fn wasmImportLayoutModes(p0 : Int) = "moonplasma:desktop/layout-control@0.1.0" "layout-modes"
///|
fn wasmImportCurrentLayout() -> Int = "moonplasma:desktop/layout-control@0.1.0" "current-layout"
///|
fn wasmImportSetLayout(p0 : Int) = "moonplasma:desktop/layout-control@0.1.0" "set-layout"
///|
extern "wasm" fn mbt_ffi_free(position : Int) =
#|(func (param i32) local.get 0 call $moonbit.decref)
///|
extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int =
#|(func (param i32) (result i32) local.get 0 i32.load)
///|
extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int =
#|(func (param i32) (result i32) (local i32)
#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc
#| local.tee 1 i32.const 0 call $moonbit.init_array8
#| local.get 1)
///|
extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String =
#|(func (param i32) (param i32) (result i32)
#| local.get 0
#| local.get 1 call $moonbit.init_array16
#| local.get 0)
@@ -0,0 +1 @@
warnings = "-44"
@@ -0,0 +1,37 @@
// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
///|
/// Display names, indexed by mode.
pub fn layout_modes() -> Array[String] {
let return_area = mbt_ffi_malloc(8)
wasmImportLayoutModes(return_area);
let array : Array[String] = [];
for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 {
let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 8)
let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 0), mbt_ffi_load32((iter_base) + 4))
array.push(result)
}
mbt_ffi_free(mbt_ffi_load32((return_area) + 0))
let ret = array
mbt_ffi_free(return_area)
return ret
}
///|
pub fn current_layout() -> UInt {
let result : Int = wasmImportCurrentLayout();
let ret = (result).reinterpret_as_uint()
return ret
}
///|
pub fn set_layout(mode : UInt) -> Unit {
wasmImportSetLayout((mode).reinterpret_as_int());
}