mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Frame: Normalize member names
This commit is contained in:
@ -318,22 +318,19 @@ static void SignalHandler(int)
|
||||
CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geometry,
|
||||
bool use_debugger, bool batch_mode, bool show_log_window, long style)
|
||||
: CRenderFrame(parent, id, title, wxDefaultPosition, wxSize(800, 600), style),
|
||||
UseDebugger(use_debugger), m_bBatchMode(batch_mode)
|
||||
m_use_debugger(use_debugger), m_batch_mode(batch_mode)
|
||||
{
|
||||
BindEvents();
|
||||
|
||||
for (int i = 0; i <= IDM_CODE_WINDOW - IDM_LOG_WINDOW; i++)
|
||||
bFloatWindow[i] = false;
|
||||
|
||||
if (show_log_window)
|
||||
SConfig::GetInstance().m_InterfaceLogWindow = true;
|
||||
|
||||
// Debugger class
|
||||
if (UseDebugger)
|
||||
if (m_use_debugger)
|
||||
{
|
||||
g_pCodeWindow = new CCodeWindow(this, IDM_CODE_WINDOW);
|
||||
m_code_window = new CCodeWindow(this, IDM_CODE_WINDOW);
|
||||
LoadIniPerspectives();
|
||||
g_pCodeWindow->Load();
|
||||
m_code_window->Load();
|
||||
}
|
||||
|
||||
wxFrame::CreateToolBar(wxTB_DEFAULT_STYLE | wxTB_TEXT | wxTB_FLAT)->Realize();
|
||||
@ -351,21 +348,21 @@ CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geo
|
||||
// ---------------
|
||||
// Main panel
|
||||
// This panel is the parent for rendering and it holds the gamelistctrl
|
||||
m_Panel = new wxPanel(this, IDM_MPANEL, wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_panel = new wxPanel(this, IDM_MPANEL, wxDefaultPosition, wxDefaultSize, 0);
|
||||
|
||||
m_GameListCtrl = new CGameListCtrl(m_Panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
||||
wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT);
|
||||
m_GameListCtrl->Bind(wxEVT_LIST_ITEM_ACTIVATED, &CFrame::OnGameListCtrlItemActivated, this);
|
||||
m_game_list_ctrl = new CGameListCtrl(m_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
||||
wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT);
|
||||
m_game_list_ctrl->Bind(wxEVT_LIST_ITEM_ACTIVATED, &CFrame::OnGameListCtrlItemActivated, this);
|
||||
|
||||
wxBoxSizer* sizerPanel = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizerPanel->Add(m_GameListCtrl, 1, wxEXPAND | wxALL);
|
||||
m_Panel->SetSizer(sizerPanel);
|
||||
sizerPanel->Add(m_game_list_ctrl, 1, wxEXPAND | wxALL);
|
||||
m_panel->SetSizer(sizerPanel);
|
||||
// ---------------
|
||||
|
||||
// Manager
|
||||
m_Mgr = new wxAuiManager(this, wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE);
|
||||
m_mgr = new wxAuiManager(this, wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE);
|
||||
|
||||
m_Mgr->AddPane(m_Panel, wxAuiPaneInfo()
|
||||
m_mgr->AddPane(m_panel, wxAuiPaneInfo()
|
||||
.Name("Pane 0")
|
||||
.Caption("Pane 0")
|
||||
.PaneBorder(false)
|
||||
@ -373,8 +370,8 @@ CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geo
|
||||
.Layer(0)
|
||||
.Center()
|
||||
.Show());
|
||||
if (!g_pCodeWindow)
|
||||
m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo()
|
||||
if (!m_code_window)
|
||||
m_mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo()
|
||||
.Name("Pane 1")
|
||||
.Caption(_("Logging"))
|
||||
.CaptionVisible(true)
|
||||
@ -382,20 +379,20 @@ CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geo
|
||||
.FloatingSize(wxSize(600, 350))
|
||||
.CloseButton(true)
|
||||
.Hide());
|
||||
AuiFullscreen = m_Mgr->SavePerspective();
|
||||
m_aui_fullscreen_perspective = m_mgr->SavePerspective();
|
||||
|
||||
if (!SConfig::GetInstance().m_InterfaceToolbar)
|
||||
DoToggleToolbar(false);
|
||||
|
||||
m_LogWindow = new CLogWindow(this, IDM_LOG_WINDOW);
|
||||
m_LogWindow->Hide();
|
||||
m_LogWindow->Disable();
|
||||
m_log_window = new CLogWindow(this, IDM_LOG_WINDOW);
|
||||
m_log_window->Hide();
|
||||
m_log_window->Disable();
|
||||
|
||||
InitializeTASDialogs();
|
||||
InitializeCoreCallbacks();
|
||||
|
||||
// Setup perspectives
|
||||
if (g_pCodeWindow)
|
||||
if (m_code_window)
|
||||
{
|
||||
// Load perspective
|
||||
DoLoadPerspective();
|
||||
@ -415,13 +412,13 @@ CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geo
|
||||
FromDIP(wxSize(800, 600)));
|
||||
|
||||
// Start debugging maximized (Must be after the window has been positioned)
|
||||
if (UseDebugger)
|
||||
if (m_use_debugger)
|
||||
Maximize(true);
|
||||
|
||||
// Commit
|
||||
m_Mgr->Update();
|
||||
m_mgr->Update();
|
||||
|
||||
// The window must be shown for m_XRRConfig to be created (wxGTK will not allocate X11
|
||||
// The window must be shown for m_xrr_config to be created (wxGTK will not allocate X11
|
||||
// resources until the window is shown for the first time).
|
||||
Show();
|
||||
|
||||
@ -431,12 +428,12 @@ CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geo
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_XRANDR) && HAVE_XRANDR
|
||||
m_XRRConfig = new X11Utils::XRRConfiguration(X11Utils::XDisplayFromHandle(GetHandle()),
|
||||
X11Utils::XWindowFromHandle(GetHandle()));
|
||||
m_xrr_config = new X11Utils::XRRConfiguration(X11Utils::XDisplayFromHandle(GetHandle()),
|
||||
X11Utils::XWindowFromHandle(GetHandle()));
|
||||
#endif
|
||||
|
||||
// Connect event handlers
|
||||
m_Mgr->Bind(wxEVT_AUI_RENDER, &CFrame::OnManagerResize, this);
|
||||
m_mgr->Bind(wxEVT_AUI_RENDER, &CFrame::OnManagerResize, this);
|
||||
|
||||
// Update controls
|
||||
UpdateGUI();
|
||||
@ -475,12 +472,12 @@ CFrame::~CFrame()
|
||||
g_controller_interface.Shutdown();
|
||||
|
||||
#if defined(HAVE_XRANDR) && HAVE_XRANDR
|
||||
delete m_XRRConfig;
|
||||
delete m_xrr_config;
|
||||
#endif
|
||||
|
||||
ClosePages();
|
||||
|
||||
delete m_Mgr;
|
||||
delete m_mgr;
|
||||
|
||||
// This object is owned by us, not wxw
|
||||
m_menubar_shadow->Destroy();
|
||||
@ -533,7 +530,7 @@ bool CFrame::RendererIsFullscreen()
|
||||
|
||||
if (Core::GetState() == Core::State::Running || Core::GetState() == Core::State::Paused)
|
||||
{
|
||||
fullscreen = m_RenderFrame->IsFullScreen();
|
||||
fullscreen = m_render_frame->IsFullScreen();
|
||||
}
|
||||
|
||||
return fullscreen;
|
||||
@ -548,13 +545,13 @@ void CFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
// Events
|
||||
void CFrame::OnActive(wxActivateEvent& event)
|
||||
{
|
||||
m_bRendererHasFocus = (event.GetActive() && event.GetEventObject() == m_RenderFrame);
|
||||
m_renderer_has_focus = (event.GetActive() && event.GetEventObject() == m_render_frame);
|
||||
if (Core::GetState() == Core::State::Running || Core::GetState() == Core::State::Paused)
|
||||
{
|
||||
if (m_bRendererHasFocus)
|
||||
if (m_renderer_has_focus)
|
||||
{
|
||||
if (SConfig::GetInstance().bRenderToMain)
|
||||
m_RenderParent->SetFocus();
|
||||
m_render_parent->SetFocus();
|
||||
else if (RendererIsFullscreen() && g_ActiveConfig.ExclusiveFullscreenEnabled())
|
||||
DoExclusiveFullscreen(true); // Regain exclusive mode
|
||||
|
||||
@ -562,7 +559,7 @@ void CFrame::OnActive(wxActivateEvent& event)
|
||||
DoPause();
|
||||
|
||||
if (SConfig::GetInstance().bHideCursor && Core::GetState() == Core::State::Running)
|
||||
m_RenderParent->SetCursor(wxCURSOR_BLANK);
|
||||
m_render_parent->SetCursor(wxCURSOR_BLANK);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -570,7 +567,7 @@ void CFrame::OnActive(wxActivateEvent& event)
|
||||
DoPause();
|
||||
|
||||
if (SConfig::GetInstance().bHideCursor)
|
||||
m_RenderParent->SetCursor(wxNullCursor);
|
||||
m_render_parent->SetCursor(wxNullCursor);
|
||||
}
|
||||
}
|
||||
event.Skip();
|
||||
@ -588,7 +585,7 @@ void CFrame::OnClose(wxCloseEvent& event)
|
||||
event.Veto();
|
||||
}
|
||||
// Tell OnStopped to resubmit the Close event
|
||||
m_bClosing = true;
|
||||
m_is_closing = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -600,19 +597,19 @@ void CFrame::OnClose(wxCloseEvent& event)
|
||||
event.Skip();
|
||||
|
||||
// Save GUI settings
|
||||
if (g_pCodeWindow)
|
||||
if (m_code_window)
|
||||
{
|
||||
SaveIniPerspectives();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_LogWindow->SaveSettings();
|
||||
m_log_window->SaveSettings();
|
||||
}
|
||||
if (m_LogWindow)
|
||||
m_LogWindow->RemoveAllListeners();
|
||||
if (m_log_window)
|
||||
m_log_window->RemoveAllListeners();
|
||||
|
||||
// Uninit
|
||||
m_Mgr->UnInit();
|
||||
m_mgr->UnInit();
|
||||
}
|
||||
|
||||
// Post events
|
||||
@ -620,10 +617,10 @@ void CFrame::OnClose(wxCloseEvent& event)
|
||||
// Warning: This may cause an endless loop if the event is propagated back to its parent
|
||||
void CFrame::PostEvent(wxCommandEvent& event)
|
||||
{
|
||||
if (g_pCodeWindow && event.GetId() >= IDM_INTERPRETER && event.GetId() <= IDM_ADDRBOX)
|
||||
if (m_code_window && event.GetId() >= IDM_INTERPRETER && event.GetId() <= IDM_ADDRBOX)
|
||||
{
|
||||
event.StopPropagation();
|
||||
g_pCodeWindow->GetEventHandler()->AddPendingEvent(event);
|
||||
m_code_window->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -656,10 +653,12 @@ void CFrame::OnResize(wxSizeEvent& event)
|
||||
}
|
||||
|
||||
// Make sure the logger pane is a sane size
|
||||
if (!g_pCodeWindow && m_LogWindow && m_Mgr->GetPane("Pane 1").IsShown() &&
|
||||
!m_Mgr->GetPane("Pane 1").IsFloating() &&
|
||||
(m_LogWindow->x > GetClientRect().GetWidth() || m_LogWindow->y > GetClientRect().GetHeight()))
|
||||
if (!m_code_window && m_log_window && m_mgr->GetPane("Pane 1").IsShown() &&
|
||||
!m_mgr->GetPane("Pane 1").IsFloating() && (m_log_window->x > GetClientRect().GetWidth() ||
|
||||
m_log_window->y > GetClientRect().GetHeight()))
|
||||
{
|
||||
ShowResizePane();
|
||||
}
|
||||
}
|
||||
|
||||
// Host messages
|
||||
@ -694,12 +693,12 @@ void CFrame::UpdateTitle(const std::string& str)
|
||||
if (SConfig::GetInstance().bRenderToMain && SConfig::GetInstance().m_InterfaceStatusbar)
|
||||
{
|
||||
GetStatusBar()->SetStatusText(str, 0);
|
||||
m_RenderFrame->SetTitle(scm_rev_str);
|
||||
m_render_frame->SetTitle(scm_rev_str);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string titleStr = StringFromFormat("%s | %s", scm_rev_str.c_str(), str.c_str());
|
||||
m_RenderFrame->SetTitle(titleStr);
|
||||
m_render_frame->SetTitle(titleStr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -708,7 +707,7 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
|
||||
switch (event.GetId())
|
||||
{
|
||||
case IDM_UPDATE_DISASM_DIALOG: // For breakpoints causing pausing
|
||||
if (!g_pCodeWindow || Core::GetState() != Core::State::Paused)
|
||||
if (!m_code_window || Core::GetState() != Core::State::Paused)
|
||||
return;
|
||||
// fallthrough
|
||||
|
||||
@ -735,17 +734,17 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
|
||||
|
||||
case WM_USER_CREATE:
|
||||
if (SConfig::GetInstance().bHideCursor)
|
||||
m_RenderParent->SetCursor(wxCURSOR_BLANK);
|
||||
m_render_parent->SetCursor(wxCURSOR_BLANK);
|
||||
break;
|
||||
|
||||
case IDM_PANIC:
|
||||
{
|
||||
wxString caption = event.GetString().BeforeFirst(':');
|
||||
wxString text = event.GetString().AfterFirst(':');
|
||||
bPanicResult =
|
||||
m_panic_result =
|
||||
(wxYES == wxMessageBox(text, caption, wxSTAY_ON_TOP | (event.GetInt() ? wxYES_NO : wxOK),
|
||||
wxWindow::FindFocus()));
|
||||
panic_event.Set();
|
||||
m_panic_event.Set();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -778,35 +777,35 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
|
||||
void CFrame::OnRenderWindowSizeRequest(int width, int height)
|
||||
{
|
||||
if (!SConfig::GetInstance().bRenderWindowAutoSize || !Core::IsRunning() ||
|
||||
RendererIsFullscreen() || m_RenderFrame->IsMaximized())
|
||||
RendererIsFullscreen() || m_render_frame->IsMaximized())
|
||||
return;
|
||||
|
||||
wxSize requested_size(width, height);
|
||||
// Convert to window pixels, since the size is from the backend it will be in framebuffer px.
|
||||
requested_size *= 1.0 / m_RenderFrame->GetContentScaleFactor();
|
||||
requested_size *= 1.0 / m_render_frame->GetContentScaleFactor();
|
||||
wxSize old_size;
|
||||
|
||||
if (!SConfig::GetInstance().bRenderToMain)
|
||||
{
|
||||
old_size = m_RenderFrame->GetClientSize();
|
||||
old_size = m_render_frame->GetClientSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Resize for the render panel only, this implicitly retains space for everything else
|
||||
// (i.e. log panel, toolbar, statusbar, etc) without needing to compute for them.
|
||||
old_size = m_RenderParent->GetSize();
|
||||
old_size = m_render_parent->GetSize();
|
||||
}
|
||||
|
||||
wxSize diff = requested_size - old_size;
|
||||
if (diff != wxSize())
|
||||
m_RenderFrame->SetSize(m_RenderFrame->GetSize() + diff);
|
||||
m_render_frame->SetSize(m_render_frame->GetSize() + diff);
|
||||
}
|
||||
|
||||
bool CFrame::RendererHasFocus()
|
||||
{
|
||||
if (m_RenderParent == nullptr)
|
||||
if (m_render_parent == nullptr)
|
||||
return false;
|
||||
return m_bRendererHasFocus;
|
||||
return m_renderer_has_focus;
|
||||
}
|
||||
|
||||
void CFrame::OnGameListCtrlItemActivated(wxListEvent& WXUNUSED(event))
|
||||
@ -818,7 +817,7 @@ void CFrame::OnGameListCtrlItemActivated(wxListEvent& WXUNUSED(event))
|
||||
// 1. Boot the selected iso
|
||||
// 2. Boot the default or last loaded iso.
|
||||
// 3. Call BrowseForDirectory if the gamelist is empty
|
||||
if (!m_GameListCtrl->GetISO(0) && CGameListCtrl::IsHidingItems())
|
||||
if (!m_game_list_ctrl->GetISO(0) && CGameListCtrl::IsHidingItems())
|
||||
{
|
||||
SConfig::GetInstance().m_ListGC = SConfig::GetInstance().m_ListWii =
|
||||
SConfig::GetInstance().m_ListWad = SConfig::GetInstance().m_ListElfDol =
|
||||
@ -853,9 +852,9 @@ void CFrame::OnGameListCtrlItemActivated(wxListEvent& WXUNUSED(event))
|
||||
|
||||
UpdateGameList();
|
||||
}
|
||||
else if (!m_GameListCtrl->GetISO(0))
|
||||
else if (!m_game_list_ctrl->GetISO(0))
|
||||
{
|
||||
m_GameListCtrl->BrowseForDirectory();
|
||||
m_game_list_ctrl->BrowseForDirectory();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1045,7 +1044,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
|
||||
// the system beep for unhandled key events when
|
||||
// receiving pad/Wiimote keypresses which take an
|
||||
// entirely different path through the HID subsystem.
|
||||
if (!m_bRendererHasFocus)
|
||||
if (!m_renderer_has_focus)
|
||||
{
|
||||
// We do however want to pass events on when the
|
||||
// render window is out of focus: this allows use
|
||||
@ -1122,13 +1121,13 @@ void CFrame::DoFullscreen(bool enable_fullscreen)
|
||||
|
||||
if (SConfig::GetInstance().bRenderToMain)
|
||||
{
|
||||
m_RenderFrame->ShowFullScreen(enable_fullscreen, wxFULLSCREEN_ALL);
|
||||
m_render_frame->ShowFullScreen(enable_fullscreen, wxFULLSCREEN_ALL);
|
||||
|
||||
if (enable_fullscreen)
|
||||
{
|
||||
// Save the current mode before going to fullscreen
|
||||
AuiCurrent = m_Mgr->SavePerspective();
|
||||
m_Mgr->LoadPerspective(AuiFullscreen, true);
|
||||
m_aui_current_perspective = m_mgr->SavePerspective();
|
||||
m_mgr->LoadPerspective(m_aui_fullscreen_perspective, true);
|
||||
|
||||
// Hide toolbar
|
||||
DoToggleToolbar(false);
|
||||
@ -1146,7 +1145,7 @@ void CFrame::DoFullscreen(bool enable_fullscreen)
|
||||
else
|
||||
{
|
||||
// Restore saved perspective
|
||||
m_Mgr->LoadPerspective(AuiCurrent, true);
|
||||
m_mgr->LoadPerspective(m_aui_current_perspective, true);
|
||||
|
||||
// Restore toolbar to the status it was at before going fullscreen.
|
||||
DoToggleToolbar(SConfig::GetInstance().m_InterfaceToolbar);
|
||||
@ -1170,16 +1169,16 @@ void CFrame::DoFullscreen(bool enable_fullscreen)
|
||||
if (!enable_fullscreen)
|
||||
DoExclusiveFullscreen(false);
|
||||
|
||||
m_RenderFrame->ShowFullScreen(enable_fullscreen, wxFULLSCREEN_ALL);
|
||||
m_RenderFrame->Raise();
|
||||
m_render_frame->ShowFullScreen(enable_fullscreen, wxFULLSCREEN_ALL);
|
||||
m_render_frame->Raise();
|
||||
|
||||
if (enable_fullscreen)
|
||||
DoExclusiveFullscreen(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_RenderFrame->ShowFullScreen(enable_fullscreen, wxFULLSCREEN_ALL);
|
||||
m_RenderFrame->Raise();
|
||||
m_render_frame->ShowFullScreen(enable_fullscreen, wxFULLSCREEN_ALL);
|
||||
m_render_frame->Raise();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1285,7 +1284,7 @@ void CFrame::ParseHotkeys()
|
||||
IsHotkey(HK_TRIGGER_SYNC_BUTTON, true));
|
||||
}
|
||||
|
||||
if (UseDebugger)
|
||||
if (m_use_debugger)
|
||||
{
|
||||
if (IsHotkey(HK_STEP))
|
||||
{
|
||||
@ -1328,7 +1327,7 @@ void CFrame::ParseHotkeys()
|
||||
if (bpDlg.ShowModal() == wxID_OK)
|
||||
{
|
||||
wxCommandEvent evt(wxEVT_HOST_COMMAND, IDM_UPDATE_BREAKPOINTS);
|
||||
g_pCodeWindow->GetEventHandler()->AddPendingEvent(evt);
|
||||
m_code_window->GetEventHandler()->AddPendingEvent(evt);
|
||||
}
|
||||
}
|
||||
if (IsHotkey(HK_MBP_ADD))
|
||||
@ -1337,7 +1336,7 @@ void CFrame::ParseHotkeys()
|
||||
if (memDlg.ShowModal() == wxID_OK)
|
||||
{
|
||||
wxCommandEvent evt(wxEVT_HOST_COMMAND, IDM_UPDATE_BREAKPOINTS);
|
||||
g_pCodeWindow->GetEventHandler()->AddPendingEvent(evt);
|
||||
m_code_window->GetEventHandler()->AddPendingEvent(evt);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1430,11 +1429,11 @@ void CFrame::ParseHotkeys()
|
||||
}
|
||||
if (IsHotkey(HK_SAVE_STATE_SLOT_SELECTED))
|
||||
{
|
||||
State::Save(m_saveSlot);
|
||||
State::Save(m_save_slot);
|
||||
}
|
||||
if (IsHotkey(HK_LOAD_STATE_SLOT_SELECTED))
|
||||
{
|
||||
State::Load(m_saveSlot);
|
||||
State::Load(m_save_slot);
|
||||
}
|
||||
|
||||
if (IsHotkey(HK_TOGGLE_STEREO_SBS))
|
||||
@ -1639,6 +1638,6 @@ void CFrame::HandleSignal(wxTimerEvent& event)
|
||||
{
|
||||
if (!s_shutdown_signal_received.TestAndClear())
|
||||
return;
|
||||
m_bClosing = true;
|
||||
m_is_closing = true;
|
||||
Close();
|
||||
}
|
||||
|
Reference in New Issue
Block a user