|
|
|
@ -26,13 +26,17 @@ test {
|
|
|
|
|
/// zz.createPlugin(@This());
|
|
|
|
|
/// }
|
|
|
|
|
///
|
|
|
|
|
/// pub const zellij_version = "0.33.0";
|
|
|
|
|
/// pub const zellij_version = "0.34.0";
|
|
|
|
|
///
|
|
|
|
|
/// pub fn init() void {}
|
|
|
|
|
/// pub fn update(event: zz.Event) void {
|
|
|
|
|
/// pub fn update(event: zz.Event) bool {
|
|
|
|
|
/// var event = zz.getEvent(gpa.allocator()) catch return;
|
|
|
|
|
/// defer event.deinit();
|
|
|
|
|
///
|
|
|
|
|
/// // use event
|
|
|
|
|
///
|
|
|
|
|
/// // return true to request render
|
|
|
|
|
/// return true;
|
|
|
|
|
/// }
|
|
|
|
|
/// pub fn render(rows: i32, cols: i32) void {}
|
|
|
|
|
/// ```
|
|
|
|
@ -40,7 +44,7 @@ pub fn createPlugin(comptime Plugin: type) void {
|
|
|
|
|
if (@TypeOf(Plugin.init) != fn () void)
|
|
|
|
|
@compileError("Function 'init' has invalid signature!");
|
|
|
|
|
|
|
|
|
|
if (@TypeOf(Plugin.update) != fn () void)
|
|
|
|
|
if (@TypeOf(Plugin.update) != fn () bool)
|
|
|
|
|
@compileError("Function 'update' has invalid signature!");
|
|
|
|
|
|
|
|
|
|
if (@TypeOf(Plugin.render) != fn (i32, i32) void)
|
|
|
|
@ -55,8 +59,8 @@ pub fn createPlugin(comptime Plugin: type) void {
|
|
|
|
|
Plugin.render(rows, cols);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export fn update() void {
|
|
|
|
|
Plugin.update();
|
|
|
|
|
export fn update() bool {
|
|
|
|
|
return Plugin.update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export fn plugin_version() void {
|
|
|
|
|