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
|
|
|
|
2009-06-21 02:39:21 -06:00
|
|
|
#define wxUSE_XPM_IN_MSW 1
|
|
|
|
#define USE_XPM_BITMAPS 1
|
|
|
|
|
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>
|
|
|
|
#include <wx/defs.h>
|
|
|
|
#include <wx/event.h>
|
|
|
|
#include <wx/windowid.h>
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2014-02-17 03:18:15 -07:00
|
|
|
#include "Common/Common.h"
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
|
|
DECLARE_EVENT_TYPE(wxEVT_CODEVIEW_CHANGE, -1);
|
|
|
|
|
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;
|
|
|
|
class wxWindow;
|
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:
|
2011-02-23 22:05:25 -07:00
|
|
|
CCodeView(DebugInterface* debuginterface, SymbolDB *symbol_db,
|
|
|
|
wxWindow* parent, wxWindowID Id = wxID_ANY);
|
2009-06-20 14:21:35 -06:00
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
void OnErase(wxEraseEvent& event);
|
2014-07-15 19:35:11 -06:00
|
|
|
void OnScrollWheel(wxMouseEvent& event);
|
2009-06-20 14:21:35 -06:00
|
|
|
void OnMouseDown(wxMouseEvent& event);
|
|
|
|
void OnMouseMove(wxMouseEvent& event);
|
|
|
|
void OnMouseUpL(wxMouseEvent& event);
|
|
|
|
void OnMouseUpR(wxMouseEvent& event);
|
|
|
|
void OnPopupMenu(wxCommandEvent& event);
|
|
|
|
void InsertBlrNop(int);
|
|
|
|
|
2013-10-28 23:23:17 -06:00
|
|
|
void ToggleBreakpoint(u32 address);
|
2009-06-20 14:21:35 -06:00
|
|
|
|
2014-07-15 21:01:17 -06:00
|
|
|
u32 GetSelection()
|
|
|
|
{
|
|
|
|
return m_selection;
|
|
|
|
}
|
|
|
|
|
2009-06-20 14:21:35 -06:00
|
|
|
void Center(u32 addr)
|
|
|
|
{
|
2014-07-15 21:01:17 -06:00
|
|
|
m_curAddress = addr;
|
|
|
|
m_selection = addr;
|
2011-02-23 22:05:25 -07:00
|
|
|
Refresh();
|
2009-06-20 14:21:35 -06:00
|
|
|
}
|
|
|
|
|
2011-02-23 22:05:25 -07:00
|
|
|
void SetPlain()
|
|
|
|
{
|
2014-07-15 21:01:17 -06:00
|
|
|
m_plain = true;
|
2009-06-21 02:39:21 -06:00
|
|
|
}
|
|
|
|
|
2009-06-20 14:21:35 -06:00
|
|
|
private:
|
|
|
|
void RaiseEvent();
|
|
|
|
int YToAddress(int y);
|
|
|
|
|
|
|
|
u32 AddrToBranch(u32 addr);
|
2011-02-23 22:05:25 -07:00
|
|
|
void OnResize(wxSizeEvent& event);
|
2009-06-20 14:21:35 -06:00
|
|
|
|
2014-07-15 21:01:17 -06:00
|
|
|
void MoveTo(int x, int y)
|
|
|
|
{
|
|
|
|
m_lx = x;
|
|
|
|
m_ly = y;
|
|
|
|
}
|
|
|
|
|
|
|
|
void LineTo(wxPaintDC &dc, int x, int y);
|
|
|
|
|
2014-07-19 15:17:10 -06:00
|
|
|
struct BlrStruct // for IDM_INSERTBLR
|
|
|
|
{
|
|
|
|
u32 address;
|
|
|
|
u32 oldValue;
|
|
|
|
};
|
|
|
|
std::vector<BlrStruct> m_blrList;
|
2014-07-15 21:01:17 -06:00
|
|
|
|
|
|
|
DebugInterface* m_debugger;
|
|
|
|
SymbolDB* m_symbol_db;
|
2009-06-21 02:39:21 -06:00
|
|
|
|
2014-07-15 21:01:17 -06:00
|
|
|
bool m_plain;
|
2009-06-20 14:21:35 -06:00
|
|
|
|
2014-07-15 21:01:17 -06:00
|
|
|
int m_curAddress;
|
|
|
|
int m_align;
|
|
|
|
int m_rowHeight;
|
2009-06-20 14:21:35 -06:00
|
|
|
|
2014-07-15 21:01:17 -06:00
|
|
|
u32 m_selection;
|
|
|
|
u32 m_oldSelection;
|
|
|
|
bool m_selecting;
|
2009-06-20 14:21:35 -06:00
|
|
|
|
2014-07-15 21:01:17 -06:00
|
|
|
int m_lx, m_ly;
|
2009-06-20 14:21:35 -06:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2008-12-07 21:46:09 -07:00
|
|
|
};
|