impr: Make data information view have per-provider state

This commit is contained in:
WerWolv
2024-01-25 22:49:56 +01:00
parent 9c25a1609e
commit 919110b024
5 changed files with 166 additions and 127 deletions

View File

@@ -210,7 +210,7 @@ namespace hex {
EVENT_DEF(EventImHexStartupFinished);
EVENT_DEF(EventFileLoaded, std::fs::path);
EVENT_DEF(EventDataChanged);
EVENT_DEF(EventDataChanged, prv::Provider *);
EVENT_DEF(EventHighlightingChanged);
EVENT_DEF(EventWindowClosing, GLFWwindow *);
EVENT_DEF(EventRegionSelected, ImHexApi::HexEditor::ProviderRegion);

View File

@@ -2,12 +2,12 @@
#include <hex.hpp>
#include <hex/api/localization_manager.hpp>
#include <hex/api/event_manager.hpp>
#include <hex/providers/undo_redo/operations/operation.hpp>
#include <map>
#include <memory>
#include <mutex>
#include <vector>
namespace hex::prv {
@@ -33,6 +33,7 @@ namespace hex::prv::undo {
template<std::derived_from<Operation> T>
bool add(auto && ... args) {
EventDataChanged::post(m_provider);
return this->add(std::make_unique<T>(std::forward<decltype(args)>(args)...));
}