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
@@ -22,8 +22,8 @@ pub mod ph {
|
||||
additional_derives: [PartialEq],
|
||||
});
|
||||
}
|
||||
use ph::exports::moonplasma::desktop as ex;
|
||||
use ph::moonplasma::desktop as d;
|
||||
use ph::exports::chandra::desktop as ex;
|
||||
use ph::chandra::desktop as d;
|
||||
|
||||
/// What a module asked of the compositor during a call.
|
||||
pub enum Req {
|
||||
@@ -347,11 +347,11 @@ impl Runtime {
|
||||
return Err("not a wasm file".to_string());
|
||||
}
|
||||
let component = Component::new(&self.engine, &bytes)
|
||||
.map_err(|_| "no plasmoid (moonplasma:desktop/plasmoid) in this module".to_string())?;
|
||||
.map_err(|_| "no plasmoid (chandra:desktop/plasmoid) in this module".to_string())?;
|
||||
// The capability grant: the host interfaces the binary imports, besides the base ones.
|
||||
let mut imports: Vec<String> = Vec::new();
|
||||
for (name, _) in component.component_type().imports(&self.engine) {
|
||||
if let Some(rest) = name.strip_prefix("moonplasma:desktop/") {
|
||||
if let Some(rest) = name.strip_prefix("chandra:desktop/") {
|
||||
let iface = rest.split('@').next().unwrap_or(rest).to_string();
|
||||
if iface != "types" && !imports.contains(&iface) {
|
||||
imports.push(iface);
|
||||
@@ -362,7 +362,7 @@ impl Runtime {
|
||||
let inst = ph::PlasmoidHost::instantiate(&mut store, &component, &self.linker)
|
||||
.map_err(|_| "wasm runtime error".to_string())?;
|
||||
let info = inst
|
||||
.moonplasma_desktop_plasmoid()
|
||||
.chandra_desktop_plasmoid()
|
||||
.call_info(&mut store)
|
||||
.map_err(|_| "widget trapped in info()".to_string())?;
|
||||
let l = Loaded { store, inst };
|
||||
@@ -392,18 +392,18 @@ impl Runtime {
|
||||
/// A trapping module yields no ops.
|
||||
pub fn render(&mut self, handle: u32, size: d::types::Size) -> Vec<d::types::DrawOp> {
|
||||
let Some(l) = self.get(handle) else { return Vec::new() };
|
||||
l.inst.moonplasma_desktop_plasmoid().call_render(&mut l.store, size).unwrap_or_default()
|
||||
l.inst.chandra_desktop_plasmoid().call_render(&mut l.store, size).unwrap_or_default()
|
||||
}
|
||||
|
||||
pub fn popup(&mut self, handle: u32) -> Option<ex::plasmoid::PopupSurface> {
|
||||
let l = self.get(handle)?;
|
||||
l.inst.moonplasma_desktop_plasmoid().call_popup(&mut l.store).ok().flatten()
|
||||
l.inst.chandra_desktop_plasmoid().call_popup(&mut l.store).ok().flatten()
|
||||
}
|
||||
|
||||
pub fn on_event(&mut self, handle: u32, on_popup: bool, ev: d::types::InputEvent) -> bool {
|
||||
let Some(l) = self.get(handle) else { return false };
|
||||
let target = if on_popup { ex::plasmoid::Surface::Popup } else { ex::plasmoid::Surface::Widget };
|
||||
l.inst.moonplasma_desktop_plasmoid().call_on_event(&mut l.store, target, &ev).unwrap_or(false)
|
||||
l.inst.chandra_desktop_plasmoid().call_on_event(&mut l.store, target, &ev).unwrap_or(false)
|
||||
}
|
||||
|
||||
pub fn picker_start(&mut self) -> bool {
|
||||
@@ -522,7 +522,7 @@ mod tests {
|
||||
fn modules_are_rejected_cleanly() {
|
||||
let mut rt = runtime();
|
||||
assert!(rt.load("/nonexistent.wasm").is_err());
|
||||
let junk = std::env::temp_dir().join("moon-plasma-junk.wasm");
|
||||
let junk = std::env::temp_dir().join("chandra-junk.wasm");
|
||||
std::fs::write(&junk, b"not wasm at all").unwrap();
|
||||
assert!(rt.load(junk.to_str().unwrap()).is_err());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user