build: Refactor ImHexAPI into multiple separate files

This commit is contained in:
WerWolv
2025-08-14 20:16:40 +02:00
parent 4ca429e389
commit d920718b44
144 changed files with 1211 additions and 1067 deletions

View File

@@ -1,5 +1,6 @@
#include <hex/api/events/requests_interaction.hpp>
#include <hex/api/task_manager.hpp>
#include <hex/api/imhex_api/system.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/api/tutorial_manager.hpp>
#include <hex/api/shortcut_manager.hpp>

View File

@@ -1,6 +1,7 @@
#if !defined(OS_WEB)
#include <hex/api/events/requests_lifecycle.hpp>
#include <hex/api/imhex_api/system.hpp>
#include <wolv/utils/guards.hpp>
#include <init/run.hpp>

View File

@@ -4,7 +4,6 @@
#include <emscripten/html5.h>
#include <GLFW/glfw3.h>
#include <hex/api/imhex_api.hpp>
#include <hex/api/events/requests_lifecycle.hpp>
#include <hex/api/task_manager.hpp>

View File

@@ -1,13 +1,12 @@
#include "window.hpp"
#include "init/splash_window.hpp"
#include <hex/api/imhex_api.hpp>
#include <hex/api/imhex_api/system.hpp>
#include <hex/api/events/requests_lifecycle.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include <hex/helpers/logger.hpp>
#include <fmt/chrono.h>
#include <romfs/romfs.hpp>

View File

@@ -1,6 +1,7 @@
#include <optional>
#include <hex/api/imhex_api.hpp>
#include <hex/api/imhex_api/messaging.hpp>
#include <hex/api/imhex_api/system.hpp>
#include <hex/api/events/events_lifecycle.hpp>
#include <hex/api/events/requests_lifecycle.hpp>
#include <hex/helpers/logger.hpp>
@@ -30,10 +31,10 @@ namespace hex::messaging {
EventNativeMessageReceived::subscribe([](const std::vector<u8> &rawData) {
i64 nullIndex = -1;
auto messageData = reinterpret_cast<const char*>(rawData.data());
size_t messageSize = rawData.size();
const auto messageData = reinterpret_cast<const char*>(rawData.data());
const std::size_t messageSize = rawData.size();
for (size_t i = 0; i < messageSize; i++) {
for (std::size_t i = 0; i < messageSize; i++) {
if (messageData[i] == '\0') {
nullIndex = i;
break;
@@ -45,8 +46,8 @@ namespace hex::messaging {
return;
}
std::string eventName(messageData, nullIndex);
std::vector<u8> eventData(messageData + nullIndex + 1, messageData + messageSize);
const std::string eventName(messageData, nullIndex);
const std::vector<u8> eventData(messageData + nullIndex + 1, messageData + messageSize);
messageReceived(eventName, eventData);
});

View File

@@ -2,7 +2,7 @@
#if defined(OS_LINUX)
#include <hex/api/imhex_api.hpp>
#include <hex/api/imhex_api/system.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/api/events/events_gui.hpp>
#include <hex/api/events/events_interaction.hpp>

View File

@@ -3,7 +3,8 @@
#if defined(OS_MACOS)
#include <hex/api/project_file_manager.hpp>
#include <hex/api/imhex_api.hpp>
#include <hex/api/imhex_api/system.hpp>
#include <hex/api/imhex_api/provider.hpp>
#include <hex/api/events/events_gui.hpp>
#include <hex/api/events/requests_gui.hpp>
#include <hex/api/events/events_interaction.hpp>

View File

@@ -4,6 +4,7 @@
#include "messaging.hpp"
#include <hex/api/imhex_api/system.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/api/theme_manager.hpp>

View File

@@ -4,7 +4,7 @@
#include <hex/api/plugin_manager.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/api/imhex_api.hpp>
#include <hex/api/imhex_api/fonts.hpp>
#include <hex/api/layout_manager.hpp>
#include <hex/api/shortcut_manager.hpp>
#include <hex/api/workspace_manager.hpp>
@@ -18,6 +18,8 @@
#include <hex/helpers/logger.hpp>
#include <hex/helpers/default_paths.hpp>
#include <hex/providers/provider.hpp>
#include <hex/ui/view.hpp>
#include <hex/ui/popup.hpp>
#include <hex/ui/banner.hpp>