summaryrefslogtreecommitdiff
path: root/core/panes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/panes.zig')
-rw-r--r--core/panes.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/panes.zig b/core/panes.zig
index cdc28dba..dd36839a 100644
--- a/core/panes.zig
+++ b/core/panes.zig
@@ -38,6 +38,21 @@ pub const Pane = struct {
// it there).
.alloc = .{ .{ "addon", "image" }, .{ "pdf", "image" }, .{ "terminal", "terminal" } },
};
+ /// A pane's slot in `Pardes.panes`, as it crosses the core's edge: an
+ /// entry's argument or answer, an event's, an effect's, a host call's.
+ /// A type of its own, so a view's slot (`View.Id`) is not taken for
+ /// it; the core's own loops and tables keep their integers.
+ pub const Id = enum(u8) {
+ _,
+ /// The id of slot `i`, a slot the core holds.
+ pub fn at(i: usize) Id {
+ return @fromBackingInt(@intCast(i));
+ }
+ /// The slot, to index the core's tables with.
+ pub fn index(id: Id) u8 {
+ return @backingInt(id);
+ }
+ };
/// The words that throw unsaved text away (builtins.zig warnModified).
pub const Discarding = enum { Exit, Restore, get, Del, Delcol };