Removed the about from all the plugins and dolphin config screen. then added the about on some plugins config screens and renamed the wiimote_test.cpp

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@787 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
daco65
2008-10-07 18:05:56 +00:00
parent c0af02df49
commit 22b2b36711
26 changed files with 52 additions and 159 deletions

View File

@ -22,7 +22,7 @@ namespace Common
DynamicLibrary CPlugin::m_hInstLib;
void(__cdecl * CPlugin::m_GetDllInfo) (PLUGIN_INFO * _PluginInfo) = 0;
void(__cdecl * CPlugin::m_DllAbout) (HWND _hParent) = 0;
//void(__cdecl * CPlugin::m_DllAbout) (HWND _hParent) = 0;
void(__cdecl * CPlugin::m_DllConfig) (HWND _hParent) = 0;
void(__cdecl * CPlugin::m_DllDebugger) (HWND _hParent) = 0; // phew, is this the last one? how many
// of these can you have?
@ -31,7 +31,7 @@ void
CPlugin::Release(void)
{
m_GetDllInfo = 0;
m_DllAbout = 0;
//m_DllAbout = 0;
m_DllConfig = 0;
m_DllDebugger = 0;
@ -44,7 +44,6 @@ CPlugin::Load(const char* _szName)
if (m_hInstLib.Load(_szName))
{
m_GetDllInfo = (void (__cdecl*)(PLUGIN_INFO*))m_hInstLib.Get("GetDllInfo");
m_DllAbout = (void (__cdecl*)(HWND))m_hInstLib.Get("DllAbout");
m_DllConfig = (void (__cdecl*)(HWND))m_hInstLib.Get("DllConfig");
m_DllDebugger = (void (__cdecl*)(HWND))m_hInstLib.Get("DllDebugger");
return(true);
@ -74,13 +73,13 @@ void CPlugin::Config(HWND _hwnd)
}
}
void CPlugin::About(HWND _hwnd)
{
if (m_DllAbout != 0)
{
m_DllAbout(_hwnd);
}
}
//void CPlugin::About(HWND _hwnd)
//{
// if (m_DllAbout != 0)
// {
// m_DllAbout(_hwnd);
// }
//}
void CPlugin::Debug(HWND _hwnd)
{

View File

@ -43,7 +43,6 @@ class CPlugin
static DynamicLibrary m_hInstLib;
static void (__cdecl * m_GetDllInfo)(PLUGIN_INFO* _PluginInfo);
static void (__cdecl * m_DllAbout)(HWND _hParent);
static void (__cdecl * m_DllConfig)(HWND _hParent);
static void (__cdecl * m_DllDebugger)(HWND _hParent);
};

View File

