| 1 |
#ifndef DAPTEXTVIEW_H |
| 2 |
#define DAPTEXTVIEW_H |
| 3 |
|
| 4 |
#include "UI.h" |
| 5 |
#include "cl_command_event.h" |
| 6 |
#include "dap/dap.hpp" |
| 7 |
|
| 8 |
#include <vector> |
| 9 |
|
| 10 |
class DAPTextView : public DAPTextViewBase |
| 11 |
{ |
| 12 |
wxString m_filepath; |
| 13 |
dap::Source m_current_source; |
| 14 |
wxString m_mimeType; |
| 15 |
|
| 16 |
protected: |
| 17 |
void ApplyTheme(); |
| 18 |
void Clear(); |
| 19 |
void SetFilePath(const wxString& filepath); |
| 20 |
void UpdateLineNumbersMargin(); |
| 21 |
|
| 22 |
void OnColourChanged(clCommandEvent& event); |
| 23 |
void OnMarginClick(wxStyledTextEvent& event); |
| 24 |
|
| 25 |
public: |
| 26 |
DAPTextView(wxWindow* parent); |
| 27 |
virtual ~DAPTextView(); |
| 28 |
|
| 29 |
wxStyledTextCtrl* GetCtrl() { return m_stcTextView; } |
| 30 |
|
| 31 |
static void ClearMarker(wxStyledTextCtrl* ctrl); |
| 32 |
void ClearMarker() { ClearMarker(m_stcTextView); } |
| 33 |
|
| 34 |
static void SetMarker(wxStyledTextCtrl* ctrl, int line_number); |
| 35 |
void SetMarker(int line_number) { SetMarker(m_stcTextView, line_number); } |
| 36 |
|
| 37 |
void SetText(const dap::Source& source, const wxString& text, const wxString& path, const wxString& mimeType); |
| 38 |
void LoadFile(const dap::Source& source, const wxString& filepath); |
| 39 |
|
| 40 |
const wxString& GetFilePath() const { return m_filepath; } |
| 41 |
bool IsSame(const dap::Source& source) const { return m_current_source == source; } |
| 42 |
void DeleteBreakpointMarkers(int line_number = wxNOT_FOUND); |
| 43 |
void SetBreakpointMarker(int line_number, const wxString& tooltip); |
| 44 |
bool HasBreakpointMarker(int line_number); |
| 45 |
size_t GetBreakpointMarkers(std::vector<int>* lines); |
| 46 |
}; |
| 47 |
|
| 48 |
#endif // DAPTEXTVIEW_H |