summaryrefslogtreecommitdiff
path: root/test/pdf.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/pdf.zig')
-rw-r--r--test/pdf.zig34
1 files changed, 17 insertions, 17 deletions
diff --git a/test/pdf.zig b/test/pdf.zig
index 2f14fb2f..b66db1df 100644
--- a/test/pdf.zig
+++ b/test/pdf.zig
@@ -45,7 +45,7 @@ const PdfLinkTests = struct {
const path = try std.fmt.allocPrint(std.testing.allocator, "{s}/links.pdf", .{dir_buf[0..len]});
defer std.testing.allocator.free(path);
const p = try Pardes.init(std.testing.allocator, .{ .file = path, .cols = 100, .rows = 36 });
- p.native_images = true;
+ p.frontend.native_images = true;
p.panes[0].?.pdf.?.fit = .height;
return p;
}
@@ -375,7 +375,7 @@ test "watched PDF reload replaces MuPDF state and preserves the reading view" {
const sections = p.panes[sections_id].?;
try std.testing.expect(sections.file.?.content.len > 0);
- p.native_images = true;
+ p.frontend.native_images = true;
state.fit = .height;
state.tint = .full;
state.pan_x = 1234;
@@ -492,7 +492,7 @@ test "PDF reload does not re-center an already revealed matching search" {
const path = try std.fmt.bufPrint(&path_buf, ".zig-cache/tmp/{s}/search.pdf", .{tmp.sub_path});
const p = try Pardes.init(gpa, .{ .file = path, .cols = 80, .rows = 28 });
defer p.deinit();
- p.native_images = true;
+ p.frontend.native_images = true;
const pane = p.panes[0].?;
const state = pane.pdf.?;
try state.setSearchQuery(p.pdf_gpa, "Pardes");
@@ -559,7 +559,7 @@ test "MuPDF pane renders, navigates, searches, and round-trips its page" {
try std.testing.expectEqualStrings(expected_tag, initial_tag);
try std.testing.expect(std.mem.endsWith(u8, initial_tag, pane_tail));
- p.native_images = true;
+ p.frontend.native_images = true;
var frame = std.heap.ArenaAllocator.init(gpa);
defer frame.deinit();
const first = try p.render(frame.allocator());
@@ -889,7 +889,7 @@ test "a fling's banded pages show the reader exactly what whole pages would" {
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .file = "docs/design.pdf", .cols = 120, .rows = 40 });
defer p.deinit();
- p.native_images = true;
+ p.frontend.native_images = true;
const pane = p.panes[0].?;
const pv = pane.pdf.?;
var frame = std.heap.ArenaAllocator.init(gpa);
@@ -993,7 +993,7 @@ test "a tall page is drawn at the display's resolution, in bands that are the wh
defer gpa.free(path);
const p = try Pardes.init(gpa, .{ .file = path, .cols = 120, .rows = 40 });
defer p.deinit();
- p.native_images = true;
+ p.frontend.native_images = true;
const pane = p.panes[0].?;
const pv = pane.pdf.?;
var frame = std.heap.ArenaAllocator.init(gpa);
@@ -1154,7 +1154,7 @@ test "Escape cancels PDF chrome in place, then leaves the pane; Shift-Escape lea
defer p.deinit();
const pane = p.panes[0].?;
const pv = pane.pdf.?;
- p.native_images = true;
+ p.frontend.native_images = true;
// A second pane, then focus it and come back: `Last` has somewhere to go
// and the PDF is where the keys land.
@@ -1214,7 +1214,7 @@ test "Escape cancels PDF chrome in place, then leaves the pane; Shift-Escape lea
try std.testing.expect(pv.selection != null);
// A text-only page shows neither: one Escape drops them and goes.
- p.native_images = false;
+ p.frontend.native_images = false;
p.update(.{ .key = .{ .cp = Key.escape } });
try std.testing.expectEqual(@as(usize, 0), p.active);
try pv.setSearchQuery(p.pdf_gpa, "Pardes");
@@ -1236,7 +1236,7 @@ test "PDF continuous strip renders every intersecting short page" {
const pane = p.panes[0].?;
const pv = pane.pdf.?;
try std.testing.expect(pv.page_count > 3);
- p.native_images = true;
+ p.frontend.native_images = true;
// A legal wide MediaBox can make more than three pages intersect one
// viewport. Seed tiny matching rasters so this tests transport/cache
@@ -1310,7 +1310,7 @@ test "PDF tint and tinted theme changes rebuild every visible raster only" {
defer p.deinit();
const pane = p.panes[0].?;
const pv = pane.pdf.?;
- p.native_images = true;
+ p.frontend.native_images = true;
var frame = std.heap.ArenaAllocator.init(gpa);
defer frame.deinit();
@@ -1433,7 +1433,7 @@ test "PDF resize preserves page-relative document position" {
defer p.deinit();
const pane = p.panes[0].?;
const pv = pane.pdf.?;
- p.native_images = true;
+ p.frontend.native_images = true;
var frame = std.heap.ArenaAllocator.init(gpa);
defer frame.deinit();
@@ -1484,7 +1484,7 @@ test "PDF pane geometry change preserves its page-relative position" {
p.sync(); // rects for the new column, exactly as the two-pane boot did
const pane = p.panes[0].?;
const pv = pane.pdf.?;
- p.native_images = true;
+ p.frontend.native_images = true;
var frame = std.heap.ArenaAllocator.init(gpa);
defer frame.deinit();
@@ -1536,7 +1536,7 @@ test "PDF n/N addresses and reveals distinct MuPDF hits on one page" {
defer p.deinit();
const pane = p.panes[0].?;
const pv = pane.pdf.?;
- p.native_images = true;
+ p.frontend.native_images = true;
var page_hits = try pv.document.search(gpa, 0, "Pardes");
defer page_hits.deinit(gpa);
@@ -1656,7 +1656,7 @@ test "PDF native mouse selection, Look, and highlights share page geometry" {
try std.testing.expect(pane.pdf.?.selection == null);
pane.sel[sel_slot].state = .none;
- p.native_images = true;
+ p.frontend.native_images = true;
_ = frame.reset(.retain_capacity);
const plain = try p.render(frame.allocator());
const plain_revision = plain.images.items[0].native.revision;
@@ -2027,7 +2027,7 @@ test "PDF Back and Forward clear selections and land on recorded pages" {
if (!pdf_enabled) return error.SkipZigTest;
const p = try Pardes.init(std.testing.allocator, .{ .file = "docs/design.pdf", .cols = 80, .rows = 28 });
defer p.deinit();
- p.native_images = true;
+ p.frontend.native_images = true;
const pane = p.panes[0].?;
const state = pane.pdf.?;
try std.testing.expect(state.page_count > 1);
@@ -2104,7 +2104,7 @@ test "a PDF's jumps: Back after a far jump returns to the exact offset, two plac
if (!pdf_enabled) return error.SkipZigTest;
const p = try Pardes.init(std.testing.allocator, .{ .file = jumpPdf(), .cols = 80, .rows = 28 });
defer p.deinit();
- p.native_images = true;
+ p.frontend.native_images = true;
const id = p.active;
const pane = p.panes[id].?;
const pv = pane.pdf.?;
@@ -2144,7 +2144,7 @@ test "a PDF's jumps: JumpScope file keeps to the PDF, and a closed PDF reopens a
const path = try std.fmt.bufPrint(&path_buf, "{s}/docs/design.pdf", .{cwd});
const p = try Pardes.init(std.testing.allocator, .{ .file = path, .cols = 80, .rows = 28 });
defer p.deinit();
- p.native_images = true;
+ p.frontend.native_images = true;
try std.testing.expectEqual(config.Runtime.JumpScope.file, p.settings.jump_scope);
const doc = p.active;
const pane = p.panes[doc].?;