switch to @This(); for output and server as they don't really have anything else

This commit is contained in:
Squibid 2025-10-16 18:15:21 -04:00
parent 0f13973300
commit d4efb73d5c
Signed by: squibid
GPG key ID: BECE5684D3C4005D
3 changed files with 110 additions and 112 deletions

View file

@ -1,7 +1,7 @@
const std = @import("std");
const wlr = @import("wlroots");
const Server = @import("server.zig").Server;
const Server = @import("server.zig");
const gpa = std.heap.c_allocator;

View file

@ -1,3 +1,5 @@
const Output = @This();
const std = @import("std");
const posix = std.posix;
const gpa = std.heap.c_allocator;
@ -5,9 +7,8 @@ const gpa = std.heap.c_allocator;
const wl = @import("wayland").server.wl;
const wlr = @import("wlroots");
const Server = @import("server.zig").Server;
const Server = @import("server.zig");
pub const Output = struct {
server: *Server,
wlr_output: *wlr.Output,
@ -67,4 +68,3 @@ pub const Output = struct {
gpa.destroy(output);
}
};

View file

@ -1,29 +1,28 @@
const Server = @This();
const std = @import("std");
const gpa = std.heap.c_allocator;
const wl = @import("wayland").server.wl;
const wlr = @import("wlroots");
const Output = @import("output.zig").Output;
const Output = @import("output.zig");
pub const Server = struct {
allocator: *wlr.Allocator,
wl_server: *wl.Server,
event_loop: *wl.EventLoop,
shm: *wlr.Shm,
scene: *wlr.Scene,
output_layout: *wlr.OutputLayout,
scene_output_layout: *wlr.SceneOutputLayout,
xdg_shell: *wlr.XdgShell,
seat: *wlr.Seat,
session: ?*wlr.Session,
backend: *wlr.Backend,
renderer: *wlr.Renderer,
compositor: *wlr.Compositor,
event_loop: *wl.EventLoop,
output_layout: *wlr.OutputLayout,
renderer: *wlr.Renderer,
scene: *wlr.Scene,
scene_output_layout: *wlr.SceneOutputLayout,
seat: *wlr.Seat,
session: ?*wlr.Session,
shm: *wlr.Shm,
wl_server: *wl.Server,
xdg_shell: *wlr.XdgShell,
// Listeners
new_output: wl.Listener(*wlr.Output) = .init(newOutput),
pub fn init(server: *Server) !void {
@ -83,4 +82,3 @@ pub const Server = struct {
return;
};
}
};