Mercurial > emacs
comparison src/macfns.c @ 90054:f2ebccfa87d4
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-74
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-709
Update from CVS: src/indent.c (Fvertical_motion): Fix last change.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-710
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-715
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-74
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 08 Dec 2004 05:02:30 +0000 |
parents | e24e2e78deda 4ad0594e1ac4 |
children | 95879cc1ed20 |
comparison
equal
deleted
inserted
replaced
90053:fff5f1a61d92 | 90054:f2ebccfa87d4 |
---|---|
1930 BLOCK_INPUT; | 1930 BLOCK_INPUT; |
1931 | 1931 |
1932 { | 1932 { |
1933 #if TARGET_API_MAC_CARBON | 1933 #if TARGET_API_MAC_CARBON |
1934 CFStringRef windowTitle = | 1934 CFStringRef windowTitle = |
1935 CFStringCreateWithCString (NULL, SDATA (name), | 1935 cfstring_create_with_utf8_cstring (SDATA (name)); |
1936 kCFStringEncodingUTF8); | |
1937 | 1936 |
1938 SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); | 1937 SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); |
1939 CFRelease (windowTitle); | 1938 CFRelease (windowTitle); |
1940 #else | 1939 #else |
1941 Str255 windowTitle; | 1940 Str255 windowTitle; |
2013 BLOCK_INPUT; | 2012 BLOCK_INPUT; |
2014 | 2013 |
2015 { | 2014 { |
2016 #if TARGET_API_MAC_CARBON | 2015 #if TARGET_API_MAC_CARBON |
2017 CFStringRef windowTitle = | 2016 CFStringRef windowTitle = |
2018 CFStringCreateWithCString (NULL, SDATA (name), | 2017 cfstring_create_with_utf8_cstring (SDATA (name)); |
2019 kCFStringEncodingUTF8); | |
2020 | 2018 |
2021 SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); | 2019 SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); |
2022 CFRelease (windowTitle); | 2020 CFRelease (windowTitle); |
2023 #else | 2021 #else |
2024 Str255 windowTitle; | 2022 Str255 windowTitle; |
4244 OSStatus status; | 4242 OSStatus status; |
4245 NavDialogCreationOptions options; | 4243 NavDialogCreationOptions options; |
4246 NavDialogRef dialogRef; | 4244 NavDialogRef dialogRef; |
4247 NavTypeListHandle fileTypes = NULL; | 4245 NavTypeListHandle fileTypes = NULL; |
4248 NavUserAction userAction; | 4246 NavUserAction userAction; |
4249 CFStringRef message=NULL, client=NULL, saveName = NULL, ok = NULL; | 4247 CFStringRef message=NULL, saveName = NULL; |
4250 CFStringRef title = NULL; | |
4251 | 4248 |
4252 BLOCK_INPUT; | 4249 BLOCK_INPUT; |
4253 /* No need for a callback function because we are modal */ | 4250 /* No need for a callback function because we are modal */ |
4254 NavGetDefaultDialogCreationOptions(&options); | 4251 NavGetDefaultDialogCreationOptions(&options); |
4255 options.modality = kWindowModalityAppModal; | 4252 options.modality = kWindowModalityAppModal; |
4257 options.optionFlags = kNavDefaultNavDlogOptions; | 4254 options.optionFlags = kNavDefaultNavDlogOptions; |
4258 options.optionFlags |= kNavAllFilesInPopup; /* All files allowed */ | 4255 options.optionFlags |= kNavAllFilesInPopup; /* All files allowed */ |
4259 options.optionFlags |= kNavSelectAllReadableItem; | 4256 options.optionFlags |= kNavSelectAllReadableItem; |
4260 if (!NILP(prompt)) | 4257 if (!NILP(prompt)) |
4261 { | 4258 { |
4262 message = CFStringCreateWithCStringNoCopy(NULL, SDATA(prompt), | 4259 message = cfstring_create_with_utf8_cstring (SDATA (prompt)); |
4263 kCFStringEncodingUTF8, | |
4264 kCFAllocatorNull); | |
4265 options.message = message; | 4260 options.message = message; |
4266 } | 4261 } |
4267 /* Don't set the application, let it use default. | 4262 /* Don't set the application, let it use default. |
4268 client = CFStringCreateWithCStringNoCopy(NULL, "Emacs", | 4263 options.clientName = CFSTR ("Emacs"); |
4269 kCFStringEncodingMacRoman, NULL); | |
4270 options.clientName = client; | |
4271 */ | 4264 */ |
4272 | 4265 |
4273 if (!NILP (only_dir_p)) | 4266 if (!NILP (only_dir_p)) |
4274 status = NavCreateChooseFolderDialog(&options, NULL, NULL, NULL, | 4267 status = NavCreateChooseFolderDialog(&options, NULL, NULL, NULL, |
4275 &dialogRef); | 4268 &dialogRef); |
4276 else if (NILP (mustmatch)) | 4269 else if (NILP (mustmatch)) |
4277 { | 4270 { |
4278 /* This is a save dialog */ | 4271 /* This is a save dialog */ |
4279 ok = CFStringCreateWithCString (NULL, "Ok", kCFStringEncodingUTF8); | |
4280 title = CFStringCreateWithCString (NULL, "Enter name", | |
4281 kCFStringEncodingUTF8); | |
4282 options.optionFlags |= kNavDontConfirmReplacement; | 4272 options.optionFlags |= kNavDontConfirmReplacement; |
4283 options.actionButtonLabel = ok; | 4273 options.actionButtonLabel = CFSTR ("Ok"); |
4284 options.windowTitle = title; | 4274 options.windowTitle = CFSTR ("Enter name"); |
4285 | 4275 |
4286 if (!NILP(default_filename)) | 4276 if (!NILP(default_filename)) |
4287 { | 4277 { |
4288 saveName = CFStringCreateWithCString(NULL, SDATA(default_filename), | 4278 saveName = |
4289 kCFStringEncodingUTF8); | 4279 cfstring_create_with_utf8_cstring (SDATA (default_filename)); |
4290 options.saveFileName = saveName; | 4280 options.saveFileName = saveName; |
4291 options.optionFlags |= kNavSelectDefaultLocation; | 4281 options.optionFlags |= kNavSelectDefaultLocation; |
4292 } | 4282 } |
4293 status = NavCreatePutFileDialog(&options, | 4283 status = NavCreatePutFileDialog(&options, |
4294 'TEXT', kNavGenericSignature, | 4284 'TEXT', kNavGenericSignature, |
4318 | 4308 |
4319 status = NavDialogRun(dialogRef); | 4309 status = NavDialogRun(dialogRef); |
4320 } | 4310 } |
4321 | 4311 |
4322 if (saveName) CFRelease(saveName); | 4312 if (saveName) CFRelease(saveName); |
4323 if (client) CFRelease(client); | |
4324 if (message) CFRelease(message); | 4313 if (message) CFRelease(message); |
4325 if (ok) CFRelease(ok); | |
4326 if (title) CFRelease(title); | |
4327 | 4314 |
4328 if (status == noErr) { | 4315 if (status == noErr) { |
4329 userAction = NavDialogGetUserAction(dialogRef); | 4316 userAction = NavDialogGetUserAction(dialogRef); |
4330 switch (userAction) | 4317 switch (userAction) |
4331 { | 4318 { |
4413 x_set_tool_bar_lines, | 4400 x_set_tool_bar_lines, |
4414 0, /* MAC_TODO: x_set_scroll_bar_foreground, */ | 4401 0, /* MAC_TODO: x_set_scroll_bar_foreground, */ |
4415 0, /* MAC_TODO: x_set_scroll_bar_background, */ | 4402 0, /* MAC_TODO: x_set_scroll_bar_background, */ |
4416 x_set_screen_gamma, | 4403 x_set_screen_gamma, |
4417 x_set_line_spacing, | 4404 x_set_line_spacing, |
4418 0, /* MAC_TODO: x_set_fringe_width, */ | 4405 x_set_fringe_width, |
4419 0, /* MAC_TODO: x_set_fringe_width, */ | 4406 x_set_fringe_width, |
4420 0, /* x_set_wait_for_wm, */ | 4407 0, /* x_set_wait_for_wm, */ |
4421 0, /* MAC_TODO: x_set_fullscreen, */ | 4408 0, /* MAC_TODO: x_set_fullscreen, */ |
4422 }; | 4409 }; |
4423 | 4410 |
4424 void | 4411 void |