summaryrefslogtreecommitdiff
path: root/abi
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-26 11:29:28 -0300
committerGabriel Schneider <[email protected]>2026-11-26 11:29:40 -0300
commit3d60aa05ec1a6f9ed535186be6c6c2850c71b24d (patch)
treee55587fb9d1ec5f55c55fa81b7d81f3a91bf5375 /abi
parentadd0837dc1927389096cbaaf65b7e1a42028eafc (diff)
parent8723462d8e02bc9d78b5004de38b910e83540575 (diff)
downloadpardes-3d60aa05ec1a6f9ed535186be6c6c2850c71b24d.tar.gz
pardes-3d60aa05ec1a6f9ed535186be6c6c2850c71b24d.zip
merge: L2a (tags, grips, band, notice onto chrome) + M2's fix + FP (PDF leaks, spawn stop, PDF hits)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'abi')
-rw-r--r--abi/addon.zig12
-rw-r--r--abi/pardes_addon.h7
2 files changed, 14 insertions, 5 deletions
diff --git a/abi/addon.zig b/abi/addon.zig
index 53227fbb..dfbac270 100644
--- a/abi/addon.zig
+++ b/abi/addon.zig
@@ -37,9 +37,9 @@ pub const c = @import("pardes_addon");
const Allocator = std.mem.Allocator;
/// The ABI this file speaks: a header of another needs it brought along.
-pub const abi = 0x30003;
+pub const abi = 0x30004;
comptime {
- if (c.PA_ABI != abi) @compileError("addon.zig speaks ABI 3.3 and the header another");
+ if (c.PA_ABI != abi) @compileError("addon.zig speaks ABI 3.4 and the header another");
}
/// A word the kind brings: `opens` a pane of it, else goes to the pane's
@@ -160,6 +160,10 @@ pub const Window = struct {
/// The view painted (View.id), and whether it shows pictures as glyph art.
view: u8,
glyphs: bool,
+ /// The theme's search hits and the current one (a pardes older than
+ /// ABI 3.4: the amber its PDFs drew them in).
+ hit: Color,
+ hit_current: Color,
/// `text` (UTF-8) from column x of row y on, a character a cell, cut at
/// the edge: column first, where the header's pa_put is row first.
@@ -315,7 +319,9 @@ pub fn ops(comptime T: type) c.pa_ops {
if (@hasDecl(T, "prefix")) t.*.prefix_len = write(T.prefix, s, &t.*.prefix, t.*.prefix.len);
}
fn paint(st: ?*anyopaque, w: [*c]const c.pa_window, out: [*c]c.pa_paint) callconv(.c) void {
- T.paint(self(st) orelse return, .{ .cells = w.*.cells, .stride = w.*.stride, .cols = w.*.cols, .rows = w.*.rows, .cell_w = w.*.cell_w, .cell_h = w.*.cell_h, .focused = w.*.focused != 0, .view = w.*.view, .glyphs = w.*.glyphs != 0 }, .{ .out = out });
+ const amber: Color = .rgb(0xff, 0xd5, 0x4f);
+ const hits = api.abi >= 0x30004;
+ T.paint(self(st) orelse return, .{ .cells = w.*.cells, .stride = w.*.stride, .cols = w.*.cols, .rows = w.*.rows, .cell_w = w.*.cell_w, .cell_h = w.*.cell_h, .focused = w.*.focused != 0, .view = w.*.view, .glyphs = w.*.glyphs != 0, .hit = if (hits) @fromBackingInt(w.*.hit) else amber, .hit_current = if (hits) @fromBackingInt(w.*.hit_current) else amber }, .{ .out = out });
}
fn view(st: ?*anyopaque, v: [*c]const c.pa_view) callconv(.c) void {
T.view(self(st) orelse return, @as(*const View, @ptrCast(v)).*);
diff --git a/abi/pardes_addon.h b/abi/pardes_addon.h
index d8257a0b..e467a239 100644
--- a/abi/pardes_addon.h
+++ b/abi/pardes_addon.h
@@ -37,7 +37,7 @@
/* Major in the high half: an addon of another major is refused. */
#define PA_ABI_MAJOR 3u
-#define PA_ABI_MINOR 3u
+#define PA_ABI_MINOR 4u
#define PA_ABI ((PA_ABI_MAJOR << 16) | PA_ABI_MINOR)
#define PA_OK 0
#define PA_RASTER_MAX (32u << 20) /* a placement's w*h*4 above this is dropped, said once */
@@ -83,6 +83,9 @@ typedef struct pa_window {
* `view`: the id of the view painted (pa_view's), whose layout paint
* draws; `glyphs`: it shows pictures as glyph art. */
uint8_t focused, view, glyphs, pad;
+ /* Since 3.4 (check api->abi): the theme's search hits, and the current
+ * one, as the body draws them (PA_RGB). */
+ uint32_t hit, hit_current;
} pa_window;
typedef struct pa_rect { uint32_t x, y, w, h; } pa_rect; /* pixels */
@@ -390,7 +393,7 @@ typedef struct pa_ops {
* copy of this header that disagrees does not compile. */
#if UINTPTR_MAX == 0xffffffffffffffffu
_Static_assert(sizeof(pa_cell) == 20, "pa_cell");
-_Static_assert(sizeof(pa_window) == 24, "pa_window");
+_Static_assert(sizeof(pa_window) == 32, "pa_window");
_Static_assert(sizeof(pa_rect) == 16 && sizeof(pa_cells) == 8, "pa_rect");
_Static_assert(sizeof(pa_placement) == 80, "pa_placement");
_Static_assert(sizeof(pa_paint) == 48 && sizeof(pa_view) == 32 && sizeof(pa_tick) == 128, "pa_paint");