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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user