2020-03-22 19:53:59 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
struct ImFont;
|
|
|
|
|
|
|
|
namespace tracy
|
|
|
|
{
|
|
|
|
|
|
|
|
class SourceView
|
|
|
|
{
|
|
|
|
struct Line
|
|
|
|
{
|
|
|
|
const char* begin;
|
|
|
|
const char* end;
|
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
|
|
|
SourceView( ImFont* font );
|
|
|
|
~SourceView();
|
|
|
|
|
2020-03-24 23:07:31 +00:00
|
|
|
void Open( const char* fileName, int line, uint64_t symAddr );
|
2020-03-22 19:53:59 +00:00
|
|
|
void Render();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void RenderLine( const Line& line, int lineNum );
|
|
|
|
|
|
|
|
ImFont* m_font;
|
|
|
|
const char* m_file;
|
2020-03-24 23:07:31 +00:00
|
|
|
uint64_t m_symAddr;
|
2020-03-22 19:53:59 +00:00
|
|
|
char* m_data;
|
|
|
|
size_t m_dataSize;
|
|
|
|
int m_targetLine;
|
|
|
|
int m_selectedLine;
|
|
|
|
|
|
|
|
std::vector<Line> m_lines;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|