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.373 by root, Tue Dec 11 15:42:51 2007 UTC

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 && !ev_is_active (&flush_ev))
1054 flush_ev.start (1. / 60.); // refresh at max. 60 hz normally 1054 flush_ev.again ();
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{
1251 int x, y; 1251 int x, y;
1252 int code = 32; 1252 int code = 32;
1253 1253
1254 x = Pixel2Col (ev.x); 1254 x = Pixel2Col (ev.x);
1255 y = Pixel2Row (ev.y); 1255 y = Pixel2Row (ev.y);
1256 if (ev.type == MotionNotify) { 1256 if (ev.type == MotionNotify)
1257 {
1257 if (x == mouse_row && y == mouse_col) 1258 if (x == mouse_row && y == mouse_col)
1258 return; 1259 return;
1259 mouse_row = x; 1260 mouse_row = x;
1260 mouse_col = y; 1261 mouse_col = y;
1261 code += 32; 1262 code += 32;
1262 } 1263 }
1263 1264
1264 if (MEvent.button == AnyButton) 1265 if (MEvent.button == AnyButton)
1265 button_number = 3; 1266 button_number = 3;
1266 else 1267 else
1267 { 1268 {
1475 break; 1476 break;
1476 1477
1477 case MapNotify: 1478 case MapNotify:
1478 mapped = 1; 1479 mapped = 1;
1479#ifdef TEXT_BLINK 1480#ifdef TEXT_BLINK
1480 text_blink_ev.start (TEXT_BLINK_INTERVAL); 1481 text_blink_ev.again ();
1481#endif 1482#endif
1482 HOOK_INVOKE ((this, HOOK_MAP_NOTIFY, DT_XEVENT, &ev, DT_END)); 1483 HOOK_INVOKE ((this, HOOK_MAP_NOTIFY, DT_XEVENT, &ev, DT_END));
1483 break; 1484 break;
1484 1485
1485 case UnmapNotify: 1486 case UnmapNotify:
1576 int dist; 1577 int dist;
1577 1578
1578 /* don't clobber the current delay if we are 1579 /* don't clobber the current delay if we are
1579 * already in the middle of scrolling. 1580 * already in the middle of scrolling.
1580 */ 1581 */
1581 if (!sel_scroll_ev.active) 1582 if (!ev_is_active (&sel_scroll_ev))
1582 sel_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 1583 sel_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
1583 1584
1584 /* save the event params so we can highlight 1585 /* save the event params so we can highlight
1585 * the selection in the pending-scroll loop 1586 * the selection in the pending-scroll loop
1586 */ 1587 */
1609 else 1610 else
1610 { 1611 {
1611 /* we are within the text window, so we 1612 /* we are within the text window, so we
1612 * shouldn't be scrolling 1613 * shouldn't be scrolling
1613 */ 1614 */
1614 if (sel_scroll_ev.active) 1615 if (ev_is_active (&sel_scroll_ev))
1615 sel_scroll_ev.stop(); 1616 sel_scroll_ev.stop();
1616 } 1617 }
1617#endif 1618#endif
1618#ifdef MOUSE_THRESHOLD 1619#ifdef MOUSE_THRESHOLD
1619 } 1620 }
1849 mouse_report (ev); 1850 mouse_report (ev);
1850 } 1851 }
1851#else 1852#else
1852 MEvent.button = ev.button; 1853 MEvent.button = ev.button;
1853 mouse_report (ev); 1854 mouse_report (ev);
1854#endif /* MOUSE_REPORT_DOUBLECLICK */ 1855#endif /* MOUSE_REPORT_DOUBLECLICK */
1855 1856
1856 } 1857 }
1857 else 1858 else
1858 { 1859 {
1859 if (ev.button != MEvent.button) 1860 if (ev.button != MEvent.button)
1953 tt_printf ("\033[5~"); 1954 tt_printf ("\033[5~");
1954 break; 1955 break;
1955 } 1956 }
1956 } 1957 }
1957 else 1958 else
1958#endif /* NO_SCROLLBAR_REPORT */ 1959#endif /* NO_SCROLLBAR_REPORT */
1959 1960
1960 { 1961 {
1961 char upordown = 0; 1962 char upordown = 0;
1962 1963
1963 if (scrollBar.style == R_SB_NEXT) 1964 if (scrollBar.style == R_SB_NEXT)
1964 { 1965 {
1965 if (scrollbarnext_upButton (ev.y)) 1966 if (scrollbarnext_upButton (ev.y))
1966 upordown = -1; /* up */ 1967 upordown = -1; /* up */
2065 scrollBar.setIdle (); 2066 scrollBar.setIdle ();
2066 scrollbar_show (0); 2067 scrollbar_show (0);
2067 } 2068 }
2068 2069
2069#ifdef SELECTION_SCROLLING 2070#ifdef SELECTION_SCROLLING
2070 if (sel_scroll_ev.active) 2071 if (ev_is_active (&sel_scroll_ev))
2071 sel_scroll_ev.stop(); 2072 sel_scroll_ev.stop();
2072#endif 2073#endif
2073 2074
2074 if (ev.window == vt) 2075 if (ev.window == vt)
2075 { 2076 {
2100 mouse_report (ev); 2101 mouse_report (ev);
2101 } 2102 }
2102#else /* MOUSE_REPORT_DOUBLECLICK */ 2103#else /* MOUSE_REPORT_DOUBLECLICK */
2103 MEvent.button = AnyButton; 2104 MEvent.button = AnyButton;
2104 mouse_report (ev); 2105 mouse_report (ev);
2105#endif /* MOUSE_REPORT_DOUBLECLICK */ 2106#endif /* MOUSE_REPORT_DOUBLECLICK */
2106 return; 2107 return;
2107 } 2108 }
2108 2109
2109 /* 2110 /*
2110 * dumb hack to compensate for the failure of click-and-drag 2111 * dumb hack to compensate for the failure of click-and-drag
2226 2227
2227 if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1) 2228 if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1)
2228 { 2229 {
2229 refresh_count = 0; 2230 refresh_count = 0;
2230 2231
2231 if (!option (Opt_skipScroll) || ev::ev_time () > ev::now () + 1. / 60.) 2232 if (!option (Opt_skipScroll) || ev_time () > ev::now () + 1. / 60.)
2232 { 2233 {
2233 refreshnow = true; 2234 refreshnow = true;
2234 ch = NOCHAR; 2235 ch = NOCHAR;
2235 break; 2236 break;
2236 } 2237 }
2447 } 2448 }
2448 } 2449 }
2449 2450
2450 pclose_printer (fd); 2451 pclose_printer (fd);
2451} 2452}
2452#endif /* PRINTPIPE */ 2453#endif /* PRINTPIPE */
2453/*}}} */ 2454/*}}} */
2454 2455
2455/* *INDENT-OFF* */ 2456/* *INDENT-OFF* */
2456enum { 2457enum {
2457 C1_40 = 0x40, 2458 C1_40 = 0x40,
2750 nargs = 0; 2751 nargs = 0;
2751 2752
2752 priv = 0; 2753 priv = 0;
2753 ch = cmd_getc (); 2754 ch = cmd_getc ();
2754 if (ch >= '<' && ch <= '?') 2755 if (ch >= '<' && ch <= '?')
2756 {
2755 { /* '<' '=' '>' '?' */ 2757 /* '<' '=' '>' '?' */
2756 priv = ch; 2758 priv = ch;
2757 ch = cmd_getc (); 2759 ch = cmd_getc ();
2758 } 2760 }
2759 2761
2760 /* read any numerical arguments */ 2762 /* read any numerical arguments */
3580 { 66, PrivMode_aplKP }, 3582 { 66, PrivMode_aplKP },
3581#ifndef NO_BACKSPACE_KEY 3583#ifndef NO_BACKSPACE_KEY
3582 { 67, PrivMode_BackSpace }, 3584 { 67, PrivMode_BackSpace },
3583#endif 3585#endif
3584 { 1000, PrivMode_MouseX11 }, 3586 { 1000, PrivMode_MouseX11 },
3585 // 1001 Use Hilite Mouse Tracking. NYI, TODO
3586 { 1002, PrivMode_MouseBtnEvent }, 3587 { 1002, PrivMode_MouseBtnEvent },
3587 { 1003, PrivMode_MouseAnyEvent }, 3588 { 1003, PrivMode_MouseAnyEvent },
3588 { 1010, PrivMode_TtyOutputInh }, // rxvt extension 3589 { 1010, PrivMode_TtyOutputInh }, // rxvt extension
3589 { 1011, PrivMode_Keypress }, // rxvt extension 3590 { 1011, PrivMode_Keypress }, // rxvt extension
3590 // 1035 enable modifiers for alt, numlock NYI 3591 // 1035 enable modifiers for alt, numlock NYI
3691 /* case 67: - backspace key */ 3692 /* case 67: - backspace key */
3692 case 1000: /* X11 mouse reporting */ 3693 case 1000: /* X11 mouse reporting */
3693 if (state) /* orthogonal */ 3694 if (state) /* orthogonal */
3694 priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); 3695 priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent);
3695 break; 3696 break;
3696#if 0
3697 case 1001:
3698 break; /* X11 mouse highlighting */
3699#endif
3700 case 1002: 3697 case 1002:
3701 case 1003: 3698 case 1003:
3702 if (state) { 3699 if (state)
3700 {
3703 priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseX11); 3701 priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseX11);
3704 priv_modes &= arg[i] == 1003 ? ~PrivMode_MouseBtnEvent : ~PrivMode_MouseAnyEvent; 3702 priv_modes &= arg[i] == 1003 ? ~PrivMode_MouseBtnEvent : ~PrivMode_MouseAnyEvent;
3705 vt_emask_mouse = PointerMotionMask; 3703 vt_emask_mouse = PointerMotionMask;
3704 }
3706 } else 3705 else
3707 vt_emask_mouse = NoEventMask; 3706 vt_emask_mouse = NoEventMask;
3708 vt_select_input (); 3707 vt_select_input ();
3709 break; 3708 break;
3710 case 1010: /* scroll to bottom on TTY output inhibit */ 3709 case 1010: /* scroll to bottom on TTY output inhibit */
3711 set_option (Opt_scrollTtyOutput, !state); 3710 set_option (Opt_scrollTtyOutput, !state);
3891rxvt_term::process_graphics () 3890rxvt_term::process_graphics ()
3892{ 3891{
3893 unicode_t ch, cmd = cmd_getc (); 3892 unicode_t ch, cmd = cmd_getc ();
3894 3893
3895 if (cmd == 'Q') 3894 if (cmd == 'Q')
3895 {
3896 { /* query graphics */ 3896 /* query graphics */
3897 tt_printf ("\033G0\012"); /* no graphics */ 3897 tt_printf ("\033G0\012"); /* no graphics */
3898 return; 3898 return;
3899 } 3899 }
3900 /* swallow other graphics sequences until terminating ':' */ 3900 /* swallow other graphics sequences until terminating ':' */
3901 do 3901 do

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines