[Scummvm-git-logs] scummvm master -> 4f5ccdbe7563e50614ea3081a90764b4c606fe25
dwatteau
noreply at scummvm.org
Sat Nov 5 09:13:10 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4f5ccdbe75 MACOSX: Update some comments about macOS 10.4/10.5 behavior
Commit: 4f5ccdbe7563e50614ea3081a90764b4c606fe25
https://github.com/scummvm/scummvm/commit/4f5ccdbe7563e50614ea3081a90764b4c606fe25
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2022-11-05T10:09:58+01:00
Commit Message:
MACOSX: Update some comments about macOS 10.4/10.5 behavior
Found while doing a review of our existing workarounds for those
versions, and the system features which can be used there.
Also fix indentation and some typos while there.
Changed paths:
backends/platform/sdl/macosx/appmenu_osx.mm
backends/platform/sdl/macosx/macosx_wrapper.mm
backends/taskbar/macosx/macosx-taskbar.mm
backends/text-to-speech/macosx/macosx-text-to-speech.mm
diff --git a/backends/platform/sdl/macosx/appmenu_osx.mm b/backends/platform/sdl/macosx/appmenu_osx.mm
index 18c5bd55232..2631a7565ec 100644
--- a/backends/platform/sdl/macosx/appmenu_osx.mm
+++ b/backends/platform/sdl/macosx/appmenu_osx.mm
@@ -43,7 +43,7 @@
typedef unsigned long NSUInteger;
// Those are not defined in the 10.4 SDK, but they are defined when targeting
-// Mac OS X 10.4 or above in the 10.5 SDK. So hopefully that means it works with 10.4 as well.
+// Mac OS X 10.4 or above in the 10.5 SDK, and they do work with 10.4.
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
enum {
NSUTF32StringEncoding = 0x8c000100,
@@ -234,6 +234,8 @@ void replaceApplicationMenuItems() {
addMenuItem(_("Minimize"), nil, @selector(performMiniaturize:), @"m", windowMenu);
}
+ // Note: this part is expected not to work at run-time on 10.5 and earlier,
+ // because setHelpMenu is only available on 10.6+ (see Bug#11260).
NSMenu *helpMenu = addMenu(_("Help"), @"", @selector(setHelpMenu:));
if (helpMenu) {
if (!delegate) {
diff --git a/backends/platform/sdl/macosx/macosx_wrapper.mm b/backends/platform/sdl/macosx/macosx_wrapper.mm
index a98a6c0684b..08dc432d9e7 100644
--- a/backends/platform/sdl/macosx/macosx_wrapper.mm
+++ b/backends/platform/sdl/macosx/macosx_wrapper.mm
@@ -40,7 +40,7 @@
typedef unsigned long NSUInteger;
// Those are not defined in the 10.4 SDK, but they are defined when targeting
-// Mac OS X 10.4 or above in the 10.5 SDK. So hopefully that means it works with 10.4 as well.
+// Mac OS X 10.4 or above in the 10.5 SDK, and they do work with 10.4.
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
enum {
NSUTF32StringEncoding = 0x8c000100,
diff --git a/backends/taskbar/macosx/macosx-taskbar.mm b/backends/taskbar/macosx/macosx-taskbar.mm
index a83ec026b53..4255931352e 100644
--- a/backends/taskbar/macosx/macosx-taskbar.mm
+++ b/backends/taskbar/macosx/macosx-taskbar.mm
@@ -39,7 +39,9 @@
#include <CoreFoundation/CFString.h>
// NSDockTile was introduced with Mac OS X 10.5.
-// Try provide backward compatibility by avoiding NSDockTile symbols.
+// The following makes it possible to compile this feature with the 10.4
+// SDK (by avoiding any NSDockTile symbol), while letting the same build
+// use this feature at run-time on 10.5+.
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
typedef id NSDockTilePtr;
#else
@@ -67,8 +69,6 @@ MacOSXTaskbarManager::MacOSXTaskbarManager() : _progress(-1.0) {
_dockTile = nil;
_applicationIconView = nil;
_overlayIconView = nil;
-
-
}
MacOSXTaskbarManager::~MacOSXTaskbarManager() {
@@ -119,7 +119,7 @@ void MacOSXTaskbarManager::setOverlayIcon(const Common::String &name, const Comm
if (!hasDockTile())
return;
- if (name.empty()) {
+ if (name.empty()) {
clearOverlayIconView();
[_dockTile performSelector:@selector(display)];
return;
@@ -149,7 +149,7 @@ void MacOSXTaskbarManager::setProgressValue(int completed, int total) {
else if (_progress < 0)
_progress = 0.0;
- NSImage *mainIcon = [[NSApp applicationIconImage] copy];
+ NSImage *mainIcon = [[NSApp applicationIconImage] copy];
double barSize = [mainIcon size].width;
double progressSize = barSize * _progress;
[mainIcon lockFocus];
@@ -209,7 +209,7 @@ void MacOSXTaskbarManager::clearError() {
if (!hasDockTile())
return;
- clearOverlayIconView();
+ clearOverlayIconView();
[_dockTile performSelector:@selector(display)];
return;
}
diff --git a/backends/text-to-speech/macosx/macosx-text-to-speech.mm b/backends/text-to-speech/macosx/macosx-text-to-speech.mm
index 0504b33734e..c87ffbd977d 100644
--- a/backends/text-to-speech/macosx/macosx-text-to-speech.mm
+++ b/backends/text-to-speech/macosx/macosx-text-to-speech.mm
@@ -134,7 +134,7 @@ bool MacOSXTextToSpeechManager::startNextSpeech() {
bool MacOSXTextToSpeechManager::stop() {
_messageQueue.clear();
if (isSpeaking()) {
- _currentSpeech.clear(); // so that it immediately reports that it is no longer speeking
+ _currentSpeech.clear(); // so that it immediately reports that it is no longer speaking
// Stop as soon as possible
// Also tell the MacOSXTextToSpeechManagerDelegate to ignore the next finishedSpeaking as
// it has already been handled, but we might have started another speach by the time we
@@ -159,7 +159,7 @@ bool MacOSXTextToSpeechManager::resume() {
}
bool MacOSXTextToSpeechManager::isSpeaking() {
- // Because the NSSpeechSynthesizer is asynchronous, it doesn't start speeking immediately
+ // Because the NSSpeechSynthesizer is asynchronous, it doesn't start speaking immediately
// and thus using [synthesizer isSpeaking] just after [synthesizer startSpeakingString:]] is
// likely to return NO. So instead we check the _currentSpeech string (set when calling
// startSpeakingString, and cleared when we receive the didFinishSpeaking message).
More information about the Scummvm-git-logs
mailing list