2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:43:35 +00:00
|
|
|
// 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
|
|
|
|
2009-06-21 08:39:21 +00:00
|
|
|
#define wxUSE_XPM_IN_MSW 1
|
|
|
|
#define USE_XPM_BITMAPS 1
|
|
|
|
|
2014-08-24 18:59:02 +00:00
|
|
|
#include <memory>
|
2014-02-17 10:18:15 +00:00
|
|
|
#include <vector>
|
2009-06-21 08:39:21 +00:00
|
|
|
|
2014-02-22 22:36:30 +00:00
|
|
|
#include <wx/control.h>
|
2014-08-24 18:59:02 +00:00
|
|
|
#include <wx/graphics.h>
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-09-08 01:06:58 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-08-17 20:18:54 +00:00
|
|
|
wxDECLARE_EVENT(wxEVT_CODEVIEW_CHANGE, wxCommandEvent);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2009-06-20 20:21:35 +00:00
|
|
|
class DebugInterface;
|
2009-06-21 08:39:21 +00:00
|
|
|
class SymbolDB;
|
2014-02-22 22:36:30 +00:00
|
|
|
class wxPaintDC;
|
2009-06-20 20:21:35 +00:00
|
|
|
|
|
|
|
class CCodeView : public wxControl
|
2008-12-08 04:46:09 +00:00
|
|
|
{
|
2009-06-20 20:21:35 +00:00
|
|
|
public:
|
2016-06-24 08:43:46 +00:00
|
|
|
CCodeView(DebugInterface* debuginterface, SymbolDB* symbol_db, wxWindow* parent,
|
|
|
|
wxWindowID Id = wxID_ANY);
|
2009-06-20 20:21:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
void ToggleBreakpoint(u32 address);
|
2009-06-20 20:21:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
u32 GetSelection() const { return m_selection; }
|
|
|
|
void Center(u32 addr)
|
|
|
|
{
|
|
|
|
m_curAddress = addr;
|
|
|
|
m_selection = addr;
|
|
|
|
Refresh();
|
|
|
|
}
|
2009-06-21 08:39:21 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
void SetPlain() { m_plain = true; }
|
2018-04-12 12:18:04 +00:00
|
|
|
|
2009-06-20 20:21:35 +00:00
|
|
|
private:
|
2016-06-24 08:43:46 +00:00
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
void OnScrollWheel(wxMouseEvent& event);
|
|
|
|
void OnMouseDown(wxMouseEvent& event);
|
|
|
|
void OnMouseMove(wxMouseEvent& event);
|
|
|
|
void OnMouseUpL(wxMouseEvent& event);
|
|
|
|
void OnMouseUpR(wxMouseEvent& event);
|
|
|
|
void OnPopupMenu(wxCommandEvent& event);
|
|
|
|
void InsertBlrNop(int);
|
|
|
|
|
|
|
|
void RaiseEvent();
|
|
|
|
int YToAddress(int y);
|
|
|
|
|
|
|
|
u32 AddrToBranch(u32 addr);
|
|
|
|
void OnResize(wxSizeEvent& event);
|
|
|
|
|
|
|
|
struct BlrStruct // for IDM_INSERTBLR
|
|
|
|
{
|
|
|
|
u32 address;
|
|
|
|
u32 oldValue;
|
|
|
|
};
|
|
|
|
std::vector<BlrStruct> m_blrList;
|
|
|
|
|
2016-10-03 07:29:50 +00:00
|
|
|
static constexpr int LEFT_COL_WIDTH = 16;
|
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
DebugInterface* m_debugger;
|
|
|
|
SymbolDB* m_symbol_db;
|
|
|
|
|
|
|
|
bool m_plain;
|
|
|
|
|
|
|
|
int m_curAddress;
|
|
|
|
int m_align;
|
|
|
|
int m_rowHeight;
|
2016-10-03 07:29:50 +00:00
|
|
|
int m_left_col_width;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
|
|
|
u32 m_selection;
|
|
|
|
u32 m_oldSelection;
|
|
|
|
bool m_selecting;
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|