···4242{
4343 public abstract class GameHost : IIpcHost, IDisposable
4444 {
4545- public GameWindow Window { get; protected set; }
4545+ public IWindow Window { get; protected set; }
46464747 protected FrameworkDebugConfigManager DebugConfig { get; private set; }
48484949 protected FrameworkConfigManager Config { get; private set; }
50505151 /// <summary>
5252- /// Whether the <see cref="GameWindow"/> is active (in the foreground).
5252+ /// Whether the <see cref="IWindow"/> is active (in the foreground).
5353 /// </summary>
5454 public readonly IBindable<bool> IsActive = new Bindable<bool>(true);
5555
+9-4
osu.Framework/Platform/GameWindow.cs
···1515using System.Drawing;
1616using JetBrains.Annotations;
1717using osu.Framework.Bindables;
1818+using osu.Framework.Graphics;
1819using Icon = osuTK.Icon;
19202021namespace osu.Framework.Platform
2122{
2222- public abstract class GameWindow : IGameWindow
2323+ public abstract class GameWindow : IWindow
2324 {
2425 /// <summary>
2526 /// The <see cref="IGraphicsContext"/> associated with this <see cref="GameWindow"/>.
···86878788 FocusedChanged += (o, e) => isActive.Value = Focused;
88898989- SupportedWindowModes.AddRange(DefaultSupportedWindowModes);
9090+ supportedWindowModes.AddRange(DefaultSupportedWindowModes);
90919192 bool firstUpdate = true;
9293 UpdateFrame += (o, e) =>
···223224224225 protected virtual void OnKeyDown(object sender, KeyboardKeyEventArgs e) => KeyDown?.Invoke(sender, e);
225226227227+ private readonly BindableMarginPadding safeAreaPadding = new BindableMarginPadding();
228228+226229 /// <summary>
227230 /// Provides a <see cref="BindableMarginPadding"/> that can be used to keep track of the "safe area" insets on mobile
228231 /// devices. This usually corresponds to areas of the screen hidden under notches and rounded corners.
229232 /// The safe area insets are provided by the operating system and dynamically change as the user rotates the device.
230233 /// </summary>
231231- public readonly BindableMarginPadding SafeAreaPadding = new BindableMarginPadding();
234234+ public IBindable<MarginPadding> SafeAreaPadding => safeAreaPadding;
232235233233- public readonly BindableList<WindowMode> SupportedWindowModes = new BindableList<WindowMode>();
236236+ private readonly BindableList<WindowMode> supportedWindowModes = new BindableList<WindowMode>();
237237+238238+ public IBindableList<WindowMode> SupportedWindowModes => supportedWindowModes;
234239235240 public virtual WindowMode DefaultWindowMode => SupportedWindowModes.First();
236241
+43
osu.Framework/Platform/IWindow.cs
···11+// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
22+// See the LICENCE file in the repository root for full licence text.
33+44+using System;
55+using osu.Framework.Bindables;
66+using osu.Framework.Configuration;
77+using osu.Framework.Graphics;
88+using osuTK;
99+using osuTK.Platform;
1010+1111+namespace osu.Framework.Platform
1212+{
1313+ /// <summary>
1414+ /// Interface representation of the game window, intended to hide any implementation-specific code.
1515+ /// Currently inherits from osuTK; this will be removed as part of the <see cref="GameWindow"/> refactor.
1616+ /// </summary>
1717+ public interface IWindow : IGameWindow
1818+ {
1919+ void CycleMode();
2020+2121+ void SetupWindow(FrameworkConfigManager config);
2222+2323+ event Func<bool> ExitRequested;
2424+2525+ event Action Exited;
2626+2727+ bool CursorInWindow { get; }
2828+2929+ CursorState CursorState { get; set; }
3030+3131+ VSyncMode VSync { get; set; }
3232+3333+ WindowMode DefaultWindowMode { get; }
3434+3535+ DisplayDevice CurrentDisplay { get; }
3636+3737+ IBindable<bool> IsActive { get; }
3838+3939+ IBindable<MarginPadding> SafeAreaPadding { get; }
4040+4141+ IBindableList<WindowMode> SupportedWindowModes { get; }
4242+ }
4343+}