Mercurial > hg > xemacs-beta
comparison src/frame.c @ 149:538048ae2ab8 r20-3b1
Import from CVS: tag r20-3b1
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:36:16 +0200 |
parents | 2af401a6ecca |
children | 59463afc5666 |
comparison
equal
deleted
inserted
replaced
148:f659db2a1f73 | 149:538048ae2ab8 |
---|---|
637 /* Called from Fselect_window() */ | 637 /* Called from Fselect_window() */ |
638 void | 638 void |
639 select_frame_1 (Lisp_Object frame) | 639 select_frame_1 (Lisp_Object frame) |
640 { | 640 { |
641 struct frame *f = XFRAME (frame); | 641 struct frame *f = XFRAME (frame); |
642 | |
643 /* If on a TTY, selecting a frame must raise it. */ | |
644 #ifdef HAVE_TTY | |
645 if (FRAME_TTY_P (f)) | |
646 FRAMEMETH(f, raise_frame, (f)); /* tty_raise_frame will call | |
647 select_frame_2, so we can skip | |
648 it. */ | |
649 else | |
650 select_frame_2 (frame); | |
651 #else | |
652 select_frame_2 (frame); | |
653 #endif | |
654 } | |
655 | |
656 /* Called from tty_raise_frame. */ | |
657 void | |
658 select_frame_2 (Lisp_Object frame) | |
659 { | |
660 struct frame *f = XFRAME (frame); | |
642 Lisp_Object old_selected_frame = Fselected_frame (Qnil); | 661 Lisp_Object old_selected_frame = Fselected_frame (Qnil); |
643 | 662 |
644 if (EQ (frame, old_selected_frame)) | 663 if (EQ (frame, old_selected_frame)) |
645 return; | 664 return; |
646 | 665 |
647 /* now select the frame's device */ | 666 /* now select the frame's device */ |
648 set_device_selected_frame (XDEVICE (FRAME_DEVICE (f)), frame); | 667 set_device_selected_frame (XDEVICE (FRAME_DEVICE (f)), frame); |
709 return XFRAME (frame); | 728 return XFRAME (frame); |
710 } | 729 } |
711 | 730 |
712 #if 0 /* FSFmacs */ | 731 #if 0 /* FSFmacs */ |
713 | 732 |
714 xxDEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 2, "e" /* | 733 xxDEFUN ("handle-switch-frame", Fhandle_switch_frame, 1, 2, "e", /* |
715 Handle a switch-frame event EVENT. | 734 Handle a switch-frame event EVENT. |
716 Switch-frame events are usually bound to this function. | 735 Switch-frame events are usually bound to this function. |
717 A switch-frame event tells Emacs that the window manager has requested | 736 A switch-frame event tells Emacs that the window manager has requested |
718 that the user's events be directed to the frame mentioned in the event. | 737 that the user's events be directed to the frame mentioned in the event. |
719 This function selects the selected window of the frame of EVENT. | 738 This function selects the selected window of the frame of EVENT. |
720 | 739 |
721 If EVENT is frame object, handle it as if it were a switch-frame event | 740 If EVENT is frame object, handle it as if it were a switch-frame event |
722 to that frame. | 741 to that frame. |
723 */ ) | 742 */ |
724 (Lisp_Object frame, Lisp_Object no_enter) | 743 (frame, no_enter)) |
725 { | 744 { |
726 /* Preserve prefix arg that the command loop just cleared. */ | 745 /* Preserve prefix arg that the command loop just cleared. */ |
727 XCONSOLE (Vselected_console)->prefix_arg = Vcurrent_prefix_arg; | 746 XCONSOLE (Vselected_console)->prefix_arg = Vcurrent_prefix_arg; |
728 #if 0 /* unclean! */ | 747 #if 0 /* unclean! */ |
729 run_hook (Qmouse_leave_buffer_hook); | 748 run_hook (Qmouse_leave_buffer_hook); |
730 #endif | 749 #endif |
731 return do_switch_frame (frame, no_enter, 0); | 750 return do_switch_frame (frame, no_enter, 0); |
732 } | 751 } |
733 | 752 |
734 /* A load of garbage. */ | 753 /* A load of garbage. */ |
735 xxDEFUN ("ignore-event", Fignore_event, Signore_event, 0, 0, "" /* | 754 xxDEFUN ("ignore-event", Fignore_event, 0, 0, "", /* |
736 Do nothing, but preserve any prefix argument already specified. | 755 Do nothing, but preserve any prefix argument already specified. |
737 This is a suitable binding for iconify-frame and make-frame-visible. | 756 This is a suitable binding for iconify-frame and make-frame-visible. |
738 */ ) | 757 */ |
739 () | 758 ()) |
740 { | 759 { |
741 struct console *c = XCONSOLE (Vselected_console); | 760 struct console *c = XCONSOLE (Vselected_console); |
742 | 761 |
743 c->prefix_arg = Vcurrent_prefix_arg; | 762 c->prefix_arg = Vcurrent_prefix_arg; |
744 return Qnil; | 763 return Qnil; |
745 } | 764 } |
746 | 765 |
747 #endif | 766 #endif /* 0 */ |
748 | 767 |
749 DEFUN ("selected-frame", Fselected_frame, 0, 1, 0, /* | 768 DEFUN ("selected-frame", Fselected_frame, 0, 1, 0, /* |
750 Return the frame that is now selected on device DEVICE. | 769 Return the frame that is now selected on device DEVICE. |
751 If DEVICE is not specified, the selected device will be used. | 770 If DEVICE is not specified, the selected device will be used. |
752 If no frames exist on the device, nil is returned. | 771 If no frames exist on the device, nil is returned. |
964 next_frame_internal (Lisp_Object frame, Lisp_Object frametype, | 983 next_frame_internal (Lisp_Object frame, Lisp_Object frametype, |
965 Lisp_Object console, int called_from_delete_device) | 984 Lisp_Object console, int called_from_delete_device) |
966 { | 985 { |
967 int passed = 0; | 986 int passed = 0; |
968 int started_over = 0; | 987 int started_over = 0; |
988 Lisp_Object tmp_frametype; | |
969 | 989 |
970 /* If this frame is dead, it won't be in frame_list, and we'll loop | 990 /* If this frame is dead, it won't be in frame_list, and we'll loop |
971 forever. Forestall that. */ | 991 forever. Forestall that. */ |
972 CHECK_LIVE_FRAME (frame); | 992 CHECK_LIVE_FRAME (frame); |
973 | 993 |
1011 /* If we've looped all the way around without finding any | 1031 /* If we've looped all the way around without finding any |
1012 eligible frames, return the original frame. */ | 1032 eligible frames, return the original frame. */ |
1013 if (EQ (f, frame)) | 1033 if (EQ (f, frame)) |
1014 return f; | 1034 return f; |
1015 | 1035 |
1016 if (frame_matches_frametype (f, frametype)) | 1036 tmp_frametype = frametype; |
1037 if (FRAME_TTY_P (XFRAME (f))) | |
1038 { | |
1039 /* Only one TTY frame is visible at a time, but | |
1040 next-frame and similar should still find | |
1041 them. */ | |
1042 if (EQ (frametype, Qvisible) | |
1043 || EQ (frametype, Qvisible_nomini) | |
1044 || EQ (frametype, Qvisible_iconic_nomini)) | |
1045 tmp_frametype = Qnil; | |
1046 } | |
1047 if (frame_matches_frametype (f, tmp_frametype)) | |
1017 return f; | 1048 return f; |
1018 } | 1049 } |
1019 | 1050 |
1020 if (EQ (frame, f)) | 1051 if (EQ (frame, f)) |
1021 passed++; | 1052 passed++; |
1041 Lisp_Object | 1072 Lisp_Object |
1042 prev_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) | 1073 prev_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) |
1043 { | 1074 { |
1044 Lisp_Object devcons, concons; | 1075 Lisp_Object devcons, concons; |
1045 Lisp_Object prev; | 1076 Lisp_Object prev; |
1077 Lisp_Object tmp_frametype; | |
1046 | 1078 |
1047 /* If this frame is dead, it won't be in frame_list, and we'll loop | 1079 /* If this frame is dead, it won't be in frame_list, and we'll loop |
1048 forever. Forestall that. */ | 1080 forever. Forestall that. */ |
1049 CHECK_LIVE_FRAME (frame); | 1081 CHECK_LIVE_FRAME (frame); |
1050 | 1082 |
1065 return prev; | 1097 return prev; |
1066 | 1098 |
1067 /* Decide whether this frame is eligible to be returned, | 1099 /* Decide whether this frame is eligible to be returned, |
1068 according to frametype. */ | 1100 according to frametype. */ |
1069 | 1101 |
1070 if (frame_matches_frametype (f, frametype)) | 1102 tmp_frametype = frametype; |
1103 if (FRAME_TTY_P (XFRAME (f))) | |
1104 { | |
1105 /* Only one TTY frame is visible at a time, but | |
1106 next-frame and similar should still find them. */ | |
1107 if (EQ (frametype, Qvisible) | |
1108 || EQ (frametype, Qvisible_nomini) | |
1109 || EQ (frametype, Qvisible_iconic_nomini)) | |
1110 tmp_frametype = Qnil; | |
1111 } | |
1112 if (frame_matches_frametype (f, tmp_frametype)) | |
1071 prev = f; | 1113 prev = f; |
1072 | 1114 |
1073 } | 1115 } |
1074 } | 1116 } |
1075 | 1117 |
2592 is being "changed" to its existing size, and do nothing if so? */ | 2634 is being "changed" to its existing size, and do nothing if so? */ |
2593 if (in_display) | 2635 if (in_display) |
2594 abort (); | 2636 abort (); |
2595 | 2637 |
2596 XSETFRAME (frame, f); | 2638 XSETFRAME (frame, f); |
2639 | |
2640 /* | |
2641 * If the frame has been initialized and the new height and width | |
2642 * are the same as the current height and width, then just return. | |
2643 */ | |
2644 if (f->init_finished && | |
2645 newheight == FRAME_HEIGHT (f) && newwidth == FRAME_WIDTH (f)) | |
2646 return; | |
2647 | |
2597 default_face_height_and_width (frame, &font_height, &font_width); | 2648 default_face_height_and_width (frame, &font_height, &font_width); |
2598 | 2649 |
2599 /* This size-change overrides any pending one for this frame. */ | 2650 /* This size-change overrides any pending one for this frame. */ |
2600 FRAME_NEW_HEIGHT (f) = 0; | 2651 FRAME_NEW_HEIGHT (f) = 0; |
2601 FRAME_NEW_WIDTH (f) = 0; | 2652 FRAME_NEW_WIDTH (f) = 0; |
2940 /* */ | 2991 /* */ |
2941 Vframe_being_created = Qnil; | 2992 Vframe_being_created = Qnil; |
2942 staticpro (&Vframe_being_created); | 2993 staticpro (&Vframe_being_created); |
2943 | 2994 |
2944 #ifdef HAVE_CDE | 2995 #ifdef HAVE_CDE |
2945 Vfeatures = Fcons (intern ("cde"), Vfeatures); | 2996 Fprovide (intern ("cde")); |
2946 #endif | 2997 #endif |
2947 | 2998 |
2948 #if 0 /* FSFmacs stupidity */ | 2999 #if 0 /* FSFmacs stupidity */ |
2949 xxDEFVAR_LISP ("emacs-iconified", &Vemacs_iconified /* | 3000 xxDEFVAR_LISP ("emacs-iconified", &Vemacs_iconified /* |
2950 Non-nil if all of emacs is iconified and frame updates are not needed. | 3001 Non-nil if all of emacs is iconified and frame updates are not needed. |