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.364 by ayin, Mon Nov 12 14:53:13 2007 UTC vs.
Revision 1.377 by root, Fri Dec 14 02:22:24 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
1251 int x, y; 1253 int x, y;
1252 int code = 32; 1254 int code = 32;
1253 1255
1254 x = Pixel2Col (ev.x); 1256 x = Pixel2Col (ev.x);
1255 y = Pixel2Row (ev.y); 1257 y = Pixel2Row (ev.y);
1256 if (ev.type == MotionNotify) { 1258 if (ev.type == MotionNotify)
1259 {
1257 if (x == mouse_row && y == mouse_col) 1260 if (x == mouse_row && y == mouse_col)
1258 return; 1261 return;
1259 mouse_row = x; 1262 mouse_row = x;
1260 mouse_col = y; 1263 mouse_col = y;
1261 code += 32; 1264 code += 32;
1262 } 1265 }
1263 1266
1264 if (MEvent.button == AnyButton) 1267 if (MEvent.button == AnyButton)
1265 button_number = 3; 1268 button_number = 3;
1266 else 1269 else
1267 { 1270 {
1475 break; 1478 break;
1476 1479
1477 case MapNotify: 1480 case MapNotify:
1478 mapped = 1; 1481 mapped = 1;
1479#ifdef TEXT_BLINK 1482#ifdef TEXT_BLINK
1480 text_blink_ev.start (TEXT_BLINK_INTERVAL); 1483 text_blink_ev.start ();
1481#endif 1484#endif
1482 HOOK_INVOKE ((this, HOOK_MAP_NOTIFY, DT_XEVENT, &ev, DT_END)); 1485 HOOK_INVOKE ((this, HOOK_MAP_NOTIFY, DT_XEVENT, &ev, DT_END));
1483 break; 1486 break;
1484 1487
1485 case UnmapNotify: 1488 case UnmapNotify:
1576 int dist; 1579 int dist;
1577 1580
1578 /* don't clobber the current delay if we are 1581 /* don't clobber the current delay if we are
1579 * already in the middle of scrolling. 1582 * already in the middle of scrolling.
1580 */ 1583 */
1581 if (!sel_scroll_ev.active) 1584 if (!sel_scroll_ev.is_active ())
1582 sel_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 1585 sel_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
1583 1586
1584 /* save the event params so we can highlight 1587 /* save the event params so we can highlight
1585 * the selection in the pending-scroll loop 1588 * the selection in the pending-scroll loop
1586 */ 1589 */
1609 else 1612 else
1610 { 1613 {
1611 /* we are within the text window, so we 1614 /* we are within the text window, so we
1612 * shouldn't be scrolling 1615 * shouldn't be scrolling
1613 */ 1616 */
1614 if (sel_scroll_ev.active)
1615 sel_scroll_ev.stop(); 1617 sel_scroll_ev.stop();
1616 } 1618 }
1617#endif 1619#endif
1618#ifdef MOUSE_THRESHOLD 1620#ifdef MOUSE_THRESHOLD
1619 } 1621 }
1620#endif 1622#endif
1684 XSetICFocus (Input_Context); 1686 XSetICFocus (Input_Context);
1685 } 1687 }
1686#endif 1688#endif
1687#if CURSOR_BLINK 1689#if CURSOR_BLINK
1688 if (option (Opt_cursorBlink)) 1690 if (option (Opt_cursorBlink))
1689 cursor_blink_ev.start (CURSOR_BLINK_INTERVAL, CURSOR_BLINK_INTERVAL); 1691 cursor_blink_ev.again ();
1690#endif 1692#endif
1691#if OFF_FOCUS_FADING 1693#if OFF_FOCUS_FADING
1692 if (rs[Rs_fade]) 1694 if (rs[Rs_fade])
1693 { 1695 {
1694 pix_colors = pix_colors_focused; 1696 pix_colors = pix_colors_focused;
1849 mouse_report (ev); 1851 mouse_report (ev);
1850 } 1852 }
1851#else 1853#else
1852 MEvent.button = ev.button; 1854 MEvent.button = ev.button;
1853 mouse_report (ev); 1855 mouse_report (ev);
1854#endif /* MOUSE_REPORT_DOUBLECLICK */ 1856#endif /* MOUSE_REPORT_DOUBLECLICK */
1855 1857
1856 } 1858 }
1857 else 1859 else
1858 { 1860 {
1859 if (ev.button != MEvent.button) 1861 if (ev.button != MEvent.button)
1953 tt_printf ("\033[5~"); 1955 tt_printf ("\033[5~");
1954 break; 1956 break;
1955 } 1957 }
1956 } 1958 }
1957 else 1959 else
1958#endif /* NO_SCROLLBAR_REPORT */ 1960#endif /* NO_SCROLLBAR_REPORT */
1959 1961
1960 { 1962 {
1961 char upordown = 0; 1963 char upordown = 0;
1962 1964
1963 if (scrollBar.style == R_SB_NEXT) 1965 if (scrollBar.style == R_SB_NEXT)
1964 { 1966 {
1965 if (scrollbarnext_upButton (ev.y)) 1967 if (scrollbarnext_upButton (ev.y))
1966 upordown = -1; /* up */ 1968 upordown = -1; /* up */
1972 if (scrollbarrxvt_upButton (ev.y)) 1974 if (scrollbarrxvt_upButton (ev.y))
1973 upordown = -1; /* up */ 1975 upordown = -1; /* up */
1974 else if (scrollbarrxvt_dnButton (ev.y)) 1976 else if (scrollbarrxvt_dnButton (ev.y))
1975 upordown = 1; /* down */ 1977 upordown = 1; /* down */
1976 } 1978 }
1979
1977 if (upordown) 1980 if (upordown)
1978 { 1981 {
1979#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1982#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
1983 if (!cont_scroll_ev.is_active ())
1980 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 1984 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
1981#endif 1985#endif
1982 if (scr_page (upordown < 0 ? UP : DN, 1)) 1986 if (scr_page (upordown < 0 ? UP : DN, 1))
1983 { 1987 {
1984 if (upordown < 0) 1988 if (upordown < 0)
1985 scrollBar.setUp (); 1989 scrollBar.setUp ();
2065 scrollBar.setIdle (); 2069 scrollBar.setIdle ();
2066 scrollbar_show (0); 2070 scrollbar_show (0);
2067 } 2071 }
2068 2072
2069#ifdef SELECTION_SCROLLING 2073#ifdef SELECTION_SCROLLING
2070 if (sel_scroll_ev.active)
2071 sel_scroll_ev.stop(); 2074 sel_scroll_ev.stop();
2072#endif 2075#endif
2073 2076
2074 if (ev.window == vt) 2077 if (ev.window == vt)
2075 { 2078 {
2076 if (HOOK_INVOKE ((this, HOOK_BUTTON_RELEASE, DT_XEVENT, &ev, DT_END))) 2079 if (HOOK_INVOKE ((this, HOOK_BUTTON_RELEASE, DT_XEVENT, &ev, DT_END)))
2100 mouse_report (ev); 2103 mouse_report (ev);
2101 } 2104 }
2102#else /* MOUSE_REPORT_DOUBLECLICK */ 2105#else /* MOUSE_REPORT_DOUBLECLICK */
2103 MEvent.button = AnyButton; 2106 MEvent.button = AnyButton;
2104 mouse_report (ev); 2107 mouse_report (ev);
2105#endif /* MOUSE_REPORT_DOUBLECLICK */ 2108#endif /* MOUSE_REPORT_DOUBLECLICK */
2106 return; 2109 return;
2107 } 2110 }
2108 2111
2109 /* 2112 /*
2110 * dumb hack to compensate for the failure of click-and-drag 2113 * dumb hack to compensate for the failure of click-and-drag
2148 { 2151 {
2149 mouse_slip_wheel_speed += v ? -1 : 1; 2152 mouse_slip_wheel_speed += v ? -1 : 1;
2150 if (mouse_slip_wheel_speed < -nrow) mouse_slip_wheel_speed = -nrow; 2153 if (mouse_slip_wheel_speed < -nrow) mouse_slip_wheel_speed = -nrow;
2151 if (mouse_slip_wheel_speed > +nrow) mouse_slip_wheel_speed = +nrow; 2154 if (mouse_slip_wheel_speed > +nrow) mouse_slip_wheel_speed = +nrow;
2152 2155
2156 if (!slip_wheel_ev.is_active ())
2153 slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 2157 slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
2154 } 2158 }
2155 else 2159 else
2156 { 2160 {
2157# endif 2161# endif
2158 scr_page (v, i); 2162 scr_page (v, i);
2226 2230
2227 if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1) 2231 if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1)
2228 { 2232 {
2229 refresh_count = 0; 2233 refresh_count = 0;
2230 2234
2231 if (!option (Opt_skipScroll) || ev::ev_time () > ev::now () + 1. / 60.) 2235 if (!option (Opt_skipScroll) || ev_time () > ev::now () + 1. / 60.)
2232 { 2236 {
2233 refreshnow = true; 2237 refreshnow = true;
2234 ch = NOCHAR; 2238 ch = NOCHAR;
2235 break; 2239 break;
2236 } 2240 }
2447 } 2451 }
2448 } 2452 }
2449 2453
2450 pclose_printer (fd); 2454 pclose_printer (fd);
2451} 2455}
2452#endif /* PRINTPIPE */ 2456#endif /* PRINTPIPE */
2453/*}}} */ 2457/*}}} */
2454 2458
2455/* *INDENT-OFF* */ 2459/* *INDENT-OFF* */
2456enum { 2460enum {
2457 C1_40 = 0x40, 2461 C1_40 = 0x40,
2750 nargs = 0; 2754 nargs = 0;
2751 2755
2752 priv = 0; 2756 priv = 0;
2753 ch = cmd_getc (); 2757 ch = cmd_getc ();
2754 if (ch >= '<' && ch <= '?') 2758 if (ch >= '<' && ch <= '?')
2759 {
2755 { /* '<' '=' '>' '?' */ 2760 /* '<' '=' '>' '?' */
2756 priv = ch; 2761 priv = ch;
2757 ch = cmd_getc (); 2762 ch = cmd_getc ();
2758 } 2763 }
2759 2764
2760 /* read any numerical arguments */ 2765 /* read any numerical arguments */
3580 { 66, PrivMode_aplKP }, 3585 { 66, PrivMode_aplKP },
3581#ifndef NO_BACKSPACE_KEY 3586#ifndef NO_BACKSPACE_KEY
3582 { 67, PrivMode_BackSpace }, 3587 { 67, PrivMode_BackSpace },
3583#endif 3588#endif
3584 { 1000, PrivMode_MouseX11 }, 3589 { 1000, PrivMode_MouseX11 },
3585 // 1001 Use Hilite Mouse Tracking. NYI, TODO
3586 { 1002, PrivMode_MouseBtnEvent }, 3590 { 1002, PrivMode_MouseBtnEvent },
3587 { 1003, PrivMode_MouseAnyEvent }, 3591 { 1003, PrivMode_MouseAnyEvent },
3588 { 1010, PrivMode_TtyOutputInh }, // rxvt extension 3592 { 1010, PrivMode_TtyOutputInh }, // rxvt extension
3589 { 1011, PrivMode_Keypress }, // rxvt extension 3593 { 1011, PrivMode_Keypress }, // rxvt extension
3590 // 1035 enable modifiers for alt, numlock NYI 3594 // 1035 enable modifiers for alt, numlock NYI
3691 /* case 67: - backspace key */ 3695 /* case 67: - backspace key */
3692 case 1000: /* X11 mouse reporting */ 3696 case 1000: /* X11 mouse reporting */
3693 if (state) /* orthogonal */ 3697 if (state) /* orthogonal */
3694 priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); 3698 priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent);
3695 break; 3699 break;
3696#if 0
3697 case 1001:
3698 break; /* X11 mouse highlighting */
3699#endif
3700 case 1002: 3700 case 1002:
3701 case 1003: 3701 case 1003:
3702 if (state) { 3702 if (state)
3703 {
3703 priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseX11); 3704 priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseX11);
3704 priv_modes &= arg[i] == 1003 ? ~PrivMode_MouseBtnEvent : ~PrivMode_MouseAnyEvent; 3705 priv_modes &= arg[i] == 1003 ? ~PrivMode_MouseBtnEvent : ~PrivMode_MouseAnyEvent;
3705 vt_emask_mouse = PointerMotionMask; 3706 vt_emask_mouse = PointerMotionMask;
3707 }
3706 } else 3708 else
3707 vt_emask_mouse = NoEventMask; 3709 vt_emask_mouse = NoEventMask;
3708 vt_select_input (); 3710 vt_select_input ();
3709 break; 3711 break;
3710 case 1010: /* scroll to bottom on TTY output inhibit */ 3712 case 1010: /* scroll to bottom on TTY output inhibit */
3711 set_option (Opt_scrollTtyOutput, !state); 3713 set_option (Opt_scrollTtyOutput, !state);
3891rxvt_term::process_graphics () 3893rxvt_term::process_graphics ()
3892{ 3894{
3893 unicode_t ch, cmd = cmd_getc (); 3895 unicode_t ch, cmd = cmd_getc ();
3894 3896
3895 if (cmd == 'Q') 3897 if (cmd == 'Q')
3898 {
3896 { /* query graphics */ 3899 /* query graphics */
3897 tt_printf ("\033G0\012"); /* no graphics */ 3900 tt_printf ("\033G0\012"); /* no graphics */
3898 return; 3901 return;
3899 } 3902 }
3900 /* swallow other graphics sequences until terminating ':' */ 3903 /* swallow other graphics sequences until terminating ':' */
3901 do 3904 do

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines