[Platform] Inherit NativeWindowBase

This commit is contained in:
thefiddler 2014-05-02 14:18:40 +02:00
parent 300203f73b
commit 612652910f
7 changed files with 177 additions and 184 deletions

View file

@ -379,6 +379,7 @@ namespace OpenTK.Input
#region Fields #region Fields
int x, y; int x, y;
float wheel_x, wheel_y;
#endregion #endregion
@ -411,6 +412,14 @@ namespace OpenTK.Input
{ {
} }
internal MouseEventArgs(float x, float y, float wx, float wy)
{
X = (int)Math.Round(x);
Y = (int)Math.Round(y);
WheelX = wx;
WheelY = wy;
}
#endregion #endregion
#region Public Members #region Public Members
@ -425,6 +434,48 @@ namespace OpenTK.Input
/// </summary> /// </summary>
public int Y { get { return y; } internal set { y = value; } } public int Y { get { return y; } internal set { y = value; } }
/// <summary>
/// Gets the offset of the horizontal wheel, if one exists.
/// </summary>
public float WheelX { get; internal set; }
/// <summary>
/// Gets the offset of the vertical wheel, if one exists.
/// </summary>
public float WheelY { get; internal set; }
/// <summary>
/// Gets the offset of the vertical wheel, if one exists.
/// This is an alias to <see cref="MouseEventArgs.WheelY"/>
/// </summary>
/// <value>The wheel.</value>
public float Wheel { get { return WheelY; } }
/// <summary>
/// Gets the <see cref="ButtonState"/> of the left mouse button.
/// </summary>
public ButtonState LeftButton { get; internal set; }
/// <summary>
/// Gets the <see cref="ButtonState"/> of the right mouse button.
/// </summary>
public ButtonState RightButton { get; internal set; }
/// <summary>
/// Gets the <see cref="ButtonState"/> of the middle mouse button.
/// </summary>
public ButtonState MiddleButton { get; internal set; }
/// <summary>
/// Gets the <see cref="ButtonState"/> of the first extra mouse button.
/// </summary>
public ButtonState X1Button { get; internal set; }
/// <summary>
/// Gets the <see cref="ButtonState"/> of the second extra mouse button.
/// </summary>
public ButtonState X2Button { get; internal set; }
/// <summary> /// <summary>
/// Gets a System.Drawing.Points representing the location of the mouse for the event. /// Gets a System.Drawing.Points representing the location of the mouse for the event.
/// </summary> /// </summary>

View file

@ -680,6 +680,26 @@ namespace OpenTK
/// </summary> /// </summary>
public event EventHandler<EventArgs> WindowStateChanged = delegate { }; public event EventHandler<EventArgs> WindowStateChanged = delegate { };
/// <summary>
/// Occurs when a <see cref="MouseButton"/> is pressed.
/// </summary>
public event EventHandler<MouseButtonEventArgs> MouseDown = delegate { };
/// <summary>
/// Occurs when a <see cref="MouseButton"/> is released.
/// </summary>
public event EventHandler<MouseButtonEventArgs> MouseUp = delegate { };
/// <summary>
/// Occurs whenever the mouse is moved.
/// </summary>
public event EventHandler<MouseMoveEventArgs> MouseMove = delegate { };
/// <summary>
/// Occurs whenever a mouse wheel is moved;
/// </summary>
public event EventHandler<MouseWheelEventArgs> MouseWheel = delegate { };
#endregion #endregion
#endregion #endregion

View file

@ -835,7 +835,7 @@ namespace OpenTK.Platform.MacOS
} }
} }
public MouseCursor Cursor public override MouseCursor Cursor
{ {
get get
{ {
@ -957,7 +957,7 @@ namespace OpenTK.Platform.MacOS
Cocoa.SendVoid(windowInfo.Handle, selInvalidateCursorRectsForView, windowInfo.ViewHandle); Cocoa.SendVoid(windowInfo.Handle, selInvalidateCursorRectsForView, windowInfo.ViewHandle);
} }
public bool CursorVisible public override bool CursorVisible
{ {
get { return cursorVisible; } get { return cursorVisible; }
set set

View file

@ -35,7 +35,7 @@ using OpenTK.Input;
namespace OpenTK.Platform namespace OpenTK.Platform
{ {
// Common base class for all INativeWindow implementations
abstract class NativeWindowBase : INativeWindow abstract class NativeWindowBase : INativeWindow
{ {
readonly LegacyInputDriver LegacyInputDriver = readonly LegacyInputDriver LegacyInputDriver =
@ -123,6 +123,26 @@ namespace OpenTK.Platform
MouseEnter(this, e); MouseEnter(this, e);
} }
protected void OnMouseDown(MouseButtonEventArgs e)
{
MouseDown(this, e);
}
protected void OnMouseUp(MouseButtonEventArgs e)
{
MouseUp(this, e);
}
protected void OnMouseDown(MouseMoveEventArgs e)
{
MouseMove(this, e);
}
protected void OnMouseWheel(MouseWheelEventArgs e)
{
MouseWheel(this, e);
}
#endregion #endregion
#region INativeWindow Members #region INativeWindow Members
@ -143,6 +163,10 @@ namespace OpenTK.Platform
public event EventHandler<KeyboardKeyEventArgs> KeyUp = delegate { }; public event EventHandler<KeyboardKeyEventArgs> KeyUp = delegate { };
public event EventHandler<EventArgs> MouseLeave = delegate { }; public event EventHandler<EventArgs> MouseLeave = delegate { };
public event EventHandler<EventArgs> MouseEnter = delegate { }; public event EventHandler<EventArgs> MouseEnter = delegate { };
public event EventHandler<MouseButtonEventArgs> MouseDown = delegate { };
public event EventHandler<MouseButtonEventArgs> MouseUp = delegate { };
public event EventHandler<MouseMoveEventArgs> MouseMove = delegate { };
public event EventHandler<MouseWheelEventArgs> MouseWheel = delegate { };
public abstract void Close(); public abstract void Close();
@ -182,7 +206,7 @@ namespace OpenTK.Platform
} }
} }
public Size Size public virtual Size Size
{ {
get get
{ {
@ -270,6 +294,8 @@ namespace OpenTK.Platform
public abstract bool CursorVisible { get; set; } public abstract bool CursorVisible { get; set; }
public abstract MouseCursor Cursor { get; set; }
#endregion #endregion
#region IDisposable Members #region IDisposable Members

View file

@ -41,7 +41,7 @@ using System.Text;
namespace OpenTK.Platform.SDL2 namespace OpenTK.Platform.SDL2
{ {
class Sdl2NativeWindow : INativeWindow, IInputDriver class Sdl2NativeWindow : NativeWindowBase, IInputDriver
{ {
readonly object sync = new object(); readonly object sync = new object();
@ -236,11 +236,11 @@ namespace OpenTK.Platform.SDL2
window.key_args.Modifiers = window.input_driver.Keyboard[0].GetModifiers(); window.key_args.Modifiers = window.input_driver.Keyboard[0].GetModifiers();
if (key_pressed) if (key_pressed)
{ {
window.KeyDown(window, window.key_args); window.OnKeyDown(window.key_args);
} }
else else
{ {
window.KeyUp(window, window.key_args); window.OnKeyUp(window.key_args);
} }
//window.keyboard.SetKey(TranslateKey(key.scancode), (uint)key.scancode, key_pressed); //window.keyboard.SetKey(TranslateKey(key.scancode), (uint)key.scancode, key_pressed);
} }
@ -274,7 +274,7 @@ namespace OpenTK.Platform.SDL2
for (int i = 0; i < decoded_length; i++) for (int i = 0; i < decoded_length; i++)
{ {
window.keypress_args.KeyChar = window.DecodeTextBuffer[i]; window.keypress_args.KeyChar = window.DecodeTextBuffer[i];
window.KeyPress(window, window.keypress_args); window.OnKeyPress(window.keypress_args);
} }
} }
@ -299,7 +299,7 @@ namespace OpenTK.Platform.SDL2
try try
{ {
window.is_in_closing_event = true; window.is_in_closing_event = true;
window.Closing(window, close_args); window.OnClosing(close_args);
} }
finally finally
{ {
@ -308,17 +308,17 @@ namespace OpenTK.Platform.SDL2
if (!close_args.Cancel) if (!close_args.Cancel)
{ {
window.Closed(window, EventArgs.Empty); window.OnClosed(EventArgs.Empty);
window.must_destroy = true; window.must_destroy = true;
} }
break; break;
case WindowEventID.ENTER: case WindowEventID.ENTER:
window.MouseEnter(window, EventArgs.Empty); window.OnMouseEnter(EventArgs.Empty);
break; break;
case WindowEventID.LEAVE: case WindowEventID.LEAVE:
window.MouseLeave(window, EventArgs.Empty); window.OnMouseLeave(EventArgs.Empty);
break; break;
case WindowEventID.EXPOSED: case WindowEventID.EXPOSED:
@ -327,47 +327,47 @@ namespace OpenTK.Platform.SDL2
case WindowEventID.FOCUS_GAINED: case WindowEventID.FOCUS_GAINED:
window.is_focused = true; window.is_focused = true;
window.FocusedChanged(window, EventArgs.Empty); window.OnFocusedChanged(EventArgs.Empty);
break; break;
case WindowEventID.FOCUS_LOST: case WindowEventID.FOCUS_LOST:
window.is_focused = false; window.is_focused = false;
window.FocusedChanged(window, EventArgs.Empty); window.OnFocusedChanged(EventArgs.Empty);
break; break;
case WindowEventID.HIDDEN: case WindowEventID.HIDDEN:
window.is_visible = false; window.is_visible = false;
window.VisibleChanged(window, EventArgs.Empty); window.OnVisibleChanged(EventArgs.Empty);
break; break;
case WindowEventID.SHOWN: case WindowEventID.SHOWN:
window.is_visible = true; window.is_visible = true;
window.VisibleChanged(window, EventArgs.Empty); window.OnVisibleChanged(EventArgs.Empty);
break; break;
case WindowEventID.MAXIMIZED: case WindowEventID.MAXIMIZED:
window.window_state = WindowState.Maximized; window.window_state = WindowState.Maximized;
window.WindowStateChanged(window, EventArgs.Empty); window.OnWindowStateChanged(EventArgs.Empty);
break; break;
case WindowEventID.MINIMIZED: case WindowEventID.MINIMIZED:
window.previous_window_state = window.window_state; window.previous_window_state = window.window_state;
window.window_state = WindowState.Minimized; window.window_state = WindowState.Minimized;
window.WindowStateChanged(window, EventArgs.Empty); window.OnWindowStateChanged(EventArgs.Empty);
break; break;
case WindowEventID.RESTORED: case WindowEventID.RESTORED:
window.window_state = window.previous_window_state; window.window_state = window.previous_window_state;
window.WindowStateChanged(window, EventArgs.Empty); window.OnWindowStateChanged(EventArgs.Empty);
break; break;
case WindowEventID.MOVED: case WindowEventID.MOVED:
window.Move(window, EventArgs.Empty); window.OnMove(EventArgs.Empty);
break; break;
case WindowEventID.RESIZED: case WindowEventID.RESIZED:
case WindowEventID.SIZE_CHANGED: case WindowEventID.SIZE_CHANGED:
window.Resize(window, EventArgs.Empty); window.OnResize(EventArgs.Empty);
break; break;
default: default:
@ -443,24 +443,7 @@ namespace OpenTK.Platform.SDL2
#region INativeWindow Members #region INativeWindow Members
public event EventHandler<EventArgs> Move = delegate { }; public override MouseCursor Cursor
public event EventHandler<EventArgs> Resize = delegate { };
public event EventHandler<System.ComponentModel.CancelEventArgs> Closing = delegate { };
public event EventHandler<EventArgs> Closed = delegate { };
public event EventHandler<EventArgs> Disposed = delegate { };
public event EventHandler<EventArgs> IconChanged = delegate { };
public event EventHandler<EventArgs> TitleChanged = delegate { };
public event EventHandler<EventArgs> VisibleChanged = delegate { };
public event EventHandler<EventArgs> FocusedChanged = delegate { };
public event EventHandler<EventArgs> WindowBorderChanged = delegate { };
public event EventHandler<EventArgs> WindowStateChanged = delegate { };
public event EventHandler<KeyboardKeyEventArgs> KeyDown = delegate { };
public event EventHandler<KeyPressEventArgs> KeyPress = delegate { };
public event EventHandler<KeyboardKeyEventArgs> KeyUp = delegate { };
public event EventHandler<EventArgs> MouseEnter = delegate { };
public event EventHandler<EventArgs> MouseLeave = delegate { };
public MouseCursor Cursor
{ {
get get
{ {
@ -540,7 +523,7 @@ namespace OpenTK.Platform.SDL2
} }
} }
public void Close() public override void Close()
{ {
lock (sync) lock (sync)
{ {
@ -560,7 +543,7 @@ namespace OpenTK.Platform.SDL2
} }
} }
public void ProcessEvents() public override void ProcessEvents()
{ {
lock (sync) lock (sync)
{ {
@ -581,21 +564,21 @@ namespace OpenTK.Platform.SDL2
} }
} }
public Point PointToClient(Point point) public override Point PointToClient(Point point)
{ {
var origin = DisplayDevice.Default.Bounds.Location; var origin = DisplayDevice.Default.Bounds.Location;
var client = Location; var client = Location;
return new Point(point.X + client.X - origin.X, point.Y + client.Y - origin.Y); return new Point(point.X + client.X - origin.X, point.Y + client.Y - origin.Y);
} }
public Point PointToScreen(Point point) public override Point PointToScreen(Point point)
{ {
var origin = DisplayDevice.Default.Bounds.Location; var origin = DisplayDevice.Default.Bounds.Location;
var client = Location; var client = Location;
return new Point(point.X + origin.X - client.X, point.Y + origin.Y - client.Y); return new Point(point.X + origin.X - client.X, point.Y + origin.Y - client.Y);
} }
public Icon Icon public override Icon Icon
{ {
get get
{ {
@ -639,13 +622,13 @@ namespace OpenTK.Platform.SDL2
} }
icon = value; icon = value;
IconChanged(this, EventArgs.Empty); OnIconChanged(EventArgs.Empty);
} }
} }
} }
} }
public string Title public override string Title
{ {
get get
{ {
@ -671,7 +654,7 @@ namespace OpenTK.Platform.SDL2
} }
} }
public bool Focused public override bool Focused
{ {
get get
{ {
@ -679,7 +662,7 @@ namespace OpenTK.Platform.SDL2
} }
} }
public bool Visible public override bool Visible
{ {
get get
{ {
@ -700,7 +683,7 @@ namespace OpenTK.Platform.SDL2
} }
} }
public bool Exists public override bool Exists
{ {
get get
{ {
@ -708,7 +691,7 @@ namespace OpenTK.Platform.SDL2
} }
} }
public IWindowInfo WindowInfo public override IWindowInfo WindowInfo
{ {
get get
{ {
@ -716,7 +699,7 @@ namespace OpenTK.Platform.SDL2
} }
} }
public WindowState WindowState public override WindowState WindowState
{ {
get get
{ {
@ -774,7 +757,7 @@ namespace OpenTK.Platform.SDL2
} }
} }
public WindowBorder WindowBorder public override WindowBorder WindowBorder
{ {
get get
{ {
@ -810,13 +793,13 @@ namespace OpenTK.Platform.SDL2
if (Exists) if (Exists)
{ {
WindowBorderChanged(this, EventArgs.Empty); OnWindowBorderChanged(EventArgs.Empty);
} }
} }
} }
} }
public Rectangle Bounds public override Rectangle Bounds
{ {
get get
{ {
@ -829,7 +812,7 @@ namespace OpenTK.Platform.SDL2
} }
} }
public Point Location public override Point Location
{ {
get get
{ {
@ -856,7 +839,7 @@ namespace OpenTK.Platform.SDL2
} }
} }
public Size Size public override Size Size
{ {
get get
{ {
@ -883,67 +866,7 @@ namespace OpenTK.Platform.SDL2
} }
} }
public int X public override Size ClientSize
{
get
{
return Location.X;
}
set
{
Location = new Point(value, Y);
}
}
public int Y
{
get
{
return Location.Y;
}
set
{
Location = new Point(X, value);
}
}
public int Width
{
get
{
return ClientSize.Width;
}
set
{
ClientSize = new Size(value, Height);
}
}
public int Height
{
get
{
return ClientSize.Height;
}
set
{
ClientSize = new Size(Width, value);
}
}
public Rectangle ClientRectangle
{
get
{
return new Rectangle(new Point(), ClientSize);
}
set
{
ClientSize = value.Size;
}
}
public Size ClientSize
{ {
get get
{ {
@ -967,7 +890,7 @@ namespace OpenTK.Platform.SDL2
} }
} }
public IInputDriver InputDriver public override IInputDriver InputDriver
{ {
get get
{ {
@ -975,7 +898,7 @@ namespace OpenTK.Platform.SDL2
} }
} }
public bool CursorVisible public override bool CursorVisible
{ {
get get
{ {
@ -1043,7 +966,7 @@ namespace OpenTK.Platform.SDL2
#region IDisposable implementation #region IDisposable implementation
void Dispose(bool manual) protected override void Dispose(bool manual)
{ {
if (!disposed) if (!disposed)
{ {
@ -1082,17 +1005,6 @@ namespace OpenTK.Platform.SDL2
} }
} }
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
~Sdl2NativeWindow()
{
Dispose(true);
}
#endregion #endregion
} }
} }

View file

@ -44,7 +44,7 @@ namespace OpenTK.Platform.Windows
/// Drives GameWindow on Windows. /// Drives GameWindow on Windows.
/// This class supports OpenTK, and is not intended for use by OpenTK programs. /// This class supports OpenTK, and is not intended for use by OpenTK programs.
/// </summary> /// </summary>
internal sealed class WinGLNative : INativeWindow, IInputDriver internal sealed class WinGLNative : NativeWindowBase, IInputDriver
{ {
#region Fields #region Fields
@ -977,7 +977,7 @@ namespace OpenTK.Platform.Windows
#region Bounds #region Bounds
public Rectangle Bounds public override Rectangle Bounds
{ {
get { return bounds; } get { return bounds; }
set set
@ -1042,7 +1042,7 @@ namespace OpenTK.Platform.Windows
#region ClientSize #region ClientSize
public Size ClientSize public override Size ClientSize
{ {
get get
{ {
@ -1101,7 +1101,7 @@ namespace OpenTK.Platform.Windows
#region Icon #region Icon
public Icon Icon public override Icon Icon
{ {
get get
{ {
@ -1126,7 +1126,7 @@ namespace OpenTK.Platform.Windows
#region Focused #region Focused
public bool Focused public override bool Focused
{ {
get { return focused; } get { return focused; }
} }
@ -1136,7 +1136,7 @@ namespace OpenTK.Platform.Windows
#region Title #region Title
StringBuilder sb_title = new StringBuilder(256); StringBuilder sb_title = new StringBuilder(256);
public string Title public override string Title
{ {
get get
{ {
@ -1160,7 +1160,7 @@ namespace OpenTK.Platform.Windows
#region Visible #region Visible
public bool Visible public override bool Visible
{ {
get get
{ {
@ -1193,13 +1193,13 @@ namespace OpenTK.Platform.Windows
#region Exists #region Exists
public bool Exists { get { return exists; } } public override bool Exists { get { return exists; } }
#endregion #endregion
#region Cursor #region Cursor
public MouseCursor Cursor public override MouseCursor Cursor
{ {
get get
{ {
@ -1271,7 +1271,7 @@ namespace OpenTK.Platform.Windows
#region CursorVisible #region CursorVisible
public bool CursorVisible public override bool CursorVisible
{ {
get { return cursor_visible_count >= 0; } // Not used get { return cursor_visible_count >= 0; } // Not used
set set
@ -1303,7 +1303,7 @@ namespace OpenTK.Platform.Windows
#region Close #region Close
public void Close() public override void Close()
{ {
Functions.PostMessage(window.Handle, WindowMessage.CLOSE, IntPtr.Zero, IntPtr.Zero); Functions.PostMessage(window.Handle, WindowMessage.CLOSE, IntPtr.Zero, IntPtr.Zero);
} }
@ -1312,7 +1312,7 @@ namespace OpenTK.Platform.Windows
#region public WindowState WindowState #region public WindowState WindowState
public WindowState WindowState public override WindowState WindowState
{ {
get get
{ {
@ -1406,7 +1406,7 @@ namespace OpenTK.Platform.Windows
#region public WindowBorder WindowBorder #region public WindowBorder WindowBorder
public WindowBorder WindowBorder public override WindowBorder WindowBorder
{ {
get get
{ {
@ -1500,7 +1500,7 @@ namespace OpenTK.Platform.Windows
#region PointToClient #region PointToClient
public Point PointToClient(Point point) public override Point PointToClient(Point point)
{ {
if (!Functions.ScreenToClient(window.Handle, ref point)) if (!Functions.ScreenToClient(window.Handle, ref point))
throw new InvalidOperationException(String.Format( throw new InvalidOperationException(String.Format(
@ -1514,7 +1514,7 @@ namespace OpenTK.Platform.Windows
#region PointToScreen #region PointToScreen
public Point PointToScreen(Point point) public override Point PointToScreen(Point point)
{ {
if (!Functions.ClientToScreen(window.Handle, ref point)) if (!Functions.ClientToScreen(window.Handle, ref point))
throw new InvalidOperationException(String.Format( throw new InvalidOperationException(String.Format(
@ -1554,7 +1554,7 @@ namespace OpenTK.Platform.Windows
#region public void ProcessEvents() #region public void ProcessEvents()
MSG msg; MSG msg;
public void ProcessEvents() public override void ProcessEvents()
{ {
while (Functions.PeekMessage(ref msg, IntPtr.Zero, 0, 0, PeekMessageFlags.Remove)) while (Functions.PeekMessage(ref msg, IntPtr.Zero, 0, 0, PeekMessageFlags.Remove))
{ {
@ -1576,7 +1576,7 @@ namespace OpenTK.Platform.Windows
#region public IWindowInfo WindowInfo #region public IWindowInfo WindowInfo
public IWindowInfo WindowInfo public override IWindowInfo WindowInfo
{ {
get { return child_window; } get { return child_window; }
} }
@ -1640,7 +1640,7 @@ namespace OpenTK.Platform.Windows
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
void Dispose(bool calledManually) protected override void Dispose(bool calledManually)
{ {
if (!disposed) if (!disposed)
{ {
@ -1667,11 +1667,6 @@ namespace OpenTK.Platform.Windows
} }
} }
~WinGLNative()
{
Dispose(false);
}
#endregion #endregion
} }
} }

View file

@ -45,7 +45,7 @@ namespace OpenTK.Platform.X11
/// Drives GameWindow on X11. /// Drives GameWindow on X11.
/// This class supports OpenTK, and is not intended for use by OpenTK programs. /// This class supports OpenTK, and is not intended for use by OpenTK programs.
/// </summary> /// </summary>
internal sealed class X11GLNative : INativeWindow, IDisposable internal sealed class X11GLNative : NativeWindowBase
{ {
// TODO: Disable screensaver. // TODO: Disable screensaver.
// TODO: What happens if we can't disable decorations through motif? // TODO: What happens if we can't disable decorations through motif?
@ -785,7 +785,7 @@ namespace OpenTK.Platform.X11
#region ProcessEvents #region ProcessEvents
public void ProcessEvents() public override void ProcessEvents()
{ {
// Process all pending events // Process all pending events
while (Exists && window != null) while (Exists && window != null)
@ -1015,7 +1015,7 @@ namespace OpenTK.Platform.X11
#region Bounds #region Bounds
public Rectangle Bounds public override Rectangle Bounds
{ {
get get
{ {
@ -1116,7 +1116,7 @@ namespace OpenTK.Platform.X11
#region ClientSize #region ClientSize
public Size ClientSize public override Size ClientSize
{ {
get get
{ {
@ -1172,7 +1172,7 @@ namespace OpenTK.Platform.X11
#region Icon #region Icon
public Icon Icon public override Icon Icon
{ {
get get
{ {
@ -1246,7 +1246,7 @@ namespace OpenTK.Platform.X11
#region Focused #region Focused
public bool Focused public override bool Focused
{ {
get get
{ {
@ -1258,7 +1258,7 @@ namespace OpenTK.Platform.X11
#region WindowState #region WindowState
public OpenTK.WindowState WindowState public override OpenTK.WindowState WindowState
{ {
get get
{ {
@ -1395,7 +1395,7 @@ namespace OpenTK.Platform.X11
#region WindowBorder #region WindowBorder
public OpenTK.WindowBorder WindowBorder public override OpenTK.WindowBorder WindowBorder
{ {
get get
{ {
@ -1465,7 +1465,7 @@ namespace OpenTK.Platform.X11
#region Cursor #region Cursor
public MouseCursor Cursor public override MouseCursor Cursor
{ {
get get
{ {
@ -1505,7 +1505,7 @@ namespace OpenTK.Platform.X11
#region CursorVisible #region CursorVisible
public bool CursorVisible public override bool CursorVisible
{ {
get { return cursor_visible; } get { return cursor_visible; }
set set
@ -1552,7 +1552,7 @@ namespace OpenTK.Platform.X11
/// <summary> /// <summary>
/// Returns true if a render window/context exists. /// Returns true if a render window/context exists.
/// </summary> /// </summary>
public bool Exists public override bool Exists
{ {
get { return exists; } get { return exists; }
} }
@ -1586,7 +1586,7 @@ namespace OpenTK.Platform.X11
/// TODO: Use atoms for this property. /// TODO: Use atoms for this property.
/// Gets or sets the GameWindow title. /// Gets or sets the GameWindow title.
/// </summary> /// </summary>
public string Title public override string Title
{ {
get get
{ {
@ -1618,7 +1618,7 @@ namespace OpenTK.Platform.X11
#region public bool Visible #region public bool Visible
public bool Visible public override bool Visible
{ {
get get
{ {
@ -1647,14 +1647,14 @@ namespace OpenTK.Platform.X11
#region public IWindowInfo WindowInfo #region public IWindowInfo WindowInfo
public IWindowInfo WindowInfo public override IWindowInfo WindowInfo
{ {
get { return window; } get { return window; }
} }
#endregion #endregion
public void Close() { Exit(); } public override void Close() { Exit(); }
#region public void Exit() #region public void Exit()
@ -1691,7 +1691,7 @@ namespace OpenTK.Platform.X11
#region PointToClient #region PointToClient
public Point PointToClient(Point point) public override Point PointToClient(Point point)
{ {
int ox, oy; int ox, oy;
IntPtr child; IntPtr child;
@ -1711,7 +1711,7 @@ namespace OpenTK.Platform.X11
#region PointToScreen #region PointToScreen
public Point PointToScreen(Point point) public override Point PointToScreen(Point point)
{ {
int ox, oy; int ox, oy;
IntPtr child; IntPtr child;
@ -1733,13 +1733,7 @@ namespace OpenTK.Platform.X11
#region IDisposable Members #region IDisposable Members
public void Dispose() protected override void Dispose(bool manuallyCalled)
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
private void Dispose(bool manuallyCalled)
{ {
if (!disposed) if (!disposed)
{ {
@ -1775,11 +1769,6 @@ namespace OpenTK.Platform.X11
} }
} }
~X11GLNative()
{
this.Dispose(false);
}
#endregion #endregion
} }
} }