diff options
author | YAMAMOTO Mitsuharu <[email protected]> | 2006-05-07 08:05:02 +0000 |
---|---|---|
committer | YAMAMOTO Mitsuharu <[email protected]> | 2006-05-07 08:05:02 +0000 |
commit | 000447ac013c15d5127af86d523bd9cedb9c3de1 (patch) | |
tree | 6f06fb4294897e6e528da66944f791ea623e8663 /src | |
parent | bd13cae72f91c7301c609cd1d7c1a2aa237d3cdd (diff) |
(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.
Diffstat (limited to 'src')
-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 408600c56b..b9a71ca684 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -2013,6 +2013,22 @@ mac_update_title_bar (f, save_match_data) #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 @@ mac_window (f) #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 @@ mac_nav_event_callback (selector, parms, data) #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 @@ frame_parm_handler mac_frame_parm_handlers[] = 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 @@ Chinese, Japanese, and Korean. */); 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 @@ Chinese, Japanese, and Korean. */); #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 |