diff --git a/src/types/drm.zig b/src/types/drm.zig new file mode 100644 index 0000000..e899de5 --- /dev/null +++ b/src/types/drm.zig @@ -0,0 +1,24 @@ +const wlr = @import("../wlroots.zig"); + +const wayland = @import("wayland"); +const wl = wayland.server.wl; + +pub const Drm = extern struct { + global: *wl.Global, + + events: extern struct { + destroy: wl.Signal(void), + }, + + // private state + + node_name: [*:0]u8, + formats: wlr.DrmFormatSet, + + server_destroy: wl.Listener(*wl.Server), + + extern fn wlr_drm_create(server: *wl.Server, renderer: *wlr.Renderer) ?*Drm; + pub fn create(server: *wl.Server, renderer: *wlr.Renderer) !*Drm { + return wlr_drm_create(server, renderer) orelse error.WlrDrmCreateFailed; + } +}; diff --git a/src/wlroots.zig b/src/wlroots.zig index d616e19..00b0f66 100644 --- a/src/wlroots.zig +++ b/src/wlroots.zig @@ -15,6 +15,8 @@ pub const Swapchain = opaque {}; pub const DrmFormat = @import("render/drm_format_set.zig").DrmFormat; pub const DrmFormatSet = @import("render/drm_format_set.zig").DrmFormatSet; +pub const Drm = @import("types/drm.zig").Drm; + pub const FractionalScaleManagerV1 = @import("types/fractional_scale_v1.zig").FractionalScaleManagerV1; pub const ShmAttributes = @import("types/buffer.zig").ShmAttributes;