Extract a tiny interface from DisplayManager for ApiHawk
This commit is contained in:
parent
0704db5940
commit
7edf3b36ad
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Drawing.Text;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface IDisplayManagerForApi
|
||||
{
|
||||
PrivateFontCollection CustomFonts { get; }
|
||||
|
||||
OSDManager OSD { get; }
|
||||
|
||||
/// <summary>locks the lua surface called <paramref name="name"/></summary>
|
||||
/// <exception cref="InvalidOperationException">already locked, or unknown surface</exception>
|
||||
DisplaySurface LockLuaSurface(string name, bool clear = true);
|
||||
|
||||
/// <summary>unlocks this DisplaySurface which had better have been locked as a lua surface</summary>
|
||||
/// <exception cref="InvalidOperationException">already unlocked</exception>
|
||||
void UnlockLuaSurface(DisplaySurface surface);
|
||||
}
|
||||
}
|
|
@ -37,7 +37,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
IEmulatorServiceProvider serviceProvider,
|
||||
Action<string> logCallback,
|
||||
IMainFormForApi mainForm,
|
||||
DisplayManager displayManager,
|
||||
IDisplayManagerForApi displayManager,
|
||||
InputManager inputManager,
|
||||
IMovieSession movieSession,
|
||||
ToolManager toolManager,
|
||||
|
@ -49,7 +49,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
[typeof(Action<string>)] = logCallback,
|
||||
[typeof(IMainFormForApi)] = mainForm,
|
||||
[typeof(DisplayManager)] = displayManager,
|
||||
[typeof(IDisplayManagerForApi)] = displayManager,
|
||||
[typeof(IWindowCoordsTransformer)] = displayManager,
|
||||
[typeof(InputManager)] = inputManager,
|
||||
[typeof(IMovieSession)] = movieSession,
|
||||
|
@ -72,7 +72,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
public static IExternalApiProvider Restart(
|
||||
IEmulatorServiceProvider serviceProvider,
|
||||
IMainFormForApi mainForm,
|
||||
DisplayManager displayManager,
|
||||
IDisplayManagerForApi displayManager,
|
||||
InputManager inputManager,
|
||||
IMovieSession movieSession,
|
||||
ToolManager toolManager,
|
||||
|
@ -89,7 +89,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
IEmulatorServiceProvider serviceProvider,
|
||||
Action<string> logCallback,
|
||||
IMainFormForApi mainForm,
|
||||
DisplayManager displayManager,
|
||||
IDisplayManagerForApi displayManager,
|
||||
InputManager inputManager,
|
||||
IMovieSession movieSession,
|
||||
ToolManager toolManager,
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private readonly Action<string> LogCallback;
|
||||
|
||||
private readonly DisplayManager _displayManager;
|
||||
private readonly IDisplayManagerForApi _displayManager;
|
||||
|
||||
private readonly Dictionary<string, Image> _imageCache = new Dictionary<string, Image>();
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public bool HasGUISurface => _GUISurface != null;
|
||||
|
||||
public GuiApi(Action<string> logCallback, DisplayManager displayManager)
|
||||
public GuiApi(Action<string> logCallback, IDisplayManagerForApi displayManager)
|
||||
{
|
||||
LogCallback = logCallback;
|
||||
_displayManager = displayManager;
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// Its job is to receive OSD and emulator outputs, and produce one single buffer (BitmapBuffer? Texture2d?) for display by the PresentationPanel.
|
||||
/// Details TBD
|
||||
/// </summary>
|
||||
public class DisplayManager : IWindowCoordsTransformer, IDisposable
|
||||
public class DisplayManager : IDisplayManagerForApi, IWindowCoordsTransformer, IDisposable
|
||||
{
|
||||
private class DisplayManagerRenderTargetProvider : IRenderTargetProvider
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private readonly Func<bool> _getIsSecondaryThrottlingDisabled;
|
||||
|
||||
public readonly OSDManager OSD;
|
||||
public OSDManager OSD { get; }
|
||||
|
||||
private Config GlobalConfig;
|
||||
|
||||
|
@ -214,7 +214,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// <summary>
|
||||
/// custom fonts that don't need to be installed on the user side
|
||||
/// </summary>
|
||||
public PrivateFontCollection CustomFonts = new PrivateFontCollection();
|
||||
public PrivateFontCollection CustomFonts { get; } = new PrivateFontCollection();
|
||||
|
||||
private readonly TextureFrugalizer _videoTextureFrugalizer;
|
||||
private readonly Dictionary<string, TextureFrugalizer> _luaSurfaceFrugalizers = new Dictionary<string, TextureFrugalizer>();
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
public Win32LuaLibraries(
|
||||
IEmulatorServiceProvider serviceProvider,
|
||||
MainForm mainForm,
|
||||
DisplayManager displayManager,
|
||||
IDisplayManagerForApi displayManager,
|
||||
InputManager inputManager,
|
||||
Config config,
|
||||
IEmulator emulator,
|
||||
|
@ -104,7 +104,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
EnumerateLuaFunctions(nameof(LuaCanvas), typeof(LuaCanvas), null); // add LuaCanvas to Lua function reference table
|
||||
}
|
||||
|
||||
private readonly DisplayManager _displayManager;
|
||||
private readonly IDisplayManagerForApi _displayManager;
|
||||
|
||||
private readonly InputManager _inputManager;
|
||||
|
||||
|
|
Loading…
Reference in New Issue