Extract interface from MainForm
This commit is contained in:
parent
e3c54b2268
commit
962ac0d9d4
|
@ -15,7 +15,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private readonly int _captureWidth = 640;
|
||||
private readonly int _captureHeight = 480;
|
||||
|
||||
private VideoWriterChooserForm(MainForm mainForm, IEmulator emulator, Config config)
|
||||
private VideoWriterChooserForm(IMainFormForTools mainForm, IEmulator emulator, Config config)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
@ -55,7 +55,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// <returns>user choice, or null on Cancel\Close\invalid</returns>
|
||||
public static IVideoWriter DoVideoWriterChooserDlg(
|
||||
IEnumerable<VideoWriterInfo> list,
|
||||
MainForm owner,
|
||||
IMainFormForTools owner,
|
||||
IEmulator emulator,
|
||||
Config config,
|
||||
out int resizeW,
|
||||
|
|
|
@ -12,11 +12,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public static class ApiManager
|
||||
{
|
||||
private static readonly Type[] CtorParamTypesA = { typeof(Action<string>), typeof(DisplayManager), typeof(InputManager), typeof(MainForm) };
|
||||
private static readonly Type[] CtorParamTypesA = { typeof(Action<string>), typeof(DisplayManager), typeof(InputManager), typeof(IMainFormForApi) };
|
||||
|
||||
private static readonly Type[] CtorParamTypesB = { typeof(Action<string>) };
|
||||
|
||||
private static readonly Type[] CtorParamTypesEmuClientApi = { typeof(Action<string>), typeof(DisplayManager), typeof(InputManager), typeof(MainForm), typeof(Config), typeof(IEmulator), typeof(GameInfo) };
|
||||
private static readonly Type[] CtorParamTypesEmuClientApi = { typeof(Action<string>), typeof(DisplayManager), typeof(InputManager), typeof(IMainFormForApi), typeof(Config), typeof(IEmulator), typeof(GameInfo) };
|
||||
|
||||
/// <remarks>TODO do we need to keep references to these because of GC weirdness? --yoshi</remarks>
|
||||
private static ApiContainer? _container;
|
||||
|
@ -24,7 +24,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private static ApiContainer? _luaContainer;
|
||||
|
||||
private static ApiContainer Register(
|
||||
MainForm mainForm,
|
||||
IMainFormForApi mainForm,
|
||||
IEmulatorServiceProvider serviceProvider,
|
||||
Action<string> logCallback)
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return new ApiContainer(libDict);
|
||||
}
|
||||
|
||||
public static IExternalApiProvider Restart(MainForm mainForm, IEmulatorServiceProvider newServiceProvider)
|
||||
public static IExternalApiProvider Restart(IMainFormForApi mainForm, IEmulatorServiceProvider newServiceProvider)
|
||||
{
|
||||
GlobalWin.ClientApi = null;
|
||||
_container = Register(mainForm, newServiceProvider, Console.WriteLine);
|
||||
|
@ -65,7 +65,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return new BasicApiProvider(_container);
|
||||
}
|
||||
|
||||
public static ApiContainer RestartLua(MainForm mainForm, IEmulatorServiceProvider newServiceProvider, Action<string> logCallback)
|
||||
public static ApiContainer RestartLua(IMainFormForApi mainForm, IEmulatorServiceProvider newServiceProvider, Action<string> logCallback)
|
||||
=> _luaContainer = Register(mainForm, newServiceProvider, logCallback);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private readonly InputManager _inputManager;
|
||||
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForApi _mainForm;
|
||||
|
||||
private readonly Action<string> _logCallback;
|
||||
|
||||
|
@ -85,7 +85,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public event StateSavedEventHandler StateSaved;
|
||||
|
||||
public EmuClientApi(Action<string> logCallback, DisplayManager displayManager, InputManager inputManager, MainForm mainForm, Config config, IEmulator emulator, GameInfo game)
|
||||
public EmuClientApi(Action<string> logCallback, DisplayManager displayManager, InputManager inputManager, IMainFormForApi mainForm, Config config, IEmulator emulator, GameInfo game)
|
||||
{
|
||||
_config = config;
|
||||
_displayManager = displayManager;
|
||||
|
|
|
@ -13,9 +13,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private readonly InputManager _inputManager;
|
||||
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForApi _mainForm;
|
||||
|
||||
public InputApi(Action<string> logCallback, DisplayManager displayManager, InputManager inputManager, MainForm mainForm)
|
||||
public InputApi(Action<string> logCallback, DisplayManager displayManager, InputManager inputManager, IMainFormForApi mainForm)
|
||||
{
|
||||
_displayManager = displayManager;
|
||||
_inputManager = inputManager;
|
||||
|
|
|
@ -8,11 +8,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public sealed class SaveStateApi : ISaveStateApi
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForApi _mainForm;
|
||||
|
||||
private readonly Action<string> LogCallback;
|
||||
|
||||
public SaveStateApi(Action<string> logCallback, DisplayManager displayManager, InputManager inputManager, MainForm mainForm)
|
||||
public SaveStateApi(Action<string> logCallback, DisplayManager displayManager, InputManager inputManager, IMainFormForApi mainForm)
|
||||
{
|
||||
LogCallback = logCallback;
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -0,0 +1,110 @@
|
|||
using System.Drawing;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public interface IMainFormForApi
|
||||
{
|
||||
/// <remarks>only referenced from <see cref="ClientLuaLibrary"/></remarks>
|
||||
CheatCollection CheatList { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
Point DesktopLocation { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="ClientLuaLibrary"/></remarks>
|
||||
IEmulator Emulator { get; }
|
||||
|
||||
bool EmulatorPaused { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
bool InvisibleEmulation { set; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
bool IsSeeking { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
bool IsTurboing { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="InputApi"/></remarks>
|
||||
long MouseWheelTracker { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
bool PauseAvi { set; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
PresentationPanel PresentationPanel { get; }
|
||||
|
||||
void AddOnScreenMessage(string message);
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void ClearHolds();
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void ClickSpeedItem(int num);
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void CloseEmulator(int? exitCode = null);
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void CloseRom(bool clearSram = false);
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void EnableRewind(bool enabled);
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
bool FlushSaveRAM(bool autosave = false);
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void FrameAdvance();
|
||||
|
||||
void FrameBufferResized();
|
||||
|
||||
void FrameSkipMessage();
|
||||
|
||||
/// <remarks>only referenced from <see cref="SaveStateApi"/></remarks>
|
||||
void LoadQuickSave(string quickSlotName, bool suppressOSD = false);
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
bool LoadRom(string path, LoadRomArgs args);
|
||||
|
||||
void LoadState(string combine, string name, bool suppressOSD = false);
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void PauseEmulator();
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void RebootCore();
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void Render();
|
||||
|
||||
/// <remarks>only referenced from <see cref="SaveStateApi"/></remarks>
|
||||
void SaveQuickSave(string quickSlotName, bool fromLua = false, bool suppressOSD = false);
|
||||
|
||||
void SaveState(string path, string userFriendlyStateName, bool fromLua = false, bool suppressOSD = false);
|
||||
|
||||
void SeekFrameAdvance();
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void StepRunLoop_Throttle();
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void TakeScreenshot();
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void TakeScreenshot(string path);
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void TakeScreenshotToClipboard();
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void TogglePause();
|
||||
|
||||
/// <remarks>only referenced from <see cref="EmuClientApi"/></remarks>
|
||||
void ToggleSound();
|
||||
|
||||
void UnpauseEmulator();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
using System.Windows.Forms;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public interface IMainFormForConfig
|
||||
{
|
||||
/// <remarks>only referenced from <see cref="GenericCoreConfig"/></remarks>
|
||||
IEmulator Emulator { get; }
|
||||
|
||||
IMovieSession MovieSession { get; }
|
||||
|
||||
void AddOnScreenMessage(string message);
|
||||
|
||||
void PutCoreSettings(object o);
|
||||
|
||||
void PutCoreSyncSettings(object o);
|
||||
|
||||
DialogResult ShowDialogAsChild(Form dialog);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using BizHawk.Bizware.BizwareGL;
|
||||
using BizHawk.Client.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public interface IMainFormForTools
|
||||
{
|
||||
CheatCollection CheatList { get; }
|
||||
|
||||
string CurrentlyOpenRom { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="HexEditor"/></remarks>
|
||||
LoadRomArgs CurrentlyOpenRomArgs { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="TAStudio"/></remarks>
|
||||
bool EmulatorPaused { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="TAStudio"/></remarks>
|
||||
bool GameIsClosing { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="PlaybackBox"/></remarks>
|
||||
bool HoldFrameAdvance { set; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="BasicBot"/></remarks>
|
||||
bool InvisibleEmulation { get; set; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="TAStudio"/></remarks>
|
||||
bool IsSeeking { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="LuaConsole"/></remarks>
|
||||
bool IsTurboing { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="PresentationPanel"/></remarks>
|
||||
MouseEventHandler MainForm_MouseClick { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="PresentationPanel"/></remarks>
|
||||
MouseEventHandler MainForm_MouseMove { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="PresentationPanel"/></remarks>
|
||||
MouseEventHandler MainForm_MouseWheel { get; }
|
||||
|
||||
int? PauseOnFrame { get; set; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="PlaybackBox"/></remarks>
|
||||
bool PressRewind { set; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="GenericDebugger"/></remarks>
|
||||
event Action<bool> OnPauseChanged;
|
||||
|
||||
void AddOnScreenMessage(string message);
|
||||
|
||||
BitmapBuffer CaptureOSD();
|
||||
|
||||
/// <remarks>only referenced from <see cref="TAStudio"/></remarks>
|
||||
void DisableRewind();
|
||||
|
||||
/// <remarks>only referenced from <see cref="TAStudio"/></remarks>
|
||||
void EnableRewind(bool enabled);
|
||||
|
||||
/// <remarks>only referenced from <see cref="TAStudio"/></remarks>
|
||||
bool EnsureCoreIsAccurate();
|
||||
|
||||
/// <remarks>only referenced from <see cref="TAStudio"/></remarks>
|
||||
void FrameAdvance();
|
||||
|
||||
/// <remarks>only referenced from <see cref="LuaConsole"/></remarks>
|
||||
void FrameBufferResized();
|
||||
|
||||
/// <remarks>only referenced from <see cref="BasicBot"/></remarks>
|
||||
void LoadQuickSave(string quickSlotName, bool suppressOSD = false);
|
||||
|
||||
/// <remarks>only referenced from <see cref="MultiDiskBundler"/></remarks>
|
||||
bool LoadRom(string path, LoadRomArgs args);
|
||||
|
||||
/// <remarks>only referenced from <see cref="BookmarksBranchesBox"/></remarks>
|
||||
BitmapBuffer MakeScreenshotImage();
|
||||
|
||||
void PauseEmulator();
|
||||
|
||||
/// <remarks>only referenced from <see cref="TAStudio"/></remarks>
|
||||
void RelinquishControl(IControlMainform master);
|
||||
|
||||
/// <remarks>only referenced from <see cref="TAStudio"/></remarks>
|
||||
void SeekFrameAdvance();
|
||||
|
||||
void SetMainformMovieInfo();
|
||||
|
||||
/// <remarks>only referenced from <see cref="TAStudio"/></remarks>
|
||||
void SetWindowText();
|
||||
|
||||
/// <remarks>only referenced from <see cref="VideoWriterChooserForm"/></remarks>
|
||||
DialogResult ShowDialogAsChild(Form dialog);
|
||||
|
||||
bool StartNewMovie(IMovie movie, bool record);
|
||||
|
||||
/// <remarks>only referenced from <see cref="TAStudio"/></remarks>
|
||||
void TakeBackControl();
|
||||
|
||||
/// <remarks>only referenced from <see cref="BasicBot"/></remarks>
|
||||
void Throttle();
|
||||
|
||||
/// <remarks>only referenced from <see cref="PresentationPanel"/></remarks>
|
||||
void ToggleFullscreen(bool allowSuppress = false);
|
||||
|
||||
/// <remarks>only referenced from <see cref="TAStudio"/></remarks>
|
||||
void TogglePause();
|
||||
|
||||
void UnpauseEmulator();
|
||||
|
||||
/// <remarks>only referenced from <see cref="BasicBot"/></remarks>
|
||||
void Unthrottle();
|
||||
|
||||
/// <remarks>only referenced from <see cref="LogWindow"/></remarks>
|
||||
void UpdateDumpIcon();
|
||||
|
||||
/// <remarks>only referenced from <see cref="BookmarksBranchesBox"/></remarks>
|
||||
void UpdateStatusSlots();
|
||||
}
|
||||
}
|
|
@ -38,7 +38,7 @@ using BizHawk.Emulation.Cores.Consoles.Nintendo.Faust;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public partial class MainForm : Form
|
||||
public partial class MainForm : Form, IMainFormForApi, IMainFormForConfig, IMainFormForTools
|
||||
{
|
||||
/// <remarks><c>AppliesTo[0]</c> is used as the group label, and <c>Config.PreferredCores[AppliesTo[0]]</c> determines the currently selected option</remarks>
|
||||
private static readonly IReadOnlyCollection<(string[] AppliesTo, string[] CoreNames)> CoreData = new List<(string[], string[])> {
|
||||
|
@ -2129,7 +2129,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
AddOnScreenMessage(message);
|
||||
}
|
||||
|
||||
internal void Render()
|
||||
/*internal*/public void Render()
|
||||
{
|
||||
if (Config.DispSpeedupFeatures == 0)
|
||||
{
|
||||
|
@ -2760,7 +2760,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
AddOnScreenMessage($"Config file loaded: {iniPath}");
|
||||
}
|
||||
|
||||
internal void StepRunLoop_Throttle()
|
||||
/*internal*/public void StepRunLoop_Throttle()
|
||||
{
|
||||
SyncThrottle();
|
||||
_throttle.signal_frameAdvance = _runloopFrameAdvance;
|
||||
|
|
|
@ -11,10 +11,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// </summary>
|
||||
public class PresentationPanel
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForTools _mainForm;
|
||||
private readonly Config _config;
|
||||
|
||||
public PresentationPanel(MainForm mainForm, Config config, IGL gl)
|
||||
public PresentationPanel(IMainFormForTools mainForm, Config config, IGL gl)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
_config = config;
|
||||
|
|
|
@ -7,11 +7,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class A7800ControllerSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly A7800Hawk.A7800SyncSettings _syncSettings;
|
||||
|
||||
public A7800ControllerSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
A7800Hawk.A7800SyncSettings syncSettings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -7,11 +7,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class A7800FilterSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly A7800Hawk.A7800SyncSettings _syncSettings;
|
||||
|
||||
public A7800FilterSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
A7800Hawk.A7800SyncSettings syncSettings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -6,11 +6,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class AmstradCpcAudioSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly AmstradCPC.AmstradCPCSettings _settings;
|
||||
|
||||
public AmstradCpcAudioSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
AmstradCPC.AmstradCPCSettings settings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -6,10 +6,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class AmstradCpcCoreEmulationSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly AmstradCPC.AmstradCPCSyncSettings _syncSettings;
|
||||
|
||||
public AmstradCpcCoreEmulationSettings(MainForm mainForm,
|
||||
public AmstradCpcCoreEmulationSettings(IMainFormForConfig mainForm,
|
||||
AmstradCPC.AmstradCPCSyncSettings syncSettings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -6,11 +6,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class AmstradCpcNonSyncSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly AmstradCPC.AmstradCPCSettings _settings;
|
||||
|
||||
public AmstradCpcNonSyncSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
AmstradCPC.AmstradCPCSettings settings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -7,10 +7,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class AmstradCpcPokeMemory : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly AmstradCPC _cpc;
|
||||
|
||||
public AmstradCpcPokeMemory(MainForm mainForm, AmstradCPC cpc)
|
||||
public AmstradCpcPokeMemory(IMainFormForConfig mainForm, AmstradCPC cpc)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
_cpc = cpc;
|
||||
|
|
|
@ -7,11 +7,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class ColecoControllerSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly ColecoVision.ColecoSyncSettings _syncSettings;
|
||||
|
||||
public ColecoControllerSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
ColecoVision.ColecoSyncSettings settings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class FirmwaresConfig : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly Config _config;
|
||||
|
||||
// friendlier names than the system Ids
|
||||
|
@ -94,7 +94,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private string _currSelectorDir;
|
||||
private readonly ListViewSorter _listViewSorter;
|
||||
|
||||
public FirmwaresConfig(MainForm mainForm, Config config, bool retryLoadRom = false, string reloadRomPath = null)
|
||||
public FirmwaresConfig(IMainFormForConfig mainForm, Config config, bool retryLoadRom = false, string reloadRomPath = null)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
_config = config;
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private bool SyncSettingsChanged => gbPrefControl1.SyncSettingsChanged || gbPrefControl2.SyncSettingsChanged;
|
||||
|
||||
public static void DoDGBPrefsDialog(MainForm mainForm, GambatteLink gambatte)
|
||||
public static void DoDGBPrefsDialog(IMainFormForConfig mainForm, GambatteLink gambatte)
|
||||
{
|
||||
var s = gambatte.GetSettings();
|
||||
var ss = gambatte.GetSyncSettings();
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
Icon = Properties.Resources.gambatte_MultiSize;
|
||||
}
|
||||
|
||||
public static void DoGBPrefsDialog(MainForm mainForm, Gameboy gb)
|
||||
public static void DoGBPrefsDialog(IMainFormForConfig mainForm, Gameboy gb)
|
||||
{
|
||||
var s = gb.GetSettings();
|
||||
var ss = gb.GetSyncSettings();
|
||||
|
|
|
@ -9,13 +9,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class GenericCoreConfig : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private object _s;
|
||||
private object _ss;
|
||||
private bool _syncSettingsChanged;
|
||||
private bool _settingsChanged;
|
||||
|
||||
private GenericCoreConfig(MainForm mainForm, bool ignoreSettings = false, bool ignoreSyncSettings = false)
|
||||
private GenericCoreConfig(IMainFormForConfig mainForm, bool ignoreSettings = false, bool ignoreSyncSettings = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
_mainForm = mainForm;
|
||||
|
@ -106,7 +106,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
Close();
|
||||
}
|
||||
|
||||
public static void DoDialog(MainForm owner, string title)
|
||||
public static void DoDialog(IMainFormForConfig owner, string title)
|
||||
{
|
||||
if (owner.Emulator is Emulation.Cores.Waterbox.NymaCore core)
|
||||
{
|
||||
|
@ -131,7 +131,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
public static void DoDialog(MainForm owner, string title, bool hideSettings, bool hideSyncSettings)
|
||||
public static void DoDialog(IMainFormForConfig owner, string title, bool hideSettings, bool hideSyncSettings)
|
||||
{
|
||||
using var dlg = new GenericCoreConfig(owner, hideSettings, hideSyncSettings) { Text = title };
|
||||
owner.ShowDialogAsChild(dlg);
|
||||
|
|
|
@ -7,11 +7,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class IntvControllerSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly Intellivision.IntvSyncSettings _syncSettings;
|
||||
|
||||
public IntvControllerSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
Intellivision.IntvSyncSettings syncSettings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class N64ControllersSetup : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly N64SyncSettings _syncSettings;
|
||||
|
||||
private List<N64ControllerSettingControl> ControllerSettingControls => Controls
|
||||
|
@ -18,7 +18,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
.ToList();
|
||||
|
||||
public N64ControllersSetup(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
N64SyncSettings syncSettings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class N64VideoPluginConfig : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly Config _config;
|
||||
private readonly IEmulator _emulator;
|
||||
private readonly N64Settings _s;
|
||||
|
@ -41,7 +41,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private bool _programmaticallyChangingPluginComboBox = false;
|
||||
|
||||
public N64VideoPluginConfig(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
Config config,
|
||||
IEmulator emulator)
|
||||
{
|
||||
|
|
|
@ -6,11 +6,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class NdsSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly MelonDS.MelonSyncSettings _syncSettings;
|
||||
|
||||
public NdsSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
MelonDS.MelonSyncSettings syncSettings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -14,13 +14,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
// Allow selection of palette file from archive
|
||||
// Hotkeys for BG & Sprite display toggle
|
||||
// NTSC filter settings? Hue, Tint (This should probably be a client thing, not a nes specific thing?)
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly Config _config;
|
||||
private NES.NESSettings _settings;
|
||||
//private Bitmap _bmp;
|
||||
|
||||
public NESGraphicsConfig(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
Config config,
|
||||
NES.NESSettings settings)
|
||||
{
|
||||
|
|
|
@ -9,12 +9,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class NESSyncSettingsForm : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly DataTableDictionaryBind<string, string> _dataTableDictionary;
|
||||
private readonly NES.NESSyncSettings _syncSettings;
|
||||
|
||||
public NESSyncSettingsForm(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
NES.NESSyncSettings syncSettings,
|
||||
bool hasMapperProperties)
|
||||
{
|
||||
|
|
|
@ -6,12 +6,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class NesVsSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly NES.NESSyncSettings _settings;
|
||||
|
||||
|
||||
public NesVsSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
NES.NESSyncSettings syncSettings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -7,11 +7,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class NesControllerSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly NES.NESSyncSettings _syncSettings;
|
||||
|
||||
public NesControllerSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
NES.NESSyncSettings syncSettings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -10,12 +10,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class QuickNesConfig : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly Config _config;
|
||||
private readonly QuickNES.QuickNESSettings _settings;
|
||||
|
||||
public QuickNesConfig(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
Config config,
|
||||
QuickNES.QuickNESSettings settings)
|
||||
{
|
||||
|
|
|
@ -7,11 +7,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class PSXControllerConfig : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly Octoshock.SyncSettings _syncSettings;
|
||||
|
||||
public PSXControllerConfig(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
Octoshock.SyncSettings syncSettings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private readonly string _lblPixelProText, _lblMednafenText, _lblTweakedMednafenText;
|
||||
|
||||
private PSXOptions(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
Config config,
|
||||
Octoshock.Settings settings,
|
||||
Octoshock.SyncSettings syncSettings,
|
||||
|
@ -63,7 +63,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
private Size _previewVideoSize;
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly Config _config;
|
||||
private readonly OctoshockDll.eVidStandard _previewVideoStandard;
|
||||
private readonly Octoshock.Settings _settings;
|
||||
|
@ -76,7 +76,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
MessageBox.Show("Finetuned Display Options will take effect if you OK from PSX Options");
|
||||
}
|
||||
|
||||
public static DialogResult DoSettingsDialog(MainForm mainForm, Config config, Octoshock psx)
|
||||
public static DialogResult DoSettingsDialog(IMainFormForConfig mainForm, Config config, Octoshock psx)
|
||||
{
|
||||
var s = psx.GetSettings();
|
||||
var ss = psx.GetSyncSettings();
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
public partial class PathConfig : Form
|
||||
{
|
||||
private readonly Config _config;
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly string _currentSystemId;
|
||||
|
||||
// All path text boxes should do some kind of error checking
|
||||
|
@ -42,7 +42,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"..\\"
|
||||
};
|
||||
|
||||
public PathConfig(MainForm mainForm, Config config, string currentSystemId)
|
||||
public PathConfig(IMainFormForConfig mainForm, Config config, string currentSystemId)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
_config = config;
|
||||
|
|
|
@ -15,12 +15,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class ProfileConfig : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly IEmulator _emulator;
|
||||
private readonly Config _config;
|
||||
|
||||
public ProfileConfig(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
IEmulator emulator,
|
||||
Config config)
|
||||
{
|
||||
|
|
|
@ -7,12 +7,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class SNESControllerSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly LibsnesCore.SnesSyncSettings _syncSettings;
|
||||
private bool _suppressDropdownChangeEvents;
|
||||
|
||||
public SNESControllerSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
LibsnesCore.SnesSyncSettings syncSettings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private bool _suppressDoubleSize;
|
||||
private bool _userDoubleSizeOption;
|
||||
|
||||
public static void DoSettingsDialog(MainForm mainForm, LibsnesCore bsnes)
|
||||
public static void DoSettingsDialog(IMainFormForConfig mainForm, LibsnesCore bsnes)
|
||||
{
|
||||
var s = bsnes.GetSettings();
|
||||
var ss = bsnes.GetSyncSettings();
|
||||
|
|
|
@ -7,11 +7,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class TI83PaletteConfig : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly TI83.TI83Settings _settings;
|
||||
|
||||
public TI83PaletteConfig(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
TI83.TI83Settings settings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -6,11 +6,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class ZxSpectrumAudioSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly ZXSpectrum.ZXSpectrumSettings _settings;
|
||||
|
||||
public ZxSpectrumAudioSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
ZXSpectrum.ZXSpectrumSettings settings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -6,11 +6,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class ZxSpectrumCoreEmulationSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly ZXSpectrum.ZXSpectrumSyncSettings _syncSettings;
|
||||
|
||||
public ZxSpectrumCoreEmulationSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
ZXSpectrum.ZXSpectrumSyncSettings syncSettings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -7,12 +7,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class ZxSpectrumJoystickSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly ZXSpectrum.ZXSpectrumSyncSettings _syncSettings;
|
||||
private string[] _possibleControllers;
|
||||
|
||||
public ZxSpectrumJoystickSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
ZXSpectrum.ZXSpectrumSyncSettings syncSettings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -6,12 +6,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class ZxSpectrumNonSyncSettings : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly ZXSpectrum.ZXSpectrumSettings _settings;
|
||||
private int _bgColor;
|
||||
|
||||
public ZxSpectrumNonSyncSettings(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
ZXSpectrum.ZXSpectrumSettings settings)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -6,10 +6,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class ZxSpectrumPokeMemory : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForConfig _mainForm;
|
||||
private readonly ZXSpectrum _speccy;
|
||||
public ZxSpectrumPokeMemory(
|
||||
MainForm mainForm,
|
||||
IMainFormForConfig mainForm,
|
||||
ZXSpectrum speccy)
|
||||
{
|
||||
_mainForm = mainForm;
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class PlayMovie : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForTools _mainForm;
|
||||
private readonly Config _config;
|
||||
private readonly GameInfo _game;
|
||||
private readonly IEmulator _emulator;
|
||||
|
@ -31,7 +31,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private string _sortedDetailsCol;
|
||||
|
||||
public PlayMovie(
|
||||
MainForm mainForm,
|
||||
IMainFormForTools mainForm,
|
||||
Config config,
|
||||
GameInfo game,
|
||||
IEmulator emulator,
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
// TODO - Allow relative paths in record TextBox
|
||||
public partial class RecordMovie : Form
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
private readonly IMainFormForTools _mainForm;
|
||||
private readonly Config _config;
|
||||
private readonly GameInfo _game;
|
||||
private readonly IEmulator _emulator;
|
||||
|
@ -19,7 +19,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private readonly FirmwareManager _firmwareManager;
|
||||
|
||||
public RecordMovie(
|
||||
MainForm mainForm,
|
||||
IMainFormForTools mainForm,
|
||||
Config config,
|
||||
GameInfo game,
|
||||
IEmulator core,
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class BreakpointControl : UserControl
|
||||
{
|
||||
public MainForm MainForm { get; set; }
|
||||
public IMainFormForTools MainForm { get; set; }
|
||||
public IDebuggable Core { get; set; }
|
||||
public IMemoryCallbackSystem Mcs { get; set; }
|
||||
public GenericDebugger ParentDebugger { get; set; }
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[OptionalService]
|
||||
private IVideoProvider VideoProvider { get; set; }
|
||||
|
||||
public MainForm MainForm { get; set; }
|
||||
public IMainFormForApi MainForm { get; set; }
|
||||
|
||||
public ClientLuaLibrary(Lua lua)
|
||||
: base(lua) { }
|
||||
|
|
|
@ -244,7 +244,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
var currentScripts = LuaImp?.ScriptList; // Temp fix for now
|
||||
LuaImp = OSTailoredCode.IsUnixHost ? (LuaLibraries) new UnixLuaLibraries() : new Win32LuaLibraries(MainForm, Emulator.ServiceProvider);
|
||||
LuaImp = OSTailoredCode.IsUnixHost ? (LuaLibraries) new UnixLuaLibraries() : new Win32LuaLibraries((MainForm) MainForm, Emulator.ServiceProvider);
|
||||
LuaImp.ScriptList.AddRange(currentScripts ?? Enumerable.Empty<LuaFile>());
|
||||
|
||||
InputBox.AutoCompleteCustomSource.AddRange(LuaImp.Docs.Select(a => $"{a.Library}.{a.Name}").ToArray());
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
_lua["keepalives"] = _lua.NewTable();
|
||||
}
|
||||
|
||||
public Win32LuaLibraries(MainForm mainForm, IEmulatorServiceProvider serviceProvider)
|
||||
public Win32LuaLibraries(IMainFormForApi mainForm, IEmulatorServiceProvider serviceProvider)
|
||||
: this()
|
||||
{
|
||||
LuaWait = new AutoResetEvent(false);
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private ITasMovie Movie => Tastudio.CurrentTasMovie;
|
||||
private ITasBranchCollection Branches => Movie.Branches;
|
||||
|
||||
private MainForm MainForm => Tastudio.MainForm;
|
||||
private IMainFormForTools MainForm => Tastudio.MainForm;
|
||||
private TasBranch _backupBranch;
|
||||
private BranchUndo _branchUndo = BranchUndo.None;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public ToolManager Tools { get; set; }
|
||||
public Config Config { get; set; }
|
||||
public MainForm MainForm { get; set; }
|
||||
public IMainFormForTools MainForm { get; set; }
|
||||
|
||||
public IMovieSession MovieSession { get; set; }
|
||||
public IGameInfo Game { get; set; }
|
||||
|
@ -122,7 +122,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
protected void RefreshFloatingWindowControl(bool floatingWindow)
|
||||
{
|
||||
Owner = floatingWindow ? null : MainForm;
|
||||
Owner = floatingWindow ? null : (MainForm) MainForm;
|
||||
}
|
||||
|
||||
protected bool IsOnScreen(Point topLeft)
|
||||
|
|
Loading…
Reference in New Issue