2024-01-18 04:52:33 +01:00
|
|
|
const std = @import("std");
|
|
|
|
const Tty = @import("tty/Tty.zig");
|
2024-01-19 02:02:59 +01:00
|
|
|
const odditui = @import("odditui.zig");
|
2024-01-18 04:52:33 +01:00
|
|
|
|
2024-01-19 02:02:59 +01:00
|
|
|
const log = std.log.scoped(.main);
|
2024-01-18 04:52:33 +01:00
|
|
|
pub fn main() !void {
|
2024-01-19 02:02:59 +01:00
|
|
|
var app: odditui.App(Event) = try odditui.App(Event).init(.{});
|
2024-01-18 04:52:33 +01:00
|
|
|
|
2024-01-19 02:02:59 +01:00
|
|
|
try app.start();
|
2024-01-18 04:52:33 +01:00
|
|
|
|
2024-01-19 02:02:59 +01:00
|
|
|
while (true) {
|
|
|
|
const event = app.nextEvent();
|
|
|
|
log.debug("event: {}", .{event});
|
|
|
|
}
|
2024-01-18 04:52:33 +01:00
|
|
|
|
2024-01-19 02:02:59 +01:00
|
|
|
app.stop();
|
2024-01-18 04:52:33 +01:00
|
|
|
}
|
|
|
|
|
2024-01-18 23:16:21 +01:00
|
|
|
const Event = union(enum) {
|
|
|
|
key: u8,
|
|
|
|
mouse: u8,
|
|
|
|
};
|
|
|
|
|
|
|
|
fn eventCallback(_: Event) void {}
|
|
|
|
|
2024-01-18 04:52:33 +01:00
|
|
|
test "simple test" {
|
2024-01-18 23:16:21 +01:00
|
|
|
_ = @import("odditui.zig");
|
|
|
|
_ = @import("queue.zig");
|
2024-01-18 04:52:33 +01:00
|
|
|
}
|