Debugger: more clang-tidy

This commit is contained in:
Ziemas 2021-10-07 16:35:37 +02:00 committed by refractionpcsx2
parent f873e3b630
commit 7fd40f094a
1 changed files with 32 additions and 25 deletions

View File

@ -23,17 +23,18 @@
struct GenericListViewColumn struct GenericListViewColumn
{ {
const wchar_t *name; const wchar_t* name;
float size; float size;
}; };
class GenericListView: public wxListView class GenericListView : public wxListView
{ {
public: public:
GenericListView(wxWindow* parent, GenericListViewColumn* columns, int columnCount); GenericListView(wxWindow* parent, GenericListViewColumn* columns, int columnCount);
void update(); void update();
wxDECLARE_EVENT_TABLE(); wxDECLARE_EVENT_TABLE();
protected: protected:
void sizeEvent(wxSizeEvent& evt); void sizeEvent(wxSizeEvent& evt);
void keydownEvent(wxKeyEvent& evt); void keydownEvent(wxKeyEvent& evt);
@ -41,11 +42,11 @@ protected:
void mouseEvent(wxMouseEvent& evt); void mouseEvent(wxMouseEvent& evt);
void listEvent(wxListEvent& evt); void listEvent(wxListEvent& evt);
virtual wxString getColumnText(int row, int col) const = 0; [[nodiscard]] virtual wxString getColumnText(int row, int col) const = 0;
virtual int getRowCount() = 0; virtual int getRowCount() = 0;
virtual void onDoubleClick(int itemIndex, const wxPoint& point) { }; virtual void onDoubleClick(int itemIndex, const wxPoint& point){};
virtual void onRightClick(int itemIndex, const wxPoint& point) { }; virtual void onRightClick(int itemIndex, const wxPoint& point){};
virtual void onKeyDown(int key) { }; virtual void onKeyDown(int key){};
// This flag prevents resizing loop in the resizeColumn method of this class // This flag prevents resizing loop in the resizeColumn method of this class
// when the Windows Classic theme with some large resolutions around larger // when the Windows Classic theme with some large resolutions around larger
@ -60,26 +61,28 @@ private:
void insertColumns(GenericListViewColumn* columns, int count); void insertColumns(GenericListViewColumn* columns, int count);
void resizeColumn(int col, int width); void resizeColumn(int col, int width);
void resizeColumns(int totalWidth); void resizeColumns(int totalWidth);
wxString OnGetItemText(long item, long col) const; [[nodiscard]] wxString OnGetItemText(long item, long col) const override;
GenericListViewColumn* columns; GenericListViewColumn* columns;
wxPoint clickPos; wxPoint clickPos;
bool dontResizeColumnsInSizeEventHandler; bool dontResizeColumnsInSizeEventHandler;
}; };
class BreakpointList: public GenericListView class BreakpointList : public GenericListView
{ {
public: public:
BreakpointList(wxWindow* parent, DebugInterface* _cpu, CtrlDisassemblyView* _disassembly); BreakpointList(wxWindow* parent, DebugInterface* _cpu, CtrlDisassemblyView* _disassembly);
void reloadBreakpoints(); void reloadBreakpoints();
protected: protected:
void onPopupClick(wxCommandEvent& evt); void onPopupClick(wxCommandEvent& evt);
virtual wxString getColumnText(int row, int col) const; [[nodiscard]] wxString getColumnText(int row, int col) const override;
virtual int getRowCount(); int getRowCount() override;
virtual void onDoubleClick(int itemIndex, const wxPoint& point); void onDoubleClick(int itemIndex, const wxPoint& point) override;
virtual void onRightClick(int itemIndex, const wxPoint& point); void onRightClick(int itemIndex, const wxPoint& point) override;
virtual void onKeyDown(int key); void onKeyDown(int key) override;
private: private:
int getBreakpointIndex(int itemIndex, bool& isMemory) const; int getBreakpointIndex(int itemIndex, bool& isMemory) const;
int getTotalBreakpointCount(); int getTotalBreakpointCount();
@ -95,34 +98,38 @@ private:
CtrlDisassemblyView* disasm; CtrlDisassemblyView* disasm;
}; };
class ThreadList: public GenericListView class ThreadList : public GenericListView
{ {
public: public:
ThreadList(wxWindow* parent, DebugInterface* _cpu); ThreadList(wxWindow* parent, DebugInterface* _cpu);
void reloadThreads(); void reloadThreads();
EEThread getRunningThread(); EEThread getRunningThread();
protected: protected:
void onPopupClick(wxCommandEvent& evt); void onPopupClick(wxCommandEvent& evt);
virtual wxString getColumnText(int row, int col) const; [[nodiscard]] wxString getColumnText(int row, int col) const override;
virtual int getRowCount(); int getRowCount() override;
virtual void onDoubleClick(int itemIndex, const wxPoint& point); void onDoubleClick(int itemIndex, const wxPoint& point) override;
private: private:
DebugInterface* cpu; DebugInterface* cpu;
std::vector<EEThread> threads; std::vector<EEThread> threads;
}; };
class StackFramesList: public GenericListView class StackFramesList : public GenericListView
{ {
public: public:
StackFramesList(wxWindow* parent, DebugInterface* _cpu, CtrlDisassemblyView* _disassembly); StackFramesList(wxWindow* parent, DebugInterface* _cpu, CtrlDisassemblyView* _disassembly);
void loadStackFrames(EEThread& currentThread); void loadStackFrames(EEThread& currentThread);
protected: protected:
void onPopupClick(wxCommandEvent& evt); void onPopupClick(wxCommandEvent& evt);
virtual wxString getColumnText(int row, int col) const; [[nodiscard]] wxString getColumnText(int row, int col) const override;
virtual int getRowCount(); int getRowCount() override;
virtual void onDoubleClick(int itemIndex, const wxPoint& point); void onDoubleClick(int itemIndex, const wxPoint& point) override;
private: private:
DebugInterface* cpu; DebugInterface* cpu;
CtrlDisassemblyView* disassembly; CtrlDisassemblyView* disassembly;