diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-11-04 00:23:21 +0100 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-12-13 22:53:33 +0100 |
| commit | 20d804cdb5b4874a0ee168cd8db67caf0c841772 (patch) | |
| tree | 18bf003b6d37480919bba7e1852e611c9fe8411c /riverctl | |
| parent | 0c5e5a7b4a4cbd56ca797698feb7ac85b22db647 (diff) | |
| download | river-20d804cdb5b4874a0ee168cd8db67caf0c841772.tar.gz river-20d804cdb5b4874a0ee168cd8db67caf0c841772.tar.xz | |
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!
Diffstat (limited to 'riverctl')
| -rw-r--r-- | riverctl/main.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/riverctl/main.zig b/riverctl/main.zig index e3453eb..dad41ea 100644 --- a/riverctl/main.zig +++ b/riverctl/main.zig @@ -19,10 +19,10 @@ const std = @import("std"); const wayland = @import("wayland"); const wl = wayland.client.wl; -const river = wayland.client.river; +const zriver = wayland.client.zriver; const SetupContext = struct { - river_control: ?*river.ControlV1 = null, + river_control: ?*zriver.ControlV1 = null, seat: ?*wl.Seat = null, }; @@ -54,17 +54,17 @@ pub fn main() !void { fn registryListener(registry: *wl.Registry, event: wl.Registry.Event, context: *SetupContext) void { switch (event) { .global => |global| { - if (context.seat == null and std.cstr.cmp(global.interface, wl.Seat.interface().name) == 0) { + if (context.seat == null and std.cstr.cmp(global.interface, wl.Seat.getInterface().name) == 0) { context.seat = registry.bind(global.name, wl.Seat, 1) catch return; - } else if (std.cstr.cmp(global.interface, river.ControlV1.interface().name) == 0) { - context.river_control = registry.bind(global.name, river.ControlV1, 1) catch return; + } else if (std.cstr.cmp(global.interface, zriver.ControlV1.getInterface().name) == 0) { + context.river_control = registry.bind(global.name, zriver.ControlV1, 1) catch return; } }, .global_remove => {}, } } -fn callbackListener(callback: *river.CommandCallbackV1, event: river.CommandCallbackV1.Event, _: ?*c_void) void { +fn callbackListener(callback: *zriver.CommandCallbackV1, event: zriver.CommandCallbackV1.Event, _: ?*c_void) void { switch (event) { .success => |success| { if (std.mem.len(success.output) > 0) { |
