mirror of
https://github.com/MezzalunaWM/Mezzaluna.git
synced 2026-03-07 19:49:53 -05:00
lua api to interact with remote clients closes #10
This commit is contained in:
parent
d4a0abe762
commit
8e7423339c
2 changed files with 18 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ const Api = @import("Api.zig");
|
|||
const Hook = @import("Hook.zig");
|
||||
const View = @import("View.zig");
|
||||
const Output = @import("Output.zig");
|
||||
const Remote = @import("Remote.zig");
|
||||
|
||||
const gpa = std.heap.c_allocator;
|
||||
|
||||
|
|
@ -139,6 +140,11 @@ pub fn openLibs(self: *zlua.Lua) void {
|
|||
LuaUtils.newLib(self, output_funcs);
|
||||
self.setField(-2, "output");
|
||||
}
|
||||
{
|
||||
const remote_funcs = zlua.fnRegsFromType(Remote);
|
||||
LuaUtils.newLib(self, remote_funcs);
|
||||
self.setField(-2, "remote");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
12
src/lua/Remote.zig
Normal file
12
src/lua/Remote.zig
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
const Remote = @This();
|
||||
|
||||
const std = @import("std");
|
||||
const zlua = @import("zlua");
|
||||
|
||||
const LuaUtils = @import("LuaUtils.zig");
|
||||
const RemoteLua = @import("../RemoteLua.zig");
|
||||
|
||||
pub fn print(L: *zlua.Lua) i32 {
|
||||
RemoteLua.sendNewLogEntry(L.checkString(1));
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue