#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
+}
+
\f
/* Subroutines of creating a frame. */
#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);
}
#endif
\f
+/***********************************************************************
+ 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
+\f
/***********************************************************************
Initialization
***********************************************************************/
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, */
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;
#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
}