2019-01-03 22:50:55 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Threading;
|
|
|
|
|
|
|
|
using BizHawk.Client.Common;
|
|
|
|
using BizHawk.Emulation.Common;
|
|
|
|
|
|
|
|
namespace BizHawk.Client.EmuHawk
|
|
|
|
{
|
|
|
|
public abstract class PlatformEmuLuaLibrary
|
|
|
|
{
|
2019-11-04 04:30:05 +00:00
|
|
|
public readonly LuaDocumentation Docs = new LuaDocumentation();
|
2019-11-04 09:50:45 +00:00
|
|
|
public abstract LuaFunctionList RegisteredFunctions { get; }
|
2019-01-03 22:50:55 +00:00
|
|
|
public GuiLuaLibrary GuiLibrary => (GuiLuaLibrary) Libraries[typeof(GuiLuaLibrary)];
|
|
|
|
protected readonly Dictionary<Type, LuaLibraryBase> Libraries = new Dictionary<Type, LuaLibraryBase>();
|
2019-11-04 04:30:05 +00:00
|
|
|
public IEnumerable<LuaFile> RunningScripts => ScriptList.Where(lf => lf.Enabled);
|
|
|
|
public readonly LuaFileList ScriptList = new LuaFileList();
|
2019-01-03 22:50:55 +00:00
|
|
|
|
2019-11-04 04:30:05 +00:00
|
|
|
public bool IsRebootingCore { get; set; } // pretty hacky.. we dont want a lua script to be able to restart itself by rebooting the core
|
2019-01-03 22:50:55 +00:00
|
|
|
public EventWaitHandle LuaWait { get; protected set; }
|
|
|
|
|
|
|
|
public abstract void CallExitEvent(LuaFile lf);
|
|
|
|
public abstract void CallFrameAfterEvent();
|
|
|
|
public abstract void CallFrameBeforeEvent();
|
|
|
|
public abstract void CallLoadStateEvent(string name);
|
|
|
|
public abstract void CallSaveStateEvent(string name);
|
|
|
|
public abstract void Close();
|
|
|
|
public abstract void EndLuaDrawing();
|
|
|
|
public abstract void ExecuteString(string command);
|
|
|
|
public abstract void Restart(IEmulatorServiceProvider newServiceProvider);
|
2019-11-29 18:47:50 +00:00
|
|
|
public abstract EmuLuaLibrary.ResumeResult ResumeScript(LuaFile lf);
|
2019-01-03 22:50:55 +00:00
|
|
|
public abstract void SpawnAndSetFileThread(string pathToLoad, LuaFile lf);
|
|
|
|
public abstract void StartLuaDrawing();
|
|
|
|
public abstract void WindowClosed(IntPtr handle);
|
|
|
|
}
|
|
|
|
}
|