diff --git a/Source/Core/Common/Src/Plugin.cpp b/Source/Core/Common/Src/Plugin.cpp index b4e3a4262a..c605a43d07 100644 --- a/Source/Core/Common/Src/Plugin.cpp +++ b/Source/Core/Common/Src/Plugin.cpp @@ -100,10 +100,10 @@ void CPlugin::Config(HWND _hwnd) } // Debug: Open the Debugging window -void CPlugin::Debug(HWND _hwnd, bool Show) +void CPlugin::Debug(void *Parent, bool Show) { if (m_DllDebugger != NULL) - m_DllDebugger(_hwnd, Show); + m_DllDebugger(Parent, Show); } void CPlugin::SetGlobals(PLUGIN_GLOBALS* _pluginGlobals) { diff --git a/Source/Core/Common/Src/Plugin.h b/Source/Core/Common/Src/Plugin.h index 97c8b981ad..a71be619cc 100644 --- a/Source/Core/Common/Src/Plugin.h +++ b/Source/Core/Common/Src/Plugin.h @@ -26,7 +26,7 @@ namespace Common { typedef void (__cdecl * TGetDllInfo)(PLUGIN_INFO*); typedef void (__cdecl * TDllConfig)(HWND); - typedef void (__cdecl * TDllDebugger)(HWND, bool); + typedef void (__cdecl * TDllDebugger)(void *, bool); typedef void (__cdecl * TSetDllGlobals)(PLUGIN_GLOBALS*); typedef void (__cdecl * TInitialize)(void *); typedef void (__cdecl * TShutdown)(); @@ -49,7 +49,7 @@ public: void Config(HWND _hwnd); void About(HWND _hwnd); - void Debug(HWND _hwnd, bool Show); + void Debug(void *Parent, bool Show); void DoState(unsigned char **ptr, int mode); void EmuStateChange(PLUGIN_EMUSTATE newState); void Initialize(void *init); diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 38a3944d5f..cc06d09f9e 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -202,8 +202,7 @@ bool Init() return true; } -// Called from GUI thread or VI thread (why VI??? That must be bad. Window -// close? TODO: Investigate.) +// Called from GUI thread void Stop() // - Hammertime! { const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter; diff --git a/Source/Core/Core/Src/PluginManager.cpp b/Source/Core/Core/Src/PluginManager.cpp index 54e6a10434..1ad1370659 100644 --- a/Source/Core/Core/Src/PluginManager.cpp +++ b/Source/Core/Core/Src/PluginManager.cpp @@ -448,10 +448,10 @@ void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename, PLUGIN_TYP switch(Type) { case PLUGIN_TYPE_VIDEO: - GetVideo()->Debug((HWND)_Parent, Show); + GetVideo()->Debug(_Parent, Show); break; case PLUGIN_TYPE_DSP: - GetDSP()->Debug((HWND)_Parent, Show); + GetDSP()->Debug(_Parent, Show); break; default: PanicAlert("Type %d debug not supported in plugin %s", Type, _rFilename); diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.h b/Source/Core/DebuggerWX/Src/CodeWindow.h index 62834528a8..5c19cb96d2 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.h +++ b/Source/Core/DebuggerWX/Src/CodeWindow.h @@ -96,12 +96,13 @@ class CCodeWindow void OnJITOff(wxCommandEvent& event); void OnToggleWindow(wxCommandEvent& event); - void OnToggleCodeWindow(bool,int); - void OnToggleRegisterWindow(bool,int); - void OnToggleBreakPointWindow(bool,int); - void OnToggleMemoryWindow(bool,int); - void OnToggleJitWindow(bool,int); - void OnToggleDLLWindow(int,bool,int); + void ToggleCodeWindow(bool bShow); + void ToggleRegisterWindow(bool bShow); + void ToggleBreakPointWindow(bool bShow); + void ToggleMemoryWindow(bool bShow); + void ToggleJitWindow(bool bShow); + void ToggleDLLWindow(int Id, bool bShow); + void OnChangeFont(wxCommandEvent& event); void OnCodeStep(wxCommandEvent& event); @@ -119,8 +120,8 @@ class CCodeWindow // Settings bool bAutomaticStart; bool bBootToPause; - bool bLogWindow; int iLogWindow; - bool bConsoleWindow; int iConsoleWindow; + int iLogWindow; + int iConsoleWindow; bool bCodeWindow; int iCodeWindow; bool bFloatCodeWindow; bool bRegisterWindow; int iRegisterWindow; bool bFloatRegisterWindow; bool bBreakpointWindow; int iBreakpointWindow; bool bFloatBreakpointWindow; diff --git a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp index 29e3d87554..7fdc37705f 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp @@ -15,11 +15,6 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ - - - -// Include -// -------------- #include "Common.h" #include @@ -31,7 +26,6 @@ #include #include -// ugly that this lib included code from the main #include "../../DolphinWX/Src/WxUtils.h" #include "Host.h" @@ -67,7 +61,6 @@ #include "PluginManager.h" #include "ConfigManager.h" - extern "C" // Bitmaps { #include "../resources/toolbar_play.c" @@ -77,8 +70,6 @@ extern "C" // Bitmaps #include "../resources/toolbar_add_breakpoint.c" } - - // Save and load settings // ----------------------------- void CCodeWindow::Load() @@ -129,6 +120,7 @@ void CCodeWindow::Load() ini.Get("ShowOnStart", "AutomaticStart", &bAutomaticStart, false); ini.Get("ShowOnStart", "BootToPause", &bBootToPause, true); } + void CCodeWindow::Save() { IniFile ini; @@ -140,14 +132,14 @@ void CCodeWindow::Save() ini.Set("ShowOnStart", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART)); ini.Set("ShowOnStart", "BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE)); - // Save windows settings + // Save windows settings //ini.Set("ShowOnStart", "Code", GetMenuBar()->IsChecked(IDM_CODEWINDOW)); ini.Set("ShowOnStart", "Registers", GetMenuBar()->IsChecked(IDM_REGISTERWINDOW)); ini.Set("ShowOnStart", "Breakpoints", GetMenuBar()->IsChecked(IDM_BREAKPOINTWINDOW)); ini.Set("ShowOnStart", "Memory", GetMenuBar()->IsChecked(IDM_MEMORYWINDOW)); ini.Set("ShowOnStart", "JIT", GetMenuBar()->IsChecked(IDM_JITWINDOW)); ini.Set("ShowOnStart", "Sound", GetMenuBar()->IsChecked(IDM_SOUNDWINDOW)); - ini.Set("ShowOnStart", "Video", GetMenuBar()->IsChecked(IDM_VIDEOWINDOW)); + ini.Set("ShowOnStart", "Video", GetMenuBar()->IsChecked(IDM_VIDEOWINDOW)); std::string _Section = StringFromFormat("P - %s", (Parent->ActivePerspective < Parent->Perspectives.size()) ? Parent->Perspectives.at(Parent->ActivePerspective).Name.c_str() : ""); @@ -169,12 +161,11 @@ void CCodeWindow::Save() ini.Set("Float", "Memory", !!FindWindowById(IDM_MEMORYWINDOW_PARENT)); ini.Set("Float", "JIT", !!FindWindowById(IDM_JITWINDOW_PARENT)); ini.Set("Float", "Sound", !!FindWindowById(IDM_SOUNDWINDOW_PARENT)); - ini.Set("Float", "Video", !!FindWindowById(IDM_VIDEOWINDOW_PARENT)); + ini.Set("Float", "Video", !!FindWindowById(IDM_VIDEOWINDOW_PARENT)); ini.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); } - // Symbols, JIT, Profiler // ---------------- void CCodeWindow::CreateMenuSymbols() @@ -200,7 +191,7 @@ void CCodeWindow::CreateMenuSymbols() pSymbolsMenu->Append(IDM_USESIGNATUREFILE, _T("&Use signature file...")); pSymbolsMenu->AppendSeparator(); pSymbolsMenu->Append(IDM_PATCHHLEFUNCTIONS, _T("&Patch HLE functions")); - pSymbolsMenu->Append(IDM_RENAME_SYMBOLS, _T("&Rename symbols from file...")); + pSymbolsMenu->Append(IDM_RENAME_SYMBOLS, _T("&Rename symbols from file...")); pMenuBar->Append(pSymbolsMenu, _T("&Symbols")); wxMenu *pProfilerMenu = new wxMenu; @@ -210,7 +201,6 @@ void CCodeWindow::CreateMenuSymbols() pMenuBar->Append(pProfilerMenu, _T("&Profiler")); } - void CCodeWindow::OnProfilerMenu(wxCommandEvent& event) { if (Core::GetState() == Core::CORE_RUN) { @@ -255,7 +245,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (db.Load((File::GetSysDirectory() + TOTALDB).c_str())) { db.Apply(&g_symbolDB); - Parent->StatusBarMessage("Generated symbol names from '%s'", TOTALDB); + Parent->StatusBarMessage("Generated symbol names from '%s'", TOTALDB); } else { @@ -281,7 +271,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) g_symbolDB.LoadMap(mapfile.c_str()); Parent->StatusBarMessage("Loaded symbols from '%s'", mapfile.c_str()); } - HLE::PatchFunctions(); + HLE::PatchFunctions(); NotifyMapLoaded(); break; case IDM_SAVEMAPFILE: @@ -291,39 +281,39 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) g_symbolDB.SaveMap(mapfile.c_str(), true); break; - case IDM_RENAME_SYMBOLS: - { - wxString path = wxFileSelector( - _T("Apply signature file"), wxEmptyString, wxEmptyString, wxEmptyString, - _T("Dolphin Symbole Rename File (*.sym)|*.sym;"), wxFD_OPEN | wxFD_FILE_MUST_EXIST, - this); - if (! path.IsEmpty()) - { - FILE *f = fopen(path.mb_str(), "r"); - if (!f) - return; + case IDM_RENAME_SYMBOLS: + { + wxString path = wxFileSelector( + _T("Apply signature file"), wxEmptyString, wxEmptyString, wxEmptyString, + _T("Dolphin Symbole Rename File (*.sym)|*.sym;"), wxFD_OPEN | wxFD_FILE_MUST_EXIST, + this); + if (! path.IsEmpty()) + { + FILE *f = fopen(path.mb_str(), "r"); + if (!f) + return; - while (!feof(f)) - { - char line[512]; - fgets(line, 511, f); - if (strlen(line) < 4) - continue; + while (!feof(f)) + { + char line[512]; + fgets(line, 511, f); + if (strlen(line) < 4) + continue; - u32 address, type; - char name[512]; - sscanf(line, "%08x %02i %s", &address, &type, name); + u32 address, type; + char name[512]; + sscanf(line, "%08x %02i %s", &address, &type, name); - Symbol *symbol = g_symbolDB.GetSymbolFromAddr(address); - if (symbol) { - symbol->name = line+12; - } - } - fclose(f); - Host_NotifyMapLoaded(); - } - } - break; + Symbol *symbol = g_symbolDB.GetSymbolFromAddr(address); + if (symbol) { + symbol->name = line+12; + } + } + fclose(f); + Host_NotifyMapLoaded(); + } + } + break; case IDM_CREATESIGNATUREFILE: { @@ -373,7 +363,6 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) } } - void CCodeWindow::NotifyMapLoaded() { if (!codeview) return; @@ -392,7 +381,6 @@ void CCodeWindow::NotifyMapLoaded() Update(); } - void CCodeWindow::OnSymbolListChange(wxCommandEvent& event) { int index = symbols->GetSelection(); @@ -417,7 +405,6 @@ void CCodeWindow::OnSymbolListContextMenu(wxContextMenuEvent& event) { } - // Change the global DebuggerFont void CCodeWindow::OnChangeFont(wxCommandEvent& event) { @@ -432,157 +419,167 @@ void CCodeWindow::OnChangeFont(wxCommandEvent& event) } } - - - // Toogle windows -// ---------------- void CCodeWindow::OpenPages() -{ - Parent->DoToggleWindow(IDM_CODEWINDOW, true); - if (bRegisterWindow) Parent->DoToggleWindow(IDM_REGISTERWINDOW, true); - if (bBreakpointWindow) Parent->DoToggleWindow(IDM_BREAKPOINTWINDOW, true); - if (bMemoryWindow) Parent->DoToggleWindow(IDM_MEMORYWINDOW, true); - if (bJitWindow) Parent->DoToggleWindow(IDM_JITWINDOW, true); - if (bSoundWindow) Parent->DoToggleWindow(IDM_SOUNDWINDOW, true); - if (bVideoWindow) Parent->DoToggleWindow(IDM_VIDEOWINDOW, true); -} -void CCodeWindow::OnToggleWindow(wxCommandEvent& event) { - event.Skip(); - Parent->DoToggleWindow(event.GetId(), GetMenuBar()->IsChecked(event.GetId())); -} -void CCodeWindow::OnToggleCodeWindow(bool _Show, int i) -{ - if (_Show) - { - Parent->DoAddPage(this, i, wxT("Code"), bFloatCodeWindow); - } - else // hide - Parent->DoRemovePage (this); -} -void CCodeWindow::OnToggleRegisterWindow(bool _Show, int i) -{ - if (_Show) - { - if (!m_RegisterWindow) m_RegisterWindow = new CRegisterWindow(Parent, IDM_REGISTERWINDOW); - Parent->DoAddPage(m_RegisterWindow, i, wxT("Registers"), bFloatRegisterWindow); - } - else // hide - Parent->DoRemovePage (m_RegisterWindow); + ToggleCodeWindow(true); + if (bRegisterWindow) + ToggleRegisterWindow(true); + if (bBreakpointWindow) + ToggleBreakPointWindow(true); + if (bMemoryWindow) + ToggleMemoryWindow(true); + if (bJitWindow) + ToggleJitWindow(true); + if (bSoundWindow) + ToggleDLLWindow(IDM_SOUNDWINDOW, true); + if (bVideoWindow) + ToggleDLLWindow(IDM_VIDEOWINDOW, true); } -void CCodeWindow::OnToggleBreakPointWindow(bool _Show, int i) +void CCodeWindow::OnToggleWindow(wxCommandEvent& event) { - if (_Show) + bool bShow = GetMenuBar()->IsChecked(event.GetId()); + + switch(event.GetId()) { - if (!m_BreakpointWindow) m_BreakpointWindow = new CBreakPointWindow(this, Parent, IDM_BREAKPOINTWINDOW); - Parent->DoAddPage(m_BreakpointWindow, i, wxT("Breakpoints"), bFloatBreakpointWindow); + case IDM_REGISTERWINDOW: + ToggleRegisterWindow(bShow); + break; + case IDM_BREAKPOINTWINDOW: + ToggleBreakPointWindow(bShow); + break; + case IDM_MEMORYWINDOW: + ToggleMemoryWindow(bShow); + break; + case IDM_JITWINDOW: + ToggleJitWindow(bShow); + break; + case IDM_SOUNDWINDOW: + ToggleDLLWindow(IDM_SOUNDWINDOW, bShow); + break; + case IDM_VIDEOWINDOW: + ToggleDLLWindow(IDM_VIDEOWINDOW, bShow); + break; + } + event.Skip(); +} + +void CCodeWindow::ToggleCodeWindow(bool bShow) +{ + if (bShow) + Parent->DoAddPage(this, iCodeWindow, wxT("Code"), bFloatCodeWindow); + else // hide + Parent->DoRemovePage(this); +} + +void CCodeWindow::ToggleRegisterWindow(bool bShow) +{ + GetMenuBar()->FindItem(IDM_REGISTERWINDOW)->Check(bShow); + if (bShow) + { + if (!m_RegisterWindow) + m_RegisterWindow = new CRegisterWindow(Parent, IDM_REGISTERWINDOW); + Parent->DoAddPage(m_RegisterWindow, iRegisterWindow, + wxT("Registers"), bFloatRegisterWindow); + } + else // hide + Parent->DoRemovePage(m_RegisterWindow); +} + +void CCodeWindow::ToggleBreakPointWindow(bool bShow) +{ + GetMenuBar()->FindItem(IDM_BREAKPOINTWINDOW)->Check(bShow); + if (bShow) + { + if (!m_BreakpointWindow) + m_BreakpointWindow = new CBreakPointWindow(this, Parent, IDM_BREAKPOINTWINDOW); + Parent->DoAddPage(m_BreakpointWindow, iBreakpointWindow, + wxT("Breakpoints"), bFloatBreakpointWindow); } else // hide Parent->DoRemovePage(m_BreakpointWindow); } - -void CCodeWindow::OnToggleMemoryWindow(bool _Show, int i) +void CCodeWindow::ToggleMemoryWindow(bool bShow) { - if (_Show) + GetMenuBar()->FindItem(IDM_MEMORYWINDOW)->Check(bShow); + if (bShow) { - if (!m_MemoryWindow) m_MemoryWindow = new CMemoryWindow(Parent, IDM_MEMORYWINDOW); - Parent->DoAddPage(m_MemoryWindow, i, wxT("Memory"), bFloatMemoryWindow); + if (!m_MemoryWindow) + m_MemoryWindow = new CMemoryWindow(Parent, IDM_MEMORYWINDOW); + Parent->DoAddPage(m_MemoryWindow, iMemoryWindow, wxT("Memory"), bFloatMemoryWindow); } else // hide Parent->DoRemovePage(m_MemoryWindow); } - -void CCodeWindow::OnToggleJitWindow(bool _Show, int i) +void CCodeWindow::ToggleJitWindow(bool bShow) { - if (_Show) + GetMenuBar()->FindItem(IDM_JITWINDOW)->Check(bShow); + if (bShow) { - if (!m_JitWindow) m_JitWindow = new CJitWindow(Parent, IDM_JITWINDOW); - Parent->DoAddPage(m_JitWindow, i, wxT("JIT"), bFloatJitWindow); + if (!m_JitWindow) + m_JitWindow = new CJitWindow(Parent, IDM_JITWINDOW); + Parent->DoAddPage(m_JitWindow, iJitWindow, wxT("JIT"), bFloatJitWindow); } else // hide Parent->DoRemovePage(m_JitWindow); } - -/* - - - -Notice: This windows docking for plugin windows will produce several wx debugging messages when -::GetWindowRect and ::DestroyWindow fails in wxApp::CleanUp() for the plugin. - - - -*/ - +// Notice: This windows docking will produce several wx debugging messages for plugin +// windows when ::GetWindowRect and ::DestroyWindow fails in wxApp::CleanUp() for the +// plugin. // Toggle Sound Debugging Window -void CCodeWindow::OnToggleDLLWindow(int Id, bool _Show, int i) +void CCodeWindow::ToggleDLLWindow(int Id, bool bShow) { std::string DLLName; wxString Title; - int PLUGINTYPE; + int PluginType, i; + bool bFloat; switch(Id) { case IDM_SOUNDWINDOW: DLLName = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(); - PLUGINTYPE = PLUGIN_TYPE_DSP; + PluginType = PLUGIN_TYPE_DSP; Title = wxT("Sound"); + i = iSoundWindow; + bFloat = bFloatSoundWindow; break; case IDM_VIDEOWINDOW: DLLName = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(); - PLUGINTYPE = PLUGIN_TYPE_VIDEO; + PluginType = PLUGIN_TYPE_VIDEO; Title = wxT("Video"); + i = iVideoWindow; + bFloat = bFloatVideoWindow; break; default: - PanicAlert("CCodeWindow::OnToggleDLLWindow"); + PanicAlert("CCodeWindow::ToggleDLLWindow called with invalid Id"); return; } - if (_Show) - { - if (Parent->GetNotebookCount() == 0) return; - if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0; - wxWindow *Win = Parent->GetWxWindow(Title); - if (Win && Parent->GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) return; + GetMenuBar()->FindItem(Id)->Check(bShow); + if (bShow) + { // Show window - CPluginManager::GetInstance().OpenDebug(Parent->GetHandle(), DLLName.c_str(), (PLUGIN_TYPE)PLUGINTYPE, _Show); - - Win = Parent->GetWxWindow(Title); + CPluginManager::GetInstance().OpenDebug(Parent, + DLLName.c_str(), (PLUGIN_TYPE)PluginType, bShow); + + wxWindow* Win = Parent->GetWxWindow(Title); if (Win) - { - Win->SetName(Title); - Win->Reparent(Parent); - Win->SetId(IDM_SOUNDWINDOW); - Parent->GetNotebookFromId(i)->AddPage(Win, Title, true, Parent->aNormalFile); - } - else { - //Console->Log(LogTypes::LNOTICE, StringFromFormat("OpenDebug: Win not found\n").c_str()); - } + Win->SetId(Id); + Parent->DoAddPage(Win, i, Title, bFloat); + } } else - { - wxWindow *Win = Parent->GetWxWindow(Title); - if (Win) - { - Parent->DoRemovePage(Win, false); - //Win->Reparent(NULL); - // Destroy - CPluginManager::GetInstance().OpenDebug(Parent->GetHandle(), DLLName.c_str(), (PLUGIN_TYPE)PLUGINTYPE, _Show); - //WARN_LOG(CONSOLE, "Sound removed from NB"); - } - else - { - //WARN_LOG(CONSOLE, "Sound not found (Win %i)", FindWindowByName(wxT("Sound"))); - } + { + Parent->DoRemovePageId(Id, false, false); + CPluginManager::GetInstance().OpenDebug(Parent, + DLLName.c_str(), (PLUGIN_TYPE)PluginType, bShow); } - } diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 7fa9409712..9aa8cda704 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -365,7 +365,8 @@ CFrame::CFrame(wxFrame* parent, // Give it a console early to show potential messages from this onward ConsoleListener *Console = LogManager::GetInstance()->getConsoleListener(); if (SConfig::GetInstance().m_InterfaceConsole) Console->Open(); - if (SConfig::GetInstance().m_InterfaceLogWindow) m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW); + m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW); + m_LogWindow->Hide(); // Start debugging mazimized if (UseDebugger) this->Maximize(true); @@ -467,8 +468,10 @@ CFrame::CFrame(wxFrame* parent, else { SetSimplePaneSize(); - if (SConfig::GetInstance().m_InterfaceLogWindow) DoToggleWindow(IDM_LOGWINDOW, true); - if (SConfig::GetInstance().m_InterfaceConsole) DoToggleWindow(IDM_CONSOLEWINDOW, true); + if (SConfig::GetInstance().m_InterfaceLogWindow) + ToggleLogWindow(true); + if (SConfig::GetInstance().m_InterfaceConsole) + ToggleConsole(true); } // Show window @@ -692,38 +695,16 @@ void CFrame::OnHostMessage(wxCommandEvent& event) if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor) m_RenderParent->SetCursor(wxCURSOR_BLANK); break; + #if defined(HAVE_X11) && HAVE_X11 case WM_USER_STOP: DoStop(); break; #endif - } -} -void CFrame::OnCustomHostMessage(int Id) -{ - wxWindow *Win; - - switch(Id) - { - // Destroy windows - case AUDIO_DESTROY: - Win = GetWxWindow(wxT("Sound")); - if (Win) - { - DoRemovePage(Win, false); - - CPluginManager::GetInstance().OpenDebug( - GetHandle(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(), - PLUGIN_TYPE_DSP, false - ); - - //Win->Reparent(NULL); - //g_pCodeWindow->OnToggleDLLWindow(false, 0); - GetMenuBar()->FindItem(IDM_SOUNDWINDOW)->Check(false); - NOTICE_LOG(CONSOLE, "%s", Core::StopMessage(true, "Sound debugging window closed").c_str()); - } + case AUDIO_DESTROY: + if (g_pCodeWindow) + g_pCodeWindow->ToggleDLLWindow(IDM_SOUNDWINDOW, false); break; case VIDEO_DESTROY: @@ -906,10 +887,6 @@ void CFrame::OnKeyUp(wxKeyEvent& event) } } -// -------- -// Functions - - wxFrame * CFrame::CreateParentFrame(wxWindowID Id, const wxString& Title, wxWindow * Child) { wxFrame * Frame = new wxFrame(this, Id, Title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE); @@ -974,93 +951,3 @@ void CFrame::DoFullscreen(bool bF) else m_RenderFrame->Raise(); } - -// Debugging, show loose windows -void CFrame::ListChildren() -{ - ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); - wxAuiNotebook * NB = NULL; - - Console->Log(LogTypes::LNOTICE, "--------------------------------------------------------------------\n"); - - for (u32 i = 0; i < this->GetChildren().size(); i++) - { - wxWindow * Win = this->GetChildren().Item(i)->GetData(); - Console->Log(LogTypes::LNOTICE, StringFromFormat( - "%i: %s (%s) :: %s", i, - (const char*)Win->GetName().mb_str(), (const char*)Win->GetLabel().mb_str(), (const char*)Win->GetParent()->GetName().mb_str()).c_str()); - //if (Win->GetName().IsSameAs(wxT("control"))) - if (Win->IsKindOf(CLASSINFO(wxAuiNotebook))) - { - NB = (wxAuiNotebook*)Win; - Console->Log(LogTypes::LNOTICE, StringFromFormat(" :: NB", (const char*)NB->GetName().mb_str()).c_str()); - } - else - { - NB = NULL; - } - Console->Log(LogTypes::LNOTICE, StringFromFormat("\n").c_str()); - - Win = this->GetChildren().Item(i)->GetData(); - for (u32 j = 0; j < Win->GetChildren().size(); j++) - { - Console->Log(LogTypes::LNOTICE, StringFromFormat( - " %i.%i: %s (%s) :: %s", i, j, - (const char*)Win->GetName().mb_str(), (const char*)Win->GetLabel().mb_str(), (const char*)Win->GetParent()->GetName().mb_str()).c_str()); - if (NB) - { - if (j < NB->GetPageCount()) - Console->Log(LogTypes::LNOTICE, StringFromFormat(" :: %s", (const char*)NB->GetPage(j)->GetName().mb_str()).c_str()); - } - Console->Log(LogTypes::LNOTICE, StringFromFormat("\n").c_str()); - - /* - Win = this->GetChildren().Item(j)->GetData(); - for (int k = 0; k < Win->GetChildren().size(); k++) - { - Console->Log(LogTypes::LNOTICE, StringFromFormat( - " %i.%i.%i: %s (%s) :: %s\n", i, j, k, - Win->GetName().mb_str(), Win->GetLabel().mb_str(), Win->GetParent()->GetName().mb_str()).c_str()); - } - */ - } - } - - Console->Log(LogTypes::LNOTICE, "--------------------------------------------------------------------\n"); - - for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) - { - if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue; - wxAuiNotebook * _NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window; - Console->Log(LogTypes::LNOTICE, StringFromFormat("%i: %s\n", i, (const char *)m_Mgr->GetAllPanes().Item(i).name.mb_str()).c_str()); - - for (u32 j = 0; j < _NB->GetPageCount(); j++) - { - Console->Log(LogTypes::LNOTICE, StringFromFormat("%i.%i: %s\n", i, j, (const char *)_NB->GetPageText(j).mb_str()).c_str()); - } - } - - Console->Log(LogTypes::LNOTICE, "--------------------------------------------------------------------\n"); -} - -void CFrame::ListTopWindows() -{ - wxWindowList::const_iterator i; - int j = 0; - const wxWindowList::const_iterator end = wxTopLevelWindows.end(); - - for (i = wxTopLevelWindows.begin(); i != end; ++i) - { - wxTopLevelWindow * const Win = wx_static_cast(wxTopLevelWindow *, *i); - NOTICE_LOG(CONSOLE, "%i: %i %s", j, Win, (const char *)Win->GetTitle().mb_str()); - /* - if ( win->ShouldPreventAppExit() ) - { - // there remains at least one important TLW, don't exit - return false; - } - */ - j++; - } - NOTICE_LOG(CONSOLE, "\n"); -} diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h index a1eee4e294..313bf2337e 100644 --- a/Source/Core/DolphinWX/Src/Frame.h +++ b/Source/Core/DolphinWX/Src/Frame.h @@ -130,7 +130,6 @@ class CFrame : public CRenderFrame void PostUpdateUIEvent(wxUpdateUIEvent& event); void StatusBarMessage(const char * Text, ...); void ClearStatusBar(); - void OnCustomHostMessage(int Id); void OnSizeRequest(int& x, int& y, int& width, int& height); void BootGame(const std::string& filename); void OnRenderParentClose(wxCloseEvent& event); @@ -166,8 +165,6 @@ class CFrame : public CRenderFrame int Limit(int,int,int); int PercentageToPixels(int,int); int PixelsToPercentage(int,int); - void ListChildren(); - void ListTopWindows(); wxString GetMenuLabel(int Id); // Perspectives @@ -176,17 +173,16 @@ class CFrame : public CRenderFrame void OnAllowNotebookDnD(wxAuiNotebookEvent& event); void OnNotebookPageChanged(wxAuiNotebookEvent& event); void OnFloatWindow(wxCommandEvent& event); + void ToggleFloatWindow(int Id); void OnTab(wxAuiNotebookEvent& event); int GetNootebookAffiliation(wxString Name); void ClosePages(); - void DoToggleWindow(int,bool); void ShowAllNotebooks(bool Window = false); void HideAllNotebooks(bool Window = false); void CloseAllNotebooks(); void DoAddPage(wxWindow *, int, wxString, bool); void DoRemovePage(wxWindow *, bool Hide = true); - void DoRemovePageId(wxWindowID Id, bool Hide = true, bool Destroy = false); - void DoRemovePageString(wxString, bool Hide = true, bool Destroy = false); + void DoRemovePageId(wxWindowID Id, bool bHide, bool bDestroy); void TogglePane(); void SetSimplePaneSize(); void SetPaneSize(); diff --git a/Source/Core/DolphinWX/Src/FrameAui.cpp b/Source/Core/DolphinWX/Src/FrameAui.cpp index 45da0a4716..f02184b565 100644 --- a/Source/Core/DolphinWX/Src/FrameAui.cpp +++ b/Source/Core/DolphinWX/Src/FrameAui.cpp @@ -15,7 +15,6 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ - #include "Setup.h" // Common #include "NetWindow.h" @@ -48,7 +47,6 @@ #include // wxWidgets - // ------------ // Aui events @@ -93,20 +91,20 @@ void CFrame::OnPaneClose(wxAuiManagerEvent& event) void CFrame::OnToggleLogWindow(wxCommandEvent& event) { SConfig::GetInstance().m_InterfaceLogWindow = event.IsChecked(); - DoToggleWindow(event.GetId(), event.IsChecked()); + ToggleLogWindow(event.IsChecked(), g_pCodeWindow ? g_pCodeWindow->iLogWindow : 0); } void CFrame::ToggleLogWindow(bool bShow, int i) { + GetMenuBar()->FindItem(IDM_LOGWINDOW)->Check(bShow); + if (bShow) { if (!m_LogWindow) m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW); DoAddPage(m_LogWindow, i, wxT("Log"), bFloatLogWindow); } else - { DoRemovePage(m_LogWindow, bShow); - } // Hide or Show the pane if (!g_pCodeWindow) @@ -117,16 +115,16 @@ void CFrame::ToggleLogWindow(bool bShow, int i) void CFrame::OnToggleConsole(wxCommandEvent& event) { SConfig::GetInstance().m_InterfaceConsole = event.IsChecked(); - DoToggleWindow(event.GetId(), event.IsChecked()); + ToggleConsole(event.IsChecked(), g_pCodeWindow ? g_pCodeWindow->iConsoleWindow : 0); } void CFrame::ToggleConsole(bool bShow, int i) { -// Can anyone check this code under Linux ? commenting the windows console Hide/show -// should be enough to make it work. #ifdef _WIN32 ConsoleListener *Console = LogManager::GetInstance()->getConsoleListener(); + GetMenuBar()->FindItem(IDM_CONSOLEWINDOW)->Check(bShow); + if (bShow) { if (i < 0 || i > GetNotebookCount()-1) i = 0; @@ -166,42 +164,24 @@ void CFrame::ToggleConsole(bool bShow, int i) #endif } - // Notebooks // --------------------- void CFrame::ClosePages() { - DoToggleWindow(IDM_LOGWINDOW, false); - DoToggleWindow(IDM_CONSOLEWINDOW, false); - DoToggleWindow(IDM_CODEWINDOW, false); - DoToggleWindow(IDM_REGISTERWINDOW, false); - DoToggleWindow(IDM_BREAKPOINTWINDOW, false); - DoToggleWindow(IDM_MEMORYWINDOW, false); - DoToggleWindow(IDM_JITWINDOW, false); - DoToggleWindow(IDM_SOUNDWINDOW, false); - DoToggleWindow(IDM_VIDEOWINDOW, false); -} -void CFrame::DoToggleWindow(int Id, bool bShow) -{ - switch (Id) + ToggleLogWindow(false); + ToggleConsole(false); + if (g_pCodeWindow) { - case IDM_LOGWINDOW: ToggleLogWindow(bShow, g_pCodeWindow ? g_pCodeWindow->iLogWindow : 0); break; - case IDM_CONSOLEWINDOW: ToggleConsole(bShow, g_pCodeWindow ? g_pCodeWindow->iConsoleWindow : 0); break; - } - - if (!g_pCodeWindow) return; - - switch (Id) - { - case IDM_CODEWINDOW: g_pCodeWindow->OnToggleCodeWindow(bShow, g_pCodeWindow->iCodeWindow); break; - case IDM_REGISTERWINDOW: g_pCodeWindow->OnToggleRegisterWindow(bShow, g_pCodeWindow->iRegisterWindow); break; - case IDM_BREAKPOINTWINDOW: g_pCodeWindow->OnToggleBreakPointWindow(bShow, g_pCodeWindow->iBreakpointWindow); break; - case IDM_MEMORYWINDOW: g_pCodeWindow->OnToggleMemoryWindow(bShow, g_pCodeWindow->iMemoryWindow); break; - case IDM_JITWINDOW: g_pCodeWindow->OnToggleJitWindow(bShow, g_pCodeWindow->iJitWindow); break; - case IDM_SOUNDWINDOW: g_pCodeWindow->OnToggleDLLWindow(IDM_SOUNDWINDOW, bShow, g_pCodeWindow->iSoundWindow); break; - case IDM_VIDEOWINDOW: g_pCodeWindow->OnToggleDLLWindow(IDM_VIDEOWINDOW, bShow, g_pCodeWindow->iVideoWindow); break; + g_pCodeWindow->ToggleCodeWindow(false); + g_pCodeWindow->ToggleRegisterWindow(false); + g_pCodeWindow->ToggleBreakPointWindow(false); + g_pCodeWindow->ToggleMemoryWindow(false); + g_pCodeWindow->ToggleJitWindow(false); + g_pCodeWindow->ToggleDLLWindow(IDM_SOUNDWINDOW, false); + g_pCodeWindow->ToggleDLLWindow(IDM_VIDEOWINDOW, false); } } + void CFrame::OnNotebookPageChanged(wxAuiNotebookEvent& event) { event.Skip(); @@ -211,16 +191,26 @@ void CFrame::OnNotebookPageChanged(wxAuiNotebookEvent& event) AddRemoveBlankPage(); // Update the notebook affiliation - if(GetNootebookAffiliation(wxT("Log")) >= 0) g_pCodeWindow->iLogWindow = GetNootebookAffiliation(wxT("Log")); - if(GetNootebookAffiliation(wxT("Console")) >= 0) g_pCodeWindow->iConsoleWindow = GetNootebookAffiliation(wxT("Console")); - if(GetNootebookAffiliation(wxT("Code")) >= 0) g_pCodeWindow->iCodeWindow = GetNootebookAffiliation(wxT("Code")); - if(GetNootebookAffiliation(wxT("Registers")) >= 0) g_pCodeWindow->iRegisterWindow = GetNootebookAffiliation(wxT("Registers")); - if(GetNootebookAffiliation(wxT("Breakpoints")) >= 0) g_pCodeWindow->iBreakpointWindow = GetNootebookAffiliation(wxT("Breakpoints")); - if(GetNootebookAffiliation(wxT("JIT")) >= 0) g_pCodeWindow->iJitWindow = GetNootebookAffiliation(wxT("JIT")); - if(GetNootebookAffiliation(wxT("Memory")) >= 0) g_pCodeWindow->iMemoryWindow = GetNootebookAffiliation(wxT("Memory")); - if(GetNootebookAffiliation(wxT("Sound")) >= 0) g_pCodeWindow->iSoundWindow = GetNootebookAffiliation(wxT("Sound")); - if(GetNootebookAffiliation(wxT("Video")) >= 0) g_pCodeWindow->iVideoWindow = GetNootebookAffiliation(wxT("Video")); + if(GetNootebookAffiliation(wxT("Log")) >= 0) + g_pCodeWindow->iLogWindow = GetNootebookAffiliation(wxT("Log")); + if(GetNootebookAffiliation(wxT("Console")) >= 0) + g_pCodeWindow->iConsoleWindow = GetNootebookAffiliation(wxT("Console")); + if(GetNootebookAffiliation(wxT("Code")) >= 0) + g_pCodeWindow->iCodeWindow = GetNootebookAffiliation(wxT("Code")); + if(GetNootebookAffiliation(wxT("Registers")) >= 0) + g_pCodeWindow->iRegisterWindow = GetNootebookAffiliation(wxT("Registers")); + if(GetNootebookAffiliation(wxT("Breakpoints")) >= 0) + g_pCodeWindow->iBreakpointWindow = GetNootebookAffiliation(wxT("Breakpoints")); + if(GetNootebookAffiliation(wxT("JIT")) >= 0) + g_pCodeWindow->iJitWindow = GetNootebookAffiliation(wxT("JIT")); + if(GetNootebookAffiliation(wxT("Memory")) >= 0) + g_pCodeWindow->iMemoryWindow = GetNootebookAffiliation(wxT("Memory")); + if(GetNootebookAffiliation(wxT("Sound")) >= 0) + g_pCodeWindow->iSoundWindow = GetNootebookAffiliation(wxT("Sound")); + if(GetNootebookAffiliation(wxT("Video")) >= 0) + g_pCodeWindow->iVideoWindow = GetNootebookAffiliation(wxT("Video")); } + void CFrame::OnNotebookPageClose(wxAuiNotebookEvent& event) { // Override event @@ -228,47 +218,166 @@ void CFrame::OnNotebookPageClose(wxAuiNotebookEvent& event) wxAuiNotebook* Ctrl = (wxAuiNotebook*)event.GetEventObject(); - if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Log"))) { GetMenuBar()->FindItem(IDM_LOGWINDOW)->Check(false); DoToggleWindow(IDM_LOGWINDOW, false); } - if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Console"))) { GetMenuBar()->FindItem(IDM_CONSOLEWINDOW)->Check(false); DoToggleWindow(IDM_CONSOLEWINDOW, false); } - if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Registers"))) { GetMenuBar()->FindItem(IDM_REGISTERWINDOW)->Check(false); DoToggleWindow(IDM_REGISTERWINDOW, false); } - if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Breakpoints"))) { GetMenuBar()->FindItem(IDM_BREAKPOINTWINDOW)->Check(false); DoToggleWindow(IDM_BREAKPOINTWINDOW, false); } - if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("JIT"))) { GetMenuBar()->FindItem(IDM_JITWINDOW)->Check(false); DoToggleWindow(IDM_JITWINDOW, false); } - if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Memory"))) { GetMenuBar()->FindItem(IDM_MEMORYWINDOW)->Check(false); DoToggleWindow(IDM_MEMORYWINDOW, false); } - if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Sound"))) { GetMenuBar()->FindItem(IDM_SOUNDWINDOW)->Check(false); DoToggleWindow(IDM_SOUNDWINDOW, false); } - if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Video"))) { GetMenuBar()->FindItem(IDM_VIDEOWINDOW)->Check(false); DoToggleWindow(IDM_VIDEOWINDOW, false); } + if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Log"))) + ToggleLogWindow(false); + if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Console"))) + ToggleConsole(false); + if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Registers"))) + g_pCodeWindow->ToggleRegisterWindow(false); + if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Breakpoints"))) + g_pCodeWindow->ToggleBreakPointWindow(false); + if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("JIT"))) + g_pCodeWindow->ToggleJitWindow(false); + if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Memory"))) + g_pCodeWindow->ToggleMemoryWindow(false); + if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Sound"))) + g_pCodeWindow->ToggleDLLWindow(IDM_SOUNDWINDOW, false); + if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Video"))) + g_pCodeWindow->ToggleDLLWindow(IDM_VIDEOWINDOW, false); } + void CFrame::OnFloatWindow(wxCommandEvent& event) { - switch(event.GetId()) + ToggleFloatWindow(event.GetId()); +} + +void CFrame::ToggleFloatWindow(int Id) +{ + switch(Id) { - case IDM_FLOAT_LOGWINDOW: if (GetNootebookPageFromId(IDM_LOGWINDOW)) { DoFloatNotebookPage(IDM_LOGWINDOW); return; } break; - case IDM_FLOAT_CONSOLEWINDOW: if (GetNootebookPageFromId(IDM_CONSOLEWINDOW)) { DoFloatNotebookPage(IDM_CONSOLEWINDOW); return; } break; + case IDM_FLOAT_LOGWINDOW: + if (GetNootebookPageFromId(IDM_LOGWINDOW)) + { + DoFloatNotebookPage(IDM_LOGWINDOW); + bFloatLogWindow = true; + return; + } + break; + case IDM_FLOAT_CONSOLEWINDOW: + if (GetNootebookPageFromId(IDM_CONSOLEWINDOW)) + { + DoFloatNotebookPage(IDM_CONSOLEWINDOW); + bFloatConsoleWindow = true; + return; + } + break; } - switch(event.GetId()) + switch(Id) { - case IDM_FLOAT_LOGWINDOW: if (FindWindowById(IDM_LOGWINDOW)) DoUnfloatPage(IDM_LOGWINDOW_PARENT); break; - case IDM_FLOAT_CONSOLEWINDOW: if (FindWindowById(IDM_CONSOLEWINDOW)) DoUnfloatPage(IDM_CONSOLEWINDOW_PARENT); break; + case IDM_FLOAT_LOGWINDOW: + if (FindWindowById(IDM_LOGWINDOW)) + DoUnfloatPage(IDM_LOGWINDOW_PARENT); + bFloatLogWindow = false; + break; + case IDM_FLOAT_CONSOLEWINDOW: + if (FindWindowById(IDM_CONSOLEWINDOW)) + DoUnfloatPage(IDM_CONSOLEWINDOW_PARENT); + bFloatConsoleWindow = false; + break; } - if (!g_pCodeWindow) return; + if (!g_pCodeWindow) + return; - switch(event.GetId()) + switch(Id) { - case IDM_FLOAT_CODEWINDOW: if (GetNootebookPageFromId(IDM_CODEWINDOW)) { DoFloatNotebookPage(IDM_CODEWINDOW); return; } break; - case IDM_FLOAT_REGISTERWINDOW: if (GetNootebookPageFromId(IDM_REGISTERWINDOW)) { DoFloatNotebookPage(IDM_REGISTERWINDOW); return; } break; - case IDM_FLOAT_BREAKPOINTWINDOW: if (GetNootebookPageFromId(IDM_BREAKPOINTWINDOW)) { DoFloatNotebookPage(IDM_BREAKPOINTWINDOW); return; } break; - case IDM_FLOAT_MEMORYWINDOW: if (GetNootebookPageFromId(IDM_MEMORYWINDOW)) { DoFloatNotebookPage(IDM_MEMORYWINDOW); return; } break; - case IDM_FLOAT_JITWINDOW: if (GetNootebookPageFromId(IDM_JITWINDOW)) { DoFloatNotebookPage(IDM_JITWINDOW); return; } break; + case IDM_FLOAT_CODEWINDOW: + if (GetNootebookPageFromId(IDM_CODEWINDOW)) + { + DoFloatNotebookPage(IDM_CODEWINDOW); + g_pCodeWindow->bFloatCodeWindow = true; + return; + } + break; + case IDM_FLOAT_REGISTERWINDOW: + if (GetNootebookPageFromId(IDM_REGISTERWINDOW)) + { + DoFloatNotebookPage(IDM_REGISTERWINDOW); + g_pCodeWindow->bFloatRegisterWindow = true; + return; + } + break; + case IDM_FLOAT_BREAKPOINTWINDOW: + if (GetNootebookPageFromId(IDM_BREAKPOINTWINDOW)) + { + DoFloatNotebookPage(IDM_BREAKPOINTWINDOW); + g_pCodeWindow->bFloatBreakpointWindow = true; + return; + } + break; + case IDM_FLOAT_MEMORYWINDOW: + if (GetNootebookPageFromId(IDM_MEMORYWINDOW)) + { + DoFloatNotebookPage(IDM_MEMORYWINDOW); + g_pCodeWindow->bFloatMemoryWindow = true; + return; + } + break; + case IDM_FLOAT_JITWINDOW: + if (GetNootebookPageFromId(IDM_JITWINDOW)) + { + DoFloatNotebookPage(IDM_JITWINDOW); + g_pCodeWindow->bFloatJitWindow = true; + return; + } + break; + case IDM_FLOAT_SOUNDWINDOW: + if (GetNootebookPageFromId(IDM_SOUNDWINDOW)) + { + DoFloatNotebookPage(IDM_SOUNDWINDOW); + g_pCodeWindow->bFloatSoundWindow = true; + return; + } + break; + case IDM_FLOAT_VIDEOWINDOW: + if (GetNootebookPageFromId(IDM_VIDEOWINDOW)) + { + DoFloatNotebookPage(IDM_VIDEOWINDOW); + g_pCodeWindow->bFloatVideoWindow = true; + return; + } + break; } - switch(event.GetId()) + switch(Id) { - case IDM_FLOAT_CODEWINDOW: if (FindWindowById(IDM_CODEWINDOW)) DoUnfloatPage(IDM_LOGWINDOW_PARENT); break; - case IDM_FLOAT_REGISTERWINDOW: if (FindWindowById(IDM_REGISTERWINDOW)) DoUnfloatPage(IDM_REGISTERWINDOW_PARENT); break; - case IDM_FLOAT_BREAKPOINTWINDOW: if (FindWindowById(IDM_BREAKPOINTWINDOW)) DoUnfloatPage(IDM_BREAKPOINTWINDOW_PARENT); break; - case IDM_FLOAT_MEMORYWINDOW: if (FindWindowById(IDM_MEMORYWINDOW)) DoUnfloatPage(IDM_MEMORYWINDOW_PARENT); break; - case IDM_FLOAT_JITWINDOW: if (FindWindowById(IDM_JITWINDOW)) DoUnfloatPage(IDM_JITWINDOW_PARENT); break; + case IDM_FLOAT_CODEWINDOW: + if (FindWindowById(IDM_CODEWINDOW)) + DoUnfloatPage(IDM_CODEWINDOW_PARENT); + g_pCodeWindow->bFloatCodeWindow = false; + break; + case IDM_FLOAT_REGISTERWINDOW: + if (FindWindowById(IDM_REGISTERWINDOW)) + DoUnfloatPage(IDM_REGISTERWINDOW_PARENT); + g_pCodeWindow->bFloatRegisterWindow = false; + break; + case IDM_FLOAT_BREAKPOINTWINDOW: + if (FindWindowById(IDM_BREAKPOINTWINDOW)) + DoUnfloatPage(IDM_BREAKPOINTWINDOW_PARENT); + g_pCodeWindow->bFloatBreakpointWindow = false; + break; + case IDM_FLOAT_MEMORYWINDOW: + if (FindWindowById(IDM_MEMORYWINDOW)) + DoUnfloatPage(IDM_MEMORYWINDOW_PARENT); + g_pCodeWindow->bFloatMemoryWindow = false; + break; + case IDM_FLOAT_JITWINDOW: + if (FindWindowById(IDM_JITWINDOW)) + DoUnfloatPage(IDM_JITWINDOW_PARENT); + g_pCodeWindow->bFloatJitWindow = false; + break; + case IDM_FLOAT_SOUNDWINDOW: + if (FindWindowById(IDM_SOUNDWINDOW)) + DoUnfloatPage(IDM_SOUNDWINDOW_PARENT); + g_pCodeWindow->bFloatSoundWindow = false; + break; + case IDM_FLOAT_VIDEOWINDOW: + if (FindWindowById(IDM_VIDEOWINDOW)) + DoUnfloatPage(IDM_VIDEOWINDOW_PARENT); + g_pCodeWindow->bFloatVideoWindow = false; + break; } } + void CFrame::OnTab(wxAuiNotebookEvent& event) { event.Skip(); @@ -277,40 +386,48 @@ void CFrame::OnTab(wxAuiNotebookEvent& event) // Create the popup menu wxMenu* MenuPopup = new wxMenu; - wxMenuItem* Item = new wxMenuItem(MenuPopup, wxID_ANY, wxT("Select floating windows")); + wxMenuItem* Item = new wxMenuItem(MenuPopup, wxID_ANY, + wxT("Select floating windows")); MenuPopup->Append(Item); Item->Enable(false); MenuPopup->Append(new wxMenuItem(MenuPopup)); - Item = new wxMenuItem(MenuPopup, IDM_FLOAT_LOGWINDOW, WindowNameFromId(IDM_LOGWINDOW), wxT(""), wxITEM_CHECK); + Item = new wxMenuItem(MenuPopup, IDM_FLOAT_LOGWINDOW, + WindowNameFromId(IDM_LOGWINDOW), wxT(""), wxITEM_CHECK); MenuPopup->Append(Item); Item->Check(!!FindWindowById(IDM_LOGWINDOW_PARENT)); - Item = new wxMenuItem(MenuPopup, IDM_FLOAT_CONSOLEWINDOW, WindowNameFromId(IDM_CONSOLEWINDOW), wxT(""), wxITEM_CHECK); + Item = new wxMenuItem(MenuPopup, IDM_FLOAT_CONSOLEWINDOW, + WindowNameFromId(IDM_CONSOLEWINDOW), wxT(""), wxITEM_CHECK); MenuPopup->Append(Item); Item->Check(!!FindWindowById(IDM_CONSOLEWINDOW_PARENT)); MenuPopup->Append(new wxMenuItem(MenuPopup)); - Item = new wxMenuItem(MenuPopup, IDM_FLOAT_CODEWINDOW, WindowNameFromId(IDM_CODEWINDOW), wxT(""), wxITEM_CHECK); + Item = new wxMenuItem(MenuPopup, IDM_FLOAT_CODEWINDOW, + WindowNameFromId(IDM_CODEWINDOW), wxT(""), wxITEM_CHECK); MenuPopup->Append(Item); Item->Check(!!FindWindowById(IDM_CODEWINDOW_PARENT)); - Item = new wxMenuItem(MenuPopup, IDM_FLOAT_REGISTERWINDOW, WindowNameFromId(IDM_REGISTERWINDOW), wxT(""), wxITEM_CHECK); + Item = new wxMenuItem(MenuPopup, IDM_FLOAT_REGISTERWINDOW, + WindowNameFromId(IDM_REGISTERWINDOW), wxT(""), wxITEM_CHECK); MenuPopup->Append(Item); Item->Check(!!FindWindowById(IDM_REGISTERWINDOW_PARENT)); - Item = new wxMenuItem(MenuPopup, IDM_FLOAT_BREAKPOINTWINDOW, WindowNameFromId(IDM_BREAKPOINTWINDOW), wxT(""), wxITEM_CHECK); + Item = new wxMenuItem(MenuPopup, IDM_FLOAT_BREAKPOINTWINDOW, + WindowNameFromId(IDM_BREAKPOINTWINDOW), wxT(""), wxITEM_CHECK); MenuPopup->Append(Item); Item->Check(!!FindWindowById(IDM_BREAKPOINTWINDOW_PARENT)); - Item = new wxMenuItem(MenuPopup, IDM_FLOAT_MEMORYWINDOW, WindowNameFromId(IDM_MEMORYWINDOW), wxT(""), wxITEM_CHECK); + Item = new wxMenuItem(MenuPopup, IDM_FLOAT_MEMORYWINDOW, + WindowNameFromId(IDM_MEMORYWINDOW), wxT(""), wxITEM_CHECK); MenuPopup->Append(Item); Item->Check(!!FindWindowById(IDM_MEMORYWINDOW_PARENT)); - Item = new wxMenuItem(MenuPopup, IDM_FLOAT_JITWINDOW, WindowNameFromId(IDM_JITWINDOW), wxT(""), wxITEM_CHECK); + Item = new wxMenuItem(MenuPopup, IDM_FLOAT_JITWINDOW, + WindowNameFromId(IDM_JITWINDOW), wxT(""), wxITEM_CHECK); MenuPopup->Append(Item); Item->Check(!!FindWindowById(IDM_JITWINDOW_PARENT)); - Item = new wxMenuItem(MenuPopup, IDM_FLOAT_SOUNDWINDOW, WindowNameFromId(IDM_SOUNDWINDOW), wxT(""), wxITEM_CHECK); + Item = new wxMenuItem(MenuPopup, IDM_FLOAT_SOUNDWINDOW, + WindowNameFromId(IDM_SOUNDWINDOW), wxT(""), wxITEM_CHECK); MenuPopup->Append(Item); Item->Check(!!FindWindowById(IDM_SOUNDWINDOW_PARENT)); - Item->Enable(false); - Item = new wxMenuItem(MenuPopup, IDM_FLOAT_VIDEOWINDOW, WindowNameFromId(IDM_VIDEOWINDOW), wxT(""), wxITEM_CHECK); + Item = new wxMenuItem(MenuPopup, IDM_FLOAT_VIDEOWINDOW, + WindowNameFromId(IDM_VIDEOWINDOW), wxT(""), wxITEM_CHECK); MenuPopup->Append(Item); Item->Check(!!FindWindowById(IDM_VIDEOWINDOW_PARENT)); - Item->Enable(false); // Line up our menu with the cursor wxPoint Pt = ::wxGetMousePosition(); @@ -318,12 +435,14 @@ void CFrame::OnTab(wxAuiNotebookEvent& event) // Show PopupMenu(MenuPopup, Pt); } + void CFrame::OnAllowNotebookDnD(wxAuiNotebookEvent& event) { event.Skip(); event.Allow(); ResizeConsole(); } + void CFrame::TogglePane() { // Get the first notebook @@ -344,48 +463,8 @@ void CFrame::TogglePane() SetSimplePaneSize(); } -void CFrame::DoRemovePageString(wxString Str, bool /*_Hide*/, bool _Destroy) -{ - wxWindow * Win = FindWindowByName(Str); - - if (Win) - { - Win->Reparent(this); - Win->Hide(); - FindWindowById(WindowParentIdFromChildId(Win->GetId()))->Destroy(); - } - else - { - for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) - { - if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue; - wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window; - for (u32 j = 0; j < NB->GetPageCount(); j++) - { - if (NB->GetPageText(j).IsSameAs(Str)) - { - if (!_Destroy) - { - // Reparent to avoid destruction if the notebook is closed and destroyed - wxWindow * NBPageWin = NB->GetPage(j); - NB->RemovePage(j); - NBPageWin->Reparent(this); - } - else - { - NB->DeletePage(j); - } - break; - } - } - } - } -} void CFrame::DoRemovePage(wxWindow * Win, bool _Hide) { - // If m_dialog is NULL, then possibly the system didn't report the checked menu item status correctly. - // It should be true just after the menu item was selected, if there was no modeless dialog yet. - //wxASSERT(Win != NULL); if (!Win) return; if (Win->GetId() > 0 && FindWindowById(WindowParentIdFromChildId(Win->GetId()))) @@ -410,34 +489,43 @@ void CFrame::DoRemovePage(wxWindow * Win, bool _Hide) } } } + void CFrame::DoRemovePageId(wxWindowID Id, bool bHide, bool bDestroy) { - if (!FindWindowById(Id)) return; - wxWindow * Win = FindWindowById(Id); + wxWindow *Win = FindWindowById(Id); + if (!Win) + return; - if (FindWindowById(WindowParentIdFromChildId(Id))) + wxWindow *Parent = FindWindowById(WindowParentIdFromChildId(Id)); + + if (Parent) { Win->Reparent(this); if (bDestroy) Win->Destroy(); else Win->Hide(); - FindWindowById(WindowParentIdFromChildId(Id))->Destroy(); + Parent->Destroy(); } else { for (int i = 0; i < GetNotebookCount(); i++) { - if (GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) + int PageIndex = GetNotebookFromId(i)->GetPageIndex(Win); + if (PageIndex != wxNOT_FOUND) { - GetNotebookFromId(i)->RemovePage(GetNotebookFromId(i)->GetPageIndex(Win)); - // Reparent to avoid destruction if the notebook is closed and destroyed - Win->Reparent(this); - if (bHide) Win->Hide(); + GetNotebookFromId(i)->RemovePage(PageIndex); + if (bHide) + { + // Reparent to avoid destruction if the notebook is closed and destroyed + Win->Reparent(this); + Win->Hide(); + } } } } } + void CFrame::DoAddPage(wxWindow * Win, int i, wxString Name, bool Float) { if (!Win) return; @@ -452,7 +540,7 @@ void CFrame::DoAddPage(wxWindow * Win, int i, wxString Name, bool Float) void CFrame::DoUnfloatPage(int Id) { - wxFrame * Win = (wxFrame*)this->FindWindowById(Id); + wxFrame * Win = (wxFrame*)FindWindowById(Id); if (!Win) return; wxWindow * Child = Win->GetWindowChildren().Item(0)->GetData(); @@ -460,10 +548,12 @@ void CFrame::DoUnfloatPage(int Id) DoAddPage(Child, 0, Win->GetTitle(), false); Win->Destroy(); } + void CFrame::OnFloatingPageClosed(wxCloseEvent& event) { - DoUnfloatPage(event.GetId()); + ToggleFloatWindow(event.GetId() - IDM_LOGWINDOW_PARENT + IDM_FLOAT_LOGWINDOW); } + void CFrame::OnFloatingPageSize(wxSizeEvent& event) { event.Skip(); @@ -520,6 +610,7 @@ void CFrame::OnDropDownSettingsToolbar(wxAuiToolBarEvent& event) if (!m_bEdit) Tb->SetToolSticky(event.GetId(), false); } } + void CFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& event) { event.Skip(); @@ -556,6 +647,7 @@ void CFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& event) tb->SetToolSticky(event.GetId(), false); } } + void CFrame::OnToolBar(wxCommandEvent& event) { ClearStatusBar(); @@ -583,6 +675,7 @@ void CFrame::OnToolBar(wxCommandEvent& event) break; } } + void CFrame::OnDropDownToolbarSelect(wxCommandEvent& event) { ClearStatusBar(); @@ -633,9 +726,6 @@ void CFrame::OnDropDownToolbarSelect(wxCommandEvent& event) } } - -// Functions -// --------------------- void CFrame::ResetToolbarStyle() { wxAuiPaneInfoArray& AllPanes = m_Mgr->GetAllPanes(); @@ -703,6 +793,7 @@ void CFrame::ToggleNotebookStyle(bool On, long Style) } } } + void CFrame::OnSelectPerspective(wxCommandEvent& event) { u32 _Selection = event.GetId() - IDM_PERSPECTIVES_0; @@ -718,9 +809,7 @@ void CFrame::ResizeConsole() wxWindow * Win = FindWindowById(IDM_CONSOLEWINDOW); if (!Win) return; - // ---------------------------------------------------------- // Get OS version - // ------------------ int wxBorder, Border, LowerBorder, MenuBar, ScrollBar, WidthReduction; OSVERSIONINFO osvi; ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); @@ -743,7 +832,7 @@ void CFrame::ResizeConsole() ScrollBar = 19; } WidthReduction = 30 - Border; - // -------------------------------- + // Get the client size int X = Win->GetClientSize().GetX(); int Y = Win->GetClientSize().GetY(); @@ -869,11 +958,10 @@ void CFrame::ReloadPanes() // Open notebook pages AddRemoveBlankPage(); if (g_pCodeWindow) g_pCodeWindow->OpenPages(); - if (SConfig::GetInstance().m_InterfaceLogWindow) DoToggleWindow(IDM_LOGWINDOW, true); - if (SConfig::GetInstance().m_InterfaceConsole) DoToggleWindow(IDM_CONSOLEWINDOW, true); + if (SConfig::GetInstance().m_InterfaceLogWindow) ToggleLogWindow(true); + if (SConfig::GetInstance().m_InterfaceConsole) ToggleConsole(true); //Console->Log(LogTypes::LNOTICE, StringFromFormat("ReloadPanes end: Sound %i\n", FindWindowByName(wxT("Sound"))).c_str()); - //ListChildren(); } void CFrame::DoLoadPerspective() @@ -930,6 +1018,7 @@ void CFrame::SaveLocal() Perspectives.push_back(Tmp); } } + void CFrame::Save() { if (Perspectives.size() == 0) return; @@ -998,6 +1087,7 @@ void CFrame::NamePanes() } } } + void CFrame::AddPane() { m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo() @@ -1008,7 +1098,6 @@ void CFrame::AddPane() m_Mgr->Update(); } - // Utility // --------------------- @@ -1018,11 +1107,13 @@ int CFrame::Limit(int i, int Low, int High) if (i > High) return High; return i; } + int CFrame::PercentageToPixels(int Percentage, int Total) { int Pixels = (int)((float)Total * ((float)Percentage / 100.0)); return Pixels; } + int CFrame::PixelsToPercentage(int Pixels, int Total) { int Percentage = (int)(((float)Pixels / (float)Total) * 100.0); @@ -1038,6 +1129,7 @@ wxWindow * CFrame::GetWxWindowHwnd(HWND hWnd) return Win; } #endif + wxWindow * CFrame::GetWxWindow(wxString Name) { #ifdef _WIN32 @@ -1052,20 +1144,15 @@ wxWindow * CFrame::GetWxWindow(wxString Name) else #endif if (FindWindowByName(Name)) - { return FindWindowByName(Name); - } else if (FindWindowByLabel(Name)) - { return FindWindowByLabel(Name); - } else if (GetNootebookPage(Name)) - { return GetNootebookPage(Name); - } else return NULL; } + wxWindow * CFrame::GetFloatingPage(int Id) { if (this->FindWindowById(Id)) @@ -1073,6 +1160,7 @@ wxWindow * CFrame::GetFloatingPage(int Id) else return NULL; } + wxWindow * CFrame::GetNootebookPage(wxString Name) { for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) @@ -1087,6 +1175,7 @@ wxWindow * CFrame::GetNootebookPage(wxString Name) } return NULL; } + wxWindow * CFrame::GetNootebookPageFromId(wxWindowID Id) { for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) @@ -1100,6 +1189,7 @@ wxWindow * CFrame::GetNootebookPageFromId(wxWindowID Id) } return NULL; } + void CFrame::AddRemoveBlankPage() { for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) @@ -1113,6 +1203,7 @@ void CFrame::AddRemoveBlankPage() if (NB->GetPageCount() == 0) NB->AddPage(CreateEmptyPanel(), wxT("<>"), true); } } + int CFrame::GetNootebookAffiliation(wxString Name) { for (u32 i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) @@ -1127,6 +1218,7 @@ int CFrame::GetNootebookAffiliation(wxString Name) } return -1; } + wxWindowID CFrame::WindowParentIdFromChildId(int Id) { switch(Id) @@ -1143,6 +1235,7 @@ wxWindowID CFrame::WindowParentIdFromChildId(int Id) } return NULL; } + wxString CFrame::WindowNameFromId(int Id) { switch(Id) @@ -1179,6 +1272,7 @@ void CFrame::CloseAllNotebooks() i++; } } + int CFrame::GetNotebookCount() { int Ret = 0; @@ -1199,6 +1293,7 @@ wxAuiNotebook * CFrame::GetNotebookFromId(u32 NBId) } return NULL; } + void CFrame::ShowAllNotebooks(bool bShow) { for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) @@ -1213,6 +1308,7 @@ void CFrame::ShowAllNotebooks(bool bShow) } m_Mgr->Update(); } + void CFrame::HideAllNotebooks(bool Window) { for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index af1589f41c..de9efe9199 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -905,6 +905,9 @@ void CFrame::DoStop() // Clean framerate indications from the status bar. m_pStatusBar->SetStatusText(wxT(" "), 0); + // Clear wiimote connection status from the status bar. + m_pStatusBar->SetStatusText(wxT(" "), 1); + // If batch mode was specified on the command-line, exit now. if (m_bBatchMode) Close(true); diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index e4b6d917ab..eb7827c38c 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -483,21 +483,8 @@ CFrame* DolphinApp::GetCFrame() void Host_Message(int Id) { - - switch(Id) - { -#if defined(HAVE_X11) && HAVE_X11 - case WM_USER_STOP: -#endif - case WM_USER_CREATE: - { - wxCommandEvent event(wxEVT_HOST_COMMAND, Id); - main_frame->GetEventHandler()->AddPendingEvent(event); - break; - } - default: - main_frame->OnCustomHostMessage(Id); - } + wxCommandEvent event(wxEVT_HOST_COMMAND, Id); + main_frame->GetEventHandler()->AddPendingEvent(event); } // OK, this thread boundary is DANGEROUS on linux diff --git a/Source/PluginSpecs/PluginSpecs.h b/Source/PluginSpecs/PluginSpecs.h index 8a2cbbb736..b726c02630 100644 --- a/Source/PluginSpecs/PluginSpecs.h +++ b/Source/PluginSpecs/PluginSpecs.h @@ -48,7 +48,6 @@ enum PLUGIN_COMM // simulate something that looks like win32 // long term, kill these #define HWND void* - #define HINSTANCE void* #endif #if defined(__cplusplus) @@ -127,7 +126,7 @@ EXPORT void CALL DllConfig(HWND _hParent); // input: a handle to the window that calls this function // output: none // -EXPORT void CALL DllDebugger(HWND _hParent, bool Show); +EXPORT void CALL DllDebugger(void *_hParent, bool Show); // ___________________________________________________________________________ // Function: DllSetGlobals diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp index 72703d5cf0..3acf10971d 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp @@ -119,7 +119,7 @@ wxWindow* GetParentedWxWindow(HWND Parent) #endif -void DllDebugger(HWND _hParent, bool Show) +void DllDebugger(void *_hParent, bool Show) { } diff --git a/Source/Plugins/Plugin_DSP_LLE/Src/Debugger/DSPDebugWindow.cpp b/Source/Plugins/Plugin_DSP_LLE/Src/Debugger/DSPDebugWindow.cpp index 5c3d67d9c1..33633c36c2 100644 --- a/Source/Plugins/Plugin_DSP_LLE/Src/Debugger/DSPDebugWindow.cpp +++ b/Source/Plugins/Plugin_DSP_LLE/Src/Debugger/DSPDebugWindow.cpp @@ -32,7 +32,7 @@ void Host_NotifyMapLoaded() {} void Host_UpdateBreakPointView() {} -BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxFrame) +BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxPanel) EVT_CLOSE(DSPDebuggerLLE::OnClose) EVT_MENU_RANGE(ID_RUNTOOL, ID_STEPTOOL, DSPDebuggerLLE::OnChangeState) EVT_MENU(ID_SHOWPCTOOL, DSPDebuggerLLE::OnShowPC) @@ -42,9 +42,8 @@ END_EVENT_TABLE() DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent) - : wxFrame(parent, wxID_ANY, _("DSP LLE Debugger"), - wxDefaultPosition, wxSize(700, 800), - wxDEFAULT_FRAME_STYLE) + : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(700, 800), + wxTAB_TRAVERSAL, _("Sound")) , m_CachedStepCounter(-1) { // notify wxAUI which frame to use diff --git a/Source/Plugins/Plugin_DSP_LLE/Src/Debugger/DSPDebugWindow.h b/Source/Plugins/Plugin_DSP_LLE/Src/Debugger/DSPDebugWindow.h index cae7c087a8..ac50d44055 100644 --- a/Source/Plugins/Plugin_DSP_LLE/Src/Debugger/DSPDebugWindow.h +++ b/Source/Plugins/Plugin_DSP_LLE/Src/Debugger/DSPDebugWindow.h @@ -48,7 +48,7 @@ class DSPRegisterView; class CCodeView; class CMemoryView; -class DSPDebuggerLLE : public wxFrame +class DSPDebuggerLLE : public wxPanel { public: DSPDebuggerLLE(wxWindow *parent); diff --git a/Source/Plugins/Plugin_DSP_LLE/Src/main.cpp b/Source/Plugins/Plugin_DSP_LLE/Src/main.cpp index 315d772658..cc16c803ef 100644 --- a/Source/Plugins/Plugin_DSP_LLE/Src/main.cpp +++ b/Source/Plugins/Plugin_DSP_LLE/Src/main.cpp @@ -201,16 +201,24 @@ void EmuStateChange(PLUGIN_EMUSTATE newState) DSP_ClearAudioBuffer((newState == PLUGIN_EMUSTATE_PLAY) ? false : true); } -void DllDebugger(HWND _hParent, bool Show) +void DllDebugger(void *_hParent, bool Show) { #if defined(HAVE_WX) && HAVE_WX - if (!m_DebuggerFrame) - m_DebuggerFrame = new DSPDebuggerLLE(GetParentedWxWindow(_hParent)); - if (Show) + { + if (!m_DebuggerFrame) + m_DebuggerFrame = new DSPDebuggerLLE((wxWindow *)_hParent); m_DebuggerFrame->Show(); + } else - m_DebuggerFrame->Hide(); + { + if (m_DebuggerFrame) + { + m_DebuggerFrame->Close(); + m_DebuggerFrame->Destroy(); + m_DebuggerFrame = NULL; + } + } #endif } diff --git a/Source/Plugins/Plugin_VideoDX11/Src/main.cpp b/Source/Plugins/Plugin_VideoDX11/Src/main.cpp index 93f94273f6..7f848e64b2 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/main.cpp @@ -107,7 +107,7 @@ wxWindow* GetParentedWxWindow(HWND Parent) } #endif -void DllDebugger(HWND _hParent, bool Show) +void DllDebugger(void *_hParent, bool Show) { } diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Debugger/Debugger.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Debugger/Debugger.cpp index 27f40dd326..db939a6b6c 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Debugger/Debugger.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Debugger/Debugger.cpp @@ -30,7 +30,7 @@ extern int g_Preset; -BEGIN_EVENT_TABLE(GFXDebuggerDX9,wxDialog) +BEGIN_EVENT_TABLE(GFXDebuggerDX9, wxPanel) EVT_CLOSE(GFXDebuggerDX9::OnClose) EVT_CHECKBOX(ID_SAVETOFILE,GFXDebuggerDX9::GeneralSettings) EVT_CHECKBOX(ID_INFOLOG,GFXDebuggerDX9::GeneralSettings) @@ -51,9 +51,9 @@ BEGIN_EVENT_TABLE(GFXDebuggerDX9,wxDialog) END_EVENT_TABLE() -GFXDebuggerDX9::GFXDebuggerDX9(wxWindow *parent, wxWindowID id, const wxString &title, - const wxPoint &position, const wxSize& size, long style) - : wxDialog(parent, id, title, position, size, style) +GFXDebuggerDX9::GFXDebuggerDX9(wxWindow *parent, wxWindowID id, const wxPoint &position, + const wxSize& size, long style, const wxString &title) + : wxPanel(parent, id, position, size, style, title) { CreateGUIControls(); @@ -167,7 +167,6 @@ void GFXDebuggerDX9::CreateGUIControls() g_pdebugger = this; // Basic settings - SetIcon(wxNullIcon); CenterOnParent(); // MainPanel diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Debugger/Debugger.h b/Source/Plugins/Plugin_VideoDX9/Src/Debugger/Debugger.h index 6af2035f6c..c5e3e50a5e 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Debugger/Debugger.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/Debugger/Debugger.h @@ -25,19 +25,15 @@ class IniFile; -class GFXDebuggerDX9 : public wxDialog +class GFXDebuggerDX9 : public wxPanel { public: GFXDebuggerDX9(wxWindow *parent, - wxWindowID id = 1, - const wxString &title = wxT("Video"), + wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - #ifdef _WIN32 - long style = wxNO_BORDER); - #else - long style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE); - #endif + long style = wxTAB_TRAVERSAL, + const wxString &title = wxT("Video")); virtual ~GFXDebuggerDX9(); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp index be548020be..ae9d0b6501 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp @@ -97,16 +97,24 @@ wxWindow* GetParentedWxWindow(HWND Parent) } #endif -void DllDebugger(HWND _hParent, bool Show) +void DllDebugger(void *_hParent, bool Show) { #if defined(HAVE_WX) && HAVE_WX - if (!m_DebuggerFrame) - m_DebuggerFrame = new GFXDebuggerDX9(GetParentedWxWindow(_hParent)); - if (Show) + { + if (!m_DebuggerFrame) + m_DebuggerFrame = new GFXDebuggerDX9((wxWindow *)_hParent); m_DebuggerFrame->Show(); + } else - m_DebuggerFrame->Hide(); + { + if (m_DebuggerFrame) + { + m_DebuggerFrame->Close(); + m_DebuggerFrame->Destroy(); + m_DebuggerFrame = NULL; + } + } #endif } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.cpp index 4aaaa6db04..fb0857cfec 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.cpp @@ -25,7 +25,7 @@ extern int g_Preset; -BEGIN_EVENT_TABLE(GFXDebuggerOGL,wxDialog) +BEGIN_EVENT_TABLE(GFXDebuggerOGL,wxPanel) EVT_CLOSE(GFXDebuggerOGL::OnClose) EVT_CHECKBOX(ID_SAVETOFILE,GFXDebuggerOGL::GeneralSettings) EVT_CHECKBOX(ID_INFOLOG,GFXDebuggerOGL::GeneralSettings) @@ -35,9 +35,9 @@ BEGIN_EVENT_TABLE(GFXDebuggerOGL,wxDialog) EVT_CHECKBOX(ID_SAVESHADERS,GFXDebuggerOGL::GeneralSettings) END_EVENT_TABLE() -GFXDebuggerOGL::GFXDebuggerOGL(wxWindow *parent, wxWindowID id, const wxString &title, - const wxPoint &position, const wxSize& size, long style) - : wxDialog(parent, id, title, position, size, style) +GFXDebuggerOGL::GFXDebuggerOGL(wxWindow *parent, wxWindowID id, const wxPoint& pos, + const wxSize& size, long style, const wxString &title) + : wxPanel(parent, id, pos, size, style, title) { CreateGUIControls(); @@ -46,21 +46,14 @@ GFXDebuggerOGL::GFXDebuggerOGL(wxWindow *parent, wxWindowID id, const wxString & GFXDebuggerOGL::~GFXDebuggerOGL() { - SaveSettings(); - m_DebuggerFrame = NULL; - NOTICE_LOG(CONSOLE, "Stop [Video Thread]: Closing OpenGL debugging window"); } void GFXDebuggerOGL::OnClose(wxCloseEvent& event) { - // This means wxDialog's Destroy is used - //event.Skip(); - // Save the window position SaveSettings(); - // Destroy - delete this; + event.Skip(); } void GFXDebuggerOGL::SaveSettings() const @@ -122,29 +115,24 @@ void GFXDebuggerOGL::LoadSettings() void GFXDebuggerOGL::CreateGUIControls() { // Basic settings - SetIcon(wxNullIcon); CenterOnParent(); - // MainPanel - m_MainPanel = new wxPanel(this, ID_MAINPANEL, wxDefaultPosition, wxDefaultSize); - // Options - wxStaticBoxSizer *sOptions = new wxStaticBoxSizer(wxVERTICAL, m_MainPanel, wxT("Options")); - m_Check[0] = new wxCheckBox(m_MainPanel, ID_SAVETOFILE, wxT("Save to file"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); - m_Check[1] = new wxCheckBox(m_MainPanel, ID_INFOLOG, wxT("Info log"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); - m_Check[2] = new wxCheckBox(m_MainPanel, ID_PRIMLOG, wxT("Primary log"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); - m_Check[3] = new wxCheckBox(m_MainPanel, ID_SAVETEXTURES, wxT("Save Textures"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); - m_Check[4] = new wxCheckBox(m_MainPanel, ID_SAVETARGETS, wxT("Save Targets"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); - m_Check[5] = new wxCheckBox(m_MainPanel, ID_SAVESHADERS, wxT("Save Shaders"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + wxStaticBoxSizer *sOptions = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Options")); + m_Check[0] = new wxCheckBox(this, ID_SAVETOFILE, wxT("Save to file"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_Check[1] = new wxCheckBox(this, ID_INFOLOG, wxT("Info log"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_Check[2] = new wxCheckBox(this, ID_PRIMLOG, wxT("Primary log"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_Check[3] = new wxCheckBox(this, ID_SAVETEXTURES, wxT("Save Textures"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_Check[4] = new wxCheckBox(this, ID_SAVETARGETS, wxT("Save Targets"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_Check[5] = new wxCheckBox(this, ID_SAVESHADERS, wxT("Save Shaders"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); for (int i = 0; i < NUM_OPTIONS-ID_SAVETOFILE; ++i) sOptions->Add(m_Check[i], 0, 0, 5); - // Layout everything on m_MainPanel + // Layout everything wxBoxSizer *sMain = new wxBoxSizer(wxHORIZONTAL); sMain->Add(sOptions); - sMain->Add(100, 0); // Add some width so we can see the window title by default - m_MainPanel->SetSizerAndFit(sMain); + SetSizerAndFit(sMain); Fit(); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.h b/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.h index 638554c113..7f5652ebec 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.h @@ -25,19 +25,15 @@ class IniFile; -class GFXDebuggerOGL : public wxDialog +class GFXDebuggerOGL : public wxPanel { public: GFXDebuggerOGL(wxWindow *parent, - wxWindowID id = 1, - const wxString &title = wxT("Video"), + wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - #ifdef _WIN32 - long style = wxNO_BORDER); - #else - long style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE); - #endif + long style = wxTAB_TRAVERSAL, + const wxString &title = wxT("Video")); virtual ~GFXDebuggerOGL(); @@ -53,8 +49,6 @@ public: private: DECLARE_EVENT_TABLE(); - wxPanel* m_MainPanel; - wxCheckBox* m_Check[6]; // WARNING: Make sure these are not also elsewhere diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Globals.h b/Source/Plugins/Plugin_VideoOGL/Src/Globals.h index b9796706f5..e0d86e702a 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Globals.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Globals.h @@ -24,12 +24,6 @@ #include "VideoCommon.h" #include "pluginspecs_video.h" -#if defined(HAVE_WX) && HAVE_WX - #include "Debugger/Debugger.h" - class GFXDebuggerOGL; - extern GFXDebuggerOGL *m_DebuggerFrame; -#endif - // A global plugin specification extern PLUGIN_GLOBALS* globals; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp index b68eca263f..e5ce618f54 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp @@ -64,7 +64,7 @@ Make AA apply instantly during gameplay if possible #include "GUI/ConfigDlg.h" GFXConfigDialogOGL *m_ConfigFrame = NULL; #include "Debugger/Debugger.h" -GFXDebuggerOGL *m_DebuggerFrame = NULL; +static GFXDebuggerOGL *m_DebuggerFrame = NULL; #endif // HAVE_WX #include "VideoConfig.h" @@ -152,15 +152,23 @@ wxWindow* GetParentedWxWindow(HWND Parent) } #endif -void DllDebugger(HWND _hParent, bool Show) +void DllDebugger(void *_hParent, bool Show) { #if defined(HAVE_WX) && HAVE_WX - if (Show) { + if (Show) + { if (!m_DebuggerFrame) - m_DebuggerFrame = new GFXDebuggerOGL(NULL); + m_DebuggerFrame = new GFXDebuggerOGL((wxWindow *)_hParent); m_DebuggerFrame->Show(); - } else { - if (m_DebuggerFrame) m_DebuggerFrame->Hide(); + } + else + { + if (m_DebuggerFrame) + { + m_DebuggerFrame->Close(); + m_DebuggerFrame->Destroy(); + m_DebuggerFrame = NULL; + } } #endif } diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/main.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/main.cpp index b4f7b4a15a..cd6a75de35 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/main.cpp @@ -61,7 +61,7 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals) LogManager::SetInstance((LogManager *)globals->logManager); } -void DllDebugger(HWND _hParent, bool Show) +void DllDebugger(void *_hParent, bool Show) { } diff --git a/Source/Plugins/Plugin_Wiimote/Src/main.cpp b/Source/Plugins/Plugin_Wiimote/Src/main.cpp index f7ecad1b8e..ee28cf63d9 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/main.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/main.cpp @@ -152,7 +152,7 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals) LogManager::SetInstance((LogManager *)globals->logManager); } -void DllDebugger(HWND _hParent, bool Show) {} +void DllDebugger(void *_hParent, bool Show) {} void DllConfig(HWND _hParent) { diff --git a/Source/Plugins/Plugin_Wiimote/Src/main.h b/Source/Plugins/Plugin_Wiimote/Src/main.h index 4a88dc7676..a61289240f 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/main.h +++ b/Source/Plugins/Plugin_Wiimote/Src/main.h @@ -62,7 +62,9 @@ struct SRecordingAll extern u32 g_ISOId; extern bool g_SearchDeviceDone; extern bool g_RealWiiMotePresent; +#ifdef _WIN32 extern HINSTANCE g_hInstance; +#endif // Debugging extern bool g_DebugAccelerometer; diff --git a/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteNew.cpp b/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteNew.cpp index 46980ccb9f..aec62f1df6 100644 --- a/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteNew.cpp +++ b/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteNew.cpp @@ -48,10 +48,10 @@ class wxDLLApp : public wxApp }; IMPLEMENT_APP_NO_MAIN(wxDLLApp) WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst); -#endif // copied from GCPad HINSTANCE g_hInstance; +#endif // copied from GCPad #if defined(HAVE_WX) && HAVE_WX @@ -320,7 +320,7 @@ void DllConfig(HWND _hParent) // input: a handle to the window that calls this function // output: none // -void DllDebugger(HWND _hParent, bool Show) +void DllDebugger(void *_hParent, bool Show) { // wut? }