package moonplasma:wm@0.2.0; interface policy { use moonplasma:desktop/types@0.1.0.{rect, size, point}; type window-id = u64; flags window-caps { can-move, can-resize, can-maximize, can-minimize, can-fullscreen, } enum layout-mode { floating, tiling, monocle, } record window-state { id: window-id, app-id: string, title: string, geometry: rect, min-size: size, max-size: option, focused: bool, maximized: bool, fullscreen: bool, workspace: u32, caps: window-caps, } variant window-request { maximize(bool), fullscreen(bool), minimize(bool), close, activate, move-to(point), resize-to(size), } variant wm-action { set-geometry(tuple), focus(window-id), raise(window-id), close(window-id), set-maximized(tuple), set-fullscreen(tuple), } variant input-target { client(tuple), decoration(tuple), shell-panel(point), none, } /// Called on startup or WM hot-swap to synchronize existing windows. sync-windows: func(outputs: list, windows: list) -> list; on-window-open: func(win: window-state, work-area: rect) -> list; on-window-close: func(id: window-id) -> list; on-window-request: func(id: window-id, req: window-request, work-area: rect) -> list; on-pointer: func(pos: point, button: option, pressed: bool) -> input-target; set-layout-mode: func(mode: layout-mode, work-area: rect) -> list; /// Returns window IDs in bottom-to-top Z-order. stacking-order: func() -> list; }