Spike Wayland compositor, hybrid MoonBit WM, SSD decorations, and wasmtime native host
This commit is contained in:
1 parent
880ecd4102
commit
17a8a46cfd
56 files changed
+8924
-11
No files matched your search
+1
@@ -0,0 +1 @@
|
||||
../../../theme.wit
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../types.wit
|
||||
@@ -0,0 +1,37 @@
|
||||
package moonplasma:compositor@0.2.0;
|
||||
|
||||
interface surface {
|
||||
use moonplasma:desktop/types@0.1.0.{size, rect, draw-op};
|
||||
|
||||
/// Unforgeable host handle to a committed client buffer (SHM or DMA-BUF).
|
||||
/// Components cannot read pixels; they can only inspect metadata and
|
||||
/// reference the handle in a `draw-surface` op.
|
||||
resource buffer-surface {
|
||||
id: func() -> u64;
|
||||
size: func() -> size;
|
||||
/// True if the buffer contains an alpha channel requiring blending.
|
||||
has-alpha: func() -> bool;
|
||||
}
|
||||
|
||||
record surface-draw {
|
||||
surface: borrow<buffer-surface>,
|
||||
dst: rect,
|
||||
src: option<rect>,
|
||||
radius: u32,
|
||||
}
|
||||
|
||||
/// Extended render-list op for compositing foreign surfaces & cached layers.
|
||||
variant composite-op {
|
||||
draw(draw-op),
|
||||
draw-surface(surface-draw),
|
||||
push-opacity(u8),
|
||||
pop-opacity,
|
||||
}
|
||||
|
||||
/// Revision-keyed display list to avoid copying unchanged draw-ops across WIT.
|
||||
record render-frame {
|
||||
revision: u64,
|
||||
/// `none` means identical to `revision` — host reuses cached display list.
|
||||
ops: option<list<draw-op>>,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package moonplasma:wm@0.2.0;
|
||||
|
||||
interface decoration {
|
||||
use moonplasma:desktop/types@0.1.0.{rect, size, draw-op};
|
||||
use policy.{window-state};
|
||||
|
||||
enum hit-role {
|
||||
none,
|
||||
titlebar,
|
||||
close,
|
||||
maximize,
|
||||
minimize,
|
||||
resize-n,
|
||||
resize-s,
|
||||
resize-e,
|
||||
resize-w,
|
||||
resize-nw,
|
||||
resize-ne,
|
||||
resize-sw,
|
||||
resize-se,
|
||||
}
|
||||
|
||||
record hit-region {
|
||||
rect: rect,
|
||||
role: hit-role,
|
||||
}
|
||||
|
||||
record decoration-frame {
|
||||
/// Insets reserved around the client surface: (top, right, bottom, left)
|
||||
insets: tuple<u32, u32, u32, u32>,
|
||||
ops: list<draw-op>,
|
||||
hit-regions: list<hit-region>,
|
||||
}
|
||||
|
||||
render: func(win: window-state, outer-size: size) -> decoration-frame;
|
||||
}
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../theme.wit
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../types.wit
|
||||
@@ -0,0 +1,71 @@
|
||||
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<size>,
|
||||
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<window-id, rect>),
|
||||
focus(window-id),
|
||||
raise(window-id),
|
||||
close(window-id),
|
||||
set-maximized(tuple<window-id, bool>),
|
||||
set-fullscreen(tuple<window-id, bool>),
|
||||
}
|
||||
|
||||
variant input-target {
|
||||
client(tuple<window-id, point>),
|
||||
decoration(tuple<window-id, point>),
|
||||
shell-panel(point),
|
||||
none,
|
||||
}
|
||||
|
||||
/// Called on startup or WM hot-swap to synchronize existing windows.
|
||||
sync-windows: func(outputs: list<rect>, windows: list<window-state>) -> list<wm-action>;
|
||||
on-window-open: func(win: window-state, work-area: rect) -> list<wm-action>;
|
||||
on-window-close: func(id: window-id) -> list<wm-action>;
|
||||
on-window-request: func(id: window-id, req: window-request, work-area: rect) -> list<wm-action>;
|
||||
on-pointer: func(pos: point, button: option<u32>, pressed: bool) -> input-target;
|
||||
set-layout-mode: func(mode: layout-mode, work-area: rect) -> list<wm-action>;
|
||||
/// Returns window IDs in bottom-to-top Z-order.
|
||||
stacking-order: func() -> list<window-id>;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package moonplasma:wm@0.2.0;
|
||||
|
||||
world window-manager {
|
||||
import moonplasma:desktop/theme@0.1.0;
|
||||
export policy;
|
||||
}
|
||||
|
||||
world decoration-provider {
|
||||
import moonplasma:desktop/theme@0.1.0;
|
||||
export decoration;
|
||||
}
|
||||
Reference in new issue
Block a user