From c8553032ef84aec74cbb5d07d07f934eecf3d4a9 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 05:19:21 -0300 Subject: kinds #9, the core's image code gone: src/image.zig (558 lines) and the static table go, so no kind is compiled in (Registry.init, Kind.image, compiledIn, `static` in /addons and "is compiled in" with them) and a test of the core's side of a kind's pane opens Kind.test_kind (a picture of one pixel, no library); a placement's fit (NativeGeometry, containGeometry) moves to surface.zig and a PDF's fit modes to pdf_view.zig; a terminal's kitty PNG decodes in TerminalImages.zig through wuffs as before, its downscale through stb_image_resize, the one part of zstbi the core keeps (stb_image patched out of it, the wuffs_images option, tag_image and image_exts gone); the image cases load the built image.so by path: test/panes.zig's and fs_namespace's through Addon.perform, T1 through Addon load (a new behaviour case: PNG, JPEG and PPM through 9P, the art words, a refused corrupt PNG, a dump's placeholder and its picture back, which replaces the decode unit test and ctl.zig's corrupt-image case), the snapshot, process and image harnesses by linking it into each session's data directory; images.snap unchanged Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/gui/gui.zig | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/gui/gui.zig') diff --git a/src/gui/gui.zig b/src/gui/gui.zig index 0d8c53ca..1125ff03 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -2030,12 +2030,16 @@ fn remoteSession(init: std.process.Init, g: *Gui, opts_in: pardes.Options, test_ const have: ?*replica.Have = if (far) &have_store else null; const allocs = pardes.memory.init(gpa); defer pardes.memory.deinit(); - pardes.image.start(io, allocs.image); - if (comptime pardes.pdf_enabled) pardes.pdf.start(allocs.pdf); + if (comptime pardes.pdf_enabled) { + pardes.TerminalImages.start(io, allocs.image); + pardes.pdf.start(allocs.pdf); + } pardes.syntax.start(allocs.tree_sitter); defer { - pardes.image.stop(); - if (comptime pardes.pdf_enabled) pardes.pdf.stop(); + if (comptime pardes.pdf_enabled) { + pardes.TerminalImages.stop(); + pardes.pdf.stop(); + } pardes.syntax.stop(); } var o = opts_in; @@ -5028,11 +5032,11 @@ fn validImageBytes(place: pardes.Placement) ?u32 { /// Where the placement's pixels go in its cells: where it says, or fitted /// there (no larger than it is, at the top left). -fn nativePlaceGeometry(g: *const Gui, place: pardes.Placement) ?pardes.image.NativeGeometry { +fn nativePlaceGeometry(g: *const Gui, place: pardes.Placement) ?pardes.NativeGeometry { if (place.at) |at| return .{ .src = place.src, .dst = at }; const bound_w = std.math.mul(u32, place.dst.w, g.cell_w) catch return null; const bound_h = std.math.mul(u32, place.dst.h, g.cell_h) catch return null; - const fit = pardes.image.containGeometry(place.src.w, place.src.h, bound_w, bound_h) orelse return null; + const fit = pardes.containGeometry(place.src.w, place.src.h, bound_w, bound_h) orelse return null; return .{ .src = place.src, .dst = fit.dst }; } -- cgit v1.3