Off-loaded ByteItemGraphicsScene construction to Insight worker task

This commit is contained in:
Nav
2022-09-10 22:50:52 +01:00
parent a88b77df8a
commit 241d94da54
13 changed files with 231 additions and 43 deletions

View File

@@ -0,0 +1,32 @@
#include "ConstructHexViewerByteItemScene.hpp"
namespace Bloom
{
ConstructHexViewerByteItemScene::ConstructHexViewerByteItemScene(
const Targets::TargetMemoryDescriptor& memoryDescriptor,
std::vector<FocusedMemoryRegion>& focusedMemoryRegions,
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
const Widgets::HexViewerWidgetSettings& settings,
Widgets::Label* hoveredAddressLabel
)
: memoryDescriptor(memoryDescriptor)
, focusedMemoryRegions(focusedMemoryRegions)
, excludedMemoryRegions(excludedMemoryRegions)
, settings(settings)
, hoveredAddressLabel(hoveredAddressLabel)
{}
void ConstructHexViewerByteItemScene::run(TargetController::TargetControllerConsole&) {
auto* scene = new Widgets::ByteItemGraphicsScene(
this->memoryDescriptor,
this->focusedMemoryRegions,
this->excludedMemoryRegions,
this->settings,
this->hoveredAddressLabel,
nullptr
);
scene->moveToThread(nullptr);
emit this->sceneCreated(scene);
}
}

View File

@@ -0,0 +1,44 @@
#pragma once
#include "InsightWorkerTask.hpp"
#include "src/Targets/TargetMemory.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidgetSettings.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/FocusedMemoryRegion.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/ExcludedMemoryRegion.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
namespace Bloom
{
class ConstructHexViewerByteItemScene: public InsightWorkerTask
{
Q_OBJECT
public:
ConstructHexViewerByteItemScene(
const Targets::TargetMemoryDescriptor& memoryDescriptor,
std::vector<FocusedMemoryRegion>& focusedMemoryRegions,
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
const Widgets::HexViewerWidgetSettings& settings,
Widgets::Label* hoveredAddressLabel
);
TaskGroups getTaskGroups() const override {
return TaskGroups();
};
signals:
void sceneCreated(Widgets::ByteItemGraphicsScene* scene);
protected:
void run(TargetController::TargetControllerConsole& targetControllerConsole) override;
private:
const Targets::TargetMemoryDescriptor& memoryDescriptor;
std::vector<FocusedMemoryRegion>& focusedMemoryRegions;
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions;
const Widgets::HexViewerWidgetSettings& settings;
Widgets::Label* hoveredAddressLabel;
};
}