Spike Wayland compositor, hybrid MoonBit WM, SSD decorations, and wasmtime native host

This commit is contained in:
Antigravity committed 2026-11-25 00:42:01 +00:00
1 parent 880ecd4102
commit 17a8a46cfd
56 files changed
+8924 -11

No files matched your search

@@ -0,0 +1,106 @@
// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
///|
pub(all) struct WindowCaps(Byte) derive()
///|
pub fn WindowCaps::default() -> WindowCaps {
WindowCaps(b'\x00')
}
///|
pub(all) enum WindowCapsFlag {
CAN_MOVE; CAN_RESIZE; CAN_MAXIMIZE; CAN_MINIMIZE; CAN_FULLSCREEN
}
///|
fn WindowCapsFlag::value(self : WindowCapsFlag) -> Byte {
match self {
CAN_MOVE => ((1U << 0).to_byte())
CAN_RESIZE => ((1U << 1).to_byte())
CAN_MAXIMIZE => ((1U << 2).to_byte())
CAN_MINIMIZE => ((1U << 3).to_byte())
CAN_FULLSCREEN => ((1U << 4).to_byte())
}
}
///|
pub fn WindowCaps::set(self : Self, other: WindowCapsFlag) -> WindowCaps {
let WindowCaps(flag) = self
WindowCaps(flag.lor(other.value()))
}
///|
pub fn WindowCaps::unset(self : Self, other: WindowCapsFlag) -> WindowCaps {
let WindowCaps(flag) = self
WindowCaps(flag.land(other.value().lnot()))
}
///|
pub fn WindowCaps::is_set(self : Self, other: WindowCapsFlag) -> Bool {
let WindowCaps(flag) = self
(flag.land(other.value()) == other.value())
}
///|
pub(all) enum LayoutMode {
FLOATING; TILING; MONOCLE
} derive()
///|
pub fn LayoutMode::ordinal(self : LayoutMode) -> Int {
match self {
FLOATING => 0
TILING => 1
MONOCLE => 2
}
}
///|
pub fn LayoutMode::from(self : Int) -> LayoutMode {
match self {
0 => FLOATING
1 => TILING
2 => MONOCLE
_ => panic()
}
}
///|
pub(all) struct WindowState {
id : UInt64; app_id : String; title : String; geometry : @types.Rect; min_size : @types.Size; max_size : @types.Size?; focused : Bool; maximized : Bool; fullscreen : Bool; workspace : UInt; caps : WindowCaps
}
///|
pub(all) enum WindowRequest {
Maximize(Bool)
Fullscreen(Bool)
Minimize(Bool)
Close
Activate
MoveTo(@types.Point)
ResizeTo(@types.Size)
}
///|
pub(all) enum WmAction {
SetGeometry((UInt64, @types.Rect))
Focus(UInt64)
Raise(UInt64)
Close(UInt64)
SetMaximized((UInt64, Bool))
SetFullscreen((UInt64, Bool))
}
///|
pub(all) enum InputTarget {
Client((UInt64, @types.Point))
Decoration((UInt64, @types.Point))
ShellPanel(@types.Point)
None
}
///|
/// Called on startup or WM hot-swap to synchronize existing windows.
declare pub fn sync_windows(outputs : Array[@types.Rect], windows : Array[WindowState]) -> Array[WmAction]
///|
declare pub fn on_window_open(win : WindowState, work_area : @types.Rect) -> Array[WmAction]
///|
declare pub fn on_window_close(id : UInt64) -> Array[WmAction]
///|
declare pub fn on_window_request(id : UInt64, req : WindowRequest, work_area : @types.Rect) -> Array[WmAction]
///|
declare pub fn on_pointer(pos : @types.Point, button : UInt?, pressed : Bool) -> InputTarget
///|
declare pub fn set_layout_mode(mode : LayoutMode, work_area : @types.Rect) -> Array[WmAction]
///|
/// Returns window IDs in bottom-to-top Z-order.
declare pub fn stacking_order() -> Array[UInt64]