aboutsummaryrefslogtreecommitdiff
path: root/src/object.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/object.zig')
-rw-r--r--src/object.zig9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/object.zig b/src/object.zig
index 0751859..14089c1 100644
--- a/src/object.zig
+++ b/src/object.zig
@@ -3,11 +3,12 @@ const wayland = @import("root.zig");
const Self = @This();
+pub const Ref = usize;
+
const VTable = struct {
on_event: *const fn (ptr: *anyopaque, ctx: *wayland.Context, opcode: u16, args: []const u8) void,
};
-id: ?u32 = null,
ptr: ?*anyopaque,
vtable: VTable,
@@ -28,6 +29,10 @@ pub inline fn from_self(ptr: anytype) Self {
};
}
+pub fn disable(self: *Self) void {
+ self.ptr = null;
+}
+
pub fn format(
self: *const Self,
comptime fmt: []const u8,
@@ -37,5 +42,5 @@ pub fn format(
_ = fmt;
_ = options;
- try writer.print("Object {{ {?} }}", .{self.id});
+ try writer.print("Object {{ {?} }}", .{self.ptr});
}