Mercurial > hg > xemacs-beta
comparison src/frame.c @ 155:43dd3413c7c7 r20-3b4
Import from CVS: tag r20-3b4
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:39:39 +0200 |
parents | 25f70ba0133c |
children | 5a88923fcbfe |
comparison
equal
deleted
inserted
replaced
154:94141801dd7e | 155:43dd3413c7c7 |
---|---|
367 return foolist; | 367 return foolist; |
368 } | 368 } |
369 | 369 |
370 DEFUN ("make-frame", Fmake_frame, 0, 2, "", /* | 370 DEFUN ("make-frame", Fmake_frame, 0, 2, "", /* |
371 Create a new frame, displaying the current buffer. | 371 Create a new frame, displaying the current buffer. |
372 Runs the functions listed in `create-frame-hook' after frame creation. | |
372 | 373 |
373 Optional argument PROPS is a property list (a list of alternating | 374 Optional argument PROPS is a property list (a list of alternating |
374 keyword-value specifications) of properties for the new frame. | 375 keyword-value specifications) of properties for the new frame. |
375 \(An alist is accepted for backward compatibility but should not | 376 \(An alist is accepted for backward compatibility but should not |
376 be passed in.) | 377 be passed in.) |
454 if (!NILP (f->minibuffer_window)) | 455 if (!NILP (f->minibuffer_window)) |
455 reset_face_cachels (XWINDOW (f->minibuffer_window)); | 456 reset_face_cachels (XWINDOW (f->minibuffer_window)); |
456 reset_face_cachels (XWINDOW (f->root_window)); | 457 reset_face_cachels (XWINDOW (f->root_window)); |
457 } | 458 } |
458 | 459 |
460 /* If no frames on this device formerly existed, say this is the | |
461 first frame. It kind of assumes that frameless devices don't | |
462 exist, but it shouldn't be too harmful. */ | |
463 if (NILP (DEVICE_FRAME_LIST (d))) | |
464 first_frame_on_device = 1; | |
465 | |
459 /* This *must* go before the init_*() methods. Those functions | 466 /* This *must* go before the init_*() methods. Those functions |
460 call Lisp code, and if any of them causes a warning to be displayed | 467 call Lisp code, and if any of them causes a warning to be displayed |
461 and the *Warnings* buffer to be created, it won't get added to | 468 and the *Warnings* buffer to be created, it won't get added to |
462 the frame-specific version of the buffer-alist unless the frame | 469 the frame-specific version of the buffer-alist unless the frame |
463 is accessible from the device. */ | 470 is accessible from the device. */ |
502 | 509 |
503 /* Hallelujah, praise the lord. */ | 510 /* Hallelujah, praise the lord. */ |
504 f->init_finished = 1; | 511 f->init_finished = 1; |
505 | 512 |
506 /* If this is the first frame on the device, make it the selected one. */ | 513 /* If this is the first frame on the device, make it the selected one. */ |
507 if (NILP (DEVICE_SELECTED_FRAME (d))) | 514 if (first_frame_on_device && NILP (DEVICE_SELECTED_FRAME (d))) |
508 { | 515 set_device_selected_frame (d, frame); |
509 first_frame_on_device = 1; | |
510 set_device_selected_frame (d, frame); | |
511 } | |
512 | 516 |
513 /* If at startup or if the current console is a stream console | 517 /* If at startup or if the current console is a stream console |
514 (usually also at startup), make this console the selected one | 518 (usually also at startup), make this console the selected one |
515 so that messages show up on it. */ | 519 so that messages show up on it. */ |
516 if (NILP (Fselected_console ()) || | 520 if (NILP (Fselected_console ()) || |
635 | 639 |
636 | 640 |
637 /* Called from Fselect_window() */ | 641 /* Called from Fselect_window() */ |
638 void | 642 void |
639 select_frame_1 (Lisp_Object frame) | 643 select_frame_1 (Lisp_Object frame) |
640 { | |
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 { | 644 { |
660 struct frame *f = XFRAME (frame); | 645 struct frame *f = XFRAME (frame); |
661 Lisp_Object old_selected_frame = Fselected_frame (Qnil); | 646 Lisp_Object old_selected_frame = Fselected_frame (Qnil); |
662 | 647 |
663 if (EQ (frame, old_selected_frame)) | 648 if (EQ (frame, old_selected_frame)) |
983 next_frame_internal (Lisp_Object frame, Lisp_Object frametype, | 968 next_frame_internal (Lisp_Object frame, Lisp_Object frametype, |
984 Lisp_Object console, int called_from_delete_device) | 969 Lisp_Object console, int called_from_delete_device) |
985 { | 970 { |
986 int passed = 0; | 971 int passed = 0; |
987 int started_over = 0; | 972 int started_over = 0; |
988 Lisp_Object tmp_frametype; | |
989 | 973 |
990 /* If this frame is dead, it won't be in frame_list, and we'll loop | 974 /* If this frame is dead, it won't be in frame_list, and we'll loop |
991 forever. Forestall that. */ | 975 forever. Forestall that. */ |
992 CHECK_LIVE_FRAME (frame); | 976 CHECK_LIVE_FRAME (frame); |
993 | 977 |
1031 /* If we've looped all the way around without finding any | 1015 /* If we've looped all the way around without finding any |
1032 eligible frames, return the original frame. */ | 1016 eligible frames, return the original frame. */ |
1033 if (EQ (f, frame)) | 1017 if (EQ (f, frame)) |
1034 return f; | 1018 return f; |
1035 | 1019 |
1036 tmp_frametype = frametype; | 1020 if (frame_matches_frametype (f, 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)) | |
1048 return f; | 1021 return f; |
1049 } | 1022 } |
1050 | 1023 |
1051 if (EQ (frame, f)) | 1024 if (EQ (frame, f)) |
1052 passed++; | 1025 passed++; |
1072 Lisp_Object | 1045 Lisp_Object |
1073 prev_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) | 1046 prev_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) |
1074 { | 1047 { |
1075 Lisp_Object devcons, concons; | 1048 Lisp_Object devcons, concons; |
1076 Lisp_Object prev; | 1049 Lisp_Object prev; |
1077 Lisp_Object tmp_frametype; | |
1078 | 1050 |
1079 /* If this frame is dead, it won't be in frame_list, and we'll loop | 1051 /* If this frame is dead, it won't be in frame_list, and we'll loop |
1080 forever. Forestall that. */ | 1052 forever. Forestall that. */ |
1081 CHECK_LIVE_FRAME (frame); | 1053 CHECK_LIVE_FRAME (frame); |
1082 | 1054 |
1097 return prev; | 1069 return prev; |
1098 | 1070 |
1099 /* Decide whether this frame is eligible to be returned, | 1071 /* Decide whether this frame is eligible to be returned, |
1100 according to frametype. */ | 1072 according to frametype. */ |
1101 | 1073 |
1102 tmp_frametype = frametype; | 1074 if (frame_matches_frametype (f, 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)) | |
1113 prev = f; | 1075 prev = f; |
1114 | 1076 |
1115 } | 1077 } |
1116 } | 1078 } |
1117 | 1079 |