diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-11 14:43:13 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-11 16:17:33 -0300 |
| commit | 3093eb55ac4a7054f51f06ea2786b5f9c9ec73f6 (patch) | |
| tree | f1bc91879a447f178dfaba39d0df107d01e557bd /anim/src/hexdump.zig | |
| parent | a72831d5c322078260314c305ddd940e4967947d (diff) | |
| download | computeranim-3093eb55ac4a7054f51f06ea2786b5f9c9ec73f6.tar.gz computeranim-3093eb55ac4a7054f51f06ea2786b5f9c9ec73f6.zip | |
canim: a minimap in each pane; source wherever it can be had, libc's included
From the user. Each pane with more than it shows carries a strip of its
whole column at its right edge, the pane's window outlined and what
happens off it marked there; the corner minimap is gone and the dive
folds each column of the map into its pane's strip. The source panel
follows the pc into any file the build has: glibc's own, from the
distro's debuginfod by an optional step that caches them by build id
(zig build sources; nothing else touches the network), and musl's, from
Zig's lib directory. The syscalls scene shows open64.c on the way down,
and a new scene follows the same call through a Zig-built musl. A
graph's counts and inks are as of the moment shown.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'anim/src/hexdump.zig')
| -rw-r--r-- | anim/src/hexdump.zig | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/anim/src/hexdump.zig b/anim/src/hexdump.zig index 21db91f..a35f091 100644 --- a/anim/src/hexdump.zig +++ b/anim/src/hexdump.zig @@ -142,9 +142,12 @@ pub const View = struct { rows: usize, box: Rect, - /// What a sprint cannot show: veiled, over its rows. + /// What a sprint cannot show: veiled, over its rows; then, a dump's, + /// its minimap: its window (published as it drew, `map.window`) on its + /// column of the map, a strip of its own (`map.strip`). pub fn veil(v: View, now: cursors.Now) void { @import("context.zig").veiled(v.u, v.box, now.sprint_veil); + @import("map.zig").strip(.view, v.u, v.box); } }; @@ -281,20 +284,20 @@ fn rowPasses(now: cursors.Now, addr: u64) Passes { fn rowPin(u: ui.Ui, now: cursors.Now, addr: u64, y: f32) f32 { ties.anchor(u, .{ .dump_pin = addr }, .{ .x = 0, .y = y, .w = b.bracket, .h = m.row }); const at = pinned(u, now, addr); - if (at.names.len == 0 or at.shows <= 0) return full_room; - const x = u.faded(at.shows).pinEnd(full_room, y, at.names, rows.ink(rows.regionOf(now.moment(), addr))); + if (at.names.len == 0 or at.shows <= 0) return viewRoom(); + const x = u.faded(at.shows).pinEnd(viewRoom(), y, at.names, rows.ink(rows.regionOf(now.moment(), addr))); return x - adv; } /// Where the reading of a row must end for its pin (`rowPin`), not drawing it. fn rowPinRoom(u: ui.Ui, now: cursors.Now, addr: u64) f32 { const at = pinned(u, now, addr); - if (at.names.len == 0 or at.shows <= 0) return full_room; + if (at.names.len == 0 or at.shows <= 0) return viewRoom(); const p = theme.metric.pin; var shown: []const u8 = ""; for (at.names[0..@min(at.names.len, 3)], 0..) |name, i| shown = if (i == 0) name else u.print("{s} {s}", .{ shown, name }); if (at.names.len > 3) shown = u.print("{s} +{d}", .{ shown, at.names.len - 3 }); - return full_room - u.width(.mono, theme.size.mono.context, shown) - p.row_gap - p.row_head[0] - adv; + return viewRoom() - u.width(.mono, theme.size.mono.context, shown) - p.row_gap - p.row_head[0] - adv; } fn pinned(u: ui.Ui, now: cursors.Now, addr: u64) struct { names: []const []const u8, shows: f32 } { @@ -527,6 +530,7 @@ pub fn fielded(v: View, now: cursors.Now, y: f32, of: Fields) void { for (at_rows.items) |r| if (addr >= r.addr and addr < r.addr + 16) pointerArcs(&arcs, now, addr, r.y, at_rows.items, 16, .{ y - m.pad, ry + m.pad }, false, field.reads == .protected); }; arcs.draw(u, theme.metric.arc.lanes.len); + if (of.pins) @import("map.zig").window(.view, .{ of.base + 16 * shown[0], of.base + 16 * shown[shown.len - 1] }, .{ of.base + 16 * shown[0], of.base + 16 * shown[shown.len - 1] }, 1); } /// Which of `rs` (rows of fields, the region's last row `last`) a window @@ -699,6 +703,11 @@ pub fn reading(u: ui.Ui, y: f32, shift: f32, moment: Recording.Moment, values: * /// The panel's width less its side: where a reading ends with no pin at its row's end. const full_room = theme.layout.state.w - theme.metric.context.side; +/// A view's: less its strip, in the working frame. +fn viewRoom() f32 { + return @import("map.zig").content(full_room); +} + /// `reading`, ending at `room` (a pin at the row's end takes the rest). pub fn readingIn(u: ui.Ui, y: f32, shift: f32, moment: Recording.Moment, values: *const [16]u8, known: *const [16]bool, fields: []const Field, room: f32) f32 { const size = theme.size.mono.context; |
