summaryrefslogtreecommitdiff
path: root/src/tui/tui.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 05:19:21 -0300
committerGabriel Schneider <[email protected]>2026-11-06 05:55:49 -0300
commitc8553032ef84aec74cbb5d07d07f934eecf3d4a9 (patch)
treee47d3dd72b83e0b95d53271df9f5932dab389959 /src/tui/tui.zig
parentde0447471febe1253b42a32fe9a1d6cdccc9d5b9 (diff)
downloadpardes-c8553032ef84aec74cbb5d07d07f934eecf3d4a9.tar.gz
pardes-c8553032ef84aec74cbb5d07d07f934eecf3d4a9.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/tui/tui.zig')
-rw-r--r--src/tui/tui.zig16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/tui/tui.zig b/src/tui/tui.zig
index 0c74cbaa..fd47cb67 100644
--- a/src/tui/tui.zig
+++ b/src/tui/tui.zig
@@ -766,7 +766,7 @@ fn exactKittyPlacement(
screen_pixel_w: u16,
screen_pixel_h: u16,
) ?KittyPlacement {
- const g: pardes.image.NativeGeometry = .{ .src = place.src, .dst = place.at orelse return null };
+ const g: pardes.NativeGeometry = .{ .src = place.src, .dst = place.at orelse return null };
const cell_w = terminalCellPixels(screen_pixel_w, screen_cols, 8);
const cell_h = terminalCellPixels(screen_pixel_h, screen_rows, 16);
if (g.dst.w == 0 or g.dst.h == 0 or g.src.w == 0 or g.src.h == 0) return null;
@@ -823,7 +823,7 @@ fn kittyPlacement(
) ?KittyPlacement {
const cell_w = terminalCellPixels(screen_pixel_w, screen_cols, 8);
const cell_h = terminalCellPixels(screen_pixel_h, screen_rows, 16);
- const geometry: pardes.image.NativeGeometry = .{ .src = place.src, .dst = place.at orelse return null };
+ const geometry: pardes.NativeGeometry = .{ .src = place.src, .dst = place.at orelse return null };
const fit: enum { width, height } = if (geometry.dst.w >= @as(u32, place.dst.w) * cell_w) .width else .height;
const safe_rows_u32 = geometry.dst.h / cell_h;
@@ -1221,12 +1221,16 @@ pub fn remote(init: std.process.Init, opts: pardes.Options, path: []const u8, se
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;