2013-04-18 03:43:35 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// 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-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>
|
|
|
|
#include <wx/defs.h>
|
|
|
|
#include <wx/event.h>
|
|
|
|
#include <wx/windowid.h>
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "Common/Common.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_TYPE(wxEVT_CODEVIEW_CHANGE, -1);
|
|
|
|
|
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;
|
|
|
|
class wxWindow;
|
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:
|
2011-02-24 05:05:25 +00:00
|
|
|
CCodeView(DebugInterface* debuginterface, SymbolDB *symbol_db,
|
|
|
|
wxWindow* parent, wxWindowID Id = wxID_ANY);
|
2009-06-20 20:21:35 +00: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-29 05:23:17 +00:00
|
|
|
void ToggleBreakpoint(u32 address);
|
2009-06-20 20:21:35 +00:00
|
|
|
|
|
|
|
struct BlrStruct // for IDM_INSERTBLR
|
|
|
|
{
|
|
|
|
u32 Address;
|
|
|
|
u32 OldValue;
|
|
|
|
};
|
|
|
|
std::vector<BlrStruct> BlrList;
|
|
|
|
|
|
|
|
void Center(u32 addr)
|
|
|
|
{
|
|
|
|
curAddress = addr;
|
|
|
|
selection = addr;
|
2011-02-24 05:05:25 +00:00
|
|
|
Refresh();
|
2009-06-20 20:21:35 +00:00
|
|
|
}
|
|
|
|
|
2011-02-24 05:05:25 +00:00
|
|
|
void SetPlain()
|
|
|
|
{
|
2009-06-21 08:39:21 +00:00
|
|
|
plain = true;
|
|
|
|
}
|
|
|
|
|
2009-06-20 20:21:35 +00:00
|
|
|
private:
|
|
|
|
void RaiseEvent();
|
|
|
|
int YToAddress(int y);
|
|
|
|
|
|
|
|
u32 AddrToBranch(u32 addr);
|
2011-02-24 05:05:25 +00:00
|
|
|
void OnResize(wxSizeEvent& event);
|
2009-06-20 20:21:35 +00:00
|
|
|
|
|
|
|
DebugInterface* debugger;
|
2009-06-21 08:39:21 +00:00
|
|
|
SymbolDB* symbol_db;
|
|
|
|
|
|
|
|
bool plain;
|
2009-06-20 20:21:35 +00: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-08 04:46:09 +00:00
|
|
|
};
|