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