~leon_plickat/zig-wayland-native

ff5c30a7 — Isaac Freund a month ago
Generate wrappers for wl.Proxy.destroy() if needed
19234604 — Isaac Freund a month ago
Clean up wl_proxy and wl_display bindings

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~leon_plickat/zig-wayland-native
read/write
git@git.sr.ht:~leon_plickat/zig-wayland-native

You can also use your local clone with git send-email.

#zig-wayland-native

Native Wayland library for zig 0.8.0.

This library is work in progress. Currently only client code is supported and the API is unstable. Breaking changes are very likely.

This library implemets the Wayland protocol with a tiny amount of sugar. That means it only covers the communication between client and display server as defined in the protocol and nothing more. As such, there are no functions like createWindow() or displayText() or takeScreenshot(). All logic must be implemented by the user, including pixel manipulation / rendering.

#Usage

A ScanProtocolsStep is provided which you may integrate with your build.zig:

const std = @import("std");
const Builder = std.build.Builder;

const ScanProtocolStep = @import("zig-wayland/build.zig").ScanProtocolStep;

pub fn build(b: *Builder) void {
    const target = b.standardTargetOptions(.{});
    const mode = b.standardReleaseOptions();

    const scanner = ScanProtocolStep.create(b);
    scanner.addSystemProtocol("stable/xdg-shell/xdg-shell.xml");
    scanner.addProtocolPath("protocol/foobar.xml");

    const exe = b.addExecutable("foo", "foo.zig");
    exe.setTarget(target);
    exe.setBuildMode(mode);

    exe.step.dependOn(&scanner.step);
    exe.addPackage(scanner.getPkg());

    exe.install();
}

Then, you may import the provided package in your project:

const wayland = @import("wayland-native").client;

#License

zig-wayland-native is released under the MIT (expat) license.

This project is a fork of zig-wayland.

Please also see the licenses of the protocols you use.