summaryrefslogtreecommitdiff
path: root/src/term/TerminalImages.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 03:06:49 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit98f84f99e79cccc2344aff2efe10823540d0c7b7 (patch)
tree0e11fcb0a2252858dc8c7b442a9c78152af5a585 /src/term/TerminalImages.zig
parentf749eb712d990a9b03f1db372d5311e77bd32edd (diff)
downloadpardes-98f84f99e79cccc2344aff2efe10823540d0c7b7.tar.gz
pardes-98f84f99e79cccc2344aff2efe10823540d0c7b7.zip
plain: the records the core and the terminal both name, a leaf module (docs/next-terminal.md, Phase 1, its first step): src/plain/plain.zig takes Color, FontRole, CellStyle, Cell, RectPx, RectCell, Raster and Placement from surface.zig and Key from Event.zig, moved as they are, and imports std alone; surface.zig and Event.zig re-export them under their old names, so no caller changes; src/term/'s files name them through `plain` (pager.zig and TerminalImages.zig no longer reach surface.zig); build.zig's wireCore gives every core module the `plain` import; locations.Row stays (it names look.Spot and walk's digest: not free); core-test 985 of 985, lib-test
Diffstat (limited to 'src/term/TerminalImages.zig')
-rw-r--r--src/term/TerminalImages.zig9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/term/TerminalImages.zig b/src/term/TerminalImages.zig
index 6894945c..ab7aca25 100644
--- a/src/term/TerminalImages.zig
+++ b/src/term/TerminalImages.zig
@@ -8,6 +8,7 @@
//! moves with the text it was put on, and a virtual one (`U=1`) shown
//! through the U+10EEEE placeholder cells the program prints.
const std = @import("std");
+const plain = @import("plain");
const ghostty_vt = @import("ghostty-vt");
const pardes = @import("../pardes.zig");
const zstbi = @import("zstbi");
@@ -15,7 +16,7 @@ const wuffs = @import("wuffs");
const TerminalImages = @This();
const gfx = ghostty_vt.kitty.graphics;
-const PixelRect = @import("../surface.zig").RectPx;
+const PixelRect = plain.RectPx;
/// The bytes ghostty-vt may hold for one screen's images (it evicts the
/// oldest past this): a 4K picture in RGBA, with room for a second.
@@ -190,8 +191,8 @@ pub fn draw(
// Handed on lowest z first (the storage's order is a hash map's), the
// order a shell draws them in; equal z keeps the order they came in.
const first = s.placements.items.len;
- defer std.sort.insertion(pardes.Placement, s.placements.items[first..], {}, struct {
- fn lessThan(_: void, a: pardes.Placement, b: pardes.Placement) bool {
+ defer std.sort.insertion(plain.Placement, s.placements.items[first..], {}, struct {
+ fn lessThan(_: void, a: plain.Placement, b: plain.Placement) bool {
return a.z < b.z;
}
}.lessThan);
@@ -314,7 +315,7 @@ const Ctx = struct {
.w = @intCast(x1 - x0),
.h = @intCast(y1 - y0),
},
- .key = pardes.Placement.keyOf(ctx.serial, img.id, @truncate(img.generation)),
+ .key = plain.Placement.keyOf(ctx.serial, img.id, @truncate(img.generation)),
.z = z,
.art = .{ .glyph = ctx.ti.petscii },
});