diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-06 06:24:42 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-06 11:19:44 -0300 |
| commit | c1917b949b9580de8bf0977874a210f0266812da (patch) | |
| tree | 447dd2235ea00634f662cd3becf4bceb8a895f41 /src/pardes.zig | |
| parent | 76c55b5bce0f181b0b15b16596c900397dfef544 (diff) | |
| download | pardes-c1917b949b9580de8bf0977874a210f0266812da.tar.gz pardes-c1917b949b9580de8bf0977874a210f0266812da.zip | |
kinds #14, the core's PDF code gone: pdf.zig and pdf_view.zig leave and every pdf_enabled branch with them; look, Jump, Recent, dumps (one from before the addon opens as its pane), the watch, mouse, keys, the rail and the tag go through Kind for any kind's pane; test/pdf.zig's behaviours are T1 cases over 9P (addons_pdf.zig) and pane cases (a Shadow over a replica, a file changed under it), the harnesses load pdf.so by path
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index 58f8fa17..ecbc0633 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -69,8 +69,6 @@ pub const builtins_json = @import("builtins_json.zig"); const limits = memory.limits; const selection_pipe = @import("selection_pipe.zig"); pub const config = @import("config.zig"); -pub const pdf_enabled = panes.Pdf.enabled; -pub const pdf = panes.Pdf.pdf; pub const memory = @import("memory.zig"); pub const tape = @import("tape.zig"); pub const walk = @import("walk.zig"); @@ -111,24 +109,15 @@ pub const can_attach = platform == .tui or platform == .gui; pub const fonts = if (font_picker) @import("fonts.zig") else struct {}; -pub const PdfRasterPolicy = panes.Pdf.RasterPolicy; - -pub const kitty_pdf_raster_policy: PdfRasterPolicy = .{ - .dpi = 96, - .max_dimension = 1200, - .match_viewport = false, -}; -pub const sdl_pdf_raster_policy: PdfRasterPolicy = .{ - .dpi = 192, - .max_dimension = 4096, - .match_viewport = true, -}; -pub const pdf_raster_policy: PdfRasterPolicy = switch (platform) { - .tui => kitty_pdf_raster_policy, - // Both pixel shells rasterize for a real display and can afford it; the - // wire-bandwidth argument that shapes the Kitty policy does not apply. - .gui, .macos => sdl_pdf_raster_policy, -}; +/// The raster a frontend wants a kind's picture at (Kind.viewOf, a +/// `pa_view`): a terminal's kitty images go down a wire, so smaller; a +/// window rasterizes for its display. +pub const RasterPolicy = struct { dpi: u16, max_dimension: u16, match_viewport: bool }; +/// A view's: a window's denser than a terminal's. By the view's frontend, +/// never the build's, so every core of a session asks a kind alike. +pub fn rasterPolicy(windowed: bool) RasterPolicy { + return if (windowed) .{ .dpi = 192, .max_dimension = 4096, .match_viewport = true } else .{ .dpi = 96, .max_dimension = 1200, .match_viewport = false }; +} pub const Pane = panes.Pane; const Text = panes.Text; @@ -149,7 +138,6 @@ pub const MAX_TAG_ROWS = 8; /// bands: a band to a tag, however many lines it has. pub const MAX_TAG_LAYERS = MAX_PANES + MAX_COLS + 1 + MAX_PANES * Pane.Notices.max; pub const NOTICE_LAYER_BASE = MAX_PANES + MAX_COLS + 1; -pub const PDF_PAGE_GAP_PX = panes.Pdf.page_gap_px; /// Columns a session holds (each costs about 8 KB of state, a column tag /// being most of it). pub const MAX_COLS = 16; |
