49 |
#include <Events.h> |
#include <Events.h> |
50 |
#include <Processes.h> |
#include <Processes.h> |
51 |
#include <EPPC.h> |
#include <EPPC.h> |
52 |
|
#include <MacLocales.h> |
53 |
#endif /* not HAVE_CARBON */ |
#endif /* not HAVE_CARBON */ |
54 |
|
|
55 |
#include <utime.h> |
#include <utime.h> |
68 |
|
|
69 |
Lisp_Object QCLIPBOARD; |
Lisp_Object QCLIPBOARD; |
70 |
|
|
71 |
|
/* The system script code. */ |
72 |
|
static int mac_system_script_code; |
73 |
|
|
74 |
|
/* The system locale identifier string. */ |
75 |
|
static Lisp_Object Vmac_system_locale; |
76 |
|
|
77 |
/* An instance of the AppleScript component. */ |
/* An instance of the AppleScript component. */ |
78 |
static ComponentInstance as_scripting_component; |
static ComponentInstance as_scripting_component; |
79 |
/* The single script context used for all script executions. */ |
/* The single script context used for all script executions. */ |
4174 |
} |
} |
4175 |
#endif /* MAC_OSX */ |
#endif /* MAC_OSX */ |
4176 |
|
|
4177 |
|
|
4178 |
|
static Lisp_Object |
4179 |
|
mac_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 |
|
|
4200 |
void |
void |
4201 |
syms_of_mac () |
syms_of_mac () |
4202 |
{ |
{ |
4227 |
defsubr (&Sdo_applescript); |
defsubr (&Sdo_applescript); |
4228 |
defsubr (&Smac_file_name_to_posix); |
defsubr (&Smac_file_name_to_posix); |
4229 |
defsubr (&Sposix_file_name_to_mac); |
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. |
4237 |
|
This is not a POSIX locale ID, but an ICU locale ID. So encoding |
4238 |
|
information is not included. */); |
4239 |
|
Vmac_system_locale = mac_get_system_locale (); |
4240 |
} |
} |
4241 |
|
|
4242 |
/* arch-tag: 29d30c1f-0c6b-4f88-8a6d-0558d7f9dbff |
/* arch-tag: 29d30c1f-0c6b-4f88-8a6d-0558d7f9dbff |