summaryrefslogtreecommitdiff
path: root/src/surface.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 14:37:29 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commitd88e381793c6505bf3f2af43705bd2fa32f55ef6 (patch)
treed4f3966c4eacf7fee43b6f18fc83f136676f835d /src/surface.zig
parent7284b72396398213356577345151bd79e497d27c (diff)
downloadpardes-d88e381793c6505bf3f2af43705bd2fa32f55ef6.tar.gz
pardes-d88e381793c6505bf3f2af43705bd2fa32f55ef6.zip
One Layer for tags, notices, headers and bodies; a taller tag is one layer of rows; wire v8
src/Layer.zig merges TagLayer and BodyLayer. `rows` (0 = no layer) and a cursor at {x, y}. A tag of N rows is ONE layer of N grid rows: tagHit answers the row as `line`, bodyHit keeps its meaning, and the per-line layer bases (TAG_LINE_LAYER_BASE, HEADER_LINE_LAYER_BASE) are gone, not aliased. Wire v8, the one bump: tag layers carry rows and cursor y, and the frame carries the placed region list. v7 and v9 peers are refused in both directions (server test over both, a new frontend test over both). web: tag_layer_value 11 = rows, 12 = cursor y; app.mjs lays every row. macOS: the Zig side compiles against Layer; pardes.h still sees one row per tag layer (accepted, the macOS shell is ignored for now). No visual change: snapshot goldens and the 17 GUI goldens byte-identical. Shared files touched: pardes.zig, Messages.zig, gui.zig, macos.zig, detached/client.zig, detached/server.zig, detached/wire.zig (plus web.zig, app.mjs, edit.zig, look.zig). Not touched: mouse.zig, tagline.zig, colors.zig, tty.zig, dump.zig, exec.zig, host_io.zig, panes.zig.
Diffstat (limited to 'src/surface.zig')
-rw-r--r--src/surface.zig15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/surface.zig b/src/surface.zig
index fec43e30..db7dd468 100644
--- a/src/surface.zig
+++ b/src/surface.zig
@@ -11,8 +11,7 @@ const config = @import("config.zig");
const pdf_enabled = panes.Pdf.enabled;
const image = @import("image.zig");
const MAX_PANES = pardes.MAX_PANES;
-const BodyLayer = @import("body_layer.zig").Layer;
-const TagLayer = @import("tag_layer.zig").Layer;
+const Layer = @import("Layer.zig");
const MAX_TAG_LAYERS = pardes.MAX_TAG_LAYERS;
const CellPixels = pardes.CellPixels;
@@ -380,8 +379,8 @@ pub const Surface = struct {
/// paint the quiet affordance can carry the hover bit through the ABI
/// without every selection painter learning a new parameter.
mark_hover: bool = false,
- body_layers: [MAX_PANES]BodyLayer = @splat(.{}),
- tag_layers: [MAX_TAG_LAYERS]TagLayer = @splat(.{}),
+ body_layers: [MAX_PANES]Layer = @splat(.{}),
+ tag_layers: [MAX_TAG_LAYERS]Layer = @splat(.{}),
cols: u16 = 0,
rows: u16 = 0,
regions: [MAX_REGIONS]Region = undefined,
@@ -394,15 +393,15 @@ pub const Surface = struct {
panel_tracks: [MAX_PANES * 2]animation.Track = undefined,
npanel_tracks: usize = 0,
previous_cells: []const Cell = &.{},
- previous_body_layers: []const BodyLayer = &.{},
- previous_tag_layers: []const TagLayer = &.{},
+ previous_body_layers: []const Layer = &.{},
+ previous_tag_layers: []const Layer = &.{},
cell_diffs: []const PanelCellDiff = &.{},
- pub fn tagLayers(s: *const Surface) []const TagLayer {
+ pub fn tagLayers(s: *const Surface) []const Layer {
return &s.tag_layers;
}
- pub fn bodyLayers(s: *const Surface) []const BodyLayer {
+ pub fn bodyLayers(s: *const Surface) []const Layer {
return &s.body_layers;
}