aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2006-02-10 08:21:47 +0000
committerYAMAMOTO Mitsuharu2006-02-10 08:21:47 +0000
commit7d53d6786c13720fd51ebd17507b218915371ef0 (patch)
tree64578308ed24f2de862ce3509dd825a57bbda454 /src
parent81f4f723c86e0647ba4e7fc77d2aa39c2333320e (diff)
downloademacs-7d53d6786c13720fd51ebd17507b218915371ef0.tar.gz
emacs-7d53d6786c13720fd51ebd17507b218915371ef0.zip
(x_set_mouse_color): Don't call rif->define_frame_cursor
if window_desc is not set yet. (Fx_create_frame): Remove variable x_frame_name. Apply 2005-12-07 and 2006-01-26 changes for xfns.c. Call x_iconify_frame if frame parameter `visibility' is `icon'. (Fx_create_frame, x_create_tip_frame): Use "fontset-standard" instead of "fontset-mac". (Fx_focus_frame): New defun. (syms_of_macfns): Defsubr it.
Diffstat (limited to 'src')
-rw-r--r--src/macfns.c77
1 files changed, 57 insertions, 20 deletions
diff --git a/src/macfns.c b/src/macfns.c
index 472d8d612b5..b6ef85bcd9f 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -1448,7 +1448,8 @@ x_set_mouse_color (f, arg, oldval)
1448 1448
1449 BLOCK_INPUT; 1449 BLOCK_INPUT;
1450 1450
1451 rif->define_frame_cursor (f, cursor); 1451 if (FRAME_MAC_WINDOW (f) != 0)
1452 rif->define_frame_cursor (f, cursor);
1452 1453
1453 f->output_data.mac->text_cursor = cursor; 1454 f->output_data.mac->text_cursor = cursor;
1454 f->output_data.mac->nontext_cursor = nontext_cursor; 1455 f->output_data.mac->nontext_cursor = nontext_cursor;
@@ -2398,11 +2399,12 @@ This function is an internal primitive--use `make-frame' instead. */)
2398 struct mac_display_info *dpyinfo = NULL; 2399 struct mac_display_info *dpyinfo = NULL;
2399 Lisp_Object parent; 2400 Lisp_Object parent;
2400 struct kboard *kb; 2401 struct kboard *kb;
2401 char x_frame_name[10];
2402 static int x_frame_count = 2; /* begins at 2 because terminal frame is F1 */ 2402 static int x_frame_count = 2; /* begins at 2 because terminal frame is F1 */
2403 2403
2404 check_mac (); 2404 check_mac ();
2405 2405
2406 parms = Fcopy_alist (parms);
2407
2406 /* Use this general default value to start with 2408 /* Use this general default value to start with
2407 until we know if this frame has a specified name. */ 2409 until we know if this frame has a specified name. */
2408 Vx_resource_name = Vinvocation_name; 2410 Vx_resource_name = Vinvocation_name;
@@ -2452,18 +2454,6 @@ This function is an internal primitive--use `make-frame' instead. */)
2452 else 2454 else
2453 f = make_frame (1); 2455 f = make_frame (1);
2454 2456
2455 if (EQ (name, Qunbound) || NILP (name))
2456 {
2457 sprintf (x_frame_name, "F%d", x_frame_count++);
2458 f->name = build_string (x_frame_name);
2459 f->explicit_name = 0;
2460 }
2461 else
2462 {
2463 f->name = name;
2464 f->explicit_name = 1;
2465 }
2466
2467 XSETFRAME (frame, f); 2457 XSETFRAME (frame, f);
2468 2458
2469 /* Note that X Windows does support scroll bars. */ 2459 /* Note that X Windows does support scroll bars. */
@@ -2544,7 +2534,7 @@ This function is an internal primitive--use `make-frame' instead. */)
2544 font = x_new_font (f, "-ETL-fixed-medium-r-*--*-160-*-*-*-*-iso8859-1"); 2534 font = x_new_font (f, "-ETL-fixed-medium-r-*--*-160-*-*-*-*-iso8859-1");
2545 /* If those didn't work, look for something which will at least work. */ 2535 /* If those didn't work, look for something which will at least work. */
2546 if (! STRINGP (font)) 2536 if (! STRINGP (font))
2547 font = x_new_fontset (f, "fontset-mac"); 2537 font = x_new_fontset (f, "fontset-standard");
2548 if (! STRINGP (font)) 2538 if (! STRINGP (font))
2549 font = x_new_font (f, "-*-monaco-*-12-*-mac-roman"); 2539 font = x_new_font (f, "-*-monaco-*-12-*-mac-roman");
2550 if (! STRINGP (font)) 2540 if (! STRINGP (font))
@@ -2679,17 +2669,28 @@ This function is an internal primitive--use `make-frame' instead. */)
2679 if (EQ (visibility, Qunbound)) 2669 if (EQ (visibility, Qunbound))
2680 visibility = Qt; 2670 visibility = Qt;
2681 2671
2682#if 0 /* MAC_TODO: really no iconify on Mac */
2683 if (EQ (visibility, Qicon)) 2672 if (EQ (visibility, Qicon))
2684 x_iconify_frame (f); 2673 x_iconify_frame (f);
2685 else 2674 else if (! NILP (visibility))
2686#endif
2687 if (! NILP (visibility))
2688 x_make_frame_visible (f); 2675 x_make_frame_visible (f);
2689 else 2676 else
2690 /* Must have been Qnil. */ 2677 /* Must have been Qnil. */
2691 ; 2678 ;
2692 } 2679 }
2680
2681 /* Initialize `default-minibuffer-frame' in case this is the first
2682 frame on this display device. */
2683 if (FRAME_HAS_MINIBUF_P (f)
2684 && (!FRAMEP (kb->Vdefault_minibuffer_frame)
2685 || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame))))
2686 kb->Vdefault_minibuffer_frame = frame;
2687
2688 /* All remaining specified parameters, which have not been "used"
2689 by x_get_arg and friends, now go in the misc. alist of the frame. */
2690 for (tem = parms; !NILP (tem); tem = XCDR (tem))
2691 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
2692 f->param_alist = Fcons (XCAR (tem), f->param_alist);
2693
2693 UNGCPRO; 2694 UNGCPRO;
2694 2695
2695 /* Make sure windows on this frame appear in calls to next-window 2696 /* Make sure windows on this frame appear in calls to next-window
@@ -2699,9 +2700,11 @@ This function is an internal primitive--use `make-frame' instead. */)
2699 return unbind_to (count, frame); 2700 return unbind_to (count, frame);
2700} 2701}
2701 2702
2703
2702/* FRAME is used only to get a handle on the X display. We don't pass the 2704/* FRAME is used only to get a handle on the X display. We don't pass the
2703 display info directly because we're called from frame.c, which doesn't 2705 display info directly because we're called from frame.c, which doesn't
2704 know about that structure. */ 2706 know about that structure. */
2707
2705Lisp_Object 2708Lisp_Object
2706x_get_focus_frame (frame) 2709x_get_focus_frame (frame)
2707 struct frame *frame; 2710 struct frame *frame;
@@ -2714,6 +2717,39 @@ x_get_focus_frame (frame)
2714 XSETFRAME (xfocus, dpyinfo->x_focus_frame); 2717 XSETFRAME (xfocus, dpyinfo->x_focus_frame);
2715 return xfocus; 2718 return xfocus;
2716} 2719}
2720
2721
2722DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
2723 doc: /* Set the input focus to FRAME.
2724FRAME nil means use the selected frame. */)
2725 (frame)
2726 Lisp_Object frame;
2727{
2728 struct frame *f = check_x_frame (frame);
2729 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
2730
2731 if (dpyinfo->x_focus_frame != f)
2732 {
2733 BLOCK_INPUT;
2734#ifdef MAC_OSX
2735 ActivateWindow (ActiveNonFloatingWindow (), false);
2736 ActivateWindow (FRAME_MAC_WINDOW (f), true);
2737#else
2738#if !TARGET_API_MAC_CARBON
2739 /* SelectWindow (Non-Carbon) does not issue deactivate events if
2740 the possibly inactive window that is to be selected is
2741 already the frontmost one. */
2742 SendBehind (FRAME_MAC_WINDOW (f), NULL);
2743#endif
2744 /* This brings the window to the front. */
2745 SelectWindow (FRAME_MAC_WINDOW (f));
2746#endif
2747 UNBLOCK_INPUT;
2748 }
2749
2750 return Qnil;
2751}
2752
2717 2753
2718DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, 2754DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
2719 doc: /* Internal function called by `color-defined-p', which see. */) 2755 doc: /* Internal function called by `color-defined-p', which see. */)
@@ -3664,7 +3700,7 @@ x_create_tip_frame (dpyinfo, parms, text)
3664 font = x_new_font (f, "-ETL-fixed-medium-r-*--*-160-*-*-*-*-iso8859-1"); 3700 font = x_new_font (f, "-ETL-fixed-medium-r-*--*-160-*-*-*-*-iso8859-1");
3665 /* If those didn't work, look for something which will at least work. */ 3701 /* If those didn't work, look for something which will at least work. */
3666 if (! STRINGP (font)) 3702 if (! STRINGP (font))
3667 font = x_new_fontset (f, "fontset-mac"); 3703 font = x_new_fontset (f, "fontset-standard");
3668 if (! STRINGP (font)) 3704 if (! STRINGP (font))
3669 font = x_new_font (f, "-*-monaco-*-12-*-mac-roman"); 3705 font = x_new_font (f, "-*-monaco-*-12-*-mac-roman");
3670 if (! STRINGP (font)) 3706 if (! STRINGP (font))
@@ -4513,6 +4549,7 @@ Chinese, Japanese, and Korean. */);
4513 defsubr (&Sx_close_connection); 4549 defsubr (&Sx_close_connection);
4514 defsubr (&Sx_display_list); 4550 defsubr (&Sx_display_list);
4515 defsubr (&Sx_synchronize); 4551 defsubr (&Sx_synchronize);
4552 defsubr (&Sx_focus_frame);
4516 4553
4517 /* Setting callback functions for fontset handler. */ 4554 /* Setting callback functions for fontset handler. */
4518 get_font_info_func = x_get_font_info; 4555 get_font_info_func = x_get_font_info;