Mercurial > emacs
comparison src/image.c @ 67785:9574f135f272
[MAC_OS] (find_image_fsspec): Use coercion of Apple event data for
translation from/to file names.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Sat, 24 Dec 2005 02:50:00 +0000 |
parents | 939281029286 |
children | 3bd95f4f2941 f67e432d150c 7beb78bc1f8e |
comparison
equal
deleted
inserted
replaced
67784:7c9d6a4a35c7 | 67785:9574f135f272 |
---|---|
2257 static OSErr | 2257 static OSErr |
2258 find_image_fsspec (specified_file, file, fss) | 2258 find_image_fsspec (specified_file, file, fss) |
2259 Lisp_Object specified_file, *file; | 2259 Lisp_Object specified_file, *file; |
2260 FSSpec *fss; | 2260 FSSpec *fss; |
2261 { | 2261 { |
2262 #if MAC_OSX | |
2263 FSRef fsr; | |
2264 #endif | |
2265 OSErr err; | 2262 OSErr err; |
2263 AEDesc desc; | |
2266 | 2264 |
2267 *file = x_find_image_file (specified_file); | 2265 *file = x_find_image_file (specified_file); |
2268 if (!STRINGP (*file)) | 2266 if (!STRINGP (*file)) |
2269 return fnfErr; /* file or directory not found; | 2267 return fnfErr; /* file or directory not found; |
2270 incomplete pathname */ | 2268 incomplete pathname */ |
2271 /* Try to open the image file. */ | 2269 /* Try to open the image file. */ |
2272 #if MAC_OSX | 2270 err = AECoercePtr (TYPE_FILE_NAME, SDATA (*file), |
2273 err = FSPathMakeRef (SDATA (*file), &fsr, NULL); | 2271 SBYTES (*file), typeFSS, &desc); |
2274 if (err == noErr) | 2272 if (err == noErr) |
2275 err = FSGetCatalogInfo (&fsr, kFSCatInfoNone, NULL, NULL, fss, NULL); | 2273 { |
2274 #if TARGET_API_MAC_CARBON | |
2275 err = AEGetDescData (&desc, fss, sizeof (FSSpec)); | |
2276 #else | 2276 #else |
2277 err = posix_pathname_to_fsspec (SDATA (*file), fss); | 2277 *fss = *(FSSpec *)(*(desc.dataHandle)); |
2278 #endif | 2278 #endif |
2279 AEDisposeDesc (&desc); | |
2280 } | |
2279 return err; | 2281 return err; |
2280 } | 2282 } |
2281 | 2283 |
2282 static int | 2284 static int |
2283 image_load_qt_1 (f, img, type, fss, dh) | 2285 image_load_qt_1 (f, img, type, fss, dh) |