#if defined(OS_MACOS) #include #include #include #include "messaging.hpp" namespace hex::messaging { void sendToOtherInstance(const std::string &eventName, const std::vector &args) { log::debug("Sending event {} to another instance (not us)", eventName); // Create the message std::vector fullEventData(eventName.begin(), eventName.end()); fullEventData.push_back('\0'); fullEventData.insert(fullEventData.end(), args.begin(), args.end()); u8 *data = &fullEventData[0]; auto dataSize = fullEventData.size(); macosSendMessageToMainInstance(data, dataSize); } bool setupNative() { macosInstallEventListener(); return macosIsMainInstance(); } } #endif