feat: render interactive manuscript from Endor through generic graphics

This commit is contained in:
2026-11-12 10:52:28 +08:00
parent d29a1be329
commit 2715c1ce2c
71 changed files with 3000 additions and 78 deletions
+27
View File
@@ -1451,6 +1451,33 @@ impl UiBridge {
if !data.geometry.interactive {
bail!("Mount does not accept input");
}
if input.kind.starts_with("pointer") {
let p = input
.point
.ok_or_else(|| anyhow::anyhow!("pointer needs point"))?;
let f = vm.allocate(ContextNativeFunction::new(
"native pointer event",
crate::bridge::graphics::PointerDispatch {
owner: data.block,
mount,
desktop,
kind: input.kind.clone(),
point: crate::geometry::Point::new(p[0], p[1]),
},
vec![data.block, mount, desktop],
))?;
let result = vm.call_with_limits(
f,
&[],
endor_core::ExecutionLimits {
max_frames: 128,
max_instructions: 1_000_000,
},
);
vm.release(f)?;
vm.release_value(result?)?;
return Ok(());
}
vm.set_attr(
desktop,
"focus",