build: Refactor ContentRegistry into multiple separate files

This commit is contained in:
WerWolv
2025-08-14 21:22:03 +02:00
parent d920718b44
commit fbde2942de
141 changed files with 2337 additions and 2007 deletions

View File

@@ -1,4 +1,24 @@
#include <hex/api/content_registry.hpp>
#include <hex/api/content_registry/background_services.hpp>
#include <hex/api/content_registry/command_palette.hpp>
#include <hex/api/content_registry/communication_interface.hpp>
#include <hex/api/content_registry/data_formatter.hpp>
#include <hex/api/content_registry/data_information.hpp>
#include <hex/api/content_registry/data_inspector.hpp>
#include <hex/api/content_registry/data_processor.hpp>
#include <hex/api/content_registry/diffing.hpp>
#include <hex/api/content_registry/disassemblers.hpp>
#include <hex/api/content_registry/experiments.hpp>
#include <hex/api/content_registry/file_type_handler.hpp>
#include <hex/api/content_registry/hashes.hpp>
#include <hex/api/content_registry/hex_editor.hpp>
#include <hex/api/content_registry/user_interface.hpp>
#include <hex/api/content_registry/pattern_language.hpp>
#include <hex/api/content_registry/provider.hpp>
#include <hex/api/content_registry/reports.hpp>
#include <hex/api/content_registry/settings.hpp>
#include <hex/api/content_registry/tools.hpp>
#include <hex/api/content_registry/views.hpp>
#include <hex/api/shortcut_manager.hpp>
#include <hex/api/events/requests_provider.hpp>
@@ -579,7 +599,7 @@ namespace hex {
}
namespace ContentRegistry::CommandPaletteCommands {
namespace ContentRegistry::CommandPalette {
namespace impl {
@@ -851,7 +871,7 @@ namespace hex {
}
namespace ContentRegistry::DataProcessorNode {
namespace ContentRegistry::DataProcessor {
namespace impl {
@@ -874,7 +894,7 @@ namespace hex {
}
namespace ContentRegistry::Interface {
namespace ContentRegistry::UserInterface {
namespace impl {
@@ -1026,7 +1046,7 @@ namespace hex {
};
void updateToolbarItems() {
std::set<ContentRegistry::Interface::impl::MenuItem*, MenuItemSorter> menuItems;
std::set<impl::MenuItem*, MenuItemSorter> menuItems;
for (auto &[priority, menuItem] : impl::getMenuItemsMutable()) {
if (menuItem.toolbarIndex != -1) {
@@ -1124,7 +1144,7 @@ namespace hex {
}
namespace ContentRegistry::FileHandler {
namespace ContentRegistry::FileTypeHandler {
namespace impl {
@@ -1429,6 +1449,16 @@ namespace hex {
namespace ContentRegistry::DataInformation {
void InformationSection::load(const nlohmann::json &data) {
m_enabled = data.value<bool>("enabled", true);
}
[[nodiscard]] nlohmann::json InformationSection::store() {
nlohmann::json data;
data["enabled"] = m_enabled.load();
return data;
}
namespace impl {
static AutoReset<std::vector<CreateCallback>> s_informationSectionConstructors;
@@ -1444,7 +1474,7 @@ namespace hex {
}
namespace ContentRegistry::Disassembler {
namespace ContentRegistry::Disassemblers {
namespace impl {

View File

@@ -1,8 +1,7 @@
#include <hex/api/layout_manager.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/api/content_registry/views.hpp>
#include <hex/ui/view.hpp>
#include <hex/helpers/fs.hpp>
#include <hex/helpers/logger.hpp>
#include <hex/helpers/auto_reset.hpp>
#include <hex/helpers/default_paths.hpp>

View File

@@ -1,4 +1,3 @@
#include <hex/api/content_registry.hpp>
#include <hex/api/localization_manager.hpp>
#include <hex/helpers/auto_reset.hpp>

View File

@@ -1,11 +1,13 @@
#include <hex/api/shortcut_manager.hpp>
#include <imgui.h>
#include <hex/api/content_registry.hpp>
#include <hex/api/content_registry/user_interface.hpp>
#include <hex/api/task_manager.hpp>
#include <hex/helpers/auto_reset.hpp>
#include <hex/ui/view.hpp>
#include <imgui_internal.h>
namespace hex {
namespace {
@@ -443,7 +445,7 @@ namespace hex {
}
if (result) {
for (auto &[priority, menuItem] : ContentRegistry::Interface::impl::getMenuItemsMutable()) {
for (auto &[priority, menuItem] : ContentRegistry::UserInterface::impl::getMenuItemsMutable()) {
if (menuItem.view == view && menuItem.shortcut == oldShortcut) {
menuItem.shortcut = newShortcut;
break;