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);
|
|
|
|
void OnMouseDown(wxMouseEvent& event);
|
|
|
|
void OnMouseMove(wxMouseEvent& event);
|
|
|
|
void OnMouseUpL(wxMouseEvent& event);
|
|
|
|
void OnMouseUpR(wxMouseEvent& event);
|
|
|
|
void OnPopupMenu(wxCommandEvent& event);
|
|
|
|
void InsertBlrNop(int);
|
|
|
|
|
|
|
|
u32 GetSelection() {return(selection);}
|
2013-10-28 23:23:17 -06:00
|
|
|
void ToggleBreakpoint(u32 address);
|
2009-06-20 14:21:35 -06:00
|
|
|
|
|
|
|
struct BlrStruct // for IDM_INSERTBLR
|
|
|
|
{
|
|
|
|
u32 Address;
|
|
|
|
u32 OldValue;
|
|
|
|
};
|
|
|
|
std::vector<BlrStruct> BlrList;
|
|
|
|
|
|
|
|
void Center(u32 addr)
|
|
|
|
{
|
|
|
|
curAddress = addr;
|
|
|
|
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()
|
|
|
|
{
|
2009-06-21 02:39:21 -06:00
|
|
|
plain = true;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
|
|
DebugInterface* debugger;
|
2009-06-21 02:39:21 -06:00
|
|
|
SymbolDB* symbol_db;
|
|
|
|
|
|
|
|
bool plain;
|
2009-06-20 14:21:35 -06:00
|
|
|
|
|
|
|
int curAddress;
|
|
|
|
int align;
|
|
|
|
int rowHeight;
|
|
|
|
|
|
|
|
u32 selection;
|
|
|
|
u32 oldSelection;
|
|
|
|
bool selecting;
|
|
|
|
|
|
|
|
int lx, ly;
|
|
|
|
void _MoveTo(int x, int y) {lx = x; ly = y;}
|
|
|
|
void _LineTo(wxPaintDC &dc, int x, int y);
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2008-12-07 21:46:09 -07:00
|
|
|
};
|