From 7ac47676e21ba1c26e6886c6d6c2493e7385a739 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Tue, 14 Jun 2016 22:03:03 +0100 Subject: [PATCH] pcsx2: Use Bind compatible event declarations/definitions Also remove some unused event types. --- pcsx2/gui/App.h | 7 +------ pcsx2/gui/AppMain.cpp | 5 ----- pcsx2/gui/ApplyState.h | 4 +--- pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp | 6 +++--- pcsx2/gui/Dialogs/ConfigurationDialog.h | 4 +--- pcsx2/gui/Panels/MemoryCardListPanel.cpp | 2 -- pcsx2/gui/Panels/PluginSelectorPanel.cpp | 15 +++++++-------- 7 files changed, 13 insertions(+), 30 deletions(-) diff --git a/pcsx2/gui/App.h b/pcsx2/gui/App.h index 2adeb87bd3..0aac08b943 100644 --- a/pcsx2/gui/App.h +++ b/pcsx2/gui/App.h @@ -35,12 +35,7 @@ class DisassemblyDialog; typedef void FnType_OnThreadComplete(const wxCommandEvent& evt); typedef void (Pcsx2App::*FnPtr_Pcsx2App)(); -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE( pxEvt_LoadPluginsComplete, -1 ) - DECLARE_EVENT_TYPE( pxEvt_LogicalVsync, -1 ) - DECLARE_EVENT_TYPE( pxEvt_ThreadTaskTimeout_SysExec, -1 ) - DECLARE_EVENT_TYPE( pxEvt_SetSettingsPage, -1 ) -END_DECLARE_EVENT_TYPES() +wxDECLARE_EVENT(pxEvt_SetSettingsPage, wxCommandEvent); // This is used when the GS plugin is handling its own window. Messages from the PAD // are piped through to an app-level message handler, which dispatches them through diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index d6db0c6f06..49ab4ff3c6 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -61,11 +61,6 @@ IMPLEMENT_APP(Pcsx2App) -DEFINE_EVENT_TYPE( pxEvt_LoadPluginsComplete ); -DEFINE_EVENT_TYPE( pxEvt_LogicalVsync ); - -DEFINE_EVENT_TYPE( pxEvt_ThreadTaskTimeout_SysExec ); - std::unique_ptr g_Conf; AspectRatioType iniAR; diff --git a/pcsx2/gui/ApplyState.h b/pcsx2/gui/ApplyState.h index 2589497694..8e80064f08 100644 --- a/pcsx2/gui/ApplyState.h +++ b/pcsx2/gui/ApplyState.h @@ -23,9 +23,7 @@ class BaseApplicableConfigPanel; class BaseApplicableDialog; -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE( pxEvt_ApplySettings, -1 ) -END_DECLARE_EVENT_TYPES() +wxDECLARE_EVENT(pxEvt_ApplySettings, wxCommandEvent); namespace Exception { diff --git a/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp b/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp index 962015dd71..857b630b1a 100644 --- a/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp +++ b/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp @@ -27,9 +27,9 @@ #include #include -DEFINE_EVENT_TYPE( pxEvt_ApplySettings ) -DEFINE_EVENT_TYPE( pxEvt_SetSettingsPage ) -DEFINE_EVENT_TYPE( pxEvt_SomethingChanged ) +wxDEFINE_EVENT(pxEvt_ApplySettings, wxCommandEvent); +wxDEFINE_EVENT(pxEvt_SetSettingsPage, wxCommandEvent); +wxDEFINE_EVENT(pxEvt_SomethingChanged, wxCommandEvent); using namespace Panels; diff --git a/pcsx2/gui/Dialogs/ConfigurationDialog.h b/pcsx2/gui/Dialogs/ConfigurationDialog.h index 44c094a58b..00253b656d 100644 --- a/pcsx2/gui/Dialogs/ConfigurationDialog.h +++ b/pcsx2/gui/Dialogs/ConfigurationDialog.h @@ -29,9 +29,7 @@ namespace Panels class BaseMcdListPanel; } -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE( pxEvt_SomethingChanged, -1 ); -END_DECLARE_EVENT_TYPES() +wxDECLARE_EVENT(pxEvt_SomethingChanged, wxCommandEvent); namespace Dialogs { diff --git a/pcsx2/gui/Panels/MemoryCardListPanel.cpp b/pcsx2/gui/Panels/MemoryCardListPanel.cpp index fdf11893f7..5aa128d361 100644 --- a/pcsx2/gui/Panels/MemoryCardListPanel.cpp +++ b/pcsx2/gui/Panels/MemoryCardListPanel.cpp @@ -176,7 +176,6 @@ bool McdSlotItem::operator!=( const McdSlotItem& right ) const return operator==( right ); } -//DEFINE_EVENT_TYPE( pxEvt_RefreshSelections ); // ===================================================================================================== // BaseMcdListPanel (implementations) @@ -196,7 +195,6 @@ Panels::BaseMcdListPanel::BaseMcdListPanel( wxWindow* parent ) m_btn_Refresh = new wxButton( this, wxID_ANY, _("Refresh list") ); Connect( m_btn_Refresh->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(BaseMcdListPanel::OnRefreshSelections) ); - //Connect( pxEvt_RefreshSelections, wxCommandEventHandler(BaseMcdListPanel::OnRefreshSelections) ); } void Panels::BaseMcdListPanel::RefreshMcds() const diff --git a/pcsx2/gui/Panels/PluginSelectorPanel.cpp b/pcsx2/gui/Panels/PluginSelectorPanel.cpp index 7f5bf61606..125426d218 100644 --- a/pcsx2/gui/Panels/PluginSelectorPanel.cpp +++ b/pcsx2/gui/Panels/PluginSelectorPanel.cpp @@ -40,15 +40,14 @@ static const bool DisableThreading = using namespace pxSizerFlags; using namespace Threading; -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(pxEvt_EnumeratedNext, -1) - DECLARE_EVENT_TYPE(pxEvt_EnumerationFinished, -1) - DECLARE_EVENT_TYPE(pxEVT_ShowStatusBar, -1) -END_DECLARE_EVENT_TYPES() -DEFINE_EVENT_TYPE(pxEvt_EnumeratedNext); -DEFINE_EVENT_TYPE(pxEvt_EnumerationFinished); -DEFINE_EVENT_TYPE(pxEVT_ShowStatusBar); +wxDECLARE_EVENT(pxEvt_EnumeratedNext, wxCommandEvent); +wxDECLARE_EVENT(pxEvt_EnumerationFinished, wxCommandEvent); +wxDECLARE_EVENT(pxEVT_ShowStatusBar, wxCommandEvent); + +wxDEFINE_EVENT(pxEvt_EnumeratedNext, wxCommandEvent); +wxDEFINE_EVENT(pxEvt_EnumerationFinished, wxCommandEvent); +wxDEFINE_EVENT(pxEVT_ShowStatusBar, wxCommandEvent); typedef s32 (CALLBACK* TestFnptr)(); typedef void (CALLBACK* ConfigureFnptr)();