This repo contains the source code of Wayland C# bindings!
No build server available.
// Open conection
var display = Display.Connect();
if(display == null)
throw new NotSupportedException("Can't connect to display.");
// Get registry
var registry = display.GetRegistry();
if(registry == null)
throw new NotSupportedException("Registry can´t be null.");
// Add listener
registry.AddListener(GlobalRegistryHandler, GlobalRegistryRemover, IntPtr.Zero);
Definition of the generic handler:
private void GlobalRegistryHandler(
IntPtr data,
ref IntPtr wlRegistry,
int id,
string interfaceName,
int version)
{
Debug.WriteLine(
String.Format(
"Got a registry event for {0} with {1}.",
interfaceName,
id
)
);
}
private void GlobalRegistryRemover(
IntPtr data, ref IntPtr wlRegistry, int id)
{
Debug.WriteLine(
String.Format(
"Got a registry losing event for {0}.",
id
)
);
}