tuxpaint-pencil-sharpener/src/macos.h
Mark Kim c9e195549f macOS system language detection.
It appears the system language detection doesn't work on [some versions
of?] macOS.  Fixed.

Strangely, querying the Cocoa API for the system locale on a system in
US with the preferred language set to Korean produces the invalid locale
"ko-US" instead of the expected "ko-KR".  This behavior of returning the
language with a invalid region qualifier for the language appears to
happen only with languages where macOS does not have regional variants
(this issue does not seem to occur with Canadian English, en-CA, for
example.)  A fuzzy matching locale function has been added to handle
this issue.
2022-02-06 20:26:50 -05:00

37 lines
1.1 KiB
C

/*
macos.h
Copyright (c) 2021-2022
http://www.tuxpaint.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
*/
#ifndef __MACOS_H__
#define __MACOS_H__
#define KMOD_CTRL KMOD_META /* Anywhere Linux/Windows uses CTRL, use CMD on macOS */
void apple_init(void);
const char *apple_locale(void);
const char *apple_fontsPath(void);
const char *apple_preferencesPath(void);
const char *apple_globalPreferencesPath(void);
const char *apple_picturesPath(void);
#endif /* __MACOS_H__ */