aboutsummaryrefslogtreecommitdiff
path: root/src/wl/callback.zig
blob: dc9028dc104cfe1e3d6db762cb0dbcf893f25acb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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 = .null,
init: wayland.Object.interface.Init(Self) = .{},

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;
}