2009-01-03 01:38:44 +00:00
|
|
|
|
// Copyright (C) 2003-2008 Dolphin Project.
|
|
|
|
|
|
|
|
|
|
// 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/
|
|
|
|
|
|
|
|
|
|
|
2009-01-04 21:53:41 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// Includes
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2008-12-08 04:46:09 +00:00
|
|
|
|
#ifndef __FRAME_H_
|
|
|
|
|
#define __FRAME_H_
|
|
|
|
|
|
2009-01-04 21:53:41 +00:00
|
|
|
|
#include <wx/wx.h> // wxWidgets
|
2008-12-08 04:46:09 +00:00
|
|
|
|
#include <wx/busyinfo.h>
|
2009-01-04 21:53:41 +00:00
|
|
|
|
#include <wx/mstream.h>
|
|
|
|
|
////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// A shortcut to access the bitmaps
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
#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
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2008-12-08 04:46:09 +00:00
|
|
|
|
class CGameListCtrl;
|
|
|
|
|
class CFrame : public wxFrame
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
CFrame(wxFrame* parent,
|
|
|
|
|
wxWindowID id = wxID_ANY,
|
2008-12-13 22:40:10 +00:00
|
|
|
|
const wxString& title = wxT("Dolphin"),
|
2008-12-08 04:46:09 +00:00
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE);
|
|
|
|
|
|
2009-01-04 21:53:41 +00:00
|
|
|
|
void* GetRenderHandle()
|
|
|
|
|
{
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
return(m_Panel->GetHandle());
|
|
|
|
|
#else
|
|
|
|
|
return this;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
2009-01-04 21:53:41 +00:00
|
|
|
|
virtual ~CFrame();
|
2008-12-09 05:37:15 +00:00
|
|
|
|
|
2009-01-04 21:53:41 +00:00
|
|
|
|
// These have to be public
|
|
|
|
|
wxStatusBar* m_pStatusBar;
|
|
|
|
|
void InitBitmaps();
|
|
|
|
|
void DoStop();
|
|
|
|
|
bool bRenderToMain;
|
2008-12-09 05:37:15 +00:00
|
|
|
|
|
2009-01-04 21:53:41 +00:00
|
|
|
|
// ---------------------------------------
|
2008-12-09 05:37:15 +00:00
|
|
|
|
// Wiimote leds
|
2009-01-04 21:53:41 +00:00
|
|
|
|
// ---------------
|
2008-12-09 14:57:55 +00:00
|
|
|
|
void ModifyStatusBar();
|
2008-12-09 05:37:15 +00: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-12 03:38:50 +00:00
|
|
|
|
void DoMoveIcons(); void MoveLeds(); void MoveSpeakers();
|
2008-12-09 05:37:15 +00: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 21:53:41 +00:00
|
|
|
|
// ---------------
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
wxBoxSizer* sizerPanel;
|
|
|
|
|
CGameListCtrl* m_GameListCtrl;
|
|
|
|
|
wxPanel* m_Panel;
|
2009-01-04 21:53:41 +00:00
|
|
|
|
wxToolBar* TheToolBar;
|
2009-01-03 01:38:44 +00:00
|
|
|
|
wxToolBarToolBase* m_ToolPlay;
|
|
|
|
|
|
|
|
|
|
|
2009-01-04 21:53:41 +00:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////
|
2009-01-03 01:38:44 +00:00
|
|
|
|
// Music mod
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
#ifdef MUSICMOD
|
|
|
|
|
wxToolBarToolBase* mm_ToolMute, * mm_ToolPlay, * mm_ToolLog;
|
2009-01-05 07:02:24 +00:00
|
|
|
|
wxSlider * mm_Slider;
|
2009-01-03 01:38:44 +00:00
|
|
|
|
|
2009-01-04 21:53:41 +00:00
|
|
|
|
void MM_UpdateGUI(); void MM_PopulateGUI(); void MM_InitBitmaps(int Theme);
|
2009-01-05 04:08:18 +00:00
|
|
|
|
void MM_OnPlay(); void MM_OnStop();
|
2009-01-03 01:38:44 +00:00
|
|
|
|
void MM_OnMute(wxCommandEvent& event);
|
|
|
|
|
void MM_OnPause(wxCommandEvent& event);
|
|
|
|
|
void MM_OnVolume(wxScrollEvent& event);
|
|
|
|
|
void MM_OnLog(wxCommandEvent& event);
|
|
|
|
|
#endif
|
|
|
|
|
///////////////////////////////////
|
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
2009-01-04 21:53:41 +00:00
|
|
|
|
enum EToolbar
|
2008-12-08 04:46:09 +00:00
|
|
|
|
{
|
|
|
|
|
Toolbar_FileOpen,
|
|
|
|
|
Toolbar_Refresh,
|
|
|
|
|
Toolbar_Browse,
|
|
|
|
|
Toolbar_Play,
|
2009-01-03 19:30:59 +00:00
|
|
|
|
Toolbar_Stop,
|
2008-12-08 04:46:09 +00:00
|
|
|
|
Toolbar_Pause,
|
2009-01-04 21:53:41 +00:00
|
|
|
|
Toolbar_FullScreen,
|
2008-12-08 04:46:09 +00:00
|
|
|
|
Toolbar_PluginOptions,
|
|
|
|
|
Toolbar_PluginGFX,
|
2009-01-03 19:30:59 +00:00
|
|
|
|
Toolbar_PluginDSP,
|
2008-12-08 04:46:09 +00:00
|
|
|
|
Toolbar_PluginPAD,
|
2009-01-04 21:53:41 +00:00
|
|
|
|
Toolbar_Wiimote,
|
2008-12-08 04:46:09 +00:00
|
|
|
|
Toolbar_Help,
|
2009-01-04 21:53:41 +00:00
|
|
|
|
|
|
|
|
|
#ifdef MUSICMOD // Music modification
|
2009-01-03 19:39:17 +00:00
|
|
|
|
Toolbar_Log, Toolbar_PluginDSP_Dis, Toolbar_Log_Dis,
|
2009-01-03 01:38:44 +00:00
|
|
|
|
#endif
|
2009-01-04 21:53:41 +00:00
|
|
|
|
|
|
|
|
|
EToolbar_Max
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum EBitmapsThemes
|
|
|
|
|
{
|
|
|
|
|
BOOMY,
|
|
|
|
|
VISTA,
|
|
|
|
|
XPLASTIK,
|
|
|
|
|
KDE,
|
|
|
|
|
THEMES_MAX
|
2008-12-09 05:37:15 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum WiimoteBitmaps // Wiimote speaker bitmaps
|
|
|
|
|
{
|
2009-01-04 21:53:41 +00:00
|
|
|
|
CREATELEDS,
|
2008-12-09 05:37:15 +00:00
|
|
|
|
DESTROYLEDS,
|
|
|
|
|
CREATESPEAKERS,
|
|
|
|
|
DESTROYSPEAKERS
|
2008-12-08 04:46:09 +00:00
|
|
|
|
};
|
|
|
|
|
|
2009-01-04 21:53:41 +00:00
|
|
|
|
wxBitmap m_Bitmaps[EToolbar_Max];
|
|
|
|
|
wxBitmap m_BitmapsMenu[EToolbar_Max];
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
|
|
void PopulateToolbar(wxToolBar* toolBar);
|
|
|
|
|
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 08:47:37 +00:00
|
|
|
|
// Event functions
|
2008-12-08 04:46:09 +00:00
|
|
|
|
void OnQuit(wxCommandEvent& event);
|
|
|
|
|
void OnHelp(wxCommandEvent& event);
|
2008-12-23 08:47:37 +00:00
|
|
|
|
|
2009-01-05 04:08:18 +00:00
|
|
|
|
void OnOpen(wxCommandEvent& event); void DoOpen(bool Boot); // File menu
|
2008-12-08 04:46:09 +00:00
|
|
|
|
void OnRefresh(wxCommandEvent& event);
|
2008-12-23 08:47:37 +00:00
|
|
|
|
void OnBrowse(wxCommandEvent& event);
|
|
|
|
|
|
|
|
|
|
void OnPlay(wxCommandEvent& event); // Emulation
|
|
|
|
|
void OnChangeDisc(wxCommandEvent& event);
|
|
|
|
|
void OnStop(wxCommandEvent& event);
|
|
|
|
|
void OnClose(wxCloseEvent &event);
|
|
|
|
|
void OnLoadState(wxCommandEvent& event);
|
|
|
|
|
void OnSaveState(wxCommandEvent& event);
|
|
|
|
|
|
|
|
|
|
void OnConfigMain(wxCommandEvent& event); // Options
|
2008-12-08 04:46:09 +00:00
|
|
|
|
void OnPluginGFX(wxCommandEvent& event);
|
|
|
|
|
void OnPluginDSP(wxCommandEvent& event);
|
|
|
|
|
void OnPluginPAD(wxCommandEvent& event);
|
|
|
|
|
void OnPluginWiimote(wxCommandEvent& event);
|
2008-12-23 08:47:37 +00:00
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
|
void OnToggleFullscreen(wxCommandEvent& event);
|
|
|
|
|
void OnToggleDualCore(wxCommandEvent& event);
|
|
|
|
|
void OnToggleSkipIdle(wxCommandEvent& event);
|
|
|
|
|
void OnToggleThrottle(wxCommandEvent& event);
|
2008-12-12 03:38:50 +00:00
|
|
|
|
void OnResize(wxSizeEvent& event);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
void OnToggleToolbar(wxCommandEvent& event);
|
|
|
|
|
void OnToggleStatusbar(wxCommandEvent& event);
|
2008-12-28 18:50:24 +00:00
|
|
|
|
void OnKeyDown(wxKeyEvent& event); void OnKeyUp(wxKeyEvent& event);
|
2009-01-04 21:53:41 +00:00
|
|
|
|
void OnDoubleClick(wxMouseEvent& event); void OnMotion(wxMouseEvent& event);
|
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
|
void OnHostMessage(wxCommandEvent& event);
|
|
|
|
|
|
2008-12-23 08:47:37 +00:00
|
|
|
|
void OnMemcard(wxCommandEvent& event); // Misc
|
|
|
|
|
void OnShow_CheatsWindow(wxCommandEvent& event);
|
|
|
|
|
|
|
|
|
|
// Menu items
|
2008-12-08 04:46:09 +00:00
|
|
|
|
wxMenuBar* m_pMenuBar;
|
|
|
|
|
|
2008-12-23 08:47:37 +00:00
|
|
|
|
wxMenuItem* m_pMenuItemOpen; // File
|
|
|
|
|
|
|
|
|
|
wxMenuItem* m_pMenuItemPlay; // Emulation
|
2008-12-08 04:46:09 +00:00
|
|
|
|
wxMenuItem* m_pMenuItemStop;
|
2008-12-23 08:47:37 +00:00
|
|
|
|
wxMenuItem* m_pMenuChangeDisc;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
wxMenuItem* m_pPluginOptions;
|
|
|
|
|
wxMenuItem* m_pMenuItemLoad;
|
|
|
|
|
wxMenuItem* m_pMenuItemSave;
|
|
|
|
|
wxToolBarToolBase* m_pToolPlay;
|
|
|
|
|
|
|
|
|
|
void UpdateGUI();
|
|
|
|
|
|
2009-01-04 21:53:41 +00:00
|
|
|
|
// Double click and mouse move options
|
|
|
|
|
double m_fLastClickTime, m_iLastMotionTime; int LastMouseX, LastMouseY;
|
|
|
|
|
|
|
|
|
|
#if wxUSE_TIMER
|
|
|
|
|
void Update();
|
|
|
|
|
void OnTimer(wxTimerEvent& WXUNUSED(event)) { Update(); }
|
|
|
|
|
wxTimer m_timer;
|
|
|
|
|
#endif
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
2009-01-04 21:53:41 +00:00
|
|
|
|
// Event table
|
2008-12-08 04:46:09 +00:00
|
|
|
|
DECLARE_EVENT_TABLE();
|
|
|
|
|
};
|
2009-01-04 21:53:41 +00:00
|
|
|
|
////////////////////////////////
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
|
|
#endif // __FRAME_H_
|