diff options
Diffstat (limited to 'docs/typ')
| -rw-r--r-- | docs/typ/reference.typ | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/docs/typ/reference.typ b/docs/typ/reference.typ index ff035fac..c66de5ad 100644 --- a/docs/typ/reference.typ +++ b/docs/typ/reference.typ @@ -980,9 +980,15 @@ in C or anything that speaks C, and links nothing of pardes: the records are the header's, and what pardes does for it (an allocation from the pane's arena, memory that outlives a call, a job off the loop, a Look or an Exec, a message, a new text pane, its selection) it is handed at load. -`addons/fake/fake.c` uses every function and `addons/snake/snake.c` is a -game in it; a kind with only a head and `paint` is a valid one. Pictures -are an addon too, `addons/image/image.c` (PNG, JPEG, GIF, BMP, PPM, PGM and +`addons/fake/fake.c` uses every function; a kind with only a head and +`paint` is a valid one. In Zig, `src/kinds/addon.zig` (over the same +header, and nothing of the core) makes the `pa_ops` from a struct of the +functions a kind has (`export const pardes_addon = addon.ops(Snake);`), +with the pane's arena as a `std.mem.Allocator`, typed keys, a window to +`put` text in, a deadline for `tick`, a struct's bytes as its record, and +its own `zig test` (`zig build addon-test` runs them): +`addons/snake/snake.zig` is a game in it. Pictures +are an addon too, `addons/image/image.zig` (PNG, JPEG, GIF, BMP, PPM, PGM and TGA through stb_image, at most 1280 pixels a side), which `zig build image` installs as `<prefix>/lib/pardes/addons/image.so`, and so are PDFs, `addons/pdf/pdf.c` over MuPDF (its pages rendered on jobs, two at once), |
