h/t Pere for adding the missing pieces.
WIP b/c there's one minor side effect that needs addressing
(final label, highlighted red, does not lose its highlight)
Onscreen keyboard repositions itself to the top if you use [Enter]
to move the cursor down, and it begins overlapping the keyboard.
Also, play "carriage return" sound effect, even when entering
a blank 'line' of text.
Fixed the issue with the backspace not working in text and label tools
when in certain language modes in macOS. Mac keyboards have the DELETE
key where PC keyboards have the BACKSPACE key, and the two keys have
different keycodes, so the backspace requires special handling on the
macOS in programs writtens for the PC.
* macOS language detection has been updated to be backward compatible to macOS
10.10 Yosemite.
It appears older version(s?) of macOS can just return "en" instead of "en-US"
when queried for the preferred locale. Updated code to account for this.
Avoid leaking memory when loading Label text strings from a saved drawing.
Also, a heck of a lot of comments to explain (as best I understand)
what load_info_about_label_surface() is doing.
It has likely become unneccessary by recent fix for the common part.
Also backported a fix for uppercase issue from sdl2.0 branch (Define Windows native
function for mbstowcs/wcstombs).
When reading label text (on non-Windows, at least), fscanf("%lc")
was being used. It seemed to be skipping the initial space,
causing strings to be shifted left one, and end up with garbage
bytes at the far right.
Fixes https://sourceforge.net/p/tuxpaint/bugs/247/ I hope!
"Apply Label" mode of Label tool can be activated/deactivated,
though it doesn't currently do the work yet.
Also
* Modularized routine to select a Label (via click or [Enter] key):
`select_label_node()`
* Starting routine for applying a Label to the canvas
(via click or [Enter] key): `apply_label_node()`
* Modularized routine for repositioning the on-screen keyboard based on
where we're typing: `reposition_onscreen_keyboard()`
Seems likely that I broke some things.
Starting work towards
https://sourceforge.net/p/tuxpaint/feature-requests/213/
The ability to 'apply' a label to the canvas, making it permanent
(as if added using the "Text" tool instead).
Removed unused "label rotate" option's code (and hence addressed
a bug we didn't relalize when choosing the "Label" tool while in
in "--nostampcontrols" mode; the unused "rotate" button would appear).