summaryrefslogtreecommitdiff
path: root/core/Term.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Term.zig')
-rw-r--r--core/Term.zig102
1 files changed, 4 insertions, 98 deletions
diff --git a/core/Term.zig b/core/Term.zig
index 6ef9b0a5..86c7518b 100644
--- a/core/Term.zig
+++ b/core/Term.zig
@@ -50,14 +50,9 @@ pub const Painted = iface.Painted;
pub const PaintedRow = iface.PaintedRow;
pub const ImagesAt = iface.ImagesAt;
pub const EchoCell = iface.EchoCell;
-pub const Peer = iface.Peer;
-pub const Applied = iface.Applied;
-pub const Encoder = iface.Encoder;
-pub const Track = iface.Track;
-pub const Replica = iface.Replica;
fn the() *const iface.Ops {
- return ops orelse unreachable; // no State, Encoder or Replica is made without it
+ return ops orelse unreachable; // no State is made without it
}
/// A terminal pane's terminal: the module's handle, and the walk's hooks
@@ -236,16 +231,11 @@ pub fn follow(s: *State) void {
the().follow(s.impl);
}
-/// Its grid reflowed, now or when `resizeDeferred` makes it.
-pub fn resize(s: *State, cols: u16, rows: u16, later: bool) void {
+/// Its grid reflowed.
+pub fn resize(s: *State, cols: u16, rows: u16) void {
writes +%= 1;
s.written = true;
- the().resize(s.impl, cols, rows, later);
-}
-
-pub fn resizeDeferred(s: *State) bool {
- writes +%= 1;
- return the().resizeDeferred(s.impl);
+ the().resize(s.impl, cols, rows);
}
/// Its cells' size in pixels (kitty graphics, CSI 14/16 t).
@@ -365,12 +355,6 @@ pub fn promptPrefix(tab: u16, s: ?*State, row: i32, raw: []const u8) usize {
};
}
-/// A step read its rows: its replicas must hold them for the step's
-/// replay.
-pub fn markRead(s: *State) void {
- the().markRead(s.impl);
-}
-
/// What a predicted echo reads of a cell of its active area.
pub fn echoCell(s: *const State, x: u16, y: u16) ?EchoCell {
return the().echoCell(s.impl, x, y);
@@ -425,84 +409,6 @@ pub fn hasImages(s: ?*const State) bool {
return o.hasImages(if (s) |state| state.impl else null);
}
-// ---- its replicas ----
-
-pub fn encoder(gpa: std.mem.Allocator) !*Encoder {
- return the().encoder(gpa);
-}
-
-pub fn encoderFree(e: *Encoder) void {
- the().encoderFree(e);
-}
-
-pub fn track(gpa: std.mem.Allocator) !*Track {
- return the().track(gpa);
-}
-
-/// A peer's track of it let go (`s` null: it is gone).
-pub fn untrack(t: *Track, gpa: std.mem.Allocator, s: ?*State) void {
- the().untrack(t, gpa, if (s) |state| state.impl else null);
-}
-
-/// What a peer is owed of it, a delta against what the peer was sent.
-pub fn encode(s: *State, e: *Encoder, t: *Track, peer: *Peer, out: *std.Io.Writer) !bool {
- return the().encode(s.impl, e, t, peer, out);
-}
-
-/// Rows of it a replica holds as holes.
-pub fn encodeRows(s: *State, e: *Encoder, t: *Track, lo: u64, hi: u64, out: *std.Io.Writer) !void {
- return the().encodeRows(s.impl, e, t, lo, hi, out);
-}
-
-/// Whether a step read its rows since `clearRead`.
-pub fn wasRead(s: *const State) bool {
- return the().wasRead(s.impl);
-}
-
-pub fn clearRead(s: *State) void {
- the().clearRead(s.impl);
-}
-
-/// A replica's side of one terminal: made, freed, where its active area
-/// begins, and the history rows it does not hold.
-pub fn replica(gpa: std.mem.Allocator) !*Replica {
- return the().replica(gpa);
-}
-
-pub fn replicaFree(r: *Replica, gpa: std.mem.Allocator) void {
- the().replicaFree(r, gpa);
-}
-
-pub fn replicaTop(r: *const Replica) u64 {
- return the().replicaTop(r);
-}
-
-pub fn missing(r: *const Replica, lo: u64, hi: u64, out: *std.ArrayList([2]u64), gpa: std.mem.Allocator) !void {
- return the().missing(r, lo, hi, out, gpa);
-}
-
-/// A replica's side: a delta applied, rows applied, the rows its view
-/// shows, rows blank until they come.
-pub fn apply(s: *State, r: *Replica, bytes: []const u8) !Applied {
- return the().apply(s.impl, r, bytes);
-}
-
-pub fn applyRows(s: *State, r: *Replica, bytes: []const u8) !void {
- return the().applyRows(s.impl, r, bytes);
-}
-
-pub fn shown(s: *State, r: *const Replica) [2]u64 {
- return the().shown(s.impl, r);
-}
-
-pub fn blank(s: *State, r: *const Replica, lo: u64, hi: u64) void {
- the().blank(s.impl, r, lo, hi);
-}
-
-pub fn dumpScreen(s: *State, w: *std.Io.Writer) !void {
- return the().dumpScreen(s.impl, w);
-}
-
// ---- a core without a terminal (core-test's) ----
test "a core without a terminal boots to a scratch pane" {