2018-07-24 10:39:02 -07:00
|
|
|
#include "hostsignaller.h"
|
2018-07-26 22:42:21 -07:00
|
|
|
#include "extensions.h"
|
2018-07-24 10:39:02 -07:00
|
|
|
|
|
|
|
void HostSignaller::Initialize()
|
|
|
|
{
|
2018-07-25 10:46:59 -07:00
|
|
|
Host::RegisterProcessAttachCallback([&](DWORD pid){ emit AddProcess(pid); });
|
|
|
|
Host::RegisterProcessDetachCallback([&](DWORD pid){ emit RemoveProcess(pid); });
|
|
|
|
Host::RegisterThreadCreateCallback([&](TextThread* thread)
|
|
|
|
{
|
|
|
|
emit AddThread(thread);
|
|
|
|
thread->RegisterOutputCallBack([&](TextThread* thread, std::wstring output)
|
|
|
|
{
|
2018-07-26 22:42:21 -07:00
|
|
|
output = DispatchSentenceToExtensions(output, {});
|
2018-07-25 10:46:59 -07:00
|
|
|
emit ThreadOutput(thread, QString::fromWCharArray(output.c_str()));
|
|
|
|
return output;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
Host::RegisterThreadRemoveCallback([&](TextThread* thread){ emit RemoveThread(thread); });
|
2018-07-24 10:39:02 -07:00
|
|
|
}
|