It's been reported that the latest version of Tux Paint does not run on macOS
10.7 (Lion). This change fixes the issue.
BACKGROUND
A user has reported Tux Paint 0.9.23 does not run on macOS 10.7. She also
identified that the issue is due to a system library required by Tux Paint,
/System/Library/Frameworks/CoreGraphics.framework does not exist on macOS 10.7
Some investigation revealed that CoreGraphics.framework is a library required
by libSDL, and it exists under an alternate path in macOS 10.7, underneath
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/.
CoreGraphics.framework also exists underneath this path in newer version of
macOS as a symlink to the real directory as well, so the issue can be fixed by
simply relinking SDL to use the old (compatible) path instead of the new
(default) path to CoreGraphics.framework.
This change adds the code such that, during the `make install` step to create
TuxPaint.app, any library referencing CoreGraphics.framework is re-linked to
the compatible path rather than the path that only exists on the newer version
of macOS.
For more information, see:
https://stackoverflow.com/questions/20206985/xcode-linking-against-applicationservices-framework-with-sdk-10-9-causes-10-7
Ability to bring up the print dialog from the macOS build was removed in
Tux Paint 0.9.23 to support the new build mechanism. It has been re-added.
To access it, option-click the print icon, or configure Tux Paint to always
bring up the dialog upon print.
Added function name to the output of verbose logging. Verbose logging is
the feature introduced in the previous git commit where a call to printf()
automatically adds the source filename and line from where the printf() is
called, and the runtime timestamp at which the call was made. Now this
feature adds the functio name from which the printf() is called. This
feature is enabled if and only if both DEBUG and VERBOSE are defined in
debug.h and the source is compiled with GCC.
Added a new macro DEBUG_PRINTF() that expands to printf() if and only if
DEBUG is defined in debug.h. This feature works with verbose logging if
VERBOSE is also defined and the source is compiled with GCC.
Reduced the launch time. A user reported an issue with Tux Paint taking 7
minutes to launch; an investigation showed that launching Tux Paint with
all stamps and the screen width set wide (~1500 pixels) can cause the
slowdown during the progress bar drawing sequence because progress bar
takes a long time to draw on screens with a wide screen, and it is called
~10 thousand times during the stamp loading process. The issue has been
addressed by calling the progress bar less frequently.
Updated the macOS build version and date, under which these features were
tested.
Previously, testing in macOS required running `make install`, switching
over to the Finder, then double clicking TuxPaint.app, which was a time
consuming process. This change allows the tuxpaint binary to be run
directly from the command line (./tuxpaint) without `make install`, which
makes it easier to test any small code change. Now `make install` is only
required to build the TuxPaint.app bundle for execution from the
Finder.
FYI, `make install` also builds TuxPaint.dmg for distribution. A small
change is included in this commit to allow TuxPaint.dmg to be built without
building TuxPaint.app (if, for example, you delete TuxPaint.dmg by accident
and need to rebuild it.) This is done via `make TuxPaint.dmg`.
Running Tux Paint under macOS in Korean mode (and some other languages) causes
it to crash, unless "load system fonts" option is also enabled. Some
investigation showed the issue occurs when num_font_families is 0 in fonts.c.
This change removes the assumption from the code that assumes num_font_families
has at least one record.
Previously, the DMG's default window is slightly larger than the
background, exposing some whitespace. This fixes the window size to be
identical to the background image, so no whitespace is exposed.
Previously `make install` on macOS created TuxPaint.dmg, but it was a
simple disk image.
Now TuxPaint.dmg is formatted as one would expect from any other macOS app,
with a Tux folder icon, symlink to the /Applications folder, and a
background image with an arrow.