diff --git a/Source/OpenTK/Platform/Windows/WinGLControlHelper.cs b/Source/OpenTK/Platform/Windows/WinGLControlHelper.cs deleted file mode 100644 index 23300425..00000000 --- a/Source/OpenTK/Platform/Windows/WinGLControlHelper.cs +++ /dev/null @@ -1,45 +0,0 @@ -#region --- License --- -/* Licensed under the MIT/X11 license. - * Copyright (c) 2006-2008 the OpenTK Team. - * This notice may not be removed from any source distribution. - * See license.txt for licensing detailed licensing details. - */ -#endregion - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace OpenTK.Platform.Windows -{ - /// - /// Utility to obtain IWindowInfo from a System.Windows.Forms.Control on win32. - internal sealed class WinGLControlHelper : IGLControlHelper - { - MSG msg = new MSG(); - Control control; - - #region --- Constructors --- - - public WinGLControlHelper(Control c) - { - control = c; - } - - #endregion - - #region --- IGLControlHelper Members --- - - /// Returns an OpenTK.Platform.IWindowInfo describing this control. - public IWindowInfo WindowInfo { get { return new WinWindowInfo(control.Handle, null); } } - - /// Returns true if no messages are pending in the event loop. - public bool IsIdle - { - get { return !OpenTK.Platform.Windows.Functions.PeekMessage(ref msg, IntPtr.Zero, 0, 0, 0); } - } - - #endregion - } -} diff --git a/Source/OpenTK/Platform/X11/X11GLControlHelper.cs b/Source/OpenTK/Platform/X11/X11GLControlHelper.cs deleted file mode 100644 index 24f975fb..00000000 --- a/Source/OpenTK/Platform/X11/X11GLControlHelper.cs +++ /dev/null @@ -1,63 +0,0 @@ -#region --- License --- -/* Licensed under the MIT/X11 license. - * Copyright (c) 2006-2008 the OpenTK Team. - * This notice may not be removed from any source distribution. - * See license.txt for licensing detailed licensing details. - */ -#endregion - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace OpenTK.Platform.X11 -{ - /// - /// Utility to obtain IWindowInfo from a System.Windows.Forms.Control on Mono/X11. - internal sealed class X11GLControlHelper : IGLControlHelper - { - Control control; - IntPtr display; - - public X11GLControlHelper(Control c) - { - } - - #region IGLControlHelper Members - - public IWindowInfo WindowInfo - { - get - { - X11WindowInfo window = new X11WindowInfo(); - Type xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms"); - if (xplatui == null) - throw new ApplicationException("Could not get System.Windows.Forms.XplatUIX11 through reflection. Unsupported platform or Mono runtime version, aborting."); - - display = - window.Display = (IntPtr)xplatui.GetField("DisplayHandle", - System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).GetValue(null); - window.RootWindow = (IntPtr)xplatui.GetField("RootWindow", - System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).GetValue(null); - window.Screen = (int)xplatui.GetField("ScreenNo", - System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).GetValue(null); - - return (IWindowInfo)window; - } - } - - public bool IsIdle - { - get - { - lock (Functions.Lock) - { - return Functions.XPending(display) == 0; - } - } - } - - #endregion - } -}