Some work on cleaning up the FrameAui code. Primarily this fixes the debugger windows for the audio and video plugins. They are now all subclasses of a wxPanel, instead of a mix of wxFrames and wxDialogs. This makes them work correctly in linux, windows (they really didn't before), and most likely on MacOSX too!

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5913 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2010-07-19 02:09:34 +00:00
parent 3457ead880
commit b175397cb7
28 changed files with 506 additions and 545 deletions
+2 -2
View File
@@ -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) {
+2 -2
View File
@@ -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);
+1 -2
View File
@@ -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;
+2 -2
View File
@@ -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);
+9 -8
View File
@@ -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;
+146 -149
View File
@@ -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 <wx/button.h>
@@ -31,7 +26,6 @@
#include <wx/tipwin.h>
#include <wx/fontdlg.h>
// 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);
}
}
+10 -123
View File
@@ -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");
}
+2 -6
View File
@@ -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();
File diff suppressed because it is too large Load Diff
+3
View File
@@ -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);
+2 -15
View File
@@ -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
+1 -2
View File
@@ -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
+1 -1
View File
@@ -119,7 +119,7 @@ wxWindow* GetParentedWxWindow(HWND Parent)
#endif
void DllDebugger(HWND _hParent, bool Show)
void DllDebugger(void *_hParent, bool Show)
{
}
@@ -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
@@ -48,7 +48,7 @@ class DSPRegisterView;
class CCodeView;
class CMemoryView;
class DSPDebuggerLLE : public wxFrame
class DSPDebuggerLLE : public wxPanel
{
public:
DSPDebuggerLLE(wxWindow *parent);
+13 -5
View File
@@ -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
}
+1 -1
View File
@@ -107,7 +107,7 @@ wxWindow* GetParentedWxWindow(HWND Parent)
}
#endif
void DllDebugger(HWND _hParent, bool Show)
void DllDebugger(void *_hParent, bool Show)
{
}
@@ -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
@@ -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();
+13 -5
View File
@@ -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
}

Some files were not shown because too many files have changed in this diff Show More