geode/loader/src/platform/mac/InternalLoader.cpp
HJfod 72bbffa79d Great Geode cleanup project
- move all platform sources to one central folder under src/platform/name
 - don't add obj-c sources on windows or platform files from other platforms on all platforms
2022-11-28 19:45:23 +02:00

42 lines
1.2 KiB
C++

#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::postIPCReply(
void* rawPipeHandle,
std::string const& replyID,
nlohmann::json 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