public static WlDisplay Connect(string name = null) { var handle = LibWayland.wl_display_connect(name); if (handle == IntPtr.Zero) { throw new Win32Exception(); } return(new WlDisplay(handle)); }
public void Dispose() { if (this is WlDisplay wlDisplay) { //TODO: free all associated objects } else { CallWaylandDestructor(); LibWayland.UnregisterProxy(_id); LibWayland.wl_proxy_destroy(Handle); } }
public WlProxy(IntPtr handle, int version, WlDisplay display) { Version = version; Handle = handle; Display = display; if (this is WlDisplay d) { Display = d; } else { if (display == null) { throw new ArgumentNullException(nameof(display)); } _id = LibWayland.RegisterProxy(this); } }
protected static T FromNative <T>(IntPtr proxy) where T : WlProxy { return(LibWayland.FindByNative(proxy) as T); }
public int Roundtrip() => LibWayland.wl_display_roundtrip(Handle);
public int Dispatch() => LibWayland.wl_display_dispatch(Handle);