mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
impr: Added various new events
This commit is contained in:
@@ -52,7 +52,7 @@ namespace hex::plugin::builtin {
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
if (provider == nullptr) {
|
||||
success = false;
|
||||
continue;
|
||||
|
||||
@@ -83,6 +83,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void FileProvider::save() {
|
||||
this->applyPatches();
|
||||
Provider::save();
|
||||
}
|
||||
|
||||
void FileProvider::saveAs(const std::fs::path &path) {
|
||||
|
||||
@@ -219,6 +219,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void GDBProvider::save() {
|
||||
this->applyPatches();
|
||||
Provider::save();
|
||||
}
|
||||
|
||||
size_t GDBProvider::getActualSize() const {
|
||||
|
||||
@@ -36,6 +36,8 @@ namespace hex::plugin::builtin {
|
||||
});
|
||||
|
||||
ImHexApi::Provider::markDirty();
|
||||
|
||||
EventManager::post<EventBookmarkCreated>(ProviderExtraData::getCurrent().bookmarks.back());
|
||||
});
|
||||
|
||||
ImHexApi::HexEditor::addBackgroundHighlightingProvider([](u64 address, const u8* data, size_t size, bool) -> std::optional<color_t> {
|
||||
|
||||
@@ -181,8 +181,10 @@ namespace hex::plugin::builtin {
|
||||
if (this->m_hasUnevaluatedChanges && this->m_runningEvaluators == 0 && this->m_runningParsers == 0) {
|
||||
this->m_hasUnevaluatedChanges = false;
|
||||
|
||||
auto code = this->m_textEditor.GetText();
|
||||
EventManager::post<EventPatternEditorChanged>(code);
|
||||
|
||||
TaskManager::createBackgroundTask("Pattern Parsing", [this, code = this->m_textEditor.GetText(), provider](auto &){
|
||||
TaskManager::createBackgroundTask("Pattern Parsing", [this, code, provider](auto &){
|
||||
this->parsePattern(code, provider);
|
||||
|
||||
if (this->m_runAutomatically)
|
||||
@@ -697,6 +699,7 @@ namespace hex::plugin::builtin {
|
||||
ContentRegistry::PatternLanguage::configureRuntime(*patternLanguage.runtime, provider);
|
||||
|
||||
EventManager::post<EventHighlightingChanged>();
|
||||
EventManager::post<EventPatternExecuted>(code);
|
||||
|
||||
TaskManager::createTask("hex.builtin.view.pattern_editor.evaluating", TaskManager::NoProgress, [this, &patternLanguage, code](auto &task) {
|
||||
std::scoped_lock lock(patternLanguage.runtimeMutex);
|
||||
|
||||
@@ -99,6 +99,9 @@ namespace hex::plugin::builtin {
|
||||
if (entry.isFolder) {
|
||||
Tar tar(this->m_downloadPath, Tar::Mode::Read);
|
||||
tar.extractAll(this->m_downloadPath.parent_path() / this->m_downloadPath.stem());
|
||||
EventManager::post<EventStoreContentDownloaded>(this->m_downloadPath.parent_path() / this->m_downloadPath.stem());
|
||||
} else {
|
||||
EventManager::post<EventStoreContentDownloaded>(this->m_downloadPath);
|
||||
}
|
||||
|
||||
downloadDoneCallback();
|
||||
@@ -286,6 +289,7 @@ namespace hex::plugin::builtin {
|
||||
wolv::io::fs::removeAll(folderPath);
|
||||
|
||||
removed = removed && !wolv::io::fs::exists(filePath) && !wolv::io::fs::exists(folderPath);
|
||||
EventManager::post<EventStoreContentRemoved>(filePath);
|
||||
}
|
||||
|
||||
return removed;
|
||||
|
||||
Reference in New Issue
Block a user