LOK runs on Windows and Linux; packaging stages engines (W-01, K-01)

The kernel is the merged library on every platform; Windows and
Linux find it beside the app in libreoffice/program. All three run
unipoll: macOS through GCD, Linux by answering one request per poll,
Windows through a message-only window on the loop's thread (LOK's
own main thread had deadlocked Calc loads). Patch 0043 flushes
callbacks inline everywhere, so a request sees its result; 0042 stops
MSVC's Boost auto-link. Linux paints with cairo, BGRA; the start-up
check now paints red text and finds red in byte two on every
platform, since getTileMode does not see Skia.

ely-lok on Windows: 180 of 189 pass; on Linux 187. The rest are
listed after 0.1.3 (spelling, Calc dark tiles, show layers and
fields, a11y selection). Tests build file URLs portably and accept
CRLF where Windows writes it.

packaging/stage.sh lays out an app with its engines for Windows and
Linux; licenses.sh finds each licence on all three. ElyMark finds its
page beside the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-10 18:27:53 -04:00
1 parent dc4c1ed0fe
commit c96d39a342
34 files changed
+658 -214

No files matched your search

+20 -23
View File
@@ -16,6 +16,14 @@ mod revision;
mod slides;
mod teardown;
mod text;
#[cfg(windows)]
mod messages;
#[cfg(windows)]
use messages::serve;
#[cfg(target_os = "linux")]
mod unipoll;
#[cfg(target_os = "linux")]
use unipoll::serve;
/// English kernel, desktop hints; macros stay off (LOK-11).
const LOAD_OPTIONS: &str = "Language=en-US,DeviceFormFactor=desktop";
@@ -49,7 +57,12 @@ fn serve(lok: Lok, input: impl io::Read + Send + 'static) -> io::Result<()> {
}
std::thread::spawn(move || reader(input));
std::thread::spawn(events::push);
lok.run_loop();
// Aqua never polls: GCD brings the requests.
extern "C" fn poll(_: *mut std::ffi::c_void, _: i32) -> i32 {
0
}
extern "C" fn wake(_: *mut std::ffi::c_void) {}
lok.run_loop(Some(poll), Some(wake));
Ok(())
}
@@ -146,23 +159,6 @@ mod gcd {
use _dispatch_main_q as _raw;
}
#[cfg(not(target_os = "macos"))]
fn serve(lok: Lok, mut input: impl io::Read) -> io::Result<()> {
let lok = Box::leak(Box::new(lok));
pin(lok);
lok.register_callback(password::on_kit);
std::thread::spawn(events::push);
loop {
match ipc::read_frame(&mut input)? {
Some((tag, id, payload)) => answer(lok, tag, id, &payload),
None => {
log::info!("lok-worker: stdin closed");
teardown::teardown(0);
}
}
}
}
/// Handles one frame and writes its answer.
fn answer(lok: &Lok, tag: u8, id: u64, payload: &[u8]) {
let out = OUT.get().expect("the output is set");
@@ -375,15 +371,16 @@ fn docs() -> &'static Mutex<std::collections::HashMap<u64, Document>> {
DOCS.get_or_init(|| Mutex::new(std::collections::HashMap::new()))
}
/// Loads and paints; the bytes gained (R-01).
/// Loads and paints red text; its BGRA red pixels (R-01).
fn verify(lok: &Lok, url: &str) -> io::Result<u64> {
let doc = lok.load(url, LOAD_OPTIONS)?;
let mut tile = vec![0xABu8; 64 * 64 * 4];
doc.paint_tile(&mut tile, 64, 64);
// Past the 2 cm margin, where the text sits.
doc.paint_rect(&mut tile, (64, 64), (0, 0, 3000, 3000));
drop(doc);
let gained = tile.iter().filter(|byte| **byte != 0xAB).count() as u64;
log::info!("lok-worker: tile self-check gained {gained} bytes");
Ok(gained)
let red = tile.chunks_exact(4).filter(|px| px[2] > 200 && px[0] < 80 && px[1] < 80).count();
log::info!("lok-worker: tile self-check found {red} red pixels");
Ok(red as u64)
}
/// Borrows a live document for a read call.