diff options
Diffstat (limited to 'src/macfns.c')
| -rw-r--r-- | src/macfns.c | 67 |
1 files changed, 63 insertions, 4 deletions
diff --git a/src/macfns.c b/src/macfns.c index 2a83fef0870..bb2b8b540ff 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -2013,6 +2013,22 @@ mac_update_title_bar (f, save_match_data) | |||
| 2013 | #endif | 2013 | #endif |
| 2014 | } | 2014 | } |
| 2015 | 2015 | ||
| 2016 | static void | ||
| 2017 | mac_set_font (f, arg, oldval) | ||
| 2018 | struct frame *f; | ||
| 2019 | Lisp_Object arg, oldval; | ||
| 2020 | { | ||
| 2021 | x_set_font (f, arg, oldval); | ||
| 2022 | #if USE_MAC_FONT_PANEL | ||
| 2023 | if (FRAME_MAC_DISPLAY_INFO (f)->x_focus_frame == f) | ||
| 2024 | { | ||
| 2025 | BLOCK_INPUT; | ||
| 2026 | mac_set_font_info_for_selection (f); | ||
| 2027 | UNBLOCK_INPUT; | ||
| 2028 | } | ||
| 2029 | #endif | ||
| 2030 | } | ||
| 2031 | |||
| 2016 | 2032 | ||
| 2017 | /* Subroutines of creating a frame. */ | 2033 | /* Subroutines of creating a frame. */ |
| 2018 | 2034 | ||
| @@ -2213,8 +2229,10 @@ mac_window (f) | |||
| 2213 | #if TARGET_API_MAC_CARBON | 2229 | #if TARGET_API_MAC_CARBON |
| 2214 | CreateNewWindow (kDocumentWindowClass, | 2230 | CreateNewWindow (kDocumentWindowClass, |
| 2215 | kWindowStandardDocumentAttributes | 2231 | kWindowStandardDocumentAttributes |
| 2216 | /* | kWindowToolbarButtonAttribute */, | 2232 | #ifdef MAC_OSX |
| 2217 | &r, &FRAME_MAC_WINDOW (f)); | 2233 | | kWindowToolbarButtonAttribute |
| 2234 | #endif | ||
| 2235 | , &r, &FRAME_MAC_WINDOW (f)); | ||
| 2218 | if (FRAME_MAC_WINDOW (f)) | 2236 | if (FRAME_MAC_WINDOW (f)) |
| 2219 | { | 2237 | { |
| 2220 | SetWRefCon (FRAME_MAC_WINDOW (f), (long) f->output_data.mac); | 2238 | SetWRefCon (FRAME_MAC_WINDOW (f), (long) f->output_data.mac); |
| @@ -4469,6 +4487,43 @@ mac_nav_event_callback (selector, parms, data) | |||
| 4469 | #endif | 4487 | #endif |
| 4470 | 4488 | ||
| 4471 | /*********************************************************************** | 4489 | /*********************************************************************** |
| 4490 | Fonts | ||
| 4491 | ***********************************************************************/ | ||
| 4492 | |||
| 4493 | DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, | ||
| 4494 | Smac_clear_font_name_table, 0, 0, 0, | ||
| 4495 | doc: /* Clear the font name table. */) | ||
| 4496 | () | ||
| 4497 | { | ||
| 4498 | check_mac (); | ||
| 4499 | mac_clear_font_name_table (); | ||
| 4500 | return Qnil; | ||
| 4501 | } | ||
| 4502 | |||
| 4503 | #if USE_MAC_FONT_PANEL | ||
| 4504 | DEFUN ("mac-set-font-panel-visibility", Fmac_set_font_panel_visibility, | ||
| 4505 | Smac_set_font_panel_visibility, 1, 1, 0, | ||
| 4506 | doc: /* Set the font panel visibile if and only if VISIBLE is non-nil. | ||
| 4507 | This is for internal use only. Use `mac-font-panel-mode' instead. */) | ||
| 4508 | (visible) | ||
| 4509 | Lisp_Object visible; | ||
| 4510 | { | ||
| 4511 | OSStatus err = noErr; | ||
| 4512 | |||
| 4513 | check_mac (); | ||
| 4514 | |||
| 4515 | BLOCK_INPUT; | ||
| 4516 | if (NILP (visible) == (FPIsFontPanelVisible () == true)) | ||
| 4517 | err = FPShowHideFontPanel (); | ||
| 4518 | UNBLOCK_INPUT; | ||
| 4519 | |||
| 4520 | if (err != noErr) | ||
| 4521 | error ("Cannot change visibility of the font panel"); | ||
| 4522 | return Qnil; | ||
| 4523 | } | ||
| 4524 | #endif | ||
| 4525 | |||
| 4526 | /*********************************************************************** | ||
| 4472 | Initialization | 4527 | Initialization |
| 4473 | ***********************************************************************/ | 4528 | ***********************************************************************/ |
| 4474 | 4529 | ||
| @@ -4484,7 +4539,7 @@ frame_parm_handler mac_frame_parm_handlers[] = | |||
| 4484 | x_set_border_width, | 4539 | x_set_border_width, |
| 4485 | x_set_cursor_color, | 4540 | x_set_cursor_color, |
| 4486 | x_set_cursor_type, | 4541 | x_set_cursor_type, |
| 4487 | x_set_font, | 4542 | mac_set_font, |
| 4488 | x_set_foreground_color, | 4543 | x_set_foreground_color, |
| 4489 | x_set_icon_name, | 4544 | x_set_icon_name, |
| 4490 | 0, /* MAC_TODO: x_set_icon_type, */ | 4545 | 0, /* MAC_TODO: x_set_icon_type, */ |
| @@ -4660,7 +4715,7 @@ Chinese, Japanese, and Korean. */); | |||
| 4660 | load_font_func = x_load_font; | 4715 | load_font_func = x_load_font; |
| 4661 | find_ccl_program_func = x_find_ccl_program; | 4716 | find_ccl_program_func = x_find_ccl_program; |
| 4662 | query_font_func = x_query_font; | 4717 | query_font_func = x_query_font; |
| 4663 | set_frame_fontset_func = x_set_font; | 4718 | set_frame_fontset_func = mac_set_font; |
| 4664 | check_window_system_func = check_mac; | 4719 | check_window_system_func = check_mac; |
| 4665 | 4720 | ||
| 4666 | hourglass_atimer = NULL; | 4721 | hourglass_atimer = NULL; |
| @@ -4679,6 +4734,10 @@ Chinese, Japanese, and Korean. */); | |||
| 4679 | #if TARGET_API_MAC_CARBON | 4734 | #if TARGET_API_MAC_CARBON |
| 4680 | defsubr (&Sx_file_dialog); | 4735 | defsubr (&Sx_file_dialog); |
| 4681 | #endif | 4736 | #endif |
| 4737 | defsubr (&Smac_clear_font_name_table); | ||
| 4738 | #if USE_MAC_FONT_PANEL | ||
| 4739 | defsubr (&Smac_set_font_panel_visibility); | ||
| 4740 | #endif | ||
| 4682 | } | 4741 | } |
| 4683 | 4742 | ||
| 4684 | /* arch-tag: d7591289-f374-4377-b245-12f5dbbb8edc | 4743 | /* arch-tag: d7591289-f374-4377-b245-12f5dbbb8edc |