summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 14:51:32 -0300
committerGabriel Schneider <[email protected]>2026-11-05 15:29:09 -0300
commite20b3ab1db83298a93030faaccf41298f44452a5 (patch)
treec607fb067270be02690e2b0fef4ae5b79e9bd11e /src/pardes.zig
parent3205f21d9b5f222f7228aecda36d9d2f3a7742e4 (diff)
downloadpardes-e20b3ab1db83298a93030faaccf41298f44452a5.tar.gz
pardes-e20b3ab1db83298a93030faaccf41298f44452a5.zip
words: the core's names and notes that still told of its motion: Capabilities.lift, named for Lift and said to be its soft shadows, gates what only the SDL window draws (the grip at GripWidth, its own CursorBlink, the Pet) and is Capabilities.pixels now; nextWake, advance, the pump's wait, update's tick and the replica's and views' field notes speak of the core's deadlines and timings where they spoke of its animation (pardes.zig, views.zig, Messages.zig); animationActive keeps its name, as macOS calls it (src/macos.zig, which needs its own change on a Mac); a window test's skip for a build without the capability goes (gui.zig is the window's alone); gates: core-test and behaviour-test on tui, unit-test on gui
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index ec684b78..16dd794e 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -546,7 +546,7 @@ test "startup config runs builtin lines in order and isolates bad lines" {
try std.testing.expectEqualStrings("acme", p.theme().name);
// The theme lands without a tween (the chrome is the theme's at once);
- // the bad lines are said, so a notice may be animating.
+ // the bad lines are said, so a notice may be up.
try std.testing.expectEqual(ChromeTheme.fromTheme(p.theme()), p.chromeTheme().*);
try std.testing.expect(!p.quit);
for (0..p.effects_len) |i| switch (p.effects[(p.effects_head + i) % p.effects.len]) {
@@ -3496,8 +3496,8 @@ pub const Pardes = struct {
/// frame is still owed, and the next pump draws it again.
present_skipped: bool = false,
/// Core time. `now_ns` is the shell's monotonic clock as `advance` was
- /// last given it; `stepped_ns` is how far animation has been stepped
- /// along it, in whole frames of `frame_ns`. Idle, the two are
+ /// last given it; `stepped_ns` is how far its timings have been
+ /// stepped along it, in whole frames of `frame_ns`. Idle, the two are
/// the same instant.
now_ns: u64 = 0,
stepped_ns: u64 = 0,
@@ -3586,7 +3586,7 @@ pub const Pardes = struct {
/// effects has.
pub const replica = .{
.local = .{
- // A frame, and the animations and timings that make it.
+ // A frame, and the timings that make it.
"surface", "frames", "chrome",
"frame_arena", "scratch",
"needs_frame", "present_skipped", "native_image_patches",
@@ -5006,10 +5006,8 @@ pub const Pardes = struct {
const h = p.host;
const v = h.vtable;
if (v.wait_input) |f| {
- // Asleep until input or until core animation next needs a
- // frame; 0 is no timeout at all.
- // A render-time animation draws every loop: the wait only takes
- // what input is there.
+ // Asleep until input or until the core's next deadline
+ // (nextWake); 0 is no timeout at all.
// The clock read whether or not it is wanted: what a replica
// waits on is its own (a picture decoding wakes only a frame
// that draws it), and the tape has the same calls either way.
@@ -5035,7 +5033,7 @@ pub const Pardes = struct {
// the display for one. This is what keeps the frame rate governing
// rendering and nothing else.
// A shell with a clock draws what `advance` stepped; one without
- // steps its own `.tick`s and draws while anything animates.
+ // steps its own `.tick`s and draws while a deadline is due.
if (!p.needs_frame and (v.now != null or !p.animationActive())) return p.frames.idle();
// No one to see it: the frame stays owed (needs_frame), not drawn.
// A pty streaming into an unwatched session spent most of its time
@@ -5142,7 +5140,7 @@ pub const Pardes = struct {
defer tape.leave(p, taped);
defer panes.File.syncTwins(p);
defer p.reportFocus();
- // A tick with nothing animating is the one event that cannot change
+ // A tick with no deadline due is the one event that cannot change
// the screen.
p.needs_frame = p.needs_frame or ev != .tick;
p.shell_rows.sweep(p.gpa);
@@ -6800,12 +6798,13 @@ pub const Pardes = struct {
return &p.body_chrome.?.chrome;
}
- /// When core animation next needs a frame, on the `stepped_ns`
- /// timeline: a frame from now while anything moves, the end of the
- /// wait while something only waits (a message lingering, a look-hover
- /// delay), null when nothing is animating. Every frame-based animation
- /// the core owns is in this one list, which is what lets every shell
- /// sleep exactly as long as nothing changes.
+ /// When the core next needs a frame, on the `stepped_ns` timeline: a
+ /// frame from now while work goes on (places to find, a picture
+ /// decoding, a PDF page on a lane), the end of the wait while something
+ /// only waits (a message lingering, a look-hover delay), null when
+ /// nothing is due. Every deadline the core owns is in this one list,
+ /// which is what lets every shell sleep exactly as long as nothing
+ /// changes; what moves on the screen is the frontends' own.
pub fn nextWake(p: *const Pardes) ?u64 {
const next = p.stepped_ns + frame_ns;
// Held 9P writes go in when they pause: wake for it, never before
@@ -6865,12 +6864,12 @@ pub const Pardes = struct {
return p.nextWake() != null;
}
- /// Bring core animation up to `now_ns`, the shell's monotonic clock: one
+ /// Bring core time up to `now_ns`, the shell's monotonic clock: one
/// `.tick` for every whole frame that has passed since it last stood
- /// still, so an animation takes as long on a 144 Hz display, over ssh or
+ /// still, so a timing lasts as long on a 144 Hz display, over ssh or
/// after a slow frame as it does anywhere. A wait (a message lingering,
/// the look-hover delay) is jumped to its end in one step and drawn
- /// once. Idle, time is not banked: the next animation starts from now.
+ /// once. Idle, time is not banked: the next wait starts from now.
pub fn advance(p: *Pardes, now_ns: u64) void {
const taped = tape.enter(p, .{ .advance = now_ns });
defer tape.leave(p, taped);