diff --git a/CMakeLists.txt b/CMakeLists.txt index 94b8fbd69..01ce4be02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,7 +74,7 @@ add_executable(imhex ${application_type} source/providers/file_provider.cpp source/views/view_hexeditor.cpp - source/views/view_pattern.cpp + source/views/view_pattern_editor.cpp source/views/view_pattern_data.cpp source/views/view_hashes.cpp source/views/view_information.cpp diff --git a/include/views/view_pattern.hpp b/include/views/view_pattern_editor.hpp similarity index 89% rename from include/views/view_pattern.hpp rename to include/views/view_pattern_editor.hpp index 34739fb52..323e16342 100644 --- a/include/views/view_pattern.hpp +++ b/include/views/view_pattern_editor.hpp @@ -16,10 +16,10 @@ namespace hex { - class ViewPattern : public View { + class ViewPatternEditor : public View { public: - ViewPattern(); - ~ViewPattern() override; + ViewPatternEditor(); + ~ViewPatternEditor() override; void drawMenu() override; void drawAlwaysVisible() override; diff --git a/source/init/tasks.cpp b/source/init/tasks.cpp index f5decce39..065076aeb 100644 --- a/source/init/tasks.cpp +++ b/source/init/tasks.cpp @@ -5,7 +5,7 @@ #include #include "views/view_hexeditor.hpp" -#include "views/view_pattern.hpp" +#include "views/view_pattern_editor.hpp" #include "views/view_pattern_data.hpp" #include "views/view_hashes.hpp" #include "views/view_information.hpp" @@ -93,7 +93,7 @@ namespace hex::init { bool loadDefaultViews() { ContentRegistry::Views::add(); - ContentRegistry::Views::add(); + ContentRegistry::Views::add(); ContentRegistry::Views::add(); ContentRegistry::Views::add(); ContentRegistry::Views::add(); diff --git a/source/views/view_pattern.cpp b/source/views/view_pattern_editor.cpp similarity index 97% rename from source/views/view_pattern.cpp rename to source/views/view_pattern_editor.cpp index dcae2a058..daba68198 100644 --- a/source/views/view_pattern.cpp +++ b/source/views/view_pattern_editor.cpp @@ -1,4 +1,4 @@ -#include "views/view_pattern.hpp" +#include "views/view_pattern_editor.hpp" #include "helpers/project_file_handler.hpp" #include @@ -73,7 +73,7 @@ namespace hex { } - ViewPattern::ViewPattern() : View("hex.view.pattern.name") { + ViewPatternEditor::ViewPatternEditor() : View("hex.view.pattern.name") { this->m_patternLanguageRuntime = new lang::PatternLanguage(); this->m_textEditor.SetLanguageDefinition(PatternLanguage()); @@ -200,7 +200,7 @@ namespace hex { } } - ViewPattern::~ViewPattern() { + ViewPatternEditor::~ViewPatternEditor() { delete this->m_patternLanguageRuntime; EventManager::unsubscribe(this); @@ -210,7 +210,7 @@ namespace hex { EventManager::unsubscribe(this); } - void ViewPattern::drawMenu() { + void ViewPatternEditor::drawMenu() { if (ImGui::BeginMenu("hex.menu.file"_lang)) { if (ImGui::MenuItem("hex.view.pattern.menu.file.load_pattern"_lang)) { hex::openFileBrowser("hex.view.pattern.open_pattern"_lang, DialogMode::Open, { { "Pattern File", "hexpat" } }, [this](auto path) { @@ -221,7 +221,7 @@ namespace hex { } } - void ViewPattern::drawContent() { + void ViewPatternEditor::drawContent() { if (ImGui::Begin(View::toWindowName("hex.view.pattern.name").c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_None | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) { auto provider = SharedData::currentProvider; @@ -292,7 +292,7 @@ namespace hex { ImGui::End(); } - void ViewPattern::drawAlwaysVisible() { + void ViewPatternEditor::drawAlwaysVisible() { if (ImGui::BeginPopupModal("hex.view.pattern.accept_pattern"_lang, nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::TextWrapped("hex.view.pattern.accept_pattern.desc"_lang); @@ -329,7 +329,7 @@ namespace hex { } - void ViewPattern::loadPatternFile(std::string_view path) { + void ViewPatternEditor::loadPatternFile(std::string_view path) { FILE *file = fopen(path.data(), "rb"); if (file != nullptr) { @@ -353,7 +353,7 @@ namespace hex { } } - void ViewPattern::clearPatternData() { + void ViewPatternEditor::clearPatternData() { for (auto &data : SharedData::patternData) delete data; @@ -361,7 +361,7 @@ namespace hex { lang::PatternData::resetPalette(); } - void ViewPattern::parsePattern(char *buffer) { + void ViewPatternEditor::parsePattern(char *buffer) { this->m_evaluatorRunning = true; this->clearPatternData();