ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.365 by ayin, Thu Nov 15 10:13:37 2007 UTC vs.
Revision 1.380 by root, Fri Dec 14 02:33:03 2007 UTC

25 * - extensive modifications 25 * - extensive modifications
26 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> 26 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org>
27 * Copyright (c) 2001 Marius Gedminas 27 * Copyright (c) 2001 Marius Gedminas
28 * - Ctrl/Mod4+Tab works like Meta+Tab (options) 28 * - Ctrl/Mod4+Tab works like Meta+Tab (options)
29 * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> 29 * Copyright (c) 2003 Rob McMullen <robm@flipturn.org>
30 * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> 30 * Copyright (c) 2003-2007 Marc Lehmann <pcg@goof.com>
31 * 31 *
32 * This program is free software; you can redistribute it and/or modify 32 * This program is free software; you can redistribute it and/or modify
33 * it under the terms of the GNU General Public License as published by 33 * it under the terms of the GNU General Public License as published by
34 * the Free Software Foundation; either version 2 of the License, or 34 * the Free Software Foundation; either version 2 of the License, or
35 * (at your option) any later version. 35 * (at your option) any later version.
1048{ 1048{
1049 make_current (); 1049 make_current ();
1050 1050
1051 display->flush (); 1051 display->flush ();
1052 1052
1053 if (want_refresh && !flush_ev.active) 1053 if (want_refresh && !flush_ev.is_active ())
1054 flush_ev.start (1. / 60.); // refresh at max. 60 hz normally 1054 flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally
1055} 1055}
1056 1056
1057void 1057void
1058rxvt_term::flush_cb (ev::timer &w, int revents) 1058rxvt_term::flush_cb (ev::timer &w, int revents)
1059{ 1059{
1079 if (scr_refresh_rend (RS_Blink, RS_Blink)) 1079 if (scr_refresh_rend (RS_Blink, RS_Blink))
1080 { 1080 {
1081 hidden_text = !hidden_text; 1081 hidden_text = !hidden_text;
1082 want_refresh = 1; 1082 want_refresh = 1;
1083 } 1083 }
1084 else
1085 w.stop ();
1084} 1086}
1085#endif 1087#endif
1086 1088
1087#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1089#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
1088void 1090void
1089rxvt_term::cont_scroll_cb (ev::timer &w, int revents) 1091rxvt_term::cont_scroll_cb (ev::timer &w, int revents)
1090{ 1092{
1091 if ((scrollbar_isUp() || scrollbar_isDn()) && 1093 if ((scrollbar_isUp () || scrollbar_isDn ())
1092 scr_page (scrollbar_isUp() ? UP : DN, 1)) 1094 && scr_page (scrollbar_isUp () ? UP : DN, 1))
1093 want_refresh = 1; 1095 want_refresh = 1;
1094 else 1096 else
1095 w.stop (); 1097 w.stop ();
1096} 1098}
1097#endif 1099#endif
1112 1114
1113#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) 1115#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING)
1114void 1116void
1115rxvt_term::slip_wheel_cb (ev::timer &w, int revents) 1117rxvt_term::slip_wheel_cb (ev::timer &w, int revents)
1116{ 1118{
1117 if (mouse_slip_wheel_speed == 0 1119 if (scr_changeview (view_start - mouse_slip_wheel_speed))
1118 || mouse_slip_wheel_speed < 0 ? scr_page (DN, -mouse_slip_wheel_speed) 1120 want_refresh = 1;
1119 : scr_page (UP, mouse_slip_wheel_speed)) 1121
1122 if (view_start == top_row || view_start == 0 || mouse_slip_wheel_speed == 0)
1120 { 1123 {
1121 if (view_start == top_row || view_start == 0)
1122 mouse_slip_wheel_speed = 0; 1124 mouse_slip_wheel_speed = 0;
1123
1124 want_refresh = 1;
1125 }
1126 else
1127 w.stop (); 1125 w.stop ();
1126 }
1128} 1127}
1129#endif 1128#endif
1130 1129
1131#if LINUX_YIELD_HACK 1130#if LINUX_YIELD_HACK
1132static struct event_handler 1131static struct event_handler
1476 break; 1475 break;
1477 1476
1478 case MapNotify: 1477 case MapNotify:
1479 mapped = 1; 1478 mapped = 1;
1480#ifdef TEXT_BLINK 1479#ifdef TEXT_BLINK
1481 text_blink_ev.start (TEXT_BLINK_INTERVAL); 1480 text_blink_ev.start ();
1482#endif 1481#endif
1483 HOOK_INVOKE ((this, HOOK_MAP_NOTIFY, DT_XEVENT, &ev, DT_END)); 1482 HOOK_INVOKE ((this, HOOK_MAP_NOTIFY, DT_XEVENT, &ev, DT_END));
1484 break; 1483 break;
1485 1484
1486 case UnmapNotify: 1485 case UnmapNotify:
1577 int dist; 1576 int dist;
1578 1577
1579 /* don't clobber the current delay if we are 1578 /* don't clobber the current delay if we are
1580 * already in the middle of scrolling. 1579 * already in the middle of scrolling.
1581 */ 1580 */
1582 if (!sel_scroll_ev.active) 1581 if (!sel_scroll_ev.is_active ())
1583 sel_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 1582 sel_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
1584 1583
1585 /* save the event params so we can highlight 1584 /* save the event params so we can highlight
1586 * the selection in the pending-scroll loop 1585 * the selection in the pending-scroll loop
1587 */ 1586 */
1610 else 1609 else
1611 { 1610 {
1612 /* we are within the text window, so we 1611 /* we are within the text window, so we
1613 * shouldn't be scrolling 1612 * shouldn't be scrolling
1614 */ 1613 */
1615 if (sel_scroll_ev.active)
1616 sel_scroll_ev.stop(); 1614 sel_scroll_ev.stop();
1617 } 1615 }
1618#endif 1616#endif
1619#ifdef MOUSE_THRESHOLD 1617#ifdef MOUSE_THRESHOLD
1620 } 1618 }
1621#endif 1619#endif
1685 XSetICFocus (Input_Context); 1683 XSetICFocus (Input_Context);
1686 } 1684 }
1687#endif 1685#endif
1688#if CURSOR_BLINK 1686#if CURSOR_BLINK
1689 if (option (Opt_cursorBlink)) 1687 if (option (Opt_cursorBlink))
1690 cursor_blink_ev.start (CURSOR_BLINK_INTERVAL, CURSOR_BLINK_INTERVAL); 1688 cursor_blink_ev.again ();
1691#endif 1689#endif
1692#if OFF_FOCUS_FADING 1690#if OFF_FOCUS_FADING
1693 if (rs[Rs_fade]) 1691 if (rs[Rs_fade])
1694 { 1692 {
1695 pix_colors = pix_colors_focused; 1693 pix_colors = pix_colors_focused;
1850 mouse_report (ev); 1848 mouse_report (ev);
1851 } 1849 }
1852#else 1850#else
1853 MEvent.button = ev.button; 1851 MEvent.button = ev.button;
1854 mouse_report (ev); 1852 mouse_report (ev);
1855#endif /* MOUSE_REPORT_DOUBLECLICK */ 1853#endif /* MOUSE_REPORT_DOUBLECLICK */
1856 1854
1857 } 1855 }
1858 else 1856 else
1859 { 1857 {
1860 if (ev.button != MEvent.button) 1858 if (ev.button != MEvent.button)
1954 tt_printf ("\033[5~"); 1952 tt_printf ("\033[5~");
1955 break; 1953 break;
1956 } 1954 }
1957 } 1955 }
1958 else 1956 else
1959#endif /* NO_SCROLLBAR_REPORT */ 1957#endif /* NO_SCROLLBAR_REPORT */
1960 1958
1961 { 1959 {
1962 char upordown = 0; 1960 char upordown = 0;
1963 1961
1964 if (scrollBar.style == R_SB_NEXT) 1962 if (scrollBar.style == R_SB_NEXT)
1965 { 1963 {
1966 if (scrollbarnext_upButton (ev.y)) 1964 if (scrollbarnext_upButton (ev.y))
1967 upordown = -1; /* up */ 1965 upordown = -1; /* up */
1973 if (scrollbarrxvt_upButton (ev.y)) 1971 if (scrollbarrxvt_upButton (ev.y))
1974 upordown = -1; /* up */ 1972 upordown = -1; /* up */
1975 else if (scrollbarrxvt_dnButton (ev.y)) 1973 else if (scrollbarrxvt_dnButton (ev.y))
1976 upordown = 1; /* down */ 1974 upordown = 1; /* down */
1977 } 1975 }
1976
1978 if (upordown) 1977 if (upordown)
1979 { 1978 {
1980#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1979#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
1980 if (!cont_scroll_ev.is_active ())
1981 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 1981 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
1982#endif 1982#endif
1983 if (scr_page (upordown < 0 ? UP : DN, 1)) 1983 if (scr_page (upordown < 0 ? UP : DN, 1))
1984 { 1984 {
1985 if (upordown < 0) 1985 if (upordown < 0)
1986 scrollBar.setUp (); 1986 scrollBar.setUp ();
2066 scrollBar.setIdle (); 2066 scrollBar.setIdle ();
2067 scrollbar_show (0); 2067 scrollbar_show (0);
2068 } 2068 }
2069 2069
2070#ifdef SELECTION_SCROLLING 2070#ifdef SELECTION_SCROLLING
2071 if (sel_scroll_ev.active)
2072 sel_scroll_ev.stop(); 2071 sel_scroll_ev.stop();
2073#endif 2072#endif
2074 2073
2075 if (ev.window == vt) 2074 if (ev.window == vt)
2076 { 2075 {
2077 if (HOOK_INVOKE ((this, HOOK_BUTTON_RELEASE, DT_XEVENT, &ev, DT_END))) 2076 if (HOOK_INVOKE ((this, HOOK_BUTTON_RELEASE, DT_XEVENT, &ev, DT_END)))
2101 mouse_report (ev); 2100 mouse_report (ev);
2102 } 2101 }
2103#else /* MOUSE_REPORT_DOUBLECLICK */ 2102#else /* MOUSE_REPORT_DOUBLECLICK */
2104 MEvent.button = AnyButton; 2103 MEvent.button = AnyButton;
2105 mouse_report (ev); 2104 mouse_report (ev);
2106#endif /* MOUSE_REPORT_DOUBLECLICK */ 2105#endif /* MOUSE_REPORT_DOUBLECLICK */
2107 return; 2106 return;
2108 } 2107 }
2109 2108
2110 /* 2109 /*
2111 * dumb hack to compensate for the failure of click-and-drag 2110 * dumb hack to compensate for the failure of click-and-drag
2149 { 2148 {
2150 mouse_slip_wheel_speed += v ? -1 : 1; 2149 mouse_slip_wheel_speed += v ? -1 : 1;
2151 if (mouse_slip_wheel_speed < -nrow) mouse_slip_wheel_speed = -nrow; 2150 if (mouse_slip_wheel_speed < -nrow) mouse_slip_wheel_speed = -nrow;
2152 if (mouse_slip_wheel_speed > +nrow) mouse_slip_wheel_speed = +nrow; 2151 if (mouse_slip_wheel_speed > +nrow) mouse_slip_wheel_speed = +nrow;
2153 2152
2153 if (!slip_wheel_ev.is_active ())
2154 slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 2154 slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
2155 } 2155 }
2156 else 2156 else
2157 { 2157 {
2158# endif 2158# endif
2159 scr_page (v, i); 2159 scr_page (v, i);
2227 2227
2228 if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1) 2228 if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1)
2229 { 2229 {
2230 refresh_count = 0; 2230 refresh_count = 0;
2231 2231
2232 if (!option (Opt_skipScroll) || ev::ev_time () > ev::now () + 1. / 60.) 2232 if (!option (Opt_skipScroll) || ev_time () > ev::now () + 1. / 60.)
2233 { 2233 {
2234 refreshnow = true; 2234 refreshnow = true;
2235 ch = NOCHAR; 2235 ch = NOCHAR;
2236 break; 2236 break;
2237 } 2237 }
2448 } 2448 }
2449 } 2449 }
2450 2450
2451 pclose_printer (fd); 2451 pclose_printer (fd);
2452} 2452}
2453#endif /* PRINTPIPE */ 2453#endif /* PRINTPIPE */
2454/*}}} */ 2454/*}}} */
2455 2455
2456/* *INDENT-OFF* */ 2456/* *INDENT-OFF* */
2457enum { 2457enum {
2458 C1_40 = 0x40, 2458 C1_40 = 0x40,
2751 nargs = 0; 2751 nargs = 0;
2752 2752
2753 priv = 0; 2753 priv = 0;
2754 ch = cmd_getc (); 2754 ch = cmd_getc ();
2755 if (ch >= '<' && ch <= '?') 2755 if (ch >= '<' && ch <= '?')
2756 {
2756 { /* '<' '=' '>' '?' */ 2757 /* '<' '=' '>' '?' */
2757 priv = ch; 2758 priv = ch;
2758 ch = cmd_getc (); 2759 ch = cmd_getc ();
2759 } 2760 }
2760 2761
2761 /* read any numerical arguments */ 2762 /* read any numerical arguments */
3581 { 66, PrivMode_aplKP }, 3582 { 66, PrivMode_aplKP },
3582#ifndef NO_BACKSPACE_KEY 3583#ifndef NO_BACKSPACE_KEY
3583 { 67, PrivMode_BackSpace }, 3584 { 67, PrivMode_BackSpace },
3584#endif 3585#endif
3585 { 1000, PrivMode_MouseX11 }, 3586 { 1000, PrivMode_MouseX11 },
3586 // 1001 Use Hilite Mouse Tracking. NYI, TODO
3587 { 1002, PrivMode_MouseBtnEvent }, 3587 { 1002, PrivMode_MouseBtnEvent },
3588 { 1003, PrivMode_MouseAnyEvent }, 3588 { 1003, PrivMode_MouseAnyEvent },
3589 { 1010, PrivMode_TtyOutputInh }, // rxvt extension 3589 { 1010, PrivMode_TtyOutputInh }, // rxvt extension
3590 { 1011, PrivMode_Keypress }, // rxvt extension 3590 { 1011, PrivMode_Keypress }, // rxvt extension
3591 // 1035 enable modifiers for alt, numlock NYI 3591 // 1035 enable modifiers for alt, numlock NYI
3692 /* case 67: - backspace key */ 3692 /* case 67: - backspace key */
3693 case 1000: /* X11 mouse reporting */ 3693 case 1000: /* X11 mouse reporting */
3694 if (state) /* orthogonal */ 3694 if (state) /* orthogonal */
3695 priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); 3695 priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent);
3696 break; 3696 break;
3697#if 0
3698 case 1001:
3699 break; /* X11 mouse highlighting */
3700#endif
3701 case 1002: 3697 case 1002:
3702 case 1003: 3698 case 1003:
3703 if (state) 3699 if (state)
3704 { 3700 {
3705 priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseX11); 3701 priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseX11);
3894rxvt_term::process_graphics () 3890rxvt_term::process_graphics ()
3895{ 3891{
3896 unicode_t ch, cmd = cmd_getc (); 3892 unicode_t ch, cmd = cmd_getc ();
3897 3893
3898 if (cmd == 'Q') 3894 if (cmd == 'Q')
3895 {
3899 { /* query graphics */ 3896 /* query graphics */
3900 tt_printf ("\033G0\012"); /* no graphics */ 3897 tt_printf ("\033G0\012"); /* no graphics */
3901 return; 3898 return;
3902 } 3899 }
3903 /* swallow other graphics sequences until terminating ':' */ 3900 /* swallow other graphics sequences until terminating ':' */
3904 do 3901 do

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines