mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-24 05:10:42 -04:00
Remove unused Title get/set from OpenTK
This commit is contained in:
parent
5f3980aecc
commit
37a260a727
@ -45,9 +45,6 @@ namespace OpenTK {
|
||||
/// <summary> Gets or sets the <see cref="System.Drawing.Icon"/> of the window. </summary>
|
||||
Icon Icon { get; set; }
|
||||
|
||||
/// <summary> Gets or sets the title of the window. </summary>
|
||||
string Title { get; set; }
|
||||
|
||||
/// <summary> Gets a System.Boolean that indicates whether this window has input focus. </summary>
|
||||
bool Focused { get; }
|
||||
|
||||
@ -126,9 +123,6 @@ namespace OpenTK {
|
||||
/// <summary> Occurs when the <see cref="Icon"/> property of the window changes. </summary>
|
||||
event EventHandler<EventArgs> IconChanged;
|
||||
|
||||
/// <summary> Occurs when the <see cref="Title"/> property of the window changes. </summary>
|
||||
event EventHandler<EventArgs> TitleChanged;
|
||||
|
||||
/// <summary> Occurs when the <see cref="Visible"/> property of the window changes. </summary>
|
||||
event EventHandler<EventArgs> VisibleChanged;
|
||||
|
||||
|
@ -179,12 +179,6 @@ namespace OpenTK {
|
||||
set { EnsureUndisposed(); implementation.Size = value; }
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the NativeWindow title. </summary>
|
||||
public string Title {
|
||||
get { EnsureUndisposed(); return implementation.Title; }
|
||||
set { EnsureUndisposed(); implementation.Title = value; }
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets a System.Boolean that indicates whether this NativeWindow is visible. </summary>
|
||||
public bool Visible {
|
||||
get { EnsureUndisposed(); return implementation.Visible; }
|
||||
@ -254,9 +248,6 @@ namespace OpenTK {
|
||||
/// <summary> Occurs whenever the window is resized. </summary>
|
||||
public event EventHandler<EventArgs> Resize;
|
||||
|
||||
/// <summary> Occurs when the <see cref="Title"/> property of the window changes. </summary>
|
||||
public event EventHandler<EventArgs> TitleChanged;
|
||||
|
||||
/// <summary> Occurs when the <see cref="Visible"/> property of the window changes. </summary>
|
||||
public event EventHandler<EventArgs> VisibleChanged;
|
||||
|
||||
@ -307,11 +298,6 @@ namespace OpenTK {
|
||||
if (FocusedChanged != null) FocusedChanged(this, e);
|
||||
}
|
||||
|
||||
/// <summary> Called when the <see cref="OpenTK.INativeWindow.Icon"/> property of the NativeWindow has changed. </summary>
|
||||
protected virtual void OnIconChanged(object sender, EventArgs e) {
|
||||
if (IconChanged != null) IconChanged(this, e);
|
||||
}
|
||||
|
||||
/// <summary> Called when a character is typed. </summary>
|
||||
/// <param name="e">The <see cref="OpenTK.KeyPressEventArgs"/> for this event.</param>
|
||||
protected virtual void OnKeyPress(object sender, KeyPressEventArgs e) {
|
||||
@ -339,11 +325,6 @@ namespace OpenTK {
|
||||
if (Resize != null) Resize(this, e);
|
||||
}
|
||||
|
||||
/// <summary> Called when the <see cref="OpenTK.INativeWindow.Title"/> property of the NativeWindow has changed. </summary>
|
||||
protected virtual void OnTitleChanged(object sender, EventArgs e) {
|
||||
if (TitleChanged != null) TitleChanged(this, e);
|
||||
}
|
||||
|
||||
/// <summary> Called when the <see cref="OpenTK.INativeWindow.Visible"/> property of the NativeWindow has changed. </summary>
|
||||
protected virtual void OnVisibleChanged(object sender, EventArgs e) {
|
||||
if (VisibleChanged != null) VisibleChanged(this, e);
|
||||
@ -377,13 +358,11 @@ namespace OpenTK {
|
||||
implementation.Closing += OnClosing;
|
||||
implementation.Disposed += OnDisposed;
|
||||
implementation.FocusedChanged += OnFocusedChanged;
|
||||
implementation.IconChanged += OnIconChanged;
|
||||
implementation.KeyPress += OnKeyPress;
|
||||
implementation.MouseEnter += OnMouseEnter;
|
||||
implementation.MouseLeave += OnMouseLeave;
|
||||
implementation.Move += OnMove;
|
||||
implementation.Resize += OnResize;
|
||||
implementation.TitleChanged += OnTitleChanged;
|
||||
implementation.VisibleChanged += OnVisibleChanged;
|
||||
implementation.WindowStateChanged += OnWindowStateChanged;
|
||||
events = true;
|
||||
@ -392,13 +371,11 @@ namespace OpenTK {
|
||||
implementation.Closing -= OnClosing;
|
||||
implementation.Disposed -= OnDisposed;
|
||||
implementation.FocusedChanged -= OnFocusedChanged;
|
||||
implementation.IconChanged -= OnIconChanged;
|
||||
implementation.KeyPress -= OnKeyPress;
|
||||
implementation.MouseEnter -= OnMouseEnter;
|
||||
implementation.MouseLeave -= OnMouseLeave;
|
||||
implementation.Move -= OnMove;
|
||||
implementation.Resize -= OnResize;
|
||||
implementation.TitleChanged -= OnTitleChanged;
|
||||
implementation.VisibleChanged -= OnVisibleChanged;
|
||||
implementation.WindowStateChanged -= OnWindowStateChanged;
|
||||
events = false;
|
||||
|
@ -712,14 +712,6 @@ namespace OpenTK.Platform.MacOS
|
||||
}
|
||||
}
|
||||
|
||||
public string Title {
|
||||
get { return title; }
|
||||
set {
|
||||
API.SetWindowTitle(window.WindowRef, value);
|
||||
title = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Visible {
|
||||
get { return API.IsWindowVisible(window.WindowRef); }
|
||||
set {
|
||||
@ -923,7 +915,6 @@ namespace OpenTK.Platform.MacOS
|
||||
public event EventHandler<EventArgs> Closed;
|
||||
public event EventHandler<EventArgs> Disposed;
|
||||
public event EventHandler<EventArgs> IconChanged;
|
||||
public event EventHandler<EventArgs> TitleChanged;
|
||||
public event EventHandler<EventArgs> ClientSizeChanged;
|
||||
public event EventHandler<EventArgs> VisibleChanged;
|
||||
public event EventHandler<EventArgs> FocusedChanged;
|
||||
|
@ -110,12 +110,6 @@ namespace OpenTK.Platform.Windows {
|
||||
[DllImport("user32.dll", SetLastError = true), SuppressUnmanagedCodeSecurity]
|
||||
internal static extern bool ShowWindow(IntPtr hWnd, ShowWindowCommand nCmdShow);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto), SuppressUnmanagedCodeSecurity]
|
||||
internal static extern bool SetWindowText(IntPtr hWnd, [MarshalAs(UnmanagedType.LPTStr)] string lpString);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto), SuppressUnmanagedCodeSecurity]
|
||||
internal static extern int GetWindowText(IntPtr hWnd, [MarshalAs(UnmanagedType.LPTStr), In, Out] StringBuilder lpString, int nMaxCount);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true), SuppressUnmanagedCodeSecurity]
|
||||
//internal static extern bool ScreenToClient(IntPtr hWnd, ref POINT point);
|
||||
internal static extern bool ScreenToClient(IntPtr hWnd, ref Point point);
|
||||
|
@ -521,19 +521,6 @@ namespace OpenTK.Platform.Windows
|
||||
get { return focused; }
|
||||
}
|
||||
|
||||
StringBuilder sb_title = new StringBuilder(256);
|
||||
public string Title {
|
||||
get {
|
||||
sb_title.Remove(0, sb_title.Length);
|
||||
if (API.GetWindowText(window.WindowHandle, sb_title, sb_title.MaxCapacity) == 0)
|
||||
Debug.Print("Failed to retrieve window title (window:{0}, reason:{1}).", window.WindowHandle, Marshal.GetLastWin32Error());
|
||||
return sb_title.ToString();
|
||||
} set {
|
||||
if (!API.SetWindowText(window.WindowHandle, value))
|
||||
Debug.Print("Failed to change window title (window:{0}, new title:{1}, reason:{2}).", window.WindowHandle, value, Marshal.GetLastWin32Error());
|
||||
}
|
||||
}
|
||||
|
||||
public bool Visible {
|
||||
get { return API.IsWindowVisible(window.WindowHandle); }
|
||||
set {
|
||||
@ -673,7 +660,6 @@ namespace OpenTK.Platform.Windows
|
||||
public event EventHandler<EventArgs> Closed;
|
||||
public event EventHandler<EventArgs> Disposed;
|
||||
public event EventHandler<EventArgs> IconChanged;
|
||||
public event EventHandler<EventArgs> TitleChanged;
|
||||
public event EventHandler<EventArgs> ClientSizeChanged;
|
||||
public event EventHandler<EventArgs> VisibleChanged;
|
||||
public event EventHandler<EventArgs> FocusedChanged;
|
||||
|
@ -638,7 +638,6 @@ namespace OpenTK.Platform.X11 {
|
||||
public event EventHandler<EventArgs> Closed;
|
||||
public event EventHandler<EventArgs> Disposed;
|
||||
public event EventHandler<EventArgs> IconChanged;
|
||||
public event EventHandler<EventArgs> TitleChanged;
|
||||
public event EventHandler<EventArgs> VisibleChanged;
|
||||
public event EventHandler<EventArgs> FocusedChanged;
|
||||
public event EventHandler<EventArgs> WindowStateChanged;
|
||||
@ -703,24 +702,6 @@ namespace OpenTK.Platform.X11 {
|
||||
get { return window.WindowHandle; }
|
||||
}
|
||||
|
||||
/// <summary> TODO: Use atoms for this property.
|
||||
/// Gets or sets the GameWindow title. </summary>
|
||||
public string Title {
|
||||
get {
|
||||
IntPtr name = IntPtr.Zero;
|
||||
API.XFetchName(window.Display, window.WindowHandle, ref name);
|
||||
return name == IntPtr.Zero ? String.Empty : Marshal.PtrToStringAnsi(name);
|
||||
}
|
||||
set {
|
||||
if (value != null && value != Title) {
|
||||
API.XStoreName(window.Display, window.WindowHandle, value);
|
||||
}
|
||||
|
||||
if (TitleChanged != null)
|
||||
TitleChanged(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Visible {
|
||||
get { return visible; }
|
||||
set {
|
||||
|
Loading…
x
Reference in New Issue
Block a user