2009-07-28 15:32:10 -06:00
|
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
2009-01-02 18:38:44 -07:00
|
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
|
|
|
|
|
|
2008-12-07 21:46:09 -07:00
|
|
|
|
#ifndef __FRAME_H_
|
|
|
|
|
#define __FRAME_H_
|
|
|
|
|
|
2009-01-04 14:53:41 -07:00
|
|
|
|
#include <wx/wx.h> // wxWidgets
|
2008-12-07 21:46:09 -07:00
|
|
|
|
#include <wx/busyinfo.h>
|
2009-01-04 14:53:41 -07:00
|
|
|
|
#include <wx/mstream.h>
|
2009-03-20 12:25:36 -06:00
|
|
|
|
#include <wx/listctrl.h>
|
2009-08-26 03:19:15 -06:00
|
|
|
|
#include <wx/artprov.h>
|
2009-08-24 19:50:27 -06:00
|
|
|
|
#include <wx/aui/aui.h>
|
2009-05-13 16:23:54 -06:00
|
|
|
|
|
2009-02-24 08:04:12 -07:00
|
|
|
|
#include "CDUtils.h"
|
2009-08-24 19:50:27 -06:00
|
|
|
|
#include "CodeWindow.h"
|
2009-03-18 11:17:58 -06:00
|
|
|
|
#include "LogWindow.h"
|
2009-05-13 16:23:54 -06:00
|
|
|
|
|
2009-01-04 14:53:41 -07:00
|
|
|
|
// A shortcut to access the bitmaps
|
|
|
|
|
#define wxGetBitmapFromMemory(name) _wxGetBitmapFromMemory(name, sizeof(name))
|
|
|
|
|
inline wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length)
|
|
|
|
|
{
|
|
|
|
|
wxMemoryInputStream is(data, length);
|
|
|
|
|
return(wxBitmap(wxImage(is, wxBITMAP_TYPE_ANY, -1), -1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Class declarations
|
2008-12-07 21:46:09 -07:00
|
|
|
|
class CGameListCtrl;
|
2009-03-20 12:25:36 -06:00
|
|
|
|
class CLogWindow;
|
2009-06-18 02:22:02 -06:00
|
|
|
|
|
2008-12-07 21:46:09 -07:00
|
|
|
|
class CFrame : public wxFrame
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
2009-03-18 11:17:58 -06:00
|
|
|
|
CFrame(bool showLogWindow,
|
|
|
|
|
wxFrame* parent,
|
2008-12-07 21:46:09 -07:00
|
|
|
|
wxWindowID id = wxID_ANY,
|
2008-12-13 15:40:10 -07:00
|
|
|
|
const wxString& title = wxT("Dolphin"),
|
2008-12-07 21:46:09 -07:00
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2009-08-24 19:50:27 -06:00
|
|
|
|
bool _UseDebugger = false,
|
2008-12-07 21:46:09 -07:00
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE);
|
|
|
|
|
|
2009-01-04 14:53:41 -07:00
|
|
|
|
void* GetRenderHandle()
|
|
|
|
|
{
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
return(m_Panel->GetHandle());
|
|
|
|
|
#else
|
|
|
|
|
return this;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
2009-01-04 14:53:41 -07:00
|
|
|
|
virtual ~CFrame();
|
2008-12-08 22:37:15 -07:00
|
|
|
|
|
2009-01-04 14:53:41 -07:00
|
|
|
|
// These have to be public
|
|
|
|
|
wxStatusBar* m_pStatusBar;
|
2009-08-27 04:10:07 -06:00
|
|
|
|
CCodeWindow* g_pCodeWindow;
|
|
|
|
|
wxBitmap aNormalFile;
|
2009-01-04 14:53:41 -07:00
|
|
|
|
void InitBitmaps();
|
|
|
|
|
void DoStop();
|
|
|
|
|
bool bRenderToMain;
|
2009-02-22 14:16:12 -07:00
|
|
|
|
void UpdateGUI();
|
2009-08-27 09:53:19 -06:00
|
|
|
|
void ToggleLogWindow(bool, int i = -1);
|
|
|
|
|
void ToggleConsole(bool, int i = -1);
|
2009-08-24 19:50:27 -06:00
|
|
|
|
void PostEvent(wxCommandEvent& event);
|
|
|
|
|
void PostMenuEvent(wxMenuEvent& event);
|
|
|
|
|
void PostUpdateUIEvent(wxUpdateUIEvent& event);
|
2008-12-08 22:37:15 -07:00
|
|
|
|
|
2009-01-04 14:53:41 -07:00
|
|
|
|
// ---------------------------------------
|
2008-12-08 22:37:15 -07:00
|
|
|
|
// Wiimote leds
|
2009-08-24 19:50:27 -06:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2008-12-09 07:57:55 -07:00
|
|
|
|
void ModifyStatusBar();
|
2008-12-08 22:37:15 -07:00
|
|
|
|
void CreateDestroy(int Case);
|
|
|
|
|
void CreateLeds(); void CreateSpeakers();
|
|
|
|
|
void UpdateLeds(); void UpdateSpeakers();
|
|
|
|
|
wxBitmap CreateBitmapForLeds(bool On);
|
|
|
|
|
wxBitmap CreateBitmapForSpeakers(int BitmapType, bool On);
|
2008-12-11 20:38:50 -07:00
|
|
|
|
void DoMoveIcons(); void MoveLeds(); void MoveSpeakers();
|
2008-12-08 22:37:15 -07:00
|
|
|
|
bool HaveLeds; bool HaveSpeakers;
|
|
|
|
|
|
|
|
|
|
wxStaticBitmap *m_StatBmp[7];
|
|
|
|
|
u8 g_Leds[4]; u8 g_Leds_[4];
|
|
|
|
|
u8 g_Speakers[3]; u8 g_Speakers_[3];
|
2009-01-04 14:53:41 -07:00
|
|
|
|
// ---------------
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
2009-08-25 01:05:53 -06:00
|
|
|
|
// AUI
|
|
|
|
|
wxAuiManager *m_Mgr;
|
2009-08-27 01:33:07 -06:00
|
|
|
|
wxAuiToolBar *m_ToolBar, *m_ToolBarDebug, *m_ToolBarAui;
|
2009-08-27 09:53:19 -06:00
|
|
|
|
std::vector<wxAuiNotebook*> m_NB;
|
2009-08-27 01:33:07 -06:00
|
|
|
|
int iLeftWidth[2], iMidWidth[2];
|
2009-08-25 01:05:53 -06:00
|
|
|
|
// Perspectives
|
2009-08-27 01:33:07 -06:00
|
|
|
|
wxString AuiFullscreen, AuiCurrent;
|
|
|
|
|
wxArrayString AuiPerspective;
|
2009-08-27 13:38:35 -06:00
|
|
|
|
wxWindow * GetWxWindow(wxString);
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
wxWindow * GetWxWindowHwnd(HWND);
|
|
|
|
|
#endif
|
|
|
|
|
wxWindow * GetNootebookPage(wxString);
|
2009-08-26 09:23:48 -06:00
|
|
|
|
void OnNotebookPageClose(wxAuiNotebookEvent& event);
|
|
|
|
|
void OnAllowNotebookDnD(wxAuiNotebookEvent& event);
|
2009-08-27 09:53:19 -06:00
|
|
|
|
void OnNotebookPageChanged(wxAuiNotebookEvent& event);
|
|
|
|
|
int GetNootebookAffiliation(wxString Name);
|
2009-08-27 04:10:07 -06:00
|
|
|
|
void DoToggleWindow(int,bool);
|
|
|
|
|
void DoRemovePage(wxWindow *, bool Hide = true);
|
2009-08-27 13:38:35 -06:00
|
|
|
|
void DoRemovePageString(wxString, bool Hide = true);
|
2009-08-27 01:33:07 -06:00
|
|
|
|
void DoLoadPerspective(int);
|
2009-08-27 04:10:07 -06:00
|
|
|
|
void HidePane();
|
|
|
|
|
void SetSimplePaneSize();
|
|
|
|
|
void SetPaneSize(wxArrayInt,wxArrayInt);
|
2009-08-27 11:17:48 -06:00
|
|
|
|
void ToggleNotebookStyle(long);
|
2009-08-27 01:33:07 -06:00
|
|
|
|
void Save();
|
2009-08-29 00:08:14 -06:00
|
|
|
|
void ResizeConsole();
|
2009-08-25 01:05:53 -06:00
|
|
|
|
|
2009-08-27 04:10:07 -06:00
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
bool UseDebugger;
|
|
|
|
|
wxBoxSizer* sizerPanel;
|
|
|
|
|
wxBoxSizer* sizerFrame;
|
|
|
|
|
CGameListCtrl* m_GameListCtrl;
|
|
|
|
|
wxPanel* m_Panel;
|
|
|
|
|
wxToolBarToolBase* m_ToolPlay;
|
|
|
|
|
bool m_bLogWindow;
|
|
|
|
|
CLogWindow* m_LogWindow;
|
|
|
|
|
|
2009-02-24 08:04:12 -07:00
|
|
|
|
char **drives;
|
2009-01-02 18:38:44 -07:00
|
|
|
|
|
2009-01-04 14:53:41 -07:00
|
|
|
|
enum EToolbar
|
2008-12-07 21:46:09 -07:00
|
|
|
|
{
|
|
|
|
|
Toolbar_FileOpen,
|
|
|
|
|
Toolbar_Refresh,
|
|
|
|
|
Toolbar_Browse,
|
|
|
|
|
Toolbar_Play,
|
2009-01-03 12:30:59 -07:00
|
|
|
|
Toolbar_Stop,
|
2008-12-07 21:46:09 -07:00
|
|
|
|
Toolbar_Pause,
|
2009-02-26 20:56:34 -07:00
|
|
|
|
Toolbar_Screenshot,
|
2009-01-04 14:53:41 -07:00
|
|
|
|
Toolbar_FullScreen,
|
2008-12-07 21:46:09 -07:00
|
|
|
|
Toolbar_PluginOptions,
|
|
|
|
|
Toolbar_PluginGFX,
|
2009-01-03 12:30:59 -07:00
|
|
|
|
Toolbar_PluginDSP,
|
2008-12-07 21:46:09 -07:00
|
|
|
|
Toolbar_PluginPAD,
|
2009-01-04 14:53:41 -07:00
|
|
|
|
Toolbar_Wiimote,
|
2008-12-07 21:46:09 -07:00
|
|
|
|
Toolbar_Help,
|
2009-01-04 14:53:41 -07:00
|
|
|
|
EToolbar_Max
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum EBitmapsThemes
|
|
|
|
|
{
|
|
|
|
|
BOOMY,
|
|
|
|
|
VISTA,
|
|
|
|
|
XPLASTIK,
|
|
|
|
|
KDE,
|
|
|
|
|
THEMES_MAX
|
2008-12-08 22:37:15 -07:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum WiimoteBitmaps // Wiimote speaker bitmaps
|
|
|
|
|
{
|
2009-01-04 14:53:41 -07:00
|
|
|
|
CREATELEDS,
|
2008-12-08 22:37:15 -07:00
|
|
|
|
DESTROYLEDS,
|
|
|
|
|
CREATESPEAKERS,
|
|
|
|
|
DESTROYSPEAKERS
|
2008-12-07 21:46:09 -07:00
|
|
|
|
};
|
|
|
|
|
|
2009-01-04 14:53:41 -07:00
|
|
|
|
wxBitmap m_Bitmaps[EToolbar_Max];
|
|
|
|
|
wxBitmap m_BitmapsMenu[EToolbar_Max];
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
2009-08-24 19:50:27 -06:00
|
|
|
|
void PopulateToolbar(wxAuiToolBar* toolBar);
|
2009-08-27 01:33:07 -06:00
|
|
|
|
void PopulateToolbarAui(wxAuiToolBar* toolBar);
|
2008-12-07 21:46:09 -07:00
|
|
|
|
void RecreateToolbar();
|
|
|
|
|
void CreateMenu();
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
// Override window proc for tricks like screensaver disabling
|
|
|
|
|
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
|
|
|
|
#endif
|
2008-12-23 01:47:37 -07:00
|
|
|
|
// Event functions
|
2008-12-07 21:46:09 -07:00
|
|
|
|
void OnQuit(wxCommandEvent& event);
|
|
|
|
|
void OnHelp(wxCommandEvent& event);
|
2009-08-27 01:33:07 -06:00
|
|
|
|
void OnToolBar(wxCommandEvent& event);
|
2008-12-23 01:47:37 -07:00
|
|
|
|
|
2009-06-18 02:22:02 -06:00
|
|
|
|
void OnOpen(wxCommandEvent& event); // File menu
|
|
|
|
|
void DoOpen(bool Boot);
|
2008-12-07 21:46:09 -07:00
|
|
|
|
void OnRefresh(wxCommandEvent& event);
|
2008-12-23 01:47:37 -07:00
|
|
|
|
void OnBrowse(wxCommandEvent& event);
|
2009-02-21 16:44:40 -07:00
|
|
|
|
void OnBootDrive(wxCommandEvent& event);
|
2008-12-23 01:47:37 -07:00
|
|
|
|
|
|
|
|
|
void OnPlay(wxCommandEvent& event); // Emulation
|
2009-08-21 03:26:34 -06:00
|
|
|
|
void OnRecord(wxCommandEvent& event);
|
2009-08-21 13:55:03 -06:00
|
|
|
|
void OnPlayRecording(wxCommandEvent& event);
|
2008-12-23 01:47:37 -07:00
|
|
|
|
void OnChangeDisc(wxCommandEvent& event);
|
|
|
|
|
void OnStop(wxCommandEvent& event);
|
2009-02-26 20:56:34 -07:00
|
|
|
|
void OnScreenshot(wxCommandEvent& event);
|
2008-12-23 01:47:37 -07:00
|
|
|
|
void OnClose(wxCloseEvent &event);
|
|
|
|
|
void OnLoadState(wxCommandEvent& event);
|
|
|
|
|
void OnSaveState(wxCommandEvent& event);
|
2009-06-27 19:11:35 -06:00
|
|
|
|
void OnLoadStateFromFile(wxCommandEvent& event);
|
|
|
|
|
void OnSaveStateToFile(wxCommandEvent& event);
|
|
|
|
|
void OnLoadLastState(wxCommandEvent& event);
|
2009-06-28 15:11:51 -06:00
|
|
|
|
void OnUndoLoadState(wxCommandEvent& event);
|
|
|
|
|
void OnUndoSaveState(wxCommandEvent& event);
|
2008-12-23 01:47:37 -07:00
|
|
|
|
|
2009-08-07 19:39:56 -06:00
|
|
|
|
void OnFrameSkip(wxCommandEvent& event);
|
2009-08-21 20:05:02 -06:00
|
|
|
|
void OnFrameStep(wxCommandEvent& event);
|
2009-08-07 19:39:56 -06:00
|
|
|
|
|
2008-12-23 01:47:37 -07:00
|
|
|
|
void OnConfigMain(wxCommandEvent& event); // Options
|
2008-12-07 21:46:09 -07:00
|
|
|
|
void OnPluginGFX(wxCommandEvent& event);
|
|
|
|
|
void OnPluginDSP(wxCommandEvent& event);
|
|
|
|
|
void OnPluginPAD(wxCommandEvent& event);
|
|
|
|
|
void OnPluginWiimote(wxCommandEvent& event);
|
2008-12-23 01:47:37 -07:00
|
|
|
|
|
2008-12-07 21:46:09 -07:00
|
|
|
|
void OnToggleFullscreen(wxCommandEvent& event);
|
|
|
|
|
void OnToggleDualCore(wxCommandEvent& event);
|
|
|
|
|
void OnToggleSkipIdle(wxCommandEvent& event);
|
|
|
|
|
void OnToggleThrottle(wxCommandEvent& event);
|
2009-08-29 00:08:14 -06:00
|
|
|
|
void OnManagerResize(wxAuiManagerEvent& event);
|
2008-12-11 20:38:50 -07:00
|
|
|
|
void OnResize(wxSizeEvent& event);
|
2008-12-07 21:46:09 -07:00
|
|
|
|
void OnToggleToolbar(wxCommandEvent& event);
|
2009-08-27 01:33:07 -06:00
|
|
|
|
void DoToggleToolbar(bool);
|
2008-12-07 21:46:09 -07:00
|
|
|
|
void OnToggleStatusbar(wxCommandEvent& event);
|
2009-03-20 12:25:36 -06:00
|
|
|
|
void OnToggleLogWindow(wxCommandEvent& event);
|
|
|
|
|
void OnToggleConsole(wxCommandEvent& event);
|
2009-06-18 02:22:02 -06:00
|
|
|
|
void OnKeyDown(wxKeyEvent& event);
|
|
|
|
|
void OnKeyUp(wxKeyEvent& event);
|
|
|
|
|
void OnDoubleClick(wxMouseEvent& event);
|
|
|
|
|
void OnMotion(wxMouseEvent& event);
|
2009-01-04 14:53:41 -07:00
|
|
|
|
|
2008-12-07 21:46:09 -07:00
|
|
|
|
void OnHostMessage(wxCommandEvent& event);
|
|
|
|
|
|
2008-12-23 01:47:37 -07:00
|
|
|
|
void OnMemcard(wxCommandEvent& event); // Misc
|
2009-04-15 14:19:25 -06:00
|
|
|
|
|
2009-05-13 15:50:24 -06:00
|
|
|
|
void OnNetPlay(wxCommandEvent& event);
|
|
|
|
|
|
2008-12-23 01:47:37 -07:00
|
|
|
|
void OnShow_CheatsWindow(wxCommandEvent& event);
|
2009-04-24 12:04:50 -06:00
|
|
|
|
void OnShow_InfoWindow(wxCommandEvent& event);
|
2009-04-27 20:30:50 -06:00
|
|
|
|
void OnLoadWiiMenu(wxCommandEvent& event);
|
|
|
|
|
void GameListChanged(wxCommandEvent& event);
|
2008-12-23 01:47:37 -07:00
|
|
|
|
|
2009-01-28 09:51:05 -07:00
|
|
|
|
void OnGameListCtrl_ItemActivated(wxListEvent& event);
|
2009-08-26 13:39:11 -06:00
|
|
|
|
void DoFullscreen(bool _F);
|
2009-01-07 02:06:42 -07:00
|
|
|
|
|
2009-04-15 20:32:21 -06:00
|
|
|
|
// MenuBar
|
|
|
|
|
// File - Drive
|
|
|
|
|
wxMenuItem* m_pSubMenuDrive;
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
2009-04-15 20:32:21 -06:00
|
|
|
|
// Emulation
|
|
|
|
|
wxMenuItem* m_pSubMenuLoad;
|
|
|
|
|
wxMenuItem* m_pSubMenuSave;
|
2009-08-07 19:39:56 -06:00
|
|
|
|
wxMenuItem* m_pSubMenuFrameSkipping;
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
2009-01-07 02:06:42 -07:00
|
|
|
|
void BootGame();
|
|
|
|
|
|
2009-01-04 14:53:41 -07:00
|
|
|
|
// Double click and mouse move options
|
2009-04-15 20:32:21 -06:00
|
|
|
|
double m_fLastClickTime, m_iLastMotionTime;
|
|
|
|
|
int LastMouseX, LastMouseY;
|
2009-01-04 14:53:41 -07:00
|
|
|
|
|
|
|
|
|
#if wxUSE_TIMER
|
|
|
|
|
void Update();
|
|
|
|
|
void OnTimer(wxTimerEvent& WXUNUSED(event)) { Update(); }
|
|
|
|
|
wxTimer m_timer;
|
|
|
|
|
#endif
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
2009-01-04 14:53:41 -07:00
|
|
|
|
// Event table
|
2008-12-07 21:46:09 -07:00
|
|
|
|
DECLARE_EVENT_TABLE();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // __FRAME_H_
|