265 |
#if TARGET_API_MAC_CARBON |
#if TARGET_API_MAC_CARBON |
266 |
static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata; |
static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata; |
267 |
static Lisp_Object Qarray, Qdictionary; |
static Lisp_Object Qarray, Qdictionary; |
|
#define DECODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 0) |
|
268 |
|
|
269 |
struct cfdict_context |
struct cfdict_context |
270 |
{ |
{ |
335 |
} |
} |
336 |
|
|
337 |
|
|
338 |
/* From CFString to a lisp string. Never returns a unibyte string |
/* From CFString to a lisp string. Returns a unibyte string |
339 |
(even if it only contains ASCII characters). |
containing a UTF-8 byte sequence. */ |
|
This may cause GC during code conversion. */ |
|
340 |
|
|
341 |
Lisp_Object |
Lisp_Object |
342 |
cfstring_to_lisp (string) |
cfstring_to_lisp_nodecode (string) |
343 |
CFStringRef string; |
CFStringRef string; |
344 |
{ |
{ |
345 |
Lisp_Object result = Qnil; |
Lisp_Object result = Qnil; |
360 |
} |
} |
361 |
} |
} |
362 |
|
|
363 |
|
return result; |
364 |
|
} |
365 |
|
|
366 |
|
|
367 |
|
/* From CFString to a lisp string. Never returns a unibyte string |
368 |
|
(even if it only contains ASCII characters). |
369 |
|
This may cause GC during code conversion. */ |
370 |
|
|
371 |
|
Lisp_Object |
372 |
|
cfstring_to_lisp (string) |
373 |
|
CFStringRef string; |
374 |
|
{ |
375 |
|
Lisp_Object result = cfstring_to_lisp_nodecode (string); |
376 |
|
|
377 |
if (!NILP (result)) |
if (!NILP (result)) |
378 |
{ |
{ |
379 |
result = DECODE_UTF_8 (result); |
result = code_convert_string_norecord (result, Qutf_8, 0); |
380 |
/* This may be superfluous. Just to make sure that the result |
/* This may be superfluous. Just to make sure that the result |
381 |
is a multibyte string. */ |
is a multibyte string. */ |
382 |
result = string_to_multibyte (result); |
result = string_to_multibyte (result); |
1153 |
CFSetGetValues (key_set, (const void **)keys); |
CFSetGetValues (key_set, (const void **)keys); |
1154 |
for (index = 0; index < count; index++) |
for (index = 0; index < count; index++) |
1155 |
{ |
{ |
1156 |
res_name = SDATA (cfstring_to_lisp (keys[index])); |
res_name = SDATA (cfstring_to_lisp_nodecode (keys[index])); |
1157 |
quarks = parse_resource_name (&res_name); |
quarks = parse_resource_name (&res_name); |
1158 |
if (!(NILP (quarks) || *res_name)) |
if (!(NILP (quarks) || *res_name)) |
1159 |
{ |
{ |