示例#1
0
        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));
        }
示例#2
0
 public void Dispose()
 {
     if (this is WlDisplay wlDisplay)
     {
         //TODO: free all associated objects
     }
     else
     {
         CallWaylandDestructor();
         LibWayland.UnregisterProxy(_id);
         LibWayland.wl_proxy_destroy(Handle);
     }
 }
示例#3
0
        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);
            }
        }
示例#4
0
 protected static T FromNative <T>(IntPtr proxy) where T : WlProxy
 {
     return(LibWayland.FindByNative(proxy) as T);
 }
示例#5
0
 public int Roundtrip() => LibWayland.wl_display_roundtrip(Handle);
示例#6
0
 public int Dispatch() => LibWayland.wl_display_dispatch(Handle);