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
Generated
+11
-11
@@ -96,6 +96,17 @@ version = "1.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
|
||||
|
||||
[[package]]
|
||||
name = "chandra-host"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"ab_glyph",
|
||||
"ab_glyph_rasterizer",
|
||||
"cc",
|
||||
"libc",
|
||||
"wasmtime",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cobs"
|
||||
version = "0.3.0"
|
||||
@@ -564,17 +575,6 @@ dependencies = [
|
||||
"rustix",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "moon-plasma-host"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"ab_glyph",
|
||||
"ab_glyph_rasterizer",
|
||||
"cc",
|
||||
"libc",
|
||||
"wasmtime",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "multiversion_no_op"
|
||||
version = "1.0.0"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[package]
|
||||
name = "moon-plasma-host"
|
||||
name = "chandra-host"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
description = "Runs the moon-plasma compositor wasm component (build/components/compositor.wasm) and gives it the OS surface it imports (wit/host/sys.wit)."
|
||||
description = "Runs the chandra compositor wasm component (build/components/compositor.wasm) and gives it the OS surface it imports (wit/host/sys.wit)."
|
||||
|
||||
[features]
|
||||
# Login-session display backend (DRM/KMS + libinput + libseat + xkbcommon). Needs those libraries'
|
||||
|
||||
+13
-13
@@ -1,15 +1,15 @@
|
||||
# moon-plasma-host
|
||||
# chandra-host
|
||||
|
||||
Runs the compositor **as a WebAssembly component**.
|
||||
|
||||
```
|
||||
just compositor-wasm # build/compositor.wasm (the compositor, a component)
|
||||
just host-wasm # host-wasm/target/release/moon-plasma-host (this crate)
|
||||
just host-wasm # host-wasm/target/release/chandra-host (this crate)
|
||||
just run-wasm # both, then run in a window on your current Wayland session
|
||||
```
|
||||
|
||||
The component (`components/compositor`, entry in `compositor/app`) imports exactly one interface,
|
||||
`moonplasma:host/sys` ([`wit/host/sys.wit`](../wit/host/sys.wit)), and exports `run(args) -> s32`.
|
||||
`chandra:host/sys` ([`wit/host/sys.wit`](../wit/host/sys.wit)), and exports `run(args) -> s32`.
|
||||
It is the same MoonBit code as the native compositor: the Wayland server, window manager, scene,
|
||||
rasteriser and shell. Only `compositor/sys` differs per target (`sys_native.mbt` over a C shim,
|
||||
`sys_wasm.mbt` over the WIT imports). The component holds integer handles and bytes only; every real
|
||||
@@ -17,15 +17,15 @@ file descriptor lives in this host, which implements `sys` with libc (sockets an
|
||||
`memfd`, `poll`, spawn, files, clock).
|
||||
|
||||
```
|
||||
moon-plasma-host build/compositor.wasm --socket PATH [--theme PATH] [--window]
|
||||
moon-plasma-host build/compositor.wasm --socket PATH --gfx-out frame.png # one frame
|
||||
moon-plasma-host build/compositor.wasm --socket PATH --gfx-out frame.png --serve # keep refreshing it
|
||||
chandra-host build/compositor.wasm --socket PATH [--theme PATH] [--window]
|
||||
chandra-host build/compositor.wasm --socket PATH --gfx-out frame.png # one frame
|
||||
chandra-host build/compositor.wasm --socket PATH --gfx-out frame.png --serve # keep refreshing it
|
||||
```
|
||||
|
||||
## Drawing
|
||||
|
||||
The compositor component decides what the screen shows and the host draws it
|
||||
(`moonplasma:host/raster`, [`wit/host/raster.wit`](../wit/host/raster.wit)). Each frame the component
|
||||
(`chandra:host/raster`, [`wit/host/raster.wit`](../wit/host/raster.wit)). Each frame the component
|
||||
sends a list of draw operations (fill, stroke, line, circle, text, clip), the windows with their
|
||||
decoration ops and a surface id, and the panel ops; `src/raster.rs` draws them natively into a
|
||||
framebuffer it owns (a port of `compositor/renderer`, with the same blend arithmetic). The pixels never
|
||||
@@ -49,10 +49,10 @@ against each other's rules (`cargo test` here, `moon test` for the MoonBit side)
|
||||
|
||||
Working: Wayland server (real clients such as `foot` run and draw), window management, decorations,
|
||||
the desktop card, input routing, the nested window on the host session, real fonts (Allo Variable,
|
||||
Adwaita Mono: the host rasterises glyphs, `moonplasma:host/font`) and the panel modules.
|
||||
Adwaita Mono: the host rasterises glyphs, `chandra:host/font`) and the panel modules.
|
||||
|
||||
**Panel modules** run in this host. A component can't embed a second runtime, so the compositor
|
||||
drives them through `moonplasma:host/plasmoids` ([`wit/host/plasmoids.wit`](../wit/host/plasmoids.wit)):
|
||||
drives them through `chandra:host/plasmoids` ([`wit/host/plasmoids.wit`](../wit/host/plasmoids.wit)):
|
||||
load, render, popup, on-event, plus the data they read (apps, windows, layouts, modules, system
|
||||
snapshot) and the requests they make (launch, focus, set layout, load/unload). `src/plasmoid.rs`
|
||||
instantiates each module as a real component against one world, `plasmoid-host`
|
||||
@@ -60,7 +60,7 @@ instantiates each module as a real component against one world, `plasmoid-host`
|
||||
each is served here. `cargo test --release` loads the built modules (`just modules` first).
|
||||
|
||||
**Login session** (`--drm`): the host takes the display and input through the seat
|
||||
(`moonplasma:host/display`, [`wit/host/display.wit`](../wit/host/display.wit)): DRM/KMS output with page
|
||||
(`chandra:host/display`, [`wit/host/display.wit`](../wit/host/display.wit)): DRM/KMS output with page
|
||||
flips and a hardware cursor, libinput keyboard and pointer, an xkb keymap, libseat for device access and
|
||||
VT switching. It is the compositor's own C shim (`compositor/kms/kms_stub.c`) compiled into this host
|
||||
by `build.rs` (feature `drm`, on by default; `--no-default-features` leaves it out), so the native and
|
||||
@@ -68,10 +68,10 @@ wasm backends can't drift. Run `just run-drm` from a login VT, or `just install-
|
||||
Plasma to your display manager (`session/install.py`; `--native` installs the native compositor instead).
|
||||
Not yet exercised on a real VT; it is only built and instantiated.
|
||||
|
||||
Regenerating the host bindings (into a temp dir, then copy `interface/moonplasma/host`,
|
||||
Regenerating the host bindings (into a temp dir, then copy `interface/chandra/host`,
|
||||
`world/compositor` and `components/compositor/gen/{ffi.mbt,world}`; regenerating in place would
|
||||
overwrite the hand-fixed `desktop/theme` package):
|
||||
`wit-bindgen moonbit wit/host --world compositor --out-dir $T --gen-dir components/compositor/gen
|
||||
--project-name moonplasma/desktop --ignore-module-file --ignore-stub`, then
|
||||
`scripts/gen-native-stubs.py interface/moonplasma/host/<sys|font|plasmoids>` (the imports are
|
||||
--project-name chandra/desktop --ignore-module-file --ignore-stub`, then
|
||||
`scripts/gen-native-stubs.py interface/chandra/host/<sys|font|plasmoids>` (the imports are
|
||||
wasm-only; this restores the native stand-ins and the per-file targets).
|
||||
@@ -1,7 +1,7 @@
|
||||
//! The login-session display backend: calls into compositor/kms/kms_stub.c (built by build.rs),
|
||||
//! the same shim the native compositor uses. One display, one seat, global state.
|
||||
|
||||
use crate::moonplasma::host::display::{KeyState, Modifiers, Output, PointerPos, ScrollDelta, SeatEvent};
|
||||
use crate::chandra::host::display::{KeyState, Modifiers, Output, PointerPos, ScrollDelta, SeatEvent};
|
||||
|
||||
extern "C" {
|
||||
fn mp_kms_open() -> i32;
|
||||
|
||||
+37
-37
@@ -1,12 +1,12 @@
|
||||
//! Native host for the moon-plasma compositor component.
|
||||
//! Native host for the chandra compositor component.
|
||||
//!
|
||||
//! The compositor is a wasm component (build/compositor.wasm) that imports exactly one
|
||||
//! interface, `moonplasma:host/sys` (wit/host/sys.wit): sockets, memfd, poll, spawn, files, time.
|
||||
//! interface, `chandra:host/sys` (wit/host/sys.wit): sockets, memfd, poll, spawn, files, time.
|
||||
//! This program is the other side of that interface. The component only ever holds integer
|
||||
//! handles; every real file descriptor lives here.
|
||||
//!
|
||||
//! moon-plasma-host [--component PATH] [-- compositor args...]
|
||||
//! moon-plasma-host build/compositor.wasm --socket /run/user/1000/wayland-moon-0 --window
|
||||
//! chandra-host [--component PATH] [-- compositor args...]
|
||||
//! chandra-host build/compositor.wasm --socket /run/user/1000/wayland-moon-0 --window
|
||||
|
||||
use std::ffi::CString;
|
||||
use std::io::Read;
|
||||
@@ -28,13 +28,13 @@ wasmtime::component::bindgen!({
|
||||
// Draw operations are compared to reuse the cached wallpaper.
|
||||
additional_derives: [PartialEq],
|
||||
with: {
|
||||
"moonplasma:desktop/types@0.1.0": plasmoid::ph::moonplasma::desktop::types,
|
||||
"moonplasma:desktop/theme@0.1.0": plasmoid::ph::moonplasma::desktop::theme,
|
||||
"chandra:desktop/types@0.1.0": plasmoid::ph::chandra::desktop::types,
|
||||
"chandra:desktop/theme@0.1.0": plasmoid::ph::chandra::desktop::theme,
|
||||
},
|
||||
});
|
||||
|
||||
use moonplasma::host::font::Glyph;
|
||||
use moonplasma::host::sys::{Host, Received};
|
||||
use chandra::host::font::Glyph;
|
||||
use chandra::host::sys::{Host, Received};
|
||||
|
||||
#[derive(Default)]
|
||||
struct State {
|
||||
@@ -44,7 +44,7 @@ struct State {
|
||||
started: Option<std::time::Instant>,
|
||||
/// TTF faces loaded by the component (`font.load`), by slot, and their glyph cache.
|
||||
fonts: raster::Fonts,
|
||||
/// The framebuffer and client surfaces behind `moonplasma:host/raster`.
|
||||
/// The framebuffer and client surfaces behind `chandra:host/raster`.
|
||||
raster: raster::Raster,
|
||||
/// Runs the panel modules; set once the engine exists.
|
||||
pl: Option<plasmoid::Runtime>,
|
||||
@@ -123,10 +123,10 @@ impl State {
|
||||
}
|
||||
}
|
||||
|
||||
impl moonplasma::host::plasmoids::Host for State {
|
||||
fn load(&mut self, path: String) -> Result<moonplasma::host::plasmoids::Loaded, String> {
|
||||
impl chandra::host::plasmoids::Host for State {
|
||||
fn load(&mut self, path: String) -> Result<chandra::host::plasmoids::Loaded, String> {
|
||||
let l = self.pl().load(&path)?;
|
||||
Ok(moonplasma::host::plasmoids::Loaded {
|
||||
Ok(chandra::host::plasmoids::Loaded {
|
||||
handle: l.handle,
|
||||
id: l.info.id,
|
||||
name: l.info.name,
|
||||
@@ -141,27 +141,27 @@ impl moonplasma::host::plasmoids::Host for State {
|
||||
self.pl().unload(handle);
|
||||
}
|
||||
|
||||
fn set_tokens(&mut self, t: plasmoid::ph::moonplasma::desktop::theme::Tokens) {
|
||||
fn set_tokens(&mut self, t: plasmoid::ph::chandra::desktop::theme::Tokens) {
|
||||
self.pl().shared.borrow_mut().tokens = Some(t);
|
||||
}
|
||||
|
||||
fn render(
|
||||
&mut self,
|
||||
handle: u32,
|
||||
box_: plasmoid::ph::moonplasma::desktop::types::Size,
|
||||
) -> Vec<plasmoid::ph::moonplasma::desktop::types::DrawOp> {
|
||||
box_: plasmoid::ph::chandra::desktop::types::Size,
|
||||
) -> Vec<plasmoid::ph::chandra::desktop::types::DrawOp> {
|
||||
self.pl().render(handle, box_)
|
||||
}
|
||||
|
||||
fn popup(&mut self, handle: u32) -> Option<moonplasma::host::plasmoids::PopupSurface> {
|
||||
self.pl().popup(handle).map(|p| moonplasma::host::plasmoids::PopupSurface { box_: p.size, ops: p.ops })
|
||||
fn popup(&mut self, handle: u32) -> Option<chandra::host::plasmoids::PopupSurface> {
|
||||
self.pl().popup(handle).map(|p| chandra::host::plasmoids::PopupSurface { box_: p.size, ops: p.ops })
|
||||
}
|
||||
|
||||
fn on_event(
|
||||
&mut self,
|
||||
handle: u32,
|
||||
on_popup: bool,
|
||||
event: plasmoid::ph::moonplasma::desktop::types::InputEvent,
|
||||
event: plasmoid::ph::chandra::desktop::types::InputEvent,
|
||||
) -> bool {
|
||||
self.pl().on_event(handle, on_popup, event)
|
||||
}
|
||||
@@ -183,8 +183,8 @@ impl moonplasma::host::plasmoids::Host for State {
|
||||
self.pl().shared.borrow_mut().wallpaper = current;
|
||||
}
|
||||
|
||||
fn publish_system(&mut self, s: moonplasma::host::plasmoids::SystemSnapshot) {
|
||||
use plasmoid::ph::moonplasma::desktop::system::Snapshot;
|
||||
fn publish_system(&mut self, s: chandra::host::plasmoids::SystemSnapshot) {
|
||||
use plasmoid::ph::chandra::desktop::system::Snapshot;
|
||||
self.pl().shared.borrow_mut().system = Some(Snapshot {
|
||||
cpu_permille: s.cpu_permille,
|
||||
mem_used_kib: s.mem_used_kib,
|
||||
@@ -198,13 +198,13 @@ impl moonplasma::host::plasmoids::Host for State {
|
||||
});
|
||||
}
|
||||
|
||||
fn publish_windows(&mut self, wins: Vec<moonplasma::host::plasmoids::WindowEntry>) {
|
||||
fn publish_windows(&mut self, wins: Vec<chandra::host::plasmoids::WindowEntry>) {
|
||||
self.pl().shared.borrow_mut().windows =
|
||||
wins.into_iter().map(|w| (w.id, w.title, w.app_id, w.focused)).collect();
|
||||
}
|
||||
|
||||
fn next_request(&mut self) -> Option<moonplasma::host::plasmoids::Request> {
|
||||
use moonplasma::host::plasmoids::Request as R;
|
||||
fn next_request(&mut self) -> Option<chandra::host::plasmoids::Request> {
|
||||
use chandra::host::plasmoids::Request as R;
|
||||
use plasmoid::Req;
|
||||
let r = self.pl().shared.borrow_mut().requests.pop_front()?;
|
||||
Some(match r {
|
||||
@@ -239,8 +239,8 @@ impl moonplasma::host::plasmoids::Host for State {
|
||||
self.pl().picker_start()
|
||||
}
|
||||
|
||||
fn picker_poll(&mut self) -> moonplasma::host::plasmoids::PickerState {
|
||||
use moonplasma::host::plasmoids::PickerState as P;
|
||||
fn picker_poll(&mut self) -> chandra::host::plasmoids::PickerState {
|
||||
use chandra::host::plasmoids::PickerState as P;
|
||||
match self.pl().picker_poll() {
|
||||
None => P::Open,
|
||||
Some(None) => P::Cancelled,
|
||||
@@ -249,8 +249,8 @@ impl moonplasma::host::plasmoids::Host for State {
|
||||
}
|
||||
}
|
||||
|
||||
impl moonplasma::host::display::Host for State {
|
||||
fn open(&mut self) -> Option<moonplasma::host::display::Output> {
|
||||
impl chandra::host::display::Host for State {
|
||||
fn open(&mut self) -> Option<chandra::host::display::Output> {
|
||||
#[cfg(feature = "drm")]
|
||||
{
|
||||
kms::open()
|
||||
@@ -289,7 +289,7 @@ impl moonplasma::host::display::Host for State {
|
||||
#[cfg(not(feature = "drm"))]
|
||||
let _ = shape;
|
||||
}
|
||||
fn take_input(&mut self) -> Vec<moonplasma::host::display::SeatEvent> {
|
||||
fn take_input(&mut self) -> Vec<chandra::host::display::SeatEvent> {
|
||||
#[cfg(feature = "drm")]
|
||||
return kms::take_input();
|
||||
#[cfg(not(feature = "drm"))]
|
||||
@@ -301,7 +301,7 @@ impl moonplasma::host::display::Host for State {
|
||||
}
|
||||
}
|
||||
|
||||
impl moonplasma::host::font::Host for State {
|
||||
impl chandra::host::font::Host for State {
|
||||
fn load(&mut self, slot: u32, path: String) -> bool {
|
||||
self.fonts.load(slot, &path)
|
||||
}
|
||||
@@ -312,7 +312,7 @@ impl moonplasma::host::font::Host for State {
|
||||
}
|
||||
}
|
||||
|
||||
impl moonplasma::host::raster::Host for State {
|
||||
impl chandra::host::raster::Host for State {
|
||||
fn capture(&mut self, fd: i32, offset: i32, stride: i32, width: i32, height: i32, format: i32) -> u32 {
|
||||
if fd < 0 || offset < 0 || stride <= 0 || width <= 0 || height <= 0 {
|
||||
return 0;
|
||||
@@ -343,7 +343,7 @@ impl moonplasma::host::raster::Host for State {
|
||||
self.raster.release(id);
|
||||
}
|
||||
|
||||
fn submit(&mut self, f: moonplasma::host::raster::Frame) {
|
||||
fn submit(&mut self, f: chandra::host::raster::Frame) {
|
||||
self.raster.submit(&f, &mut self.fonts);
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ impl moonplasma::host::raster::Host for State {
|
||||
|
||||
fn export_memfd(&mut self) -> i32 {
|
||||
let data = self.raster.to_argb8888();
|
||||
let Ok(name) = CString::new("moon-plasma-frame") else { return -1 };
|
||||
let Ok(name) = CString::new("chandra-frame") else { return -1 };
|
||||
unsafe {
|
||||
let fd = libc::memfd_create(name.as_ptr(), libc::MFD_CLOEXEC);
|
||||
if fd < 0 {
|
||||
@@ -730,11 +730,11 @@ fn main() -> Result<()> {
|
||||
}
|
||||
};
|
||||
let mut linker: Linker<State> = Linker::new(&engine);
|
||||
moonplasma::host::sys::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
|
||||
moonplasma::host::font::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
|
||||
moonplasma::host::raster::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
|
||||
moonplasma::host::display::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
|
||||
moonplasma::host::plasmoids::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
|
||||
chandra::host::sys::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
|
||||
chandra::host::font::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
|
||||
chandra::host::raster::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
|
||||
chandra::host::display::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
|
||||
chandra::host::plasmoids::add_to_linker::<State, HasSelf<State>>(&mut linker, |s| s)?;
|
||||
let mut store = Store::new(&engine, State::default());
|
||||
store.data_mut().pl = Some(plasmoid::Runtime::new(&engine)?);
|
||||
let compositor = Compositor::instantiate(&mut store, &component, &linker)?;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//! The host's rasteriser (`moonplasma:host/raster`).
|
||||
//! The host's rasteriser (`chandra:host/raster`).
|
||||
//!
|
||||
//! A direct port of compositor/renderer (the pure-MoonBit software renderer), so a frame comes out
|
||||
//! pixel for pixel the same, but native: the compositor component sends draw operations and window
|
||||
//! surface ids, and the pixels never cross the component boundary. Window buffers are copied out of
|
||||
//! the client's shared memory once, at commit (`capture`), converted to RGBA, and kept here.
|
||||
|
||||
use crate::moonplasma::host::raster as wt;
|
||||
use crate::chandra::host::raster as wt;
|
||||
use ab_glyph::{Font, FontVec, OutlineCurve};
|
||||
use ab_glyph_rasterizer::{point, Rasterizer};
|
||||
use std::collections::HashMap;
|
||||
|
||||
Reference in new issue
Block a user