diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-11-21 18:48:52 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-11-21 18:48:52 +0100 |
| commit | 4db409fdff013e3e4249d567e4d6fdb0ee877256 (patch) | |
| tree | 3b985c0941fda237f60b2e5f9a63382327159fb9 /src/XLib/Display.cs | |
| parent | a1dca1431f685020df843162b805edee11e1929c (diff) | |
xcb backend
Diffstat (limited to 'src/XLib/Display.cs')
| -rw-r--r-- | src/XLib/Display.cs | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/XLib/Display.cs b/src/XLib/Display.cs deleted file mode 100644 index 7e973b88..00000000 --- a/src/XLib/Display.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace XLib -{ - public class Display : IDisposable - { - internal IntPtr handle; - internal Int32 screen; - IntPtr lastEvent; - - public Display() - { - handle = NativeMethods.XOpenDisplay(IntPtr.Zero); - if (handle == IntPtr.Zero) - throw new NotSupportedException("[XLib] Failed to open display."); - - screen = NativeMethods.XDefaultScreen(handle); - lastEvent = Marshal.AllocHGlobal(96); - } - - /*public IntPtr NextEvent { - get { - NativeMethods.XNextEvent(handle, lastEvent); - return lastEvent; - } - }*/ - - #region IDisposable Support - private bool disposedValue = false; // To detect redundant calls - - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) - { - if (disposing) - { - // TODO: dispose managed state (managed objects). - } - - //Marshal.FreeHGlobal (lastEvent); - NativeMethods.XCloseDisplay (handle); - - disposedValue = true; - } - } - - // TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources. - ~Display() { - // Do not change this code. Put cleanup code in Dispose(bool disposing) above. - Dispose(false); - } - - // This code added to correctly implement the disposable pattern. - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - - - } -} |