1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 20:43:04 +01:00

Implement OpenURL for macOS

This commit is contained in:
Gymnasiast
2020-08-01 13:44:06 +02:00
parent 352870b503
commit 3d071cec53

View File

@@ -19,9 +19,12 @@
# undef interface
# undef abstract
# include <ApplicationServices/ApplicationServices.h>
# import <Cocoa/Cocoa.h>
# include <CoreFoundation/CFBundle.h>
# include <SDL.h>
# include <mach-o/dyld.h>
# include <string>
namespace OpenRCT2::Ui
{
@@ -70,6 +73,10 @@ namespace OpenRCT2::Ui
void OpenURL(const std::string& url) override
{
CFURLRef urlRef = CFURLCreateWithBytes(
nullptr, reinterpret_cast<const UInt8*>(url.c_str()), url.length(), kCFStringEncodingUTF8, nullptr);
LSOpenCFURLRef(urlRef, 0);
CFRelease(urlRef);
}
std::string ShowFileDialog(SDL_Window* window, const FileDialogDesc& desc) override