xcb-dotnet
1.17.0
dotnet add package xcb-dotnet --version 1.17.0
NuGet\Install-Package xcb-dotnet -Version 1.17.0
<PackageReference Include="xcb-dotnet" Version="1.17.0" />
<PackageVersion Include="xcb-dotnet" Version="1.17.0" />
<PackageReference Include="xcb-dotnet" />
paket add xcb-dotnet --version 1.17.0
#r "nuget: xcb-dotnet, 1.17.0"
#:package xcb-dotnet@1.17.0
#addin nuget:?package=xcb-dotnet&version=1.17.0
#tool nuget:?package=xcb-dotnet&version=1.17.0
xcb-dotnet
.NET bindings for libxcb, the X protocol C-language binding.
Usage
using Xcb;
using var connection = XcbConnection.Connect();
var screen = connection.PreferredScreenInfo;
var window = connection.CreateWindow(
parent: screen.Root, x: 0, y: 0, width: 480, height: 320,
valueMask: XcbCw.BackPixel | XcbCw.EventMask,
values: [screen.WhitePixel, (uint)XcbEventMask.Exposure]);
connection.SetPropertyString(window, XcbAtom.WmName, "hello");
connection.MapWindow(window);
connection.Flush();
while (true)
{
using var e = connection.WaitForEvent();
if (e.EventType == XcbEventType.Expose) break;
}
Requests follow xcb's asynchronous cookie model. Reply-carrying requests return a cookie whose Reply() blocks; issue several requests before collecting replies to batch round-trips:
var a = connection.InternAtom("WM_PROTOCOLS");
var b = connection.InternAtom("WM_DELETE_WINDOW");
var (wmProtocols, wmDelete) = (a.Reply(), b.Reply());
Void requests are fire-and-forget by default (errors arrive in the event queue as entries with XcbEvent.IsError); the *Checked variants return a cookie whose Check() round-trips and throws XcbException on error.
Regenerating the bindings
The generated code is checked in; consumers and CI never need clang. To regenerate after bumping the external/libxcb and external/xcb-proto submodules and requires python3 and clang:
dotnet tool restore
sh eng/generate.sh
The script first runs c_client.py over the xcb-proto XML to produce the C headers, then runs ClangSharpPInvokeGenerator once per native library.
Testing
dotnet test # binding tests; server tests skip without DISPLAY
xvfb-run -a dotnet test # full suite against a headless X server
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.17.0 | 513 | 7/28/2026 |