rpcsx/rpcs3/Gui/GameViewer.h

94 lines
1.6 KiB
C
Raw Normal View History

#pragma once
2016-01-06 00:52:48 +01:00
#include "Emu/GameInfo.h"
struct Column
{
u32 pos;
u32 width;
bool shown;
std::vector<std::string> data;
const std::string name;
const u32 def_pos;
const u32 def_width;
Column(const u32 _def_pos, const u32 _def_width, const std::string& _name)
: def_pos(_def_pos)
, def_width(_def_width)
, pos(_def_pos)
, width(_def_width)
, shown(true)
, name(_name)
{
data.clear();
}
};
struct ColumnsArr
{
std::vector<Column> m_columns;
2016-02-01 22:46:27 +01:00
ColumnsArr();
2016-02-01 22:46:27 +01:00
std::vector<Column*> GetSortedColumnsByPos();
2016-02-01 22:46:27 +01:00
Column* GetColumnByPos(u32 pos);
public:
2014-12-13 18:27:34 +01:00
Column* m_col_icon;
Column* m_col_name;
Column* m_col_serial;
Column* m_col_fw;
Column* m_col_app_ver;
Column* m_col_category;
Column* m_col_path;
2014-12-13 18:27:34 +01:00
wxImageList* m_img_list;
std::vector<int> m_icon_indexes;
2016-02-01 22:46:27 +01:00
void Init();
2016-02-01 22:46:27 +01:00
void Update(const std::vector<GameInfo>& game_data);
2016-02-01 22:46:27 +01:00
void Show(wxListView* list);
2016-02-01 22:46:27 +01:00
void ShowData(wxListView* list);
2015-11-14 20:59:46 +01:00
2016-02-01 22:46:27 +01:00
void LoadSave(bool isLoad, const std::string& path, wxListView* list = NULL);
};
class GameViewer : public wxListView
{
int m_sortColumn;
bool m_sortAscending;
std::vector<std::string> m_games;
std::vector<GameInfo> m_game_data;
ColumnsArr m_columns;
wxMenu* m_popup;
public:
GameViewer(wxWindow* parent);
~GameViewer();
void DoResize(wxSize size);
void LoadGames();
void LoadPSF();
void ShowData();
void SaveSettings();
void LoadSettings();
void Refresh();
2015-10-24 12:38:24 +02:00
void BootGame(wxCommandEvent& event);
void ConfigureGame(wxCommandEvent& event);
void RemoveGame(wxCommandEvent& event);
private:
virtual void DClick(wxListEvent& event);
virtual void OnColClick(wxListEvent& event);
virtual void RightClick(wxListEvent& event);
};