]> code.delx.au - gnu-emacs/commitdiff
(mac_set_font): New function.
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Sun, 7 May 2006 08:05:02 +0000 (08:05 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Sun, 7 May 2006 08:05:02 +0000 (08:05 +0000)
(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.

src/macfns.c

index 408600c56bbdec27762769ed70eb4c5ae4722125..b9a71ca6840e7dc48dfb54bc2a6052dea45931c7 100644 (file)
@@ -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
+}
+
 \f
 /* 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);
@@ -4468,6 +4486,43 @@ mac_nav_event_callback (selector, parms, data)
 }
 #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
  ***********************************************************************/
@@ -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;
@@ -4678,6 +4733,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
 }