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
This commit is contained in:
323 files changed
+1055
-1013
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
"moonbitlang/core/builtin",
|
||||
"moonplasma/desktop/interface/moonplasma/desktop/types" @types,
|
||||
"moonplasma/desktop/interface/moonplasma/desktop/theme" @theme,
|
||||
"moonplasma/desktop/interface/moonplasma/host/plasmoids" @hostpl,
|
||||
"chandra/desktop/interface/chandra/desktop/types" @types,
|
||||
"chandra/desktop/interface/chandra/desktop/theme" @theme,
|
||||
"chandra/desktop/interface/chandra/host/plasmoids" @hostpl,
|
||||
}
|
||||
|
||||
supported_targets = "+native+wasm"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
///| Plasmoid host for the compositor-as-a-wasm-component build.
|
||||
///
|
||||
/// The native build runs panel modules itself through wasmer. A component can't embed a second
|
||||
/// wasm runtime, so here the same API is a thin client of the `moonplasma:host/plasmoids` import:
|
||||
/// wasm runtime, so here the same API is a thin client of the `chandra:host/plasmoids` import:
|
||||
/// the host (wasmtime) instantiates the modules, serves their capability imports from the data
|
||||
/// published below, and hands back draw ops and requests.
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ pub fn load(path : String, tokens : @theme.Tokens) -> Result[Plasmoid, String] {
|
||||
match h {
|
||||
-1 => "not a wasm file"
|
||||
-2 => "cannot read file"
|
||||
-3 | -4 => "no plasmoid (moonplasma:desktop/plasmoid) in this module"
|
||||
-3 | -4 => "no plasmoid (chandra:desktop/plasmoid) in this module"
|
||||
_ => "wasm runtime error"
|
||||
},
|
||||
)
|
||||
@@ -266,7 +266,7 @@ pub fn load(path : String, tokens : @theme.Tokens) -> Result[Plasmoid, String] {
|
||||
}
|
||||
}
|
||||
|
||||
///| Names of the moonplasma interfaces (besides types/theme) the widget at `h` imports.
|
||||
///| Names of the chandra interfaces (besides types/theme) the widget at `h` imports.
|
||||
fn read_imports(h : Int) -> Array[String] {
|
||||
let buf = Bytes::make(512, b'\x00')
|
||||
let n = c_wasm_imports(h, buf)
|
||||
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
/* Wasm plasmoid host: runs the core module of a moonplasma plasmoid component
|
||||
/* Wasm plasmoid host: runs the core module of a chandra plasmoid component
|
||||
* (or a bare core module) with wasmer's C API. Canonical-ABI marshalling stays in
|
||||
* MoonBit; this file instantiates, provides the host imports (theme, clock) and
|
||||
* exposes raw calls plus guest-memory reads. */
|
||||
@@ -18,13 +18,13 @@
|
||||
#define MAX_INST 512
|
||||
enum { EX_INFO, EX_RENDER, EX_ONEVENT, EX_POPUP, EX_POST_INFO, EX_POST_RENDER, EX_POST_POPUP, EX_REALLOC, EX_N };
|
||||
static const char *ex_names[EX_N] = {
|
||||
"moonplasma:desktop/plasmoid@0.1.0#info",
|
||||
"moonplasma:desktop/plasmoid@0.1.0#render",
|
||||
"moonplasma:desktop/plasmoid@0.1.0#on-event",
|
||||
"moonplasma:desktop/plasmoid@0.1.0#popup",
|
||||
"cabi_post_moonplasma:desktop/plasmoid@0.1.0#info",
|
||||
"cabi_post_moonplasma:desktop/plasmoid@0.1.0#render",
|
||||
"cabi_post_moonplasma:desktop/plasmoid@0.1.0#popup",
|
||||
"chandra:desktop/plasmoid@0.1.0#info",
|
||||
"chandra:desktop/plasmoid@0.1.0#render",
|
||||
"chandra:desktop/plasmoid@0.1.0#on-event",
|
||||
"chandra:desktop/plasmoid@0.1.0#popup",
|
||||
"cabi_post_chandra:desktop/plasmoid@0.1.0#info",
|
||||
"cabi_post_chandra:desktop/plasmoid@0.1.0#render",
|
||||
"cabi_post_chandra:desktop/plasmoid@0.1.0#popup",
|
||||
"cabi_realloc",
|
||||
};
|
||||
|
||||
@@ -381,9 +381,9 @@ static int load_bytes(Inst *in, const uint8_t *d, size_t n) {
|
||||
}
|
||||
|
||||
|
||||
/* "moonplasma:desktop/<iface>@<ver>" -> <iface> (copied, NUL-terminated); "" for anything else. */
|
||||
/* "chandra:desktop/<iface>@<ver>" -> <iface> (copied, NUL-terminated); "" for anything else. */
|
||||
static void iface_of(const wasm_name_t *m, char *out, size_t cap) {
|
||||
const char *pre = "moonplasma:desktop/";
|
||||
const char *pre = "chandra:desktop/";
|
||||
size_t pl = strlen(pre);
|
||||
out[0] = 0;
|
||||
if (m->size <= pl || memcmp(m->data, pre, pl) != 0) return;
|
||||
|
||||
@@ -33,7 +33,7 @@ fn load_fixture(name : String) -> Result[Plasmoid, String] {
|
||||
///|
|
||||
test "a plasmoid component loads and renders through wasmer" {
|
||||
let p = load_fixture("clock-digital.component.wasm").unwrap()
|
||||
assert_eq(p.id, "org.moonplasma.clock.digital")
|
||||
assert_eq(p.id, "org.chandra.clock.digital")
|
||||
assert_true(p.pref_w > 0 && p.pref_h > 0)
|
||||
let ops = p.render(p.pref_w, p.pref_h, test_tokens())
|
||||
assert_true(ops.length() > 0)
|
||||
@@ -56,7 +56,7 @@ test "a plasmoid component loads and renders through wasmer" {
|
||||
///|
|
||||
test "a bare core module loads too, and junk is rejected" {
|
||||
let p = load_fixture("clock-digital.core.wasm").unwrap()
|
||||
assert_eq(p.id, "org.moonplasma.clock.digital")
|
||||
assert_eq(p.id, "org.chandra.clock.digital")
|
||||
p.unload()
|
||||
assert_true(load("/nonexistent.wasm", test_tokens()) is Err(_))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user