2013-04-18 03:43:35 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2011-03-23 04:31:00 +00:00
|
|
|
#include <memory>
|
2008-12-08 04:46:09 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <wx/listctrl.h>
|
2009-09-25 16:29:00 +00:00
|
|
|
#include <wx/tipwin.h>
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
#include "ISOFile.h"
|
2010-01-14 07:19:10 +00:00
|
|
|
#include "MemoryCards/WiiSaveCrypted.h"
|
2009-09-25 16:29:00 +00:00
|
|
|
|
|
|
|
class wxEmuStateTip : public wxTipWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxEmuStateTip(wxWindow* parent, const wxString& text, wxEmuStateTip** windowPtr)
|
|
|
|
: wxTipWindow(parent, text, 70, (wxTipWindow**)windowPtr) {}
|
|
|
|
// wxTipWindow doesn't correctly handle KeyEvents and crashes... we must overload that.
|
|
|
|
void OnKeyDown(wxKeyEvent& event) { event.StopPropagation(); Close(); }
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
class CGameListCtrl : public wxListCtrl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
CGameListCtrl(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
|
|
|
|
~CGameListCtrl();
|
|
|
|
|
2009-02-03 15:03:34 +00:00
|
|
|
void Update();
|
2009-04-15 20:19:25 +00:00
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
void BrowseForDirectory();
|
|
|
|
const GameListItem *GetSelectedISO();
|
2011-03-22 07:27:23 +00:00
|
|
|
const GameListItem *GetISO(size_t index) const;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2012-12-17 11:08:45 +00:00
|
|
|
COLUMN_DUMMY = 0,
|
|
|
|
COLUMN_PLATFORM,
|
2009-09-25 16:29:00 +00:00
|
|
|
COLUMN_BANNER,
|
2008-12-08 04:46:09 +00:00
|
|
|
COLUMN_TITLE,
|
2011-12-18 12:58:44 +00:00
|
|
|
COLUMN_NOTES,
|
2008-12-08 04:46:09 +00:00
|
|
|
COLUMN_COUNTRY,
|
|
|
|
COLUMN_SIZE,
|
|
|
|
COLUMN_EMULATION_STATE,
|
|
|
|
NUMBER_OF_COLUMN
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
std::vector<int> m_FlagImageIndex;
|
2009-05-27 06:41:01 +00:00
|
|
|
std::vector<int> m_PlatformImageIndex;
|
2009-09-25 16:29:00 +00:00
|
|
|
std::vector<int> m_EmuStateImageIndex;
|
2011-03-22 07:27:23 +00:00
|
|
|
std::vector<GameListItem*> m_ISOFiles;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2011-03-23 04:31:00 +00:00
|
|
|
void ClearIsoFiles()
|
|
|
|
{
|
2014-02-17 04:51:41 +00:00
|
|
|
while (!m_ISOFiles.empty()) // so lazy
|
2011-03-23 04:31:00 +00:00
|
|
|
{
|
|
|
|
delete m_ISOFiles.back();
|
|
|
|
m_ISOFiles.pop_back();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
int last_column;
|
|
|
|
int last_sort;
|
2009-07-27 04:26:56 +00:00
|
|
|
wxSize lastpos;
|
2009-09-25 16:29:00 +00:00
|
|
|
wxEmuStateTip *toolTip;
|
2008-12-08 04:46:09 +00:00
|
|
|
void InitBitmaps();
|
|
|
|
void InsertItemInReportView(long _Index);
|
|
|
|
void SetBackgroundColor();
|
2009-02-03 15:03:34 +00:00
|
|
|
void ScanForISOs();
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
|
|
|
// events
|
2010-01-19 13:43:51 +00:00
|
|
|
void OnLeftClick(wxMouseEvent& event);
|
2008-12-08 04:46:09 +00:00
|
|
|
void OnRightClick(wxMouseEvent& event);
|
2009-09-25 16:29:00 +00:00
|
|
|
void OnMouseMotion(wxMouseEvent& event);
|
2008-12-08 04:46:09 +00:00
|
|
|
void OnColumnClick(wxListEvent& event);
|
|
|
|
void OnColBeginDrag(wxListEvent& event);
|
2009-09-25 16:29:00 +00:00
|
|
|
void OnKeyPress(wxListEvent& event);
|
2008-12-08 04:46:09 +00:00
|
|
|
void OnSize(wxSizeEvent& event);
|
|
|
|
void OnProperties(wxCommandEvent& event);
|
2011-02-25 23:33:11 +00:00
|
|
|
void OnWiki(wxCommandEvent& event);
|
2008-12-08 04:46:09 +00:00
|
|
|
void OnOpenContainingFolder(wxCommandEvent& event);
|
2009-05-02 18:06:42 +00:00
|
|
|
void OnOpenSaveFolder(wxCommandEvent& event);
|
2010-01-14 07:19:10 +00:00
|
|
|
void OnExportSave(wxCommandEvent& event);
|
2008-12-08 04:46:09 +00:00
|
|
|
void OnSetDefaultGCM(wxCommandEvent& event);
|
|
|
|
void OnDeleteGCM(wxCommandEvent& event);
|
|
|
|
void OnCompressGCM(wxCommandEvent& event);
|
|
|
|
void OnMultiCompressGCM(wxCommandEvent& event);
|
|
|
|
void OnMultiDecompressGCM(wxCommandEvent& event);
|
2009-06-17 06:37:34 +00:00
|
|
|
void OnInstallWAD(wxCommandEvent& event);
|
2013-07-22 02:25:26 +00:00
|
|
|
void OnDropFiles(wxDropFilesEvent& event);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
void CompressSelection(bool _compress);
|
|
|
|
void AutomaticColumnWidth();
|
|
|
|
void UnselectAll();
|
|
|
|
|
|
|
|
static size_t m_currentItem;
|
|
|
|
static std::string m_currentFilename;
|
|
|
|
static size_t m_numberItem;
|
|
|
|
static void CompressCB(const char* text, float percent, void* arg);
|
|
|
|
static void MultiCompressCB(const char* text, float percent, void* arg);
|
|
|
|
};
|