mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Initialize text editor.
This commit is contained in:
parent
a90ed5b4b8
commit
9dbc56beb6
@ -96,6 +96,7 @@
|
||||
<ClCompile Include="..\..\..\common\TracySocket.cpp" />
|
||||
<ClCompile Include="..\..\..\common\TracySystem.cpp" />
|
||||
<ClCompile Include="..\..\..\common\tracy_lz4.cpp" />
|
||||
<ClCompile Include="..\..\..\imguicolortextedit\TextEditor.cpp" />
|
||||
<ClCompile Include="..\..\..\imgui\imgui.cpp" />
|
||||
<ClCompile Include="..\..\..\imgui\imgui_demo.cpp" />
|
||||
<ClCompile Include="..\..\..\imgui\imgui_draw.cpp" />
|
||||
@ -120,6 +121,7 @@
|
||||
<ClInclude Include="..\..\..\common\tracy_benaphore.h" />
|
||||
<ClInclude Include="..\..\..\common\tracy_lz4.hpp" />
|
||||
<ClInclude Include="..\..\..\common\tracy_sema.h" />
|
||||
<ClInclude Include="..\..\..\imguicolortextedit\TextEditor.h" />
|
||||
<ClInclude Include="..\..\..\imgui\imconfig.h" />
|
||||
<ClInclude Include="..\..\..\imgui\imgui.h" />
|
||||
<ClInclude Include="..\..\..\imgui\imgui_internal.h" />
|
||||
|
@ -19,6 +19,9 @@
|
||||
<Filter Include="nfd">
|
||||
<UniqueIdentifier>{46eb6aa0-de1c-447a-a6dd-aee2a06f85ef}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="imguicolortextedit">
|
||||
<UniqueIdentifier>{96740ecd-86b9-452d-991c-8743dde61551}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\common\tracy_lz4.cpp">
|
||||
@ -66,6 +69,9 @@
|
||||
<ClCompile Include="..\..\..\server\TracyBadVersion.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\imguicolortextedit\TextEditor.cpp">
|
||||
<Filter>imguicolortextedit</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\common\tracy_lz4.hpp">
|
||||
@ -197,6 +203,9 @@
|
||||
<ClInclude Include="..\..\..\server\TracyFilesystem.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\imguicolortextedit\TextEditor.h">
|
||||
<Filter>imguicolortextedit</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="DebugVis.natvis" />
|
||||
|
@ -19,6 +19,8 @@
|
||||
#include "TracyPopcnt.hpp"
|
||||
#include "TracyView.hpp"
|
||||
|
||||
#include "../imguicolortextedit/TextEditor.h"
|
||||
|
||||
#ifdef TRACY_FILESELECTOR
|
||||
# include "../nfd/nfd.h"
|
||||
#endif
|
||||
@ -333,6 +335,8 @@ View::View( const char* addr )
|
||||
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
style.FrameRounding = 2.f;
|
||||
|
||||
InitTextEditor();
|
||||
}
|
||||
|
||||
View::View( FileRead& f )
|
||||
@ -373,6 +377,8 @@ View::View( FileRead& f )
|
||||
{
|
||||
assert( s_instance == nullptr );
|
||||
s_instance = this;
|
||||
|
||||
InitTextEditor();
|
||||
}
|
||||
|
||||
View::~View()
|
||||
@ -385,6 +391,13 @@ View::~View()
|
||||
s_instance = nullptr;
|
||||
}
|
||||
|
||||
void View::InitTextEditor()
|
||||
{
|
||||
m_textEditor = std::make_unique<TextEditor>();
|
||||
m_textEditor->SetReadOnly( true );
|
||||
m_textEditor->SetLanguageDefinition( TextEditor::LanguageDefinition::CPlusPlus() );
|
||||
}
|
||||
|
||||
const char* View::ShortenNamespace( const char* name ) const
|
||||
{
|
||||
if( m_namespace == Namespace::Full ) return name;
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
@ -20,6 +21,7 @@ namespace tracy
|
||||
|
||||
struct QueueItem;
|
||||
class FileRead;
|
||||
class TextEditor;
|
||||
|
||||
class View
|
||||
{
|
||||
@ -55,6 +57,8 @@ private:
|
||||
Short
|
||||
};
|
||||
|
||||
void InitTextEditor();
|
||||
|
||||
const char* ShortenNamespace( const char* name ) const;
|
||||
|
||||
void DrawHelpMarker( const char* desc ) const;
|
||||
@ -229,6 +233,8 @@ private:
|
||||
Vector<const ZoneEvent*> m_zoneInfoStack;
|
||||
Vector<const GpuEvent*> m_gpuInfoStack;
|
||||
|
||||
std::unique_ptr<TextEditor> m_textEditor;
|
||||
|
||||
struct FindZone {
|
||||
enum : uint64_t { Unselected = std::numeric_limits<uint64_t>::max() - 1 };
|
||||
enum class GroupBy : int { Thread, UserText, Callstack };
|
||||
|
Loading…
Reference in New Issue
Block a user