code: switch to custom wlroots/libwayland bindings

This is a big step up over @cImport() for ergonomics and type safety.
Nearly all void pointer casts have been eliminated!
This commit is contained in:
Isaac Freund
2020-11-04 00:23:21 +01:00
parent 0c5e5a7b4a
commit 20d804cdb5
42 changed files with 1457 additions and 1874 deletions

View File

@ -16,6 +16,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
const std = @import("std");
const wlr = @import("wlroots");
const c = @import("c.zig");
const log = @import("log.zig");
@ -93,14 +94,11 @@ pub fn main() anyerror!void {
}
}
c.wlr_log_init(
switch (log.level) {
.debug => .WLR_DEBUG,
.notice, .info => .WLR_INFO,
.warn, .err, .crit, .alert, .emerg => .WLR_ERROR,
},
null,
);
wlr.log.init(switch (log.level) {
.debug => .debug,
.notice, .info => .info,
.warn, .err, .crit, .alert, .emerg => .err,
});
log.info(.server, "initializing", .{});
@ -136,7 +134,7 @@ pub fn main() anyerror!void {
log.info(.server, "running...", .{});
server.run();
server.wl_server.run();
log.info(.server, "shutting down", .{});
}