2294 |
|
|
2295 |
/* Create and set up the Mac window for frame F. */ |
/* Create and set up the Mac window for frame F. */ |
2296 |
|
|
|
extern OSErr install_window_handler (WindowPtr); |
|
|
|
|
2297 |
static void |
static void |
2298 |
mac_window (f) |
mac_window (f) |
2299 |
struct frame *f; |
struct frame *f; |
4354 |
options.actionButtonLabel = CFSTR ("Ok"); |
options.actionButtonLabel = CFSTR ("Ok"); |
4355 |
options.windowTitle = CFSTR ("Enter name"); |
options.windowTitle = CFSTR ("Enter name"); |
4356 |
|
|
4357 |
if (!NILP(default_filename)) |
if (STRINGP (default_filename)) |
4358 |
{ |
{ |
4359 |
Lisp_Object utf8 = ENCODE_UTF_8 (default_filename); |
Lisp_Object utf8 = ENCODE_UTF_8 (default_filename); |
4360 |
char *begPtr = SDATA(utf8); |
char *begPtr = SDATA(utf8); |
4379 |
} |
} |
4380 |
|
|
4381 |
/* Set the default location and continue*/ |
/* Set the default location and continue*/ |
4382 |
if (status == noErr) { |
if (status == noErr) |
4383 |
if (!NILP(dir)) { |
{ |
|
FSRef defLoc; |
|
4384 |
AEDesc defLocAed; |
AEDesc defLocAed; |
4385 |
|
#ifdef MAC_OSX |
4386 |
|
FSRef defLoc; |
4387 |
status = FSPathMakeRef(SDATA(ENCODE_FILE(dir)), &defLoc, NULL); |
status = FSPathMakeRef(SDATA(ENCODE_FILE(dir)), &defLoc, NULL); |
4388 |
|
#else |
4389 |
|
FSSpec defLoc; |
4390 |
|
status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (dir)), &defLoc); |
4391 |
|
#endif |
4392 |
if (status == noErr) |
if (status == noErr) |
4393 |
{ |
{ |
4394 |
|
#ifdef MAC_OSX |
4395 |
AECreateDesc(typeFSRef, &defLoc, sizeof(FSRef), &defLocAed); |
AECreateDesc(typeFSRef, &defLoc, sizeof(FSRef), &defLocAed); |
4396 |
|
#else |
4397 |
|
AECreateDesc(typeFSS, &defLoc, sizeof(FSSpec), &defLocAed); |
4398 |
|
#endif |
4399 |
NavCustomControl(dialogRef, kNavCtlSetLocation, (void*) &defLocAed); |
NavCustomControl(dialogRef, kNavCtlSetLocation, (void*) &defLocAed); |
4400 |
AEDisposeDesc(&defLocAed); |
AEDisposeDesc(&defLocAed); |
4401 |
} |
} |
4402 |
|
status = NavDialogRun(dialogRef); |
4403 |
} |
} |
4404 |
|
|
|
status = NavDialogRun(dialogRef); |
|
|
} |
|
|
|
|
4405 |
if (saveName) CFRelease(saveName); |
if (saveName) CFRelease(saveName); |
4406 |
if (message) CFRelease(message); |
if (message) CFRelease(message); |
4407 |
|
|
4418 |
{ |
{ |
4419 |
NavReplyRecord reply; |
NavReplyRecord reply; |
4420 |
AEDesc aed; |
AEDesc aed; |
4421 |
|
#ifdef MAC_OSX |
4422 |
FSRef fsRef; |
FSRef fsRef; |
4423 |
|
#else |
4424 |
|
FSSpec fs; |
4425 |
|
#endif |
4426 |
status = NavDialogGetReply(dialogRef, &reply); |
status = NavDialogGetReply(dialogRef, &reply); |
4427 |
|
|
4428 |
|
#ifdef MAC_OSX |
4429 |
AECoerceDesc(&reply.selection, typeFSRef, &aed); |
AECoerceDesc(&reply.selection, typeFSRef, &aed); |
4430 |
AEGetDescData(&aed, (void *) &fsRef, sizeof (FSRef)); |
AEGetDescData(&aed, (void *) &fsRef, sizeof (FSRef)); |
4431 |
FSRefMakePath(&fsRef, (UInt8 *) filename, sizeof (filename)); |
FSRefMakePath(&fsRef, (UInt8 *) filename, sizeof (filename)); |
4432 |
|
#else |
4433 |
|
AECoerceDesc (&reply.selection, typeFSS, &aed); |
4434 |
|
AEGetDescData (&aed, (void *) &fs, sizeof (FSSpec)); |
4435 |
|
fsspec_to_posix_pathname (&fs, filename, sizeof (filename) - 1); |
4436 |
|
#endif |
4437 |
AEDisposeDesc(&aed); |
AEDisposeDesc(&aed); |
4438 |
if (reply.saveFileName) |
if (reply.saveFileName) |
4439 |
{ |
{ |