summaryrefslogtreecommitdiff
path: root/src/kinds/addon.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/kinds/addon.zig')
-rw-r--r--src/kinds/addon.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/kinds/addon.zig b/src/kinds/addon.zig
index 54f26893..557547f6 100644
--- a/src/kinds/addon.zig
+++ b/src/kinds/addon.zig
@@ -45,7 +45,9 @@ comptime {
/// `ctl`; `leader` is the keys after Space that run it ("ng": SPC n g).
pub const Word = struct { name: [:0]const u8, leader: ?[:0]const u8 = null, arg: enum(u8) { none, optional, required } = .none, opens: bool = false, doc: [:0]const u8 = "" };
/// `pictures`: its panes place pictures, and their tag says how they show.
-pub const Head = struct { name: []const u8, version: u32, exts: [:0]const u8 = "", words: []const Word = &.{}, pictures: bool = false };
+/// `plain`: PA_PLAIN, the kind is its extern struct and its step pure (the
+/// header says what that promises): a client runs it itself.
+pub const Head = struct { name: []const u8, version: u32, exts: [:0]const u8 = "", words: []const Word = &.{}, pictures: bool = false, plain: bool = false };
/// pardes's side, kept from init: about the pane of the current call.
pub var api: *const c.pa_api = undefined;
@@ -352,7 +354,7 @@ pub fn ops(comptime T: type) c.pa_ops {
if (T.head.name.len > 15) @compileError(@typeName(T) ++ "'s name " ++ T.head.name ++ " is over 15 bytes");
var name: [16]u8 = @splat(0);
@memcpy(name[0..T.head.name.len], T.head.name);
- var o: c.pa_ops = .{ .init = F.init, .open = F.open, .paint = F.paint, .head = .{ .size = @sizeOf(c.pa_head), .abi = c.PA_ABI, .name = name, .version = T.head.version, .flags = if (T.head.pictures) c.PA_PICTURES else 0, .exts = T.head.exts, .words = &F.words, .nwords = F.words.len } };
+ var o: c.pa_ops = .{ .init = F.init, .open = F.open, .paint = F.paint, .head = .{ .size = @sizeOf(c.pa_head), .abi = c.PA_ABI, .name = name, .version = T.head.version, .flags = (if (T.head.pictures) c.PA_PICTURES else 0) | (if (T.head.plain) c.PA_PLAIN else 0), .exts = T.head.exts, .words = &F.words, .nwords = F.words.len } };
// The kind's function, then the pa_ops field its wrapper fills.
const fns = .{
.{ "close", "close" }, .{ "tick", "tick" }, .{ "prefix", "tick" }, .{ "view", "view" }, .{ "key", "key" },