@ -23,7 +23,6 @@ namespace PluginDSP
// Function Pointer
TGetDllInfo GetDllInfo = 0;
TDllAbout DllAbout = 0;
TDllConfig DllConfig = 0;
TDllDebugger DllDebugger = 0;
TDSP_Initialize DSP_Initialize = 0;
@ -52,7 +51,6 @@ void UnloadPlugin()
// Set Functions to NULL
GetDllInfo = 0;
DllAbout = 0;
DllConfig = 0;
DllDebugger = 0;
DSP_Initialize = 0;
@ -73,7 +71,6 @@ bool LoadPlugin(const char *_Filename)
if (plugin.Load(_Filename))
{
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
DllAbout = reinterpret_cast<TDllAbout> (plugin.Get("DllAbout"));
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
DllDebugger = reinterpret_cast<TDllDebugger> (plugin.Get("DllDebugger"));
DSP_Initialize = reinterpret_cast<TDSP_Initialize> (plugin.Get("DSP_Initialize"));

View File

@ -28,7 +28,7 @@ void UnloadPlugin();
// Function Types
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
typedef void (__cdecl* TDllAbout)(HWND);
//typedef void (__cdecl* TDllAbout)(HWND);
typedef void (__cdecl* TDllConfig)(HWND);
typedef void (__cdecl* TDllDebugger)(HWND);
typedef void (__cdecl* TDSP_Initialize)(DSPInitialize);
@ -43,7 +43,6 @@ typedef void (__cdecl* TDSP_DoState)(unsigned char **ptr, int mode);
// Function Pointers
extern TGetDllInfo GetDllInfo;
extern TDllAbout DllAbout;
extern TDllConfig DllConfig;
extern TDllDebugger DllDebugger;
extern TDSP_Initialize DSP_Initialize;

View File

@ -24,7 +24,7 @@ namespace PluginPAD
// Function Pointers
TGetDllInfo GetDllInfo = 0;
TPAD_Shutdown PAD_Shutdown = 0;
TDllAbout DllAbout = 0;
//TDllAbout DllAbout = 0;
TDllConfig DllConfig = 0;
TPAD_Initialize PAD_Initialize = 0;
TPAD_GetStatus PAD_GetStatus = 0;
@ -45,7 +45,7 @@ void UnloadPlugin()
// Set Functions to 0
GetDllInfo = 0;
PAD_Shutdown = 0;
DllAbout = 0;
//DllAbout = 0;
DllConfig = 0;
PAD_Initialize = 0;
PAD_GetStatus = 0;
@ -57,7 +57,6 @@ bool LoadPlugin(const char *_Filename)
if (plugin.Load(_Filename))
{
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
DllAbout = reinterpret_cast<TDllAbout> (plugin.Get("DllAbout"));
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
PAD_Initialize = reinterpret_cast<TPAD_Initialize> (plugin.Get("PAD_Initialize"));
PAD_Shutdown = reinterpret_cast<TPAD_Shutdown> (plugin.Get("PAD_Shutdown"));
@ -66,7 +65,6 @@ bool LoadPlugin(const char *_Filename)
PAD_GetAttachedPads = reinterpret_cast<TPAD_GetAttachedPads>(plugin.Get("PAD_GetAttachedPads"));
if ((GetDllInfo != 0) &&
(DllAbout != 0) &&
(DllConfig != 0) &&
(PAD_Initialize != 0) &&
(PAD_Shutdown != 0) &&

View File

@ -29,7 +29,6 @@ void UnloadPlugin();
// Function Types
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
typedef void (__cdecl* TDllAbout)(HWND);
typedef void (__cdecl* TDllConfig)(HWND);
typedef void (__cdecl* TPAD_Initialize)(SPADInitialize);
typedef void (__cdecl* TPAD_Shutdown)();
@ -40,7 +39,6 @@ typedef unsigned int (__cdecl* TPAD_GetAttachedPads)();
// Function Pointers
extern TGetDllInfo GetDllInfo;
extern TPAD_Shutdown PAD_Shutdown;
extern TDllAbout DllAbout;
extern TDllConfig DllConfig;
extern TPAD_Initialize PAD_Initialize;
extern TPAD_GetStatus PAD_GetStatus;

View File

@ -24,7 +24,6 @@ namespace PluginVideo
// Function Pointer
TGetDllInfo GetDllInfo = 0;
TDllAbout DllAbout = 0;
TDllConfig DllConfig = 0;
TVideo_Initialize Video_Initialize = 0;
TVideo_Prepare Video_Prepare = 0;
@ -49,7 +48,6 @@ void UnloadPlugin()
{
// set Functions to 0
GetDllInfo = 0;
DllAbout = 0;
DllConfig = 0;
Video_Initialize = 0;
Video_Prepare = 0;
@ -68,7 +66,6 @@ bool LoadPlugin(const char *_Filename)
if (plugin.Load(_Filename))
{
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
DllAbout = reinterpret_cast<TDllAbout> (plugin.Get("DllAbout"));
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
Video_Initialize = reinterpret_cast<TVideo_Initialize> (plugin.Get("Video_Initialize"));
Video_Prepare = reinterpret_cast<TVideo_Prepare> (plugin.Get("Video_Prepare"));
@ -81,7 +78,7 @@ bool LoadPlugin(const char *_Filename)
Video_DoState = reinterpret_cast<TVideo_DoState> (plugin.Get("Video_DoState"));
Video_Stop = reinterpret_cast<TVideo_Stop> (plugin.Get("Video_Stop"));
if ((GetDllInfo != 0) &&
(DllAbout != 0) &&
//(DllAbout != 0) &&
(DllConfig != 0) &&
(Video_Initialize != 0) &&
(Video_Prepare != 0) &&

View File

@ -32,7 +32,7 @@ void UnloadPlugin();
// Function Types
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
typedef void (__cdecl* TDllAbout)(HWND);
//typedef void (__cdecl* TDllAbout)(HWND);
typedef void (__cdecl* TDllConfig)(HWND);
typedef void (__cdecl* TVideo_Initialize)(SVideoInitialize*);
typedef void (__cdecl* TVideo_Prepare)();
@ -47,7 +47,6 @@ typedef void (__cdecl* TVideo_Stop)();
// Function Pointers
extern TGetDllInfo GetDllInfo;
extern TDllAbout DllAbout;
extern TDllConfig DllConfig;
extern TVideo_Initialize Video_Initialize;
extern TVideo_Prepare Video_Prepare;

View File

@ -24,7 +24,6 @@ namespace PluginWiimote
// Function Pointer
TGetDllInfo GetDllInfo = 0;
TDllAbout DllAbout = 0;
TDllConfig DllConfig = 0;
TWiimote_Initialize Wiimote_Initialize = 0;
TWiimote_Shutdown Wiimote_Shutdown = 0;
@ -47,7 +46,6 @@ namespace PluginWiimote
// Set Functions to NULL
GetDllInfo = 0;
DllAbout = 0;
DllConfig = 0;
Wiimote_Initialize = 0;
Wiimote_Shutdown = 0;
@ -63,7 +61,6 @@ namespace PluginWiimote
{
LOG(MASTER_LOG, "getting Wiimote Plugin function pointers...");
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
DllAbout = reinterpret_cast<TDllAbout> (plugin.Get("DllAbout"));
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
Wiimote_Initialize = reinterpret_cast<TWiimote_Initialize> (plugin.Get("Wiimote_Initialize"));
Wiimote_Shutdown = reinterpret_cast<TWiimote_Shutdown> (plugin.Get("Wiimote_Shutdown"));
@ -73,7 +70,6 @@ namespace PluginWiimote
Wiimote_DoState = reinterpret_cast<TWiimote_DoState> (plugin.Get("Wiimote_DoState"));
LOG(MASTER_LOG, "%s: 0x%p", "GetDllInfo", GetDllInfo);
LOG(MASTER_LOG, "%s: 0x%p", "DllAbout", DllAbout);
LOG(MASTER_LOG, "%s: 0x%p", "DllConfig", DllConfig);
LOG(MASTER_LOG, "%s: 0x%p", "Wiimote_Initialize", Wiimote_Initialize);
LOG(MASTER_LOG, "%s: 0x%p", "Wiimote_Shutdown", Wiimote_Shutdown);

View File

@ -28,7 +28,7 @@ void UnloadPlugin();
// Function Types
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
typedef void (__cdecl* TDllAbout)(HWND);
//typedef void (__cdecl* TDllAbout)(HWND);
typedef void (__cdecl* TDllConfig)(HWND);
typedef void (__cdecl* TWiimote_Initialize)(SWiimoteInitialize);
typedef void (__cdecl* TWiimote_Shutdown)();
@ -39,7 +39,6 @@ typedef void (__cdecl* TWiimote_DoState)(void *ptr, int mode);
// Function Pointers
extern TGetDllInfo GetDllInfo;
extern TDllAbout DllAbout;
extern TDllConfig DllConfig;
extern TWiimote_Initialize Wiimote_Initialize;
extern TWiimote_Shutdown Wiimote_Shutdown;

View File

@ -43,16 +43,12 @@ EVT_BUTTON(ID_REMOVEISOPATH, CConfigMain::AddRemoveISOPaths)
EVT_FILEPICKER_CHANGED(ID_DEFAULTISO, CConfigMain::DefaultISOChanged)
EVT_DIRPICKER_CHANGED(ID_DVDROOT, CConfigMain::DVDRootChanged)
EVT_CHOICE(ID_GRAPHIC_CB, CConfigMain::OnSelectionChanged)
EVT_BUTTON(ID_GRAPHIC_ABOUT, CConfigMain::OnAbout)
EVT_BUTTON(ID_GRAPHIC_CONFIG, CConfigMain::OnConfig)
EVT_CHOICE(ID_DSP_CB, CConfigMain::OnSelectionChanged)
EVT_BUTTON(ID_DSP_ABOUT, CConfigMain::OnAbout)
EVT_BUTTON(ID_DSP_CONFIG, CConfigMain::OnConfig)
EVT_CHOICE(ID_PAD_CB, CConfigMain::OnSelectionChanged)
EVT_BUTTON(ID_PAD_ABOUT, CConfigMain::OnAbout)
EVT_BUTTON(ID_PAD_CONFIG, CConfigMain::OnConfig)
EVT_CHOICE(ID_WIIMOTE_CB, CConfigMain::OnSelectionChanged)
EVT_BUTTON(ID_WIIMOTE_ABOUT, CConfigMain::OnAbout)
EVT_BUTTON(ID_WIIMOTE_CONFIG, CConfigMain::OnConfig)
END_EVENT_TABLE()
@ -171,29 +167,26 @@ void CConfigMain::CreateGUIControls()
sPaths->Layout();
// Plugin page
//TODO: reposition the config buttons.
GraphicSelection = new wxChoice(PluginPage, ID_GRAPHIC_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
GraphicAbout = new wxButton(PluginPage, ID_GRAPHIC_ABOUT, wxT("About..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
GraphicConfig = new wxButton(PluginPage, ID_GRAPHIC_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
GraphicText = new wxStaticText(PluginPage, ID_GRAPHIC_TEXT, wxT("GFX:"), wxDefaultPosition, wxDefaultSize);
FillChoiceBox(GraphicSelection, PLUGIN_TYPE_VIDEO, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin);
DSPSelection = new wxChoice(PluginPage, ID_DSP_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
DSPAbout = new wxButton(PluginPage, ID_DSP_ABOUT, wxT("About..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
DSPConfig = new wxButton(PluginPage, ID_DSP_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
DSPText = new wxStaticText(PluginPage, ID_DSP_TEXT, wxT("DSP:"), wxDefaultPosition, wxDefaultSize);
FillChoiceBox(DSPSelection, PLUGIN_TYPE_DSP, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin);
PADSelection = new wxChoice(PluginPage, ID_PAD_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
PADAbout = new wxButton(PluginPage, ID_PAD_ABOUT, wxT("About..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
PADConfig = new wxButton(PluginPage, ID_PAD_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
PADText = new wxStaticText(PluginPage, ID_PAD_TEXT, wxT("PAD:"), wxDefaultPosition, wxDefaultSize);
FillChoiceBox(PADSelection, PLUGIN_TYPE_PAD, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin);
WiimoteSelection = new wxChoice(PluginPage, ID_WIIMOTE_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
WiimoteAbout = new wxButton(PluginPage, ID_WIIMOTE_ABOUT, wxT("About..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiimoteConfig = new wxButton(PluginPage, ID_WIIMOTE_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiimoteText = new wxStaticText(PluginPage, ID_WIIMOTE_TEXT, wxT("Wiimote:"), wxDefaultPosition, wxDefaultSize);
@ -203,22 +196,18 @@ void CConfigMain::CreateGUIControls()
sPlugins->Add(GraphicText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxLEFT, 5);
sPlugins->Add(GraphicSelection, wxGBPosition(0, 1), wxGBSpan(1, 2), wxEXPAND|wxALL, 5);
sPlugins->Add(GraphicConfig, wxGBPosition(1, 1), wxGBSpan(1, 1), wxLEFT|wxBOTTOM, 5);
sPlugins->Add(GraphicAbout, wxGBPosition(1, 2), wxGBSpan(1, 1), wxLEFT|wxBOTTOM, 5);
sPlugins->Add(DSPText, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxLEFT, 5);
sPlugins->Add(DSPSelection, wxGBPosition(2, 1), wxGBSpan(1, 2), wxEXPAND|wxALL, 5);
sPlugins->Add(DSPConfig, wxGBPosition(3, 1), wxGBSpan(1, 1), wxLEFT|wxBOTTOM, 5);
sPlugins->Add(DSPAbout, wxGBPosition(3, 2), wxGBSpan(1, 1), wxLEFT|wxBOTTOM, 5);
sPlugins->Add(PADText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxLEFT, 5);
sPlugins->Add(PADSelection, wxGBPosition(4, 1), wxGBSpan(1, 2), wxEXPAND|wxALL, 5);
sPlugins->Add(PADConfig, wxGBPosition(5, 1), wxGBSpan(1, 1), wxLEFT|wxBOTTOM, 5);
sPlugins->Add(PADAbout, wxGBPosition(5, 2), wxGBSpan(1, 1), wxLEFT|wxBOTTOM, 5);
sPlugins->Add(WiimoteText, wxGBPosition(6, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxLEFT, 5);
sPlugins->Add(WiimoteSelection, wxGBPosition(6, 1), wxGBSpan(1, 2), wxEXPAND|wxALL, 5);
sPlugins->Add(WiimoteConfig, wxGBPosition(7, 1), wxGBSpan(1, 1), wxLEFT|wxBOTTOM, 5);
sPlugins->Add(WiimoteAbout, wxGBPosition(7, 2), wxGBSpan(1, 1), wxLEFT|wxBOTTOM, 5);
PluginPage->SetSizer(sPlugins);
sPlugins->Layout();
@ -329,28 +318,6 @@ void CConfigMain::OnSelectionChanged(wxCommandEvent& WXUNUSED (event))
Apply->Enable();
}
void CConfigMain::OnAbout(wxCommandEvent& event)
{
switch (event.GetId())
{
case ID_GRAPHIC_ABOUT:
CallAbout(GraphicSelection);
break;
case ID_DSP_ABOUT:
CallAbout(DSPSelection);
break;
case ID_PAD_ABOUT:
CallAbout(PADSelection);
break;
case ID_WIIMOTE_ABOUT:
CallAbout(WiimoteSelection);
break;
}
}
void CConfigMain::OnConfig(wxCommandEvent& event)
{
switch (event.GetId())
@ -413,19 +380,6 @@ void CConfigMain::CallConfig(wxChoice* _pChoice)
}
}
void CConfigMain::CallAbout(wxChoice* _pChoice)
{
int Index = _pChoice->GetSelection();
if (Index >= 0)
{
const CPluginInfo* pInfo = static_cast<CPluginInfo*>(_pChoice->GetClientData(Index));
if (pInfo != NULL)
CPluginManager::GetInstance().OpenAbout((HWND) this->GetHandle(), pInfo->GetFileName().c_str());
}
}
void CConfigMain::DoApply()
{
Apply->Disable();

View File

@ -35,7 +35,6 @@ class CConfigMain
virtual ~CConfigMain();
void OKClick(wxCommandEvent& event);
void OnSelectionChanged(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
void OnConfig(wxCommandEvent& event);
private:
@ -76,18 +75,14 @@ class CConfigMain
wxDirPickerCtrl* DVDRoot;
wxStaticText* PADText;
wxButton* PADAbout;
wxButton* PADConfig;
wxChoice* PADSelection;
wxButton* DSPAbout;
wxButton* DSPConfig;
wxStaticText* DSPText;
wxChoice* DSPSelection;
wxButton* GraphicAbout;
wxButton* GraphicConfig;
wxStaticText* GraphicText;
wxChoice* GraphicSelection;
wxButton* WiimoteAbout;
wxButton* WiimoteConfig;
wxStaticText* WiimoteText;
wxChoice* WiimoteSelection;
@ -152,7 +147,7 @@ class CConfigMain
void FillChoiceBox(wxChoice* _pChoice, int _PluginType, const std::string& _SelectFilename);
void CallConfig(wxChoice* _pChoice);
void CallAbout(wxChoice* _pChoice);
//void CallAbout(wxChoice* _pChoice);
void DoApply();

View File

@ -99,16 +99,6 @@ void CPluginManager::ScanForPlugins(wxWindow* _wxWindow)
}
}
void CPluginManager::OpenAbout(void* _Parent, const char *_rFilename)
{
if (Common::CPlugin::Load(_rFilename))
{
Common::CPlugin::About((HWND)_Parent);
Common::CPlugin::Release();
}
}
void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename)
{
if (Common::CPlugin::Load(_rFilename))

View File

@ -41,7 +41,6 @@ class CPluginManager
public:
static CPluginManager& GetInstance() {return(m_Instance);}
void ScanForPlugins(wxWindow* _wxWindow);
void OpenAbout(void* _Parent, const char *_rFilename);
void OpenConfig(void* _Parent, const char *_rFilename);
void OpenDebug(void* _Parent, const char *_rFilename);
const CPluginInfos& GetPluginInfos() {return(m_PluginInfos);}