mirror of
https://github.com/MezzalunaWM/Mezzaluna.git
synced 2026-03-07 19:49:53 -05:00
switch to @This(); for output and server as they don't really have anything else
This commit is contained in:
parent
0f13973300
commit
d4efb73d5c
3 changed files with 110 additions and 112 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const wlr = @import("wlroots");
|
const wlr = @import("wlroots");
|
||||||
|
|
||||||
const Server = @import("server.zig").Server;
|
const Server = @import("server.zig");
|
||||||
|
|
||||||
const gpa = std.heap.c_allocator;
|
const gpa = std.heap.c_allocator;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
const Output = @This();
|
||||||
|
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const posix = std.posix;
|
const posix = std.posix;
|
||||||
const gpa = std.heap.c_allocator;
|
const gpa = std.heap.c_allocator;
|
||||||
|
|
@ -5,9 +7,8 @@ const gpa = std.heap.c_allocator;
|
||||||
const wl = @import("wayland").server.wl;
|
const wl = @import("wayland").server.wl;
|
||||||
const wlr = @import("wlroots");
|
const wlr = @import("wlroots");
|
||||||
|
|
||||||
const Server = @import("server.zig").Server;
|
const Server = @import("server.zig");
|
||||||
|
|
||||||
pub const Output = struct {
|
|
||||||
server: *Server,
|
server: *Server,
|
||||||
wlr_output: *wlr.Output,
|
wlr_output: *wlr.Output,
|
||||||
|
|
||||||
|
|
@ -67,4 +68,3 @@ pub const Output = struct {
|
||||||
|
|
||||||
gpa.destroy(output);
|
gpa.destroy(output);
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,28 @@
|
||||||
|
const Server = @This();
|
||||||
|
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const gpa = std.heap.c_allocator;
|
const gpa = std.heap.c_allocator;
|
||||||
|
|
||||||
const wl = @import("wayland").server.wl;
|
const wl = @import("wayland").server.wl;
|
||||||
const wlr = @import("wlroots");
|
const wlr = @import("wlroots");
|
||||||
|
|
||||||
const Output = @import("output.zig").Output;
|
const Output = @import("output.zig");
|
||||||
|
|
||||||
pub const Server = struct {
|
|
||||||
allocator: *wlr.Allocator,
|
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,
|
backend: *wlr.Backend,
|
||||||
renderer: *wlr.Renderer,
|
|
||||||
|
|
||||||
compositor: *wlr.Compositor,
|
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),
|
new_output: wl.Listener(*wlr.Output) = .init(newOutput),
|
||||||
|
|
||||||
pub fn init(server: *Server) !void {
|
pub fn init(server: *Server) !void {
|
||||||
|
|
@ -83,4 +82,3 @@ pub const Server = struct {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue