ALL: synced with ScummVM commit 09bf38c120

This commit is contained in:
Pawel Kolodziejski 2020-05-09 20:05:54 +02:00
parent b5d73d4c22
commit b586571900
414 changed files with 111155 additions and 38279 deletions

View file

@ -32,6 +32,7 @@
#include "backends/platform/sdl/macosx/macosx.h"
#include "backends/updates/macosx/macosx-updates.h"
#include "backends/taskbar/macosx/macosx-taskbar.h"
#include "backends/text-to-speech/macosx/macosx-text-to-speech.h"
#include "backends/dialogs/macosx/macosx-dialogs.h"
#include "backends/platform/sdl/macosx/macosx_wrapper.h"
#include "backends/fs/posix/posix-fs.h"
@ -44,11 +45,6 @@
#include "ApplicationServices/ApplicationServices.h" // for LSOpenFSRef
#include "CoreFoundation/CoreFoundation.h" // for CF* stuff
OSystem_MacOSX::OSystem_MacOSX()
:
OSystem_POSIX("Library/Preferences/ResidualVM Preferences") {
}
OSystem_MacOSX::~OSystem_MacOSX() {
releaseMenu();
}
@ -86,6 +82,11 @@ void OSystem_MacOSX::initBackend() {
_updateManager = new MacOSXUpdateManager();
#endif
#ifdef USE_TTS
// Initialize Text to Speech manager
_textToSpeechManager = new MacOSXTextToSpeechManager();
#endif
// Invoke parent implementation of this method
OSystem_POSIX::initBackend();
}
@ -147,7 +148,7 @@ bool OSystem_MacOSX::setTextInClipboard(const Common::String &text) {
}
bool OSystem_MacOSX::openUrl(const Common::String &url) {
CFURLRef urlRef = CFURLCreateWithBytes (NULL, (UInt8*)url.c_str(), url.size(), kCFStringEncodingASCII, NULL);
CFURLRef urlRef = CFURLCreateWithBytes (NULL, (const UInt8*)url.c_str(), url.size(), kCFStringEncodingASCII, NULL);
OSStatus err = LSOpenCFURLRef(urlRef, NULL);
CFRelease(urlRef);
return err == noErr;
@ -200,6 +201,24 @@ Common::String OSystem_MacOSX::getSystemLanguage() const {
#endif // USE_DETECTLANG
}
Common::String OSystem_MacOSX::getDefaultConfigFileName() {
const Common::String baseConfigName = "Library/Preferences/ResidualVM Preferences";
Common::String configFile;
Common::String prefix = getenv("HOME");
if (!prefix.empty() && (prefix.size() + 1 + baseConfigName.size()) < MAXPATHLEN) {
configFile = prefix;
configFile += '/';
configFile += baseConfigName;
} else {
configFile = baseConfigName;
}
return configFile;
}
Common::String OSystem_MacOSX::getDefaultLogFileName() {
const char *prefix = getenv("HOME");
if (prefix == nullptr) {
@ -210,7 +229,7 @@ Common::String OSystem_MacOSX::getDefaultLogFileName() {
return Common::String();
}
return Common::String(prefix) + "/Library/Logs/scummvm.log";
return Common::String(prefix) + "/Library/Logs/residualvm.log";
}
Common::String OSystem_MacOSX::getScreenshotsPath() {