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.
This was broken sometimes between release 1.8.1 and 1.9.0. I did not
track the change that broke it, but it looks like the code was trying
to get the DockTile object too early causing it to be nil.
There's no point in testing for Windows 10 since the comparison is already "greater than or equals", and it identifies itself as 6.2 for backwards compatibility. Likely it was failing before because the return type was wrong.
Version checks are unreliable anyways, should use feature checks, but "if it ain't broke don't fix it".
When -Wundeclared-selector is enabled (recommended by Apple), the
calls to the setBadgeLabel selector in MacOSXTaskbarManager are
warned on because NSDockTile declarations are not included because
they do not exist in macOS 10.4 and earlier. While I don't know
that we are even supporting such old macOS versions these days, it
is simple enough to fix this problem when compiling to modern
macOS versions by conditionally including the necessary header.
This involves moving the NSDockTilePlugIn code to backend/taskbar
and fixing style to follow our coding conventions. One make target
was also renamed. All in all there is no change in functionality with this
commit.
This allows to start a recently played game directly from the dock. The
ScummVM.app application should have been permanently added to the
dock and the menu is only present when ScummVM is not running. The
list of recently played game is written by the taskbar code in ScummVM.
The Dock Tile Plugin only reads that list to populate the menu.
This implements count badge, progress bar, and icon overlay.
It uses the NSDockTile API which is available since OS X 10.5.
The code compiles and run on older system but without doing
anything.
The Windows taskbar manager uses VerSetConditionMask and VerifyVersionInfo to check for Windows 7 or later
before enabling the taskbar integration features. Those functions did not appear until Windows 2000, so we
have to check for them at runtime.
We now look for an iconsPath configuration variable with the path to the icons folder.
In addition, we look if there is an "icons" subfolder (useful when using extrapath to store icons)