From a46436e58beaaa322c082af5e886f96fd31d7a08 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sat, 30 Aug 2025 15:49:18 +0200 Subject: Use mix-in design for interface abstraction. --- src/wl/surface.zig | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/wl/surface.zig') diff --git a/src/wl/surface.zig b/src/wl/surface.zig index 07cd80b..4405c96 100644 --- a/src/wl/surface.zig +++ b/src/wl/surface.zig @@ -26,21 +26,11 @@ pub const Events = wayland.EventSet(Self, .{ }); handle: wayland.Object.Ref, +init: wayland.Object.interface.Init(Self) = .{}, + preferred_buffer_scale: u32 = 1, preferred_buffer_transform: wl.Output.Transform = .normal, -pub fn init( - self: *Self, - ctx: wayland.Context, -) !void { - self.* = .{ - .handle = try ctx.display.registry.add_object( - ctx.allocator, - wayland.Object.from_self(self), - ), - }; -} - pub fn deinit( self: *Self, ctx: wayland.Context, -- cgit v1.2.3-70-g09d2