summaryrefslogtreecommitdiff
path: root/src/web.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/web.zig')
-rw-r--r--src/web.zig20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/web.zig b/src/web.zig
index d642e108..3a9446b6 100644
--- a/src/web.zig
+++ b/src/web.zig
@@ -105,8 +105,8 @@ const State = struct {
frame_rows: u16 = 0,
fn init(cols: u16, rows: u16) !State {
- const allocs = pardes.allocators.init(gpa);
- errdefer pardes.allocators.deinit();
+ const allocs = pardes.memory.init(gpa);
+ errdefer pardes.memory.deinit();
pardes.image.start(std.Io.failing, allocs.image);
errdefer pardes.image.stop();
if (comptime pardes.pdf_enabled) pardes.pdf.start(allocs.pdf);
@@ -131,7 +131,7 @@ const State = struct {
pardes.image.stop();
if (comptime pardes.pdf_enabled) pardes.pdf.stop();
pardes.syntax.stop();
- pardes.allocators.deinit();
+ pardes.memory.deinit();
}
};
@@ -340,12 +340,12 @@ extern "pardes" fn host_download(
) callconv(.c) void;
const vtable: pardes.Host.VTable = .{
- .push_present = present,
- .push_write_file = writeFile,
- .push_write_dump = writeDump,
- .push_set_clipboard = setClipboard,
- .pull_read_clipboard = readClipboard,
- .push_open_link = openLink,
+ .present = present,
+ .write_file = writeFile,
+ .write_dump = writeDump,
+ .set_clipboard = setClipboard,
+ .read_clipboard = readClipboard,
+ .open_link = openLink,
};
fn host(s: *State) pardes.Host {
@@ -391,6 +391,8 @@ fn present(ctx: ?*anyopaque, surface: *const pardes.Surface) void {
}
fn writeFile(_: ?*anyopaque, _: u8, path: []const u8, bytes: []const u8) void {
+ // A download the browser has been handed IS the save here: there is no
+ // filesystem to fail against, so there is no `saveFailed` to report.
host_download(path.ptr, path.len, bytes.ptr, bytes.len);
}