Begin work to add wallpaper support to beansprout

Added pixman and zigimg dependencies
Set up in build.zig, added to both exe and exe_check

Add new protocols:
     river-layer-shell-v1
     wlr-layer-shell-unstable-v1
     xdg-shell (dep of wlr-layer-shell-unstable-v1)

Update Context.zig to hold wl_output, wl_shm, and a WallpaperImage
Also re-ordered all of its fields into alphabetical order
Context.create() now takes a Context.Options struct so that it takes
     one arg instead of many smaller args.

Added new WallpaperImage.zig, but it's not yet actually used
This commit is contained in:
Ben Buhse 2026-02-06 16:37:33 -06:00
commit fb8817ebf9
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
7 changed files with 718 additions and 26 deletions

View file

@ -18,16 +18,23 @@ pub fn build(b: *std.Build) void {
// Rest of the deps
const kdl = b.dependency("kdl", .{}).module("kdl");
const known_folders = b.dependency("known_folders", .{}).module("known-folders");
const pixman = b.dependency("pixman", .{}).module("pixman");
const xkbcommon = b.dependency("xkbcommon", .{}).module("xkbcommon");
const zigimg = b.dependency("zigimg", .{}).module("zigimg");
scanner.addCustomProtocol(b.path("protocol/river-window-management-v1.xml"));
scanner.addCustomProtocol(b.path("protocol/river-xkb-bindings-v1.xml"));
scanner.addCustomProtocol(b.path("protocol/river-layer-shell-v1.xml"));
scanner.addSystemProtocol("stable/xdg-shell/xdg-shell.xml"); // dep of wlr-layer-shell-unstable-v1
scanner.addCustomProtocol(b.path("protocol/wlr-layer-shell-unstable-v1.xml"));
scanner.generate("wl_compositor", 4);
scanner.generate("wl_shm", 1);
scanner.generate("wl_output", 4);
scanner.generate("river_window_manager_v1", 3);
scanner.generate("river_xkb_bindings_v1", 2);
scanner.generate("river_layer_shell_v1", 1);
scanner.generate("zwlr_layer_shell_v1", 3);
const exe = b.addExecutable(.{
.name = "beansprout",
@ -42,12 +49,15 @@ pub fn build(b: *std.Build) void {
// Make sure to also add new imports to the exe_check step
exe.root_module.addImport("wayland", wayland);
exe.root_module.addImport("xkbcommon", xkbcommon);
exe.root_module.addImport("kdl", kdl);
exe.root_module.addImport("known_folders", known_folders);
exe.root_module.addImport("pixman", pixman);
exe.root_module.addImport("xkbcommon", xkbcommon);
exe.root_module.addImport("zigimg", zigimg);
exe.linkLibC();
exe.linkSystemLibrary("wayland-client");
exe.linkSystemLibrary("pixman-1");
exe.linkSystemLibrary("xkbcommon");
b.installArtifact(exe);
@ -90,12 +100,15 @@ pub fn build(b: *std.Build) void {
});
exe_check.root_module.addImport("wayland", wayland);
exe_check.root_module.addImport("xkbcommon", xkbcommon);
exe_check.root_module.addImport("kdl", kdl);
exe_check.root_module.addImport("known_folders", known_folders);
exe_check.root_module.addImport("pixman", pixman);
exe_check.root_module.addImport("xkbcommon", xkbcommon);
exe_check.root_module.addImport("zigimg", zigimg);
exe_check.linkLibC();
exe_check.linkSystemLibrary("wayland-client");
exe_check.linkSystemLibrary("pixman-1");
exe_check.linkSystemLibrary("xkbcommon");
const check = b.step("check", "Check if beanbag compiles");