CLOUD: Move openUrl to OSystem
This commit is contained in:
parent
dff88b1058
commit
1f2a50bcd3
20 changed files with 115 additions and 333 deletions
|
@ -107,7 +107,7 @@ void OSystem_MacOSX::addSysArchivesToSearchSet(Common::SearchSet &s, int priorit
|
|||
}
|
||||
|
||||
bool OSystem_MacOSX::hasFeature(Feature f) {
|
||||
if (f == kFeatureDisplayLogFile || f == kFeatureClipboardSupport)
|
||||
if (f == kFeatureDisplayLogFile || f == kFeatureClipboardSupport || f == kFeatureOpenUrl)
|
||||
return true;
|
||||
return OSystem_POSIX::hasFeature(f);
|
||||
}
|
||||
|
@ -133,6 +133,13 @@ Common::String OSystem_MacOSX::getTextFromClipboard() {
|
|||
return getTextFromClipboardMacOSX();
|
||||
}
|
||||
|
||||
bool OSystem_MacOSX::openUrl(const Common::String &url) {
|
||||
CFURLRef urlRef = CFURLCreateWithBytes (NULL, (UInt8*)url.c_str(), url.size(), kCFStringEncodingASCII, NULL);
|
||||
OSStatus err = LSOpenCFURLRef(urlRef, NULL);
|
||||
CFRelease(urlRef);
|
||||
return err != noErr;
|
||||
}
|
||||
|
||||
Common::String OSystem_MacOSX::getSystemLanguage() const {
|
||||
#if defined(USE_DETECTLANG) && defined(USE_TRANSLATION)
|
||||
CFArrayRef availableLocalizations = CFBundleCopyBundleLocalizations(CFBundleGetMainBundle());
|
||||
|
|
|
@ -35,6 +35,8 @@ public:
|
|||
|
||||
virtual bool hasTextInClipboard();
|
||||
virtual Common::String getTextFromClipboard();
|
||||
|
||||
virtual bool openUrl(const Common::String &url);
|
||||
|
||||
virtual Common::String getSystemLanguage() const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue