summaryrefslogtreecommitdiff
path: root/src/addon_test.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 06:24:42 -0300
committerGabriel Schneider <[email protected]>2026-11-06 11:19:32 -0300
commit0893d632e242553390d968751fff0e880627c34a (patch)
tree154e40245fd97bf399efa2cc99872b5a48b1d0a0 /src/addon_test.zig
parent7ccbb0fa852e327b6663ba933f134d5013484007 (diff)
downloadpardes-0893d632e242553390d968751fff0e880627c34a.tar.gz
pardes-0893d632e242553390d968751fff0e880627c34a.zip
kinds #12, ABI 2.1: pardes_addon.h grows at the ends of its records (pa_api's heap, view, exec and select, pa_paint's rail thumb, pa_ops's search, PA_WHEEL_LEFT and RIGHT) and the core reads them only from a 2.1 head: Esc goes to a 2.1 kind first, a press's drag and release stay its own and the pointer leaving is told, tick comes again on a view change, a kind's search rows, place, Exec and selection are taped, the jobs a call asks are emitted on every core from its taped outcome, a Shadow lays its tag out from the authority's prefix and keeps its tick state when it joins, a view's raster is its frontend's, and fake.c and snake.c leave Esc to the core
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/addon_test.zig')
-rw-r--r--src/addon_test.zig9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/addon_test.zig b/src/addon_test.zig
index a4788109..427f0289 100644
--- a/src/addon_test.zig
+++ b/src/addon_test.zig
@@ -47,7 +47,9 @@ fn run(io: std.Io, gpa: std.mem.Allocator, lib: []const u8, script_path: ?[]cons
defer pardes.memory.deinit();
pardes.syntax.start(allocs.tree_sitter);
defer pardes.syntax.stop();
- const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 24, .state = .memory, .image_allocator = allocs.image, .pdf_allocator = allocs.pdf, .tree_sitter_allocator = allocs.tree_sitter, .frame_allocator = allocs.frame });
+ // A terminal's view on every build: what a script prints is the same
+ // from a window's binary (a picture's raster is a view's, Kind.viewOf).
+ const p = try Pardes.init(gpa, .{ .tty_only = true, .windowed = false, .cols = 80, .rows = 24, .state = .memory, .image_allocator = allocs.image, .tree_sitter_allocator = allocs.tree_sitter, .frame_allocator = allocs.frame });
defer p.deinit();
// Loaded as `Addon load` loads it, the host's half here.
pardes.Addon.perform(p, .load, 0, lib);
@@ -218,6 +220,9 @@ fn show(p: *Pardes, gpa: std.mem.Allocator, id: usize, out: *std.Io.Writer, size
try out.print("|{s}\n", .{std.mem.trimEnd(u8, row.items, " ")});
}
for (s.placements.items) |pl| if (pl.pane == id) {
- try out.print("placement {d}x{d} src {d},{d} {d}x{d} over {d},{d} {d}x{d} key {x}\n", .{ pl.raster.w, pl.raster.h, pl.src.x, pl.src.y, pl.src.w, pl.src.h, pl.dst.x - r.x, pl.dst.y - r.y, pl.dst.w, pl.dst.h, pl.key });
+ try out.print("placement {d}x{d} src {d},{d} {d}x{d} over {d},{d} {d}x{d} key {x}", .{ pl.raster.w, pl.raster.h, pl.src.x, pl.src.y, pl.src.w, pl.src.h, pl.dst.x - r.x, pl.dst.y - r.y, pl.dst.w, pl.dst.h, pl.key });
+ if (pl.at) |at| try out.print(" at {d},{d} {d}x{d}", .{ at.x, at.y, at.w, at.h });
+ if (pl.dirty) |d| try out.print(" rows {d}+{d} of {x}", .{ d.y, d.h, d.from });
+ try out.writeAll("\n");
};
}