Mercurial > emacs
comparison src/keyboard.c @ 16051:ccf489f8596e
Removed support for !MULTI_FRAME.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Sun, 01 Sep 1996 21:04:32 +0000 |
parents | 96edeb283515 |
children | b69d8517497a |
comparison
equal
deleted
inserted
replaced
16050:c2805a244171 | 16051:ccf489f8596e |
---|---|
291 int last_point_position; | 291 int last_point_position; |
292 | 292 |
293 /* The buffer that was current when the last command was started. */ | 293 /* The buffer that was current when the last command was started. */ |
294 Lisp_Object last_point_position_buffer; | 294 Lisp_Object last_point_position_buffer; |
295 | 295 |
296 #ifdef MULTI_FRAME | |
297 /* The frame in which the last input event occurred, or Qmacro if the | 296 /* The frame in which the last input event occurred, or Qmacro if the |
298 last event came from a macro. We use this to determine when to | 297 last event came from a macro. We use this to determine when to |
299 generate switch-frame events. This may be cleared by functions | 298 generate switch-frame events. This may be cleared by functions |
300 like Fselect_frame, to make sure that a switch-frame event is | 299 like Fselect_frame, to make sure that a switch-frame event is |
301 generated by the next character. */ | 300 generated by the next character. */ |
302 Lisp_Object internal_last_event_frame; | 301 Lisp_Object internal_last_event_frame; |
303 #endif | |
304 | 302 |
305 /* A user-visible version of the above, intended to allow users to | 303 /* A user-visible version of the above, intended to allow users to |
306 figure out where the last event came from, if the event doesn't | 304 figure out where the last event came from, if the event doesn't |
307 carry that information itself (i.e. if it was a character). */ | 305 carry that information itself (i.e. if it was a character). */ |
308 Lisp_Object Vlast_event_frame; | 306 Lisp_Object Vlast_event_frame; |
1152 alloca (0); /* Cause a garbage collection now */ | 1150 alloca (0); /* Cause a garbage collection now */ |
1153 /* Since we can free the most stuff here. */ | 1151 /* Since we can free the most stuff here. */ |
1154 #endif /* C_ALLOCA */ | 1152 #endif /* C_ALLOCA */ |
1155 | 1153 |
1156 #if 0 | 1154 #if 0 |
1157 #ifdef MULTI_FRAME | |
1158 /* Select the frame that the last event came from. Usually, | 1155 /* Select the frame that the last event came from. Usually, |
1159 switch-frame events will take care of this, but if some lisp | 1156 switch-frame events will take care of this, but if some lisp |
1160 code swallows a switch-frame event, we'll fix things up here. | 1157 code swallows a switch-frame event, we'll fix things up here. |
1161 Is this a good idea? */ | 1158 Is this a good idea? */ |
1162 if (FRAMEP (internal_last_event_frame) | 1159 if (FRAMEP (internal_last_event_frame) |
1163 && XFRAME (internal_last_event_frame) != selected_frame) | 1160 && XFRAME (internal_last_event_frame) != selected_frame) |
1164 Fselect_frame (internal_last_event_frame, Qnil); | 1161 Fselect_frame (internal_last_event_frame, Qnil); |
1165 #endif | |
1166 #endif | 1162 #endif |
1167 /* If it has changed current-menubar from previous value, | 1163 /* If it has changed current-menubar from previous value, |
1168 really recompute the menubar from the value. */ | 1164 really recompute the menubar from the value. */ |
1169 if (! NILP (Vlucid_menu_bar_dirty_flag) | 1165 if (! NILP (Vlucid_menu_bar_dirty_flag) |
1170 && !NILP (Ffboundp (Qrecompute_lucid_menubar))) | 1166 && !NILP (Ffboundp (Qrecompute_lucid_menubar))) |
1721 reset-this-command-lengths takes effect, forget about it. */ | 1717 reset-this-command-lengths takes effect, forget about it. */ |
1722 before_command_restore_flag = 0; | 1718 before_command_restore_flag = 0; |
1723 | 1719 |
1724 if (!NILP (Vexecuting_macro)) | 1720 if (!NILP (Vexecuting_macro)) |
1725 { | 1721 { |
1726 #ifdef MULTI_FRAME | |
1727 /* We set this to Qmacro; since that's not a frame, nobody will | 1722 /* We set this to Qmacro; since that's not a frame, nobody will |
1728 try to switch frames on us, and the selected window will | 1723 try to switch frames on us, and the selected window will |
1729 remain unchanged. | 1724 remain unchanged. |
1730 | 1725 |
1731 Since this event came from a macro, it would be misleading to | 1726 Since this event came from a macro, it would be misleading to |
1733 real event came from. Normally, a switch-frame event selects | 1728 real event came from. Normally, a switch-frame event selects |
1734 internal_last_event_frame after each command is read, but | 1729 internal_last_event_frame after each command is read, but |
1735 events read from a macro should never cause a new frame to be | 1730 events read from a macro should never cause a new frame to be |
1736 selected. */ | 1731 selected. */ |
1737 Vlast_event_frame = internal_last_event_frame = Qmacro; | 1732 Vlast_event_frame = internal_last_event_frame = Qmacro; |
1738 #endif | |
1739 | 1733 |
1740 /* Exit the macro if we are at the end. | 1734 /* Exit the macro if we are at the end. |
1741 Also, some things replace the macro with t | 1735 Also, some things replace the macro with t |
1742 to force an early exit. */ | 1736 to force an early exit. */ |
1743 if (EQ (Vexecuting_macro, Qt) | 1737 if (EQ (Vexecuting_macro, Qt) |
1808 it *must not* be in effect when we call redisplay. */ | 1802 it *must not* be in effect when we call redisplay. */ |
1809 | 1803 |
1810 if (_setjmp (local_getcjmp)) | 1804 if (_setjmp (local_getcjmp)) |
1811 { | 1805 { |
1812 XSETINT (c, quit_char); | 1806 XSETINT (c, quit_char); |
1813 #ifdef MULTI_FRAME | |
1814 XSETFRAME (internal_last_event_frame, selected_frame); | 1807 XSETFRAME (internal_last_event_frame, selected_frame); |
1815 Vlast_event_frame = internal_last_event_frame; | 1808 Vlast_event_frame = internal_last_event_frame; |
1816 #endif | |
1817 /* If we report the quit char as an event, | 1809 /* If we report the quit char as an event, |
1818 don't do so more than once. */ | 1810 don't do so more than once. */ |
1819 if (!NILP (Vinhibit_quit)) | 1811 if (!NILP (Vinhibit_quit)) |
1820 Vquit_flag = Qnil; | 1812 Vquit_flag = Qnil; |
1821 | 1813 |
1958 current_kboard->kbd_queue | 1950 current_kboard->kbd_queue |
1959 = XCONS (current_kboard->kbd_queue)->cdr; | 1951 = XCONS (current_kboard->kbd_queue)->cdr; |
1960 if (NILP (current_kboard->kbd_queue)) | 1952 if (NILP (current_kboard->kbd_queue)) |
1961 current_kboard->kbd_queue_has_data = 0; | 1953 current_kboard->kbd_queue_has_data = 0; |
1962 input_pending = readable_events (0); | 1954 input_pending = readable_events (0); |
1963 #ifdef MULTI_FRAME | |
1964 if (EVENT_HAS_PARAMETERS (c) | 1955 if (EVENT_HAS_PARAMETERS (c) |
1965 && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qswitch_frame)) | 1956 && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qswitch_frame)) |
1966 internal_last_event_frame = XCONS (XCONS (c)->cdr)->car; | 1957 internal_last_event_frame = XCONS (XCONS (c)->cdr)->car; |
1967 Vlast_event_frame = internal_last_event_frame; | 1958 Vlast_event_frame = internal_last_event_frame; |
1968 #endif | |
1969 } | 1959 } |
1970 } | 1960 } |
1971 | 1961 |
1972 #ifdef MULTI_KBOARD | 1962 #ifdef MULTI_KBOARD |
1973 /* If current_kboard's side queue is empty check the other kboards. | 1963 /* If current_kboard's side queue is empty check the other kboards. |
2473 } | 2463 } |
2474 return; | 2464 return; |
2475 } | 2465 } |
2476 #endif | 2466 #endif |
2477 | 2467 |
2478 #ifdef MULTI_FRAME | |
2479 /* If this results in a quit_char being returned to Emacs as | 2468 /* If this results in a quit_char being returned to Emacs as |
2480 input, set Vlast_event_frame properly. If this doesn't | 2469 input, set Vlast_event_frame properly. If this doesn't |
2481 get returned to Emacs as an event, the next event read | 2470 get returned to Emacs as an event, the next event read |
2482 will set Vlast_event_frame again, so this is safe to do. */ | 2471 will set Vlast_event_frame again, so this is safe to do. */ |
2483 { | 2472 { |
2487 if (NILP (focus)) | 2476 if (NILP (focus)) |
2488 focus = event->frame_or_window; | 2477 focus = event->frame_or_window; |
2489 internal_last_event_frame = focus; | 2478 internal_last_event_frame = focus; |
2490 Vlast_event_frame = focus; | 2479 Vlast_event_frame = focus; |
2491 } | 2480 } |
2492 #endif | |
2493 | 2481 |
2494 last_event_timestamp = event->timestamp; | 2482 last_event_timestamp = event->timestamp; |
2495 interrupt_signal (); | 2483 interrupt_signal (); |
2496 return; | 2484 return; |
2497 } | 2485 } |
2722 | 2710 |
2723 /* If this event is on a different frame, return a switch-frame this | 2711 /* If this event is on a different frame, return a switch-frame this |
2724 time, and leave the event in the queue for next time. */ | 2712 time, and leave the event in the queue for next time. */ |
2725 else | 2713 else |
2726 { | 2714 { |
2727 #ifdef MULTI_FRAME | |
2728 Lisp_Object frame; | 2715 Lisp_Object frame; |
2729 Lisp_Object focus; | 2716 Lisp_Object focus; |
2730 | 2717 |
2731 frame = event->frame_or_window; | 2718 frame = event->frame_or_window; |
2732 if (CONSP (frame)) | 2719 if (CONSP (frame)) |
2740 | 2727 |
2741 if (! EQ (frame, internal_last_event_frame) | 2728 if (! EQ (frame, internal_last_event_frame) |
2742 && XFRAME (frame) != selected_frame) | 2729 && XFRAME (frame) != selected_frame) |
2743 obj = make_lispy_switch_frame (frame); | 2730 obj = make_lispy_switch_frame (frame); |
2744 internal_last_event_frame = frame; | 2731 internal_last_event_frame = frame; |
2745 #endif /* MULTI_FRAME */ | |
2746 | 2732 |
2747 /* If we didn't decide to make a switch-frame event, go ahead | 2733 /* If we didn't decide to make a switch-frame event, go ahead |
2748 and build a real event from the queue entry. */ | 2734 and build a real event from the queue entry. */ |
2749 | 2735 |
2750 if (NILP (obj)) | 2736 if (NILP (obj)) |
2787 x = Qnil; | 2773 x = Qnil; |
2788 (*mouse_position_hook) (&f, 0, &bar_window, &part, &x, &y, &time); | 2774 (*mouse_position_hook) (&f, 0, &bar_window, &part, &x, &y, &time); |
2789 | 2775 |
2790 obj = Qnil; | 2776 obj = Qnil; |
2791 | 2777 |
2792 #ifdef MULTI_FRAME | |
2793 /* Decide if we should generate a switch-frame event. Don't | 2778 /* Decide if we should generate a switch-frame event. Don't |
2794 generate switch-frame events for motion outside of all Emacs | 2779 generate switch-frame events for motion outside of all Emacs |
2795 frames. */ | 2780 frames. */ |
2796 if (!NILP (x) && f) | 2781 if (!NILP (x) && f) |
2797 { | 2782 { |
2804 if (! EQ (frame, internal_last_event_frame) | 2789 if (! EQ (frame, internal_last_event_frame) |
2805 && XFRAME (frame) != selected_frame) | 2790 && XFRAME (frame) != selected_frame) |
2806 obj = make_lispy_switch_frame (frame); | 2791 obj = make_lispy_switch_frame (frame); |
2807 internal_last_event_frame = frame; | 2792 internal_last_event_frame = frame; |
2808 } | 2793 } |
2809 #endif | |
2810 | 2794 |
2811 /* If we didn't decide to make a switch-frame event, go ahead and | 2795 /* If we didn't decide to make a switch-frame event, go ahead and |
2812 return a mouse-motion event. */ | 2796 return a mouse-motion event. */ |
2813 if (!NILP (x) && NILP (obj)) | 2797 if (!NILP (x) && NILP (obj)) |
2814 obj = make_lispy_movement (f, bar_window, part, x, y, time); | 2798 obj = make_lispy_movement (f, bar_window, part, x, y, time); |
2819 something for us to read! */ | 2803 something for us to read! */ |
2820 abort (); | 2804 abort (); |
2821 | 2805 |
2822 input_pending = readable_events (0); | 2806 input_pending = readable_events (0); |
2823 | 2807 |
2824 #ifdef MULTI_FRAME | |
2825 Vlast_event_frame = internal_last_event_frame; | 2808 Vlast_event_frame = internal_last_event_frame; |
2826 #endif | |
2827 | 2809 |
2828 return (obj); | 2810 return (obj); |
2829 } | 2811 } |
2830 | 2812 |
2831 /* Process any events that are not user-visible, | 2813 /* Process any events that are not user-visible, |
3996 Lisp_Object bar_window; | 3978 Lisp_Object bar_window; |
3997 enum scroll_bar_part part; | 3979 enum scroll_bar_part part; |
3998 Lisp_Object x, y; | 3980 Lisp_Object x, y; |
3999 unsigned long time; | 3981 unsigned long time; |
4000 { | 3982 { |
4001 #ifdef MULTI_FRAME | |
4002 /* Is it a scroll bar movement? */ | 3983 /* Is it a scroll bar movement? */ |
4003 if (frame && ! NILP (bar_window)) | 3984 if (frame && ! NILP (bar_window)) |
4004 { | 3985 { |
4005 Lisp_Object part_sym; | 3986 Lisp_Object part_sym; |
4006 | 3987 |
4015 Qnil))); | 3996 Qnil))); |
4016 } | 3997 } |
4017 | 3998 |
4018 /* Or is it an ordinary mouse movement? */ | 3999 /* Or is it an ordinary mouse movement? */ |
4019 else | 4000 else |
4020 #endif /* MULTI_FRAME */ | |
4021 { | 4001 { |
4022 int area; | 4002 int area; |
4023 Lisp_Object window; | 4003 Lisp_Object window; |
4024 Lisp_Object posn; | 4004 Lisp_Object posn; |
4025 int column, row; | 4005 int column, row; |
4026 | 4006 |
4027 #ifdef MULTI_FRAME | |
4028 if (frame) | 4007 if (frame) |
4029 #else | |
4030 if (1) | |
4031 #endif | |
4032 { | 4008 { |
4033 /* It's in a frame; which window on that frame? */ | 4009 /* It's in a frame; which window on that frame? */ |
4034 pixel_to_glyph_coords (frame, XINT (x), XINT (y), &column, &row, | 4010 pixel_to_glyph_coords (frame, XINT (x), XINT (y), &column, &row, |
4035 NULL, 1); | 4011 NULL, 1); |
4036 window = window_from_coordinates (frame, column, row, &area); | 4012 window = window_from_coordinates (frame, column, row, &area); |
4053 posn = Qvertical_line; | 4029 posn = Qvertical_line; |
4054 else | 4030 else |
4055 XSETINT (posn, | 4031 XSETINT (posn, |
4056 buffer_posn_from_coords (XWINDOW (window), column, row)); | 4032 buffer_posn_from_coords (XWINDOW (window), column, row)); |
4057 } | 4033 } |
4058 #ifdef MULTI_FRAME | |
4059 else if (frame != 0) | 4034 else if (frame != 0) |
4060 { | 4035 { |
4061 XSETFRAME (window, frame); | 4036 XSETFRAME (window, frame); |
4062 posn = Qnil; | 4037 posn = Qnil; |
4063 } | 4038 } |
4064 #endif | |
4065 else | 4039 else |
4066 { | 4040 { |
4067 window = Qnil; | 4041 window = Qnil; |
4068 posn = Qnil; | 4042 posn = Qnil; |
4069 XSETFASTINT (x, 0); | 4043 XSETFASTINT (x, 0); |
4899 buf[i].modifiers = meta_modifier; | 4873 buf[i].modifiers = meta_modifier; |
4900 if (meta_key != 2) | 4874 if (meta_key != 2) |
4901 cbuf[i] &= ~0x80; | 4875 cbuf[i] &= ~0x80; |
4902 | 4876 |
4903 buf[i].code = cbuf[i]; | 4877 buf[i].code = cbuf[i]; |
4904 #ifdef MULTI_FRAME | |
4905 XSETFRAME (buf[i].frame_or_window, selected_frame); | 4878 XSETFRAME (buf[i].frame_or_window, selected_frame); |
4906 #else | |
4907 buf[i].frame_or_window = Qnil; | |
4908 #endif | |
4909 } | 4879 } |
4910 } | 4880 } |
4911 | 4881 |
4912 /* Scan the chars for C-g and store them in kbd_buffer. */ | 4882 /* Scan the chars for C-g and store them in kbd_buffer. */ |
4913 for (i = 0; i < nread; i++) | 4883 for (i = 0; i < nread; i++) |
7524 /* May be > 1 if in recursive minibuffer. */ | 7494 /* May be > 1 if in recursive minibuffer. */ |
7525 if (poll_suppress_count == 0) | 7495 if (poll_suppress_count == 0) |
7526 abort (); | 7496 abort (); |
7527 #endif | 7497 #endif |
7528 #endif | 7498 #endif |
7529 #ifdef MULTI_FRAME | |
7530 if (FRAMEP (internal_last_event_frame) | 7499 if (FRAMEP (internal_last_event_frame) |
7531 && XFRAME (internal_last_event_frame) != selected_frame) | 7500 && XFRAME (internal_last_event_frame) != selected_frame) |
7532 do_switch_frame (make_lispy_switch_frame (internal_last_event_frame), | 7501 do_switch_frame (make_lispy_switch_frame (internal_last_event_frame), |
7533 Qnil, 0); | 7502 Qnil, 0); |
7534 #endif | |
7535 | 7503 |
7536 _longjmp (getcjmp, 1); | 7504 _longjmp (getcjmp, 1); |
7537 } | 7505 } |
7538 | 7506 |
7539 DEFUN ("set-input-mode", Fset_input_mode, Sset_input_mode, 3, 4, 0, | 7507 DEFUN ("set-input-mode", Fset_input_mode, Sset_input_mode, 3, 4, 0, |
7706 #ifdef HAVE_MOUSE | 7674 #ifdef HAVE_MOUSE |
7707 do_mouse_tracking = Qnil; | 7675 do_mouse_tracking = Qnil; |
7708 #endif | 7676 #endif |
7709 input_pending = 0; | 7677 input_pending = 0; |
7710 | 7678 |
7711 #ifdef MULTI_FRAME | |
7712 /* This means that command_loop_1 won't try to select anything the first | 7679 /* This means that command_loop_1 won't try to select anything the first |
7713 time through. */ | 7680 time through. */ |
7714 internal_last_event_frame = Qnil; | 7681 internal_last_event_frame = Qnil; |
7715 Vlast_event_frame = internal_last_event_frame; | 7682 Vlast_event_frame = internal_last_event_frame; |
7716 #endif | |
7717 | 7683 |
7718 #ifdef MULTI_KBOARD | 7684 #ifdef MULTI_KBOARD |
7719 current_kboard = initial_kboard; | 7685 current_kboard = initial_kboard; |
7720 #endif | 7686 #endif |
7721 wipe_kboard (current_kboard); | 7687 wipe_kboard (current_kboard); |