Frame: Make TAS dialogs private

Amends the TAS callbacks to internally store functions using
std::function instead of raw function pointers. This allows binding
extra contextual state via lambda functions, as well as keeping the
dialogs internal to the main frame (on top of being a more flexible
interface).
This commit is contained in:
Lioncash
2017-04-02 01:45:11 -04:00
parent a65a176777
commit 7f0203a5b0
5 changed files with 35 additions and 37 deletions

View File

@ -16,9 +16,7 @@
#include "Common/CommonTypes.h"
#include "Common/Event.h"
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
#include "DolphinWX/Globals.h"
#include "InputCommon/GCPadStatus.h"
#if defined(HAVE_X11) && HAVE_X11
#include "UICommon/X11Utils.h"
@ -88,7 +86,6 @@ public:
CCodeWindow* g_pCodeWindow = nullptr;
NetPlaySetupFrame* g_NetPlaySetupDiag = nullptr;
wxCheatsWindow* g_CheatsWindow = nullptr;
TASInputDlg* g_TASInputDlg[8];
void DoStop();
void UpdateGUI();
@ -140,6 +137,7 @@ private:
CLogWindow* m_LogWindow = nullptr;
LogConfigWindow* m_LogConfigWindow = nullptr;
FifoPlayerDlg* m_FifoPlayerDlg = nullptr;
TASInputDlg* g_TASInputDlg[8];
bool UseDebugger = false;
bool m_bBatchMode = false;
bool m_bEdit = false;
@ -174,6 +172,8 @@ private:
wxToolBar* OnCreateToolBar(long style, wxWindowID id, const wxString& name) override;
wxMenuBar* CreateMenuBar() const;
void InitializeTASDialogs();
// Utility
wxWindow* GetNotebookPageFromId(wxWindowID Id);
wxAuiNotebook* GetNotebookFromId(u32 NBId);
@ -339,8 +339,3 @@ private:
void OnAfterLoadCallback();
void OnStoppedCallback();
// For TASInputDlg
void GCTASManipFunction(GCPadStatus* PadStatus, int controllerID);
void WiiTASManipFunction(u8* data, WiimoteEmu::ReportFeatures rptf, int controllerID, int ext,
const wiimote_key key);