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
@ -44,9 +44,6 @@ namespace OpenTK {
|
|||||||
|
|
||||||
/// <summary> Gets or sets the <see cref="System.Drawing.Icon"/> of the window. </summary>
|
/// <summary> Gets or sets the <see cref="System.Drawing.Icon"/> of the window. </summary>
|
||||||
Icon Icon { get; set; }
|
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>
|
/// <summary> Gets a System.Boolean that indicates whether this window has input focus. </summary>
|
||||||
bool Focused { get; }
|
bool Focused { get; }
|
||||||
@ -126,9 +123,6 @@ namespace OpenTK {
|
|||||||
/// <summary> Occurs when the <see cref="Icon"/> property of the window changes. </summary>
|
/// <summary> Occurs when the <see cref="Icon"/> property of the window changes. </summary>
|
||||||
event EventHandler<EventArgs> IconChanged;
|
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>
|
/// <summary> Occurs when the <see cref="Visible"/> property of the window changes. </summary>
|
||||||
event EventHandler<EventArgs> VisibleChanged;
|
event EventHandler<EventArgs> VisibleChanged;
|
||||||
|
|
||||||
|
@ -179,12 +179,6 @@ namespace OpenTK {
|
|||||||
set { EnsureUndisposed(); implementation.Size = value; }
|
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>
|
/// <summary> Gets or sets a System.Boolean that indicates whether this NativeWindow is visible. </summary>
|
||||||
public bool Visible {
|
public bool Visible {
|
||||||
get { EnsureUndisposed(); return implementation.Visible; }
|
get { EnsureUndisposed(); return implementation.Visible; }
|
||||||
@ -254,9 +248,6 @@ namespace OpenTK {
|
|||||||
/// <summary> Occurs whenever the window is resized. </summary>
|
/// <summary> Occurs whenever the window is resized. </summary>
|
||||||
public event EventHandler<EventArgs> Resize;
|
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>
|
/// <summary> Occurs when the <see cref="Visible"/> property of the window changes. </summary>
|
||||||
public event EventHandler<EventArgs> VisibleChanged;
|
public event EventHandler<EventArgs> VisibleChanged;
|
||||||
|
|
||||||
@ -307,11 +298,6 @@ namespace OpenTK {
|
|||||||
if (FocusedChanged != null) FocusedChanged(this, e);
|
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>
|
/// <summary> Called when a character is typed. </summary>
|
||||||
/// <param name="e">The <see cref="OpenTK.KeyPressEventArgs"/> for this event.</param>
|
/// <param name="e">The <see cref="OpenTK.KeyPressEventArgs"/> for this event.</param>
|
||||||
protected virtual void OnKeyPress(object sender, KeyPressEventArgs e) {
|
protected virtual void OnKeyPress(object sender, KeyPressEventArgs e) {
|
||||||
@ -338,11 +324,6 @@ namespace OpenTK {
|
|||||||
protected virtual void OnResize(object sender, EventArgs e) {
|
protected virtual void OnResize(object sender, EventArgs e) {
|
||||||
if (Resize != null) Resize(this, e);
|
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>
|
/// <summary> Called when the <see cref="OpenTK.INativeWindow.Visible"/> property of the NativeWindow has changed. </summary>
|
||||||
protected virtual void OnVisibleChanged(object sender, EventArgs e) {
|
protected virtual void OnVisibleChanged(object sender, EventArgs e) {
|
||||||
@ -377,13 +358,11 @@ namespace OpenTK {
|
|||||||
implementation.Closing += OnClosing;
|
implementation.Closing += OnClosing;
|
||||||
implementation.Disposed += OnDisposed;
|
implementation.Disposed += OnDisposed;
|
||||||
implementation.FocusedChanged += OnFocusedChanged;
|
implementation.FocusedChanged += OnFocusedChanged;
|
||||||
implementation.IconChanged += OnIconChanged;
|
|
||||||
implementation.KeyPress += OnKeyPress;
|
implementation.KeyPress += OnKeyPress;
|
||||||
implementation.MouseEnter += OnMouseEnter;
|
implementation.MouseEnter += OnMouseEnter;
|
||||||
implementation.MouseLeave += OnMouseLeave;
|
implementation.MouseLeave += OnMouseLeave;
|
||||||
implementation.Move += OnMove;
|
implementation.Move += OnMove;
|
||||||
implementation.Resize += OnResize;
|
implementation.Resize += OnResize;
|
||||||
implementation.TitleChanged += OnTitleChanged;
|
|
||||||
implementation.VisibleChanged += OnVisibleChanged;
|
implementation.VisibleChanged += OnVisibleChanged;
|
||||||
implementation.WindowStateChanged += OnWindowStateChanged;
|
implementation.WindowStateChanged += OnWindowStateChanged;
|
||||||
events = true;
|
events = true;
|
||||||
@ -392,13 +371,11 @@ namespace OpenTK {
|
|||||||
implementation.Closing -= OnClosing;
|
implementation.Closing -= OnClosing;
|
||||||
implementation.Disposed -= OnDisposed;
|
implementation.Disposed -= OnDisposed;
|
||||||
implementation.FocusedChanged -= OnFocusedChanged;
|
implementation.FocusedChanged -= OnFocusedChanged;
|
||||||
implementation.IconChanged -= OnIconChanged;
|
|
||||||
implementation.KeyPress -= OnKeyPress;
|
implementation.KeyPress -= OnKeyPress;
|
||||||
implementation.MouseEnter -= OnMouseEnter;
|
implementation.MouseEnter -= OnMouseEnter;
|
||||||
implementation.MouseLeave -= OnMouseLeave;
|
implementation.MouseLeave -= OnMouseLeave;
|
||||||
implementation.Move -= OnMove;
|
implementation.Move -= OnMove;
|
||||||
implementation.Resize -= OnResize;
|
implementation.Resize -= OnResize;
|
||||||
implementation.TitleChanged -= OnTitleChanged;
|
|
||||||
implementation.VisibleChanged -= OnVisibleChanged;
|
implementation.VisibleChanged -= OnVisibleChanged;
|
||||||
implementation.WindowStateChanged -= OnWindowStateChanged;
|
implementation.WindowStateChanged -= OnWindowStateChanged;
|
||||||
events = false;
|
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 {
|
public bool Visible {
|
||||||
get { return API.IsWindowVisible(window.WindowRef); }
|
get { return API.IsWindowVisible(window.WindowRef); }
|
||||||
set {
|
set {
|
||||||
@ -923,7 +915,6 @@ namespace OpenTK.Platform.MacOS
|
|||||||
public event EventHandler<EventArgs> Closed;
|
public event EventHandler<EventArgs> Closed;
|
||||||
public event EventHandler<EventArgs> Disposed;
|
public event EventHandler<EventArgs> Disposed;
|
||||||
public event EventHandler<EventArgs> IconChanged;
|
public event EventHandler<EventArgs> IconChanged;
|
||||||
public event EventHandler<EventArgs> TitleChanged;
|
|
||||||
public event EventHandler<EventArgs> ClientSizeChanged;
|
public event EventHandler<EventArgs> ClientSizeChanged;
|
||||||
public event EventHandler<EventArgs> VisibleChanged;
|
public event EventHandler<EventArgs> VisibleChanged;
|
||||||
public event EventHandler<EventArgs> FocusedChanged;
|
public event EventHandler<EventArgs> FocusedChanged;
|
||||||
|
@ -108,14 +108,8 @@ namespace OpenTK.Platform.Windows {
|
|||||||
internal static extern uint MapVirtualKey(VirtualKeys vkey, MapVirtualKeyType uMapType);
|
internal static extern uint MapVirtualKey(VirtualKeys vkey, MapVirtualKeyType uMapType);
|
||||||
|
|
||||||
[DllImport("user32.dll", SetLastError = true), SuppressUnmanagedCodeSecurity]
|
[DllImport("user32.dll", SetLastError = true), SuppressUnmanagedCodeSecurity]
|
||||||
internal static extern bool ShowWindow(IntPtr hWnd, ShowWindowCommand nCmdShow);
|
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]
|
[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);
|
||||||
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; }
|
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 {
|
public bool Visible {
|
||||||
get { return API.IsWindowVisible(window.WindowHandle); }
|
get { return API.IsWindowVisible(window.WindowHandle); }
|
||||||
set {
|
set {
|
||||||
@ -673,7 +660,6 @@ namespace OpenTK.Platform.Windows
|
|||||||
public event EventHandler<EventArgs> Closed;
|
public event EventHandler<EventArgs> Closed;
|
||||||
public event EventHandler<EventArgs> Disposed;
|
public event EventHandler<EventArgs> Disposed;
|
||||||
public event EventHandler<EventArgs> IconChanged;
|
public event EventHandler<EventArgs> IconChanged;
|
||||||
public event EventHandler<EventArgs> TitleChanged;
|
|
||||||
public event EventHandler<EventArgs> ClientSizeChanged;
|
public event EventHandler<EventArgs> ClientSizeChanged;
|
||||||
public event EventHandler<EventArgs> VisibleChanged;
|
public event EventHandler<EventArgs> VisibleChanged;
|
||||||
public event EventHandler<EventArgs> FocusedChanged;
|
public event EventHandler<EventArgs> FocusedChanged;
|
||||||
|
@ -638,7 +638,6 @@ namespace OpenTK.Platform.X11 {
|
|||||||
public event EventHandler<EventArgs> Closed;
|
public event EventHandler<EventArgs> Closed;
|
||||||
public event EventHandler<EventArgs> Disposed;
|
public event EventHandler<EventArgs> Disposed;
|
||||||
public event EventHandler<EventArgs> IconChanged;
|
public event EventHandler<EventArgs> IconChanged;
|
||||||
public event EventHandler<EventArgs> TitleChanged;
|
|
||||||
public event EventHandler<EventArgs> VisibleChanged;
|
public event EventHandler<EventArgs> VisibleChanged;
|
||||||
public event EventHandler<EventArgs> FocusedChanged;
|
public event EventHandler<EventArgs> FocusedChanged;
|
||||||
public event EventHandler<EventArgs> WindowStateChanged;
|
public event EventHandler<EventArgs> WindowStateChanged;
|
||||||
@ -703,24 +702,6 @@ namespace OpenTK.Platform.X11 {
|
|||||||
get { return window.WindowHandle; }
|
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 {
|
public bool Visible {
|
||||||
get { return visible; }
|
get { return visible; }
|
||||||
set {
|
set {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user