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