geode/loader/src/internal/mac/InternalLoader.cpp

43 lines
1.2 KiB
C++
Raw Normal View History

#include "../InternalLoader.hpp"
#include <Geode/loader/Log.hpp>
#include <iostream>
#include "../InternalMod.hpp"
#ifdef GEODE_IS_MACOS
#include <CoreFoundation/CoreFoundation.h>
void InternalLoader::platformMessageBox(char const* title, std::string const& info) {
CFStringRef cfTitle = CFStringCreateWithCString(NULL, title, kCFStringEncodingUTF8);
CFStringRef cfMessage = CFStringCreateWithCString(NULL, info.c_str(), kCFStringEncodingUTF8);
CFUserNotificationDisplayNotice(
0, kCFUserNotificationNoteAlertLevel, NULL, NULL, NULL, cfTitle, cfMessage, NULL
);
}
void InternalLoader::openPlatformConsole() {
m_platformConsoleOpen = true;
for (auto const& log : Loader::get()->getLogs()) {
std::cout << log->toString(true) << "\n";
}
}
void InternalLoader::closePlatformConsole() {
m_platformConsoleOpen = false;
}
void InternalLoader::postIPCMessage(
void* rawPipeHandle,
std::string const& senderID,
std::string const& data
) {}
void InternalLoader::setupIPC() {
#warning "Set up pipes or smth for this platform"
log::log(Severity::Warning, InternalMod::get(), "IPC is not supported on this platform");
}
#endif