// Generated using `moon info`, DON'T EDIT IT package "moonplasma/desktop/lib/wm" import { "moonbitlang/core/debug", } // Values pub fn clamp_int(Int32, Int32, Int32) -> Int32 pub fn compute_bsp_rects(BspNode, Rect, Int32, vgap? : Int32) -> Array[(UInt64, Rect)] pub fn compute_split_handles(BspNode, Rect, Int32, Int32) -> Array[SplitHandle] pub fn compute_work_area(Rect, excl_top? : Int32, excl_right? : Int32, excl_bottom? : Int32, excl_left? : Int32) -> Rect pub fn insert_leaf(BspNode?, UInt64, horizontal? : Bool) -> BspNode pub fn remove_leaf(BspNode?, UInt64) -> BspNode? // Errors // Types and methods #derive(Eq, Show, @debug.Debug) pub(all) enum BspNode { Leaf(UInt64) Split(horizontal~ : Bool, ratio~ : Double, left~ : BspNode, right~ : BspNode) } #derive(Eq, Show) pub(all) enum DragMode { Move ResizeN ResizeS ResizeE ResizeW ResizeNW ResizeNE ResizeSW ResizeSE } pub(all) struct DragSession { win_id : UInt64 mode : DragMode start_ptr_x : Int32 start_ptr_y : Int32 start_rect : Rect } #derive(Eq, Show, @debug.Debug) pub(all) enum InputHit { Client(UInt64, Int32, Int32) Decoration(UInt64, Int32, Int32) ShellPanel(Int32, Int32) HitNone } #derive(Eq, Show, @debug.Debug) pub(all) enum LayoutMode { Floating Tiling Monocle } #derive(Eq, Show, @debug.Debug) pub(all) struct Rect { x : Int32 y : Int32 w : Int32 h : Int32 } pub fn Rect::contains(Self, Int32, Int32) -> Bool #derive(Eq, Show, @debug.Debug) pub(all) struct Size { w : Int32 h : Int32 } pub(all) struct SplitHandle { path : Array[Bool] horizontal : Bool rect : Rect area : Rect } pub(all) struct WindowRecord { id : UInt64 app_id : String title : String mut geometry : Rect mut floating_geometry : Rect min_size : Size max_size : Size? mut focused : Bool mut maximized : Bool mut fullscreen : Bool mut minimized : Bool mut is_floating : Bool workspace : UInt32 can_move : Bool can_resize : Bool can_maximize : Bool can_minimize : Bool can_fullscreen : Bool } #derive(Eq, Show, @debug.Debug) pub(all) enum WindowRequest { Maximize(Bool) Fullscreen(Bool) Minimize(Bool) Close Activate MoveTo(Int32, Int32) ResizeTo(Int32, Int32) } #derive(Eq, Show, @debug.Debug) pub(all) enum WmAction { SetGeometry(UInt64, Rect) Focus(UInt64) Raise(UInt64) Close(UInt64) SetMaximized(UInt64, Bool) SetFullscreen(UInt64, Bool) } pub(all) struct WmState { workspaces : Array[Workspace] windows : Map[UInt64, WindowRecord] mut active_workspace : UInt32 mut focused : UInt64? mut inner_gap : Int32 mut outer_gap : Int32 mut titlebar_h : Int32 mut border_w : Int32 mut cascade_step : Int32 mut drag : DragSession? } pub fn WmState::close_window(Self, UInt64, Rect) -> Array[WmAction] pub fn WmState::drag_split(Self, SplitHandle, Int32, Int32, Rect) -> Array[WmAction] pub fn WmState::end_drag(Self) -> Unit pub fn WmState::handle_request(Self, UInt64, WindowRequest, Rect) -> Array[WmAction] pub fn WmState::hit_test(Self, Int32, Int32, Rect?) -> InputHit pub fn WmState::new(inner_gap? : Int32, outer_gap? : Int32, titlebar_h? : Int32, border_w? : Int32) -> Self pub fn WmState::open_window(Self, WindowRecord, Rect) -> Array[WmAction] pub fn WmState::relayout(Self, UInt32, Rect) -> Array[WmAction] pub fn WmState::set_layout_mode(Self, LayoutMode, Rect) -> Array[WmAction] pub fn WmState::split_handles(Self, Rect) -> Array[SplitHandle] pub fn WmState::stacking_order(Self) -> Array[UInt64] pub fn WmState::start_drag(Self, UInt64, DragMode, Int32, Int32) -> Bool pub fn WmState::sync_windows(Self, Rect, Array[WindowRecord]) -> Array[WmAction] pub fn WmState::update_drag(Self, Int32, Int32) -> WmAction? pub(all) struct Workspace { id : UInt32 mut mode : LayoutMode mut tree : BspNode? floating : Array[UInt64] mru : Array[UInt64] mut fullscreen : UInt64? } pub fn Workspace::new(UInt32, mode? : LayoutMode) -> Self // Type aliases // Traits