mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
build: Refactor ImHexAPI into multiple separate files
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user