const std = @import("std"); const wayland = @import("../root.zig"); const wl = wayland.wl; const log = std.log.scoped(.callback); const Self = @This(); pub const Events = wayland.EventSet(Self, .{done}); is_done: *bool, handle: wayland.Object.Ref, pub fn init( self: *Self, ctx: wayland.Context, is_done: *bool, ) !void { self.is_done = is_done; self.handle = try ctx.display.registry.add_object( ctx.allocator, wayland.Object.from_self(self), ); try ctx.display.request(ctx.display, .{ .sync = .{self.handle} }); } pub fn deinit(self: *Self, ctx: wayland.Context) void { ctx.display.registry.disable_object(self.handle); } fn done(self: *Self, ctx: wayland.Context, value: u32) void { _ = value; _ = ctx; self.is_done.* = true; }