2013-04-24 22:09:11 +00:00
using System ;
2013-11-04 01:39:19 +00:00
namespace BizHawk.Emulation.Common
2011-06-11 22:15:08 +00:00
{
2016-12-12 19:14:01 +00:00
/// <summary>
2017-04-26 14:10:00 +00:00
/// This object facilitates communications between client and core
2016-12-14 15:11:07 +00:00
/// and is used by the IEmulator interface
2016-12-12 19:14:01 +00:00
/// The primary use is to provide a client => core communication, such as providing client-side callbacks for a core to use
2017-04-27 16:43:19 +00:00
/// Any communications that can be described as purely a Core -> Client system, should be provided as an <seealso cref="IEmulatorService"/> instead
2016-12-12 19:14:01 +00:00
/// </summary>
2016-12-14 15:11:07 +00:00
/// <seealso cref="IEmulator" />
2012-12-10 00:43:43 +00:00
public class CoreComm
2011-06-11 22:15:08 +00:00
{
2017-04-24 12:41:55 +00:00
public CoreComm ( Action < string > showMessage , Action < string > notifyMessage )
2014-12-05 01:56:45 +00:00
{
2016-02-28 18:35:41 +00:00
ShowMessage = showMessage ;
2017-04-24 12:41:55 +00:00
Notify = notifyMessage ;
2014-12-05 01:56:45 +00:00
}
2013-04-24 22:09:11 +00:00
2017-04-27 16:43:19 +00:00
public ICoreFileProvider CoreFileProvider { get ; set ; }
2011-06-11 22:15:08 +00:00
2017-04-14 17:28:23 +00:00
// a core should set these if you wish to provide rom status information yourself. otherwise it will be calculated by the frontend in a way you may not like, using RomGame-related concepts.
2017-04-27 16:43:19 +00:00
public string RomStatusAnnotation { get ; set ; }
public string RomStatusDetails { get ; set ; }
2012-09-16 19:38:08 +00:00
2017-04-27 16:43:19 +00:00
public int ScreenLogicalOffsetX { get ; set ; }
public int ScreenLogicalOffsetY { get ; set ; }
2012-09-30 02:07:14 +00:00
2012-11-26 02:25:23 +00:00
// size hint to a/v out resizer. this probably belongs in VideoProvider? but it's somewhat different than VirtualWidth...
2017-04-27 16:43:19 +00:00
public int NominalWidth { get ; set ; } = 640 ;
public int NominalHeight { get ; set ; } = 480 ;
2012-11-26 02:25:23 +00:00
2017-04-14 17:28:23 +00:00
// I know we want to get rid of CoreComm, but while it's still here, I'll use it for this
2017-04-27 16:43:19 +00:00
public string LaunchLibretroCore { get ; set ; }
2015-11-06 14:31:50 +00:00
2013-12-10 17:58:12 +00:00
/// <summary>
2017-04-27 16:43:19 +00:00
/// Gets a message to show. reasonably annoying (dialog box), shouldn't be used most of the time
2013-12-10 17:58:12 +00:00
/// </summary>
public Action < string > ShowMessage { get ; private set ; }
2014-03-18 03:03:53 +00:00
/// <summary>
2017-04-27 16:43:19 +00:00
/// Gets a message to show. less annoying (OSD message). Should be used for ignorable helpful messages
2014-03-18 03:03:53 +00:00
/// </summary>
public Action < string > Notify { get ; private set ; }
2017-04-27 16:43:19 +00:00
public Func < int , int , bool , object > RequestGLContext { get ; set ; }
public Action < object > ReleaseGLContext { get ; set ; }
public Action < object > ActivateGLContext { get ; set ; }
public Action DeactivateGLContext { get ; set ; } // this shouldnt be necessary.. frontend should be changing context before it does anything.. but for now..
2011-06-11 22:15:08 +00:00
}
2012-03-11 06:50:46 +00:00
}