summaryrefslogtreecommitdiff
path: root/src/pdf.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-31 06:28:48 -0300
committerGabriel Schneider <[email protected]>2026-10-31 06:28:48 -0300
commita479792a1ab2b593642d7f648194bfa23ce01dba (patch)
tree96ddee7d879a9084daa07db43b0b7910b072a785 /src/pdf.zig
parente179cc44fe5060c76a5b00c41e53f11209f5acd9 (diff)
parent4c761893e5b3fdae422622cfa02104ab36633045 (diff)
downloadpardes-a479792a1ab2b593642d7f648194bfa23ce01dba.tar.gz
pardes-a479792a1ab2b593642d7f648194bfa23ce01dba.zip
Merge the upstream daemon and replicated client/server refactor
Diffstat (limited to 'src/pdf.zig')
-rw-r--r--src/pdf.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pdf.zig b/src/pdf.zig
index 18037bb7..262af8b9 100644
--- a/src/pdf.zig
+++ b/src/pdf.zig
@@ -700,9 +700,14 @@ test "oriented selection containment delegates to MuPDF quad geometry" {
}
pub const Document = struct {
- handle: *c.pardes_pdf_document,
+ /// None in a document loaded from a dump until its PDF is opened again
+ /// (pdf_view.reopen).
+ handle: ?*c.pardes_pdf_document = null,
pages: usize,
+ /// The open document is MuPDF's, made from the file's bytes (src/walk.zig).
+ pub const replica = .{ .derived = .{"handle"} };
+
pub fn deinit(document: *Document) void {
c.pardes_pdf_close(document.handle);
document.* = undefined;