summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig30
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;