#include #include #include #include #include namespace hex::init { /** * @brief Handles a file open request by opening the file specified by OS-specific means */ void handleFileOpenRequest() { if (auto path = hex::getInitialFilePath(); path.has_value()) { RequestOpenFile::post(path.value()); } } /** * @brief Displays ImHex's splash screen and runs all initialization tasks. The splash screen will be displayed until all tasks have finished. */ [[maybe_unused]] std::unique_ptr initializeImHex() { auto splashWindow = std::make_unique(); log::info("Using '{}' GPU", ImHexApi::System::getGPUVendor()); // Add initialization tasks to run TaskManager::init(); for (const auto &[name, task, async] : init::getInitTasks()) splashWindow->addStartupTask(name, task, async); splashWindow->startStartupTasks(); return splashWindow; } /** * @brief Deinitializes ImHex by running all exit tasks */ void deinitializeImHex() { // Run exit tasks init::runExitTasks(); } }