aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2005-04-14 09:25:01 +0000
committerYAMAMOTO Mitsuharu2005-04-14 09:25:01 +0000
commit42c6741e0a3bede0ed18626ae2e66b4f2a8bb37e (patch)
tree2623cf5b38b087e2dd812e59323c9c9f4b202b0c /src
parentf0b40a1dc2bd963d40c143b8979f516ab446f5bb (diff)
downloademacs-42c6741e0a3bede0ed18626ae2e66b4f2a8bb37e.tar.gz
emacs-42c6741e0a3bede0ed18626ae2e66b4f2a8bb37e.zip
[!TARGET_API_MAC_CARBON]: Include MacLocales.h. Don't include
TextEncodingConverter.h. (mac_system_script_code, Vmac_system_locale): New variables. (syms_of_mac): Defvar them. (mac_get_system_locale): New function.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog17
-rw-r--r--src/mac.c40
2 files changed, 57 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b8fcfe614e6..71ca06e93d2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,20 @@
12005-04-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * mac.c [!TARGET_API_MAC_CARBON]: Include MacLocales.h. Don't
4 include TextEncodingConverter.h.
5 (mac_system_script_code, Vmac_system_locale): New variables.
6 (syms_of_mac): Defvar them.
7 (mac_get_system_locale): New function.
8
9 * macfns.c (x_set_name, x_set_title) [!TARGET_API_MAC_CARBON]: Use
10 ENCODE_SYSTEM to encode title bar string.
11 (x_create_tip_frame): Apply 2005-03-18 change for xfns.c.
12 (Fx_file_dialog) [TARGET_API_MAC_CARBON && !MAC_OSX]: Use
13 CFStringGetSystemEncoding to get system default string encoding.
14
15 * macterm.c [!TARGET_API_MAC_CARBON]: Don't include
16 TextEncodingConverter.h.
17
12005-04-13 Steven Tamm <steventamm@mac.com> 182005-04-13 Steven Tamm <steventamm@mac.com>
2 19
3 * macterm.c (syms_of_macterm): Remove redundant definition of 20 * macterm.c (syms_of_macterm): Remove redundant definition of
diff --git a/src/mac.c b/src/mac.c
index da6a61633dc..a11b097264c 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -49,6 +49,7 @@ Boston, MA 02111-1307, USA. */
49#include <Events.h> 49#include <Events.h>
50#include <Processes.h> 50#include <Processes.h>
51#include <EPPC.h> 51#include <EPPC.h>
52#include <MacLocales.h>
52#endif /* not HAVE_CARBON */ 53#endif /* not HAVE_CARBON */
53 54
54#include <utime.h> 55#include <utime.h>
@@ -67,6 +68,12 @@ Boston, MA 02111-1307, USA. */
67 68
68Lisp_Object QCLIPBOARD; 69Lisp_Object QCLIPBOARD;
69 70
71/* The system script code. */
72static int mac_system_script_code;
73
74/* The system locale identifier string. */
75static Lisp_Object Vmac_system_locale;
76
70/* An instance of the AppleScript component. */ 77/* An instance of the AppleScript component. */
71static ComponentInstance as_scripting_component; 78static ComponentInstance as_scripting_component;
72/* The single script context used for all script executions. */ 79/* The single script context used for all script executions. */
@@ -4167,6 +4174,29 @@ init_mac_osx_environment ()
4167} 4174}
4168#endif /* MAC_OSX */ 4175#endif /* MAC_OSX */
4169 4176
4177
4178static Lisp_Object
4179mac_get_system_locale ()
4180{
4181 OSErr err;
4182 LangCode lang;
4183 RegionCode region;
4184 LocaleRef locale;
4185 Str255 str;
4186
4187 lang = GetScriptVariable (smSystemScript, smScriptLang);
4188 region = GetScriptManagerVariable (smRegionCode);
4189 err = LocaleRefFromLangOrRegionCode (lang, region, &locale);
4190 if (err == noErr)
4191 err = LocaleRefGetPartString (locale, kLocaleAllPartsMask,
4192 sizeof (str), str);
4193 if (err == noErr)
4194 return build_string (str);
4195 else
4196 return Qnil;
4197}
4198
4199
4170void 4200void
4171syms_of_mac () 4201syms_of_mac ()
4172{ 4202{
@@ -4197,6 +4227,16 @@ syms_of_mac ()
4197 defsubr (&Sdo_applescript); 4227 defsubr (&Sdo_applescript);
4198 defsubr (&Smac_file_name_to_posix); 4228 defsubr (&Smac_file_name_to_posix);
4199 defsubr (&Sposix_file_name_to_mac); 4229 defsubr (&Sposix_file_name_to_mac);
4230
4231 DEFVAR_INT ("mac-system-script-code", &mac_system_script_code,
4232 doc: /* The system script code. */);
4233 mac_system_script_code = (ScriptCode) GetScriptManagerVariable (smSysScript);
4234
4235 DEFVAR_LISP ("mac-system-locale", &Vmac_system_locale,
4236 doc: /* The system locale identifier string.
4237This is not a POSIX locale ID, but an ICU locale ID. So encoding
4238information is not included. */);
4239 Vmac_system_locale = mac_get_system_locale ();
4200} 4240}
4201 4241
4202/* arch-tag: 29d30c1f-0c6b-4f88-8a6d-0558d7f9dbff 4242/* arch-tag: 29d30c1f-0c6b-4f88-8a6d-0558d7f9dbff