CI / test (push) Failing after 16s
moon-plasma / moonplasma / MoonPlasma / Moon Plasma become chandra / Chandra everywhere: the WIT package (chandra:desktop, chandra:host, chandra:wm), the MoonBit module (chandra/desktop) and generated bindings, the Rust host, identifiers (ChandraCompositor), the session script (chandra-session) and desktop entry (chandra.desktop), config and data paths ($XDG_CONFIG_HOME/chandra, share/chandra/modules), env vars (CHANDRA_*), UI strings, docs and tests. The test fixture components are rebuilt against the renamed WIT. Saved panel.edn and state.edn are still read from the old $XDG_CONFIG_HOME/moon-plasma until the first save writes the new copy. The remote repository keeps its experiments/moon-plasma name for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hi3L9oVBoRd373Qr4n
107 lines
3.0 KiB
MoonBit
107 lines
3.0 KiB
MoonBit
// 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]
|
|
|