Mercurial > emacs
changeset 70493:6c25fb5679a7
(mac_set_font): New function.
(mac_frame_parm_handlers, syms_of_macfns): Replace x_set_font with it.
(mac_window) [TARGET_API_MAC_CARBON && MAC_OSX]: Specify
kWindowToolbarButtonAttribute when creating window.
(Fmac_clear_font_name_table): Move from macfns.c.
(syms_of_macfns): Likewise for defsubr.
[USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): New defun.
(syms_of_macfns) [USE_MAC_FONT_PANEL]: Defsubr it.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Sun, 07 May 2006 08:05:02 +0000 |
parents | b4ed2d483432 |
children | 6d9fbe4cfce7 |
files | src/macfns.c |
diffstat | 1 files changed, 63 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/macfns.c Sun May 07 08:04:22 2006 +0000 +++ b/src/macfns.c Sun May 07 08:05:02 2006 +0000 @@ -2013,6 +2013,22 @@ #endif } +static void +mac_set_font (f, arg, oldval) + struct frame *f; + Lisp_Object arg, oldval; +{ + x_set_font (f, arg, oldval); +#if USE_MAC_FONT_PANEL + if (FRAME_MAC_DISPLAY_INFO (f)->x_focus_frame == f) + { + BLOCK_INPUT; + mac_set_font_info_for_selection (f); + UNBLOCK_INPUT; + } +#endif +} + /* Subroutines of creating a frame. */ @@ -2213,8 +2229,10 @@ #if TARGET_API_MAC_CARBON CreateNewWindow (kDocumentWindowClass, kWindowStandardDocumentAttributes - /* | kWindowToolbarButtonAttribute */, - &r, &FRAME_MAC_WINDOW (f)); +#ifdef MAC_OSX + | kWindowToolbarButtonAttribute +#endif + , &r, &FRAME_MAC_WINDOW (f)); if (FRAME_MAC_WINDOW (f)) { SetWRefCon (FRAME_MAC_WINDOW (f), (long) f->output_data.mac); @@ -4469,6 +4487,43 @@ #endif /*********************************************************************** + Fonts + ***********************************************************************/ + +DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, + Smac_clear_font_name_table, 0, 0, 0, + doc: /* Clear the font name table. */) + () +{ + check_mac (); + mac_clear_font_name_table (); + return Qnil; +} + +#if USE_MAC_FONT_PANEL +DEFUN ("mac-set-font-panel-visibility", Fmac_set_font_panel_visibility, + Smac_set_font_panel_visibility, 1, 1, 0, + doc: /* Set the font panel visibile if and only if VISIBLE is non-nil. +This is for internal use only. Use `mac-font-panel-mode' instead. */) + (visible) + Lisp_Object visible; +{ + OSStatus err = noErr; + + check_mac (); + + BLOCK_INPUT; + if (NILP (visible) == (FPIsFontPanelVisible () == true)) + err = FPShowHideFontPanel (); + UNBLOCK_INPUT; + + if (err != noErr) + error ("Cannot change visibility of the font panel"); + return Qnil; +} +#endif + +/*********************************************************************** Initialization ***********************************************************************/ @@ -4484,7 +4539,7 @@ x_set_border_width, x_set_cursor_color, x_set_cursor_type, - x_set_font, + mac_set_font, x_set_foreground_color, x_set_icon_name, 0, /* MAC_TODO: x_set_icon_type, */ @@ -4660,7 +4715,7 @@ load_font_func = x_load_font; find_ccl_program_func = x_find_ccl_program; query_font_func = x_query_font; - set_frame_fontset_func = x_set_font; + set_frame_fontset_func = mac_set_font; check_window_system_func = check_mac; hourglass_atimer = NULL; @@ -4679,6 +4734,10 @@ #if TARGET_API_MAC_CARBON defsubr (&Sx_file_dialog); #endif + defsubr (&Smac_clear_font_name_table); +#if USE_MAC_FONT_PANEL + defsubr (&Smac_set_font_panel_visibility); +#endif } /* arch-tag: d7591289-f374-4377-b245-12f5dbbb8edc