diff --git a/build.zig b/build.zig index d98e091..a7898f9 100644 --- a/build.zig +++ b/build.zig @@ -26,6 +26,7 @@ pub fn build(b: *std.Build) void { scanner.addSystemProtocol("unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml"); scanner.addSystemProtocol("staging/cursor-shape/cursor-shape-v1.xml"); scanner.addSystemProtocol("staging/tearing-control/tearing-control-v1.xml"); + scanner.addSystemProtocol("staging/content-type/content-type-v1.xml"); scanner.addCustomProtocol(b.path("protocol/wlr-layer-shell-unstable-v1.xml")); scanner.addCustomProtocol(b.path("protocol/wlr-output-power-management-unstable-v1.xml")); @@ -50,6 +51,7 @@ pub fn build(b: *std.Build) void { scanner.generate("zwp_linux_dmabuf_v1", 4); scanner.generate("wp_cursor_shape_manager_v1", 1); scanner.generate("wp_tearing_control_manager_v1", 1); + scanner.generate("wp_content_type_manager_v1", 1); scanner.generate("zwlr_layer_shell_v1", 4); scanner.generate("zwlr_output_power_manager_v1", 1); diff --git a/src/types/content_type_v1.zig b/src/types/content_type_v1.zig new file mode 100644 index 0000000..2b637e9 --- /dev/null +++ b/src/types/content_type_v1.zig @@ -0,0 +1,23 @@ +const wlr = @import("../wlroots.zig"); + +const wayland = @import("wayland"); +const wl = wayland.server.wl; +const wp = wayland.server.wp; + +pub const ContentTypeManagerV1 = extern struct { + global: *wl.Global, + + events: extern struct { + destroy: wl.Signal(void), + }, + + data: ?*anyopaque, + + extern fn wlr_content_type_manager_v1_create(server: *wl.Server, version: u32) ?*ContentTypeManagerV1; + pub fn create(server: *wl.Server, version: u32) !*ContentTypeManagerV1 { + return wlr_content_type_manager_v1_create(server, version) orelse error.OutOfMemory; + } + + extern fn wlr_surface_get_content_type_v1(manager: *ContentTypeManagerV1, surface: *wlr.Surface) wp.ContentTypeV1.Type; + pub const get = wlr_surface_get_content_type_v1; +}; diff --git a/src/wlroots.zig b/src/wlroots.zig index 868c6fd..8d827d0 100644 --- a/src/wlroots.zig +++ b/src/wlroots.zig @@ -205,6 +205,8 @@ pub const ForeignToplevelHandleV1 = @import("types/foreign_toplevel_management_v pub const SecurityContextManagerV1 = @import("types/security_context_v1.zig").SecurityContextManagerV1; pub const SecurityContextV1State = @import("types/security_context_v1.zig").SecurityContextV1State; +pub const ContentTypeManagerV1 = @import("types/content_type_v1.zig").ContentTypeManagerV1; + pub const SceneNode = @import("types/scene.zig").SceneNode; pub const Scene = @import("types/scene.zig").Scene; pub const SceneTree = @import("types/scene.zig").SceneTree;