Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2022-10-13 20:31:47 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-10-13 20:31:47 +0300
commitc89c4f46ea108e825365faeeb3e8453703f2b981 (patch)
tree8b10a71798ee51b1d6fae09a75e50b3a86d79487 /server
parent575f627136631804475dd9bcd00b225fd1c67053 (diff)
Hook up attention callback.
Diffstat (limited to 'server')
-rw-r--r--server/TracyView.cpp6
-rw-r--r--server/TracyView.hpp6
2 files changed, 8 insertions, 4 deletions
diff --git a/server/TracyView.cpp b/server/TracyView.cpp
index 9a871f40..25c8d21d 100644
--- a/server/TracyView.cpp
+++ b/server/TracyView.cpp
@@ -46,7 +46,7 @@ double s_time = 0;
static View* s_instance = nullptr;
-View::View( void(*cbMainThread)(std::function<void()>, bool), const char* addr, uint16_t port, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb, SetScaleCallback sscb )
+View::View( void(*cbMainThread)(std::function<void()>, bool), const char* addr, uint16_t port, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb, SetScaleCallback sscb, AttentionCallback acb )
: m_worker( addr, port )
, m_staticView( false )
, m_viewMode( ViewMode::LastFrames )
@@ -62,6 +62,7 @@ View::View( void(*cbMainThread)(std::function<void()>, bool), const char* addr,
, m_fixedFont( fixedWidth )
, m_stcb( stcb )
, m_sscb( sscb )
+ , m_acb( acb )
, m_userData()
, m_cbMainThread( cbMainThread )
{
@@ -72,7 +73,7 @@ View::View( void(*cbMainThread)(std::function<void()>, bool), const char* addr,
InitTextEditor( fixedWidth );
}
-View::View( void(*cbMainThread)(std::function<void()>, bool), FileRead& f, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb, SetScaleCallback sscb )
+View::View( void(*cbMainThread)(std::function<void()>, bool), FileRead& f, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb, SetScaleCallback sscb, AttentionCallback acb )
: m_worker( f )
, m_filename( f.GetFilename() )
, m_staticView( true )
@@ -85,6 +86,7 @@ View::View( void(*cbMainThread)(std::function<void()>, bool), FileRead& f, ImFon
, m_fixedFont( fixedWidth )
, m_stcb( stcb )
, m_sscb( sscb )
+ , m_acb( acb )
, m_userData( m_worker.GetCaptureProgram().c_str(), m_worker.GetCaptureTime() )
, m_cbMainThread( cbMainThread )
{
diff --git a/server/TracyView.hpp b/server/TracyView.hpp
index 8036c2da..3c942cc6 100644
--- a/server/TracyView.hpp
+++ b/server/TracyView.hpp
@@ -89,9 +89,10 @@ public:
using SetTitleCallback = void(*)( const char* );
using SetScaleCallback = void(*)( float, ImFont*&, ImFont*&, ImFont*& );
+ using AttentionCallback = void(*)();
- View( void(*cbMainThread)(std::function<void()>, bool), const char* addr, uint16_t port, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb, SetScaleCallback sscb );
- View( void(*cbMainThread)(std::function<void()>, bool), FileRead& f, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb, SetScaleCallback sscb );
+ View( void(*cbMainThread)(std::function<void()>, bool), const char* addr, uint16_t port, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb, SetScaleCallback sscb, AttentionCallback acb );
+ View( void(*cbMainThread)(std::function<void()>, bool), FileRead& f, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb, SetScaleCallback sscb, AttentionCallback acb );
~View();
static bool Draw();
@@ -517,6 +518,7 @@ private:
SetTitleCallback m_stcb;
bool m_titleSet = false;
SetScaleCallback m_sscb;
+ AttentionCallback m_acb;
float m_notificationTime = 0;
std::string m_notificationText;