diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2017-04-03 13:35:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-03 13:35:35 +0200 |
| commit | 9d1ae76d0d16a9d117e595cc07ce97f9faa83447 (patch) | |
| tree | 5658210f9932cc0e6f2632d318a6b1cc6616af22 /Source/Core/DolphinWX/Frame.cpp | |
| parent | 637bdc45b388ebd38a59a9496cea474fe3200ab8 (diff) | |
| parent | b67968c3d89d7c88cee10e110656d14fcb2d2622 (diff) | |
Merge pull request #5200 from lioncash/frame
Frame: Remove callback function prototypes from header.
Diffstat (limited to 'Source/Core/DolphinWX/Frame.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Frame.cpp | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 0675d4ad32..465eac734e 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -392,9 +392,7 @@ CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geo m_LogWindow->Disable(); InitializeTASDialogs(); - - State::SetOnAfterLoadCallback(OnAfterLoadCallback); - Core::SetOnStoppedCallback(OnStoppedCallback); + InitializeCoreCallbacks(); // Setup perspectives if (g_pCodeWindow) @@ -515,6 +513,20 @@ void CFrame::InitializeTASDialogs() }); } +void CFrame::InitializeCoreCallbacks() +{ + // Warning: this gets called from the CPU thread, so we should + // only queue things to do on the proper thread + State::SetOnAfterLoadCallback([this] { + AddPendingEvent(wxCommandEvent{wxEVT_HOST_COMMAND, IDM_UPDATE_GUI}); + }); + + // Warning: this gets called from the EmuThread + Core::SetOnStoppedCallback([this] { + AddPendingEvent(wxCommandEvent{wxEVT_HOST_COMMAND, IDM_STOPPED}); + }); +} + bool CFrame::RendererIsFullscreen() { bool fullscreen = false; @@ -1025,28 +1037,6 @@ static int GetMenuIDFromHotkey(unsigned int key) return -1; } -void OnAfterLoadCallback() -{ - // warning: this gets called from the CPU thread, so we should only queue things to do on the - // proper thread - if (main_frame) - { - wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATE_GUI); - main_frame->GetEventHandler()->AddPendingEvent(event); - } -} - -void OnStoppedCallback() -{ - // warning: this gets called from the EmuThread, so we should only queue things to do on the - // proper thread - if (main_frame) - { - wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_STOPPED); - main_frame->GetEventHandler()->AddPendingEvent(event); - } -} - void CFrame::OnKeyDown(wxKeyEvent& event) { // On OS X, we claim all keyboard events while |
