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.393 by sasha, Tue Jan 15 23:21:17 2008 UTC vs.
Revision 1.402 by ayin, Fri Feb 1 14:13:52 2008 UTC

1090 1090
1091#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1091#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
1092void 1092void
1093rxvt_term::cont_scroll_cb (ev::timer &w, int revents) 1093rxvt_term::cont_scroll_cb (ev::timer &w, int revents)
1094{ 1094{
1095 if ((scrollbar_isUp () || scrollbar_isDn ()) 1095 if ((scrollBar.state == STATE_UP || scrollBar.state == STATE_DOWN)
1096 && scr_page (scrollbar_isUp () ? UP : DN, 1)) 1096 && scr_page (scrollBar.state == STATE_UP ? UP : DN, 1))
1097 { 1097 {
1098 want_refresh = 1; 1098 want_refresh = 1;
1099 refresh_check (); 1099 refresh_check ();
1100 } 1100 }
1101 else 1101 else
1438 && ev.xfocus.mode != NotifyGrab) 1438 && ev.xfocus.mode != NotifyGrab)
1439 focus_out (); 1439 focus_out ();
1440 break; 1440 break;
1441 1441
1442 case ConfigureNotify: 1442 case ConfigureNotify:
1443 /*fprintf (stderr, "ConfigureNotify for %X, parent is %X, geom is %dx%d%+d%+d, old geom was %dx%d\n", 1443 /*fprintf (stderr, "ConfigureNotify for %X, parent is %X, geom is %dx%d%+d%+d, old geom was %dx%d\n",
1444 ev.xconfigure.window, parent[0], ev.xconfigure.width, ev.xconfigure.height, ev.xconfigure.x, ev.xconfigure.y, 1444 ev.xconfigure.window, parent[0], ev.xconfigure.width, ev.xconfigure.height, ev.xconfigure.x, ev.xconfigure.y,
1445 szHint.width, szHint.height); */ 1445 szHint.width, szHint.height);*/
1446 if (ev.xconfigure.window == parent[0]) 1446 if (ev.xconfigure.window == parent[0])
1447 { 1447 {
1448 while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev)) 1448 while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev))
1449 ; 1449 ;
1450 1450
1553 while (XCheckTypedWindowEvent (dpy, ev.xany.window, GraphicsExpose, &unused_event)) 1553 while (XCheckTypedWindowEvent (dpy, ev.xany.window, GraphicsExpose, &unused_event))
1554 ; 1554 ;
1555 1555
1556 if (scrollBar.state && ev.xany.window == scrollBar.win) 1556 if (scrollBar.state && ev.xany.window == scrollBar.win)
1557 { 1557 {
1558 scrollBar.setIdle (); 1558 scrollBar.state = STATE_IDLE;
1559 scrollbar_show (0); 1559 scrollbar_show (0);
1560 } 1560 }
1561 } 1561 }
1562 break; 1562 break;
1563 1563
1651#ifdef MOUSE_THRESHOLD 1651#ifdef MOUSE_THRESHOLD
1652 } 1652 }
1653#endif 1653#endif
1654 } 1654 }
1655 } 1655 }
1656 else if (scrollbar_isMotion () && ev.xany.window == scrollBar.win) 1656 else if (scrollBar.state == STATE_MOTION && ev.xany.window == scrollBar.win)
1657 { 1657 {
1658 while (XCheckTypedWindowEvent (dpy, scrollBar.win, 1658 while (XCheckTypedWindowEvent (dpy, scrollBar.win,
1659 MotionNotify, &ev)) 1659 MotionNotify, &ev))
1660 ; 1660 ;
1661 1661
1947 /* 1947 /*
1948 * Scrollbar window processing of button press 1948 * Scrollbar window processing of button press
1949 */ 1949 */
1950 if (scrollBar.state && ev.window == scrollBar.win) 1950 if (scrollBar.state && ev.window == scrollBar.win)
1951 { 1951 {
1952 scrollBar.setIdle (); 1952 int upordown = 0;
1953
1954 if (scrollBar.upButton (ev.y))
1955 upordown = -1; /* up */
1956 else if (scrollBar.dnButton (ev.y))
1957 upordown = 1; /* down */
1958
1959 scrollBar.state = STATE_IDLE;
1953 /* 1960 /*
1954 * Rxvt-style scrollbar: 1961 * Rxvt-style scrollbar:
1955 * move up if mouse is above slider 1962 * move up if mouse is above slider
1956 * move dn if mouse is below slider 1963 * move dn if mouse is below slider
1957 * 1964 *
1966 /* 1973 /*
1967 * Mouse report disabled scrollbar: 1974 * Mouse report disabled scrollbar:
1968 * arrow buttons - send up/down 1975 * arrow buttons - send up/down
1969 * click on scrollbar - send pageup/down 1976 * click on scrollbar - send pageup/down
1970 */ 1977 */
1971 if ((scrollBar.style == R_SB_NEXT 1978 if (upordown < 0)
1972 && scrollbarnext_upButton (ev.y))
1973 || (scrollBar.style == R_SB_RXVT
1974 && scrollbarrxvt_upButton (ev.y)))
1975 tt_printf ("\033[A"); 1979 tt_printf ("\033[A");
1976 else if ((scrollBar.style == R_SB_NEXT 1980 else if (upordown > 0)
1977 && scrollbarnext_dnButton (ev.y))
1978 || (scrollBar.style == R_SB_RXVT
1979 && scrollbarrxvt_dnButton (ev.y)))
1980 tt_printf ("\033[B"); 1981 tt_printf ("\033[B");
1981 else 1982 else
1982 switch (ev.button) 1983 switch (ev.button)
1983 { 1984 {
1984 case Button2: 1985 case Button2:
1994 } 1995 }
1995 else 1996 else
1996#endif /* NO_SCROLLBAR_REPORT */ 1997#endif /* NO_SCROLLBAR_REPORT */
1997 1998
1998 { 1999 {
1999 char upordown = 0;
2000
2001 if (scrollBar.style == R_SB_NEXT)
2002 {
2003 if (scrollbarnext_upButton (ev.y))
2004 upordown = -1; /* up */
2005 else if (scrollbarnext_dnButton (ev.y))
2006 upordown = 1; /* down */
2007 }
2008 else if (scrollBar.style == R_SB_RXVT)
2009 {
2010 if (scrollbarrxvt_upButton (ev.y))
2011 upordown = -1; /* up */
2012 else if (scrollbarrxvt_dnButton (ev.y))
2013 upordown = 1; /* down */
2014 }
2015
2016 if (upordown) 2000 if (upordown)
2017 { 2001 {
2018#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 2002#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
2019 if (!cont_scroll_ev.is_active ()) 2003 if (!cont_scroll_ev.is_active ())
2020 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 2004 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
2021#endif 2005#endif
2022 if (scr_page (upordown < 0 ? UP : DN, 1)) 2006 if (scr_page (upordown < 0 ? UP : DN, 1))
2023 { 2007 {
2024 if (upordown < 0) 2008 if (upordown < 0)
2025 scrollBar.setUp (); 2009 scrollBar.state = STATE_UP;
2026 else 2010 else
2027 scrollBar.setDn (); 2011 scrollBar.state = STATE_DOWN;
2028 } 2012 }
2029 } 2013 }
2030 else 2014 else
2031 switch (ev.button) 2015 switch (ev.button)
2032 { 2016 {
2047 if (scrollBar.style == R_SB_XTERM 2031 if (scrollBar.style == R_SB_XTERM
2048 || scrollbar_above_slider (ev.y) 2032 || scrollbar_above_slider (ev.y)
2049 || scrollbar_below_slider (ev.y)) 2033 || scrollbar_below_slider (ev.y))
2050 scr_move_to (scrollbar_position (ev.y) - csrO, scrollbar_size ()); 2034 scr_move_to (scrollbar_position (ev.y) - csrO, scrollbar_size ());
2051 2035
2052 scrollBar.setMotion (); 2036 scrollBar.state = STATE_MOTION;
2053 break; 2037 break;
2054 2038
2055 case Button1: 2039 case Button1:
2056 if (scrollBar.align == R_SB_ALIGN_CENTRE) 2040 if (scrollBar.align == R_SB_ALIGN_CENTRE)
2057 csrO = ev.y - scrollBar.top; 2041 csrO = ev.y - scrollBar.top;
2071 scr_page (DN, nrow - 1); 2055 scr_page (DN, nrow - 1);
2072# else 2056# else
2073 scr_page (DN, nrow / 4); 2057 scr_page (DN, nrow / 4);
2074# endif 2058# endif
2075 else 2059 else
2076 scrollBar.setMotion (); 2060 scrollBar.state = STATE_MOTION;
2077 } 2061 }
2078 else 2062 else
2079 { 2063 {
2080 scr_page ((ev.button == Button1 ? DN : UP), 2064 scr_page ((ev.button == Button1 ? DN : UP),
2081 (nrow 2065 (nrow
2098 2082
2099 csrO = 0; /* reset csr Offset */ 2083 csrO = 0; /* reset csr Offset */
2100 if (!bypass_keystate) 2084 if (!bypass_keystate)
2101 reportmode = !! (priv_modes & PrivMode_mouse_report); 2085 reportmode = !! (priv_modes & PrivMode_mouse_report);
2102 2086
2103 if (scrollbar_isUpDn ()) 2087 if (scrollBar.state == STATE_UP || scrollBar.state == STATE_DOWN)
2104 { 2088 {
2105 scrollBar.setIdle (); 2089 scrollBar.state = STATE_IDLE;
2106 scrollbar_show (0); 2090 scrollbar_show (0);
2107 } 2091 }
2108 2092
2109#ifdef SELECTION_SCROLLING 2093#ifdef SELECTION_SCROLLING
2110 sel_scroll_ev.stop(); 2094 sel_scroll_ev.stop();
2848 // versions. 2832 // versions.
2849 // 2833 //
2850 tt_printf ("\033[>%d;95;0c", 'U'); 2834 tt_printf ("\033[>%d;95;0c", 'U');
2851 } 2835 }
2852 break; 2836 break;
2837
2853 case '?': 2838 case '?':
2854 if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') 2839 if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't')
2855 process_terminal_mode (ch, priv, nargs, arg); 2840 process_terminal_mode (ch, priv, nargs, arg);
2856 break; 2841 break;
2857 } 2842 }
3373 *buf++ = '\0'; 3358 *buf++ = '\0';
3374 3359
3375 process_color_seq (op, color, name, resp); 3360 process_color_seq (op, color, name, resp);
3376 } 3361 }
3377 break; 3362 break;
3363 case Rxvt_restoreFG:
3378 case XTerm_Color00: 3364 case XTerm_Color00:
3379 process_color_seq (op, Color_fg, str, resp); 3365 process_color_seq (op, Color_fg, str, resp);
3380 break; 3366 break;
3367 case Rxvt_restoreBG:
3381 case XTerm_Color01: 3368 case XTerm_Color01:
3382 process_color_seq (op, Color_bg, str, resp); 3369 process_color_seq (op, Color_bg, str, resp);
3383 break; 3370 break;
3384#ifndef NO_CURSORCOLOR 3371#ifndef NO_CURSORCOLOR
3385 case XTerm_Color_cursor: 3372 case XTerm_Color_cursor:
3463 if (changed) 3450 if (changed)
3464 update_background (); 3451 update_background ();
3465 } 3452 }
3466 break; 3453 break;
3467#endif 3454#endif
3468
3469 case Rxvt_restoreFG:
3470 set_window_color (Color_fg, str);
3471 break;
3472 case Rxvt_restoreBG:
3473 set_window_color (Color_bg, str);
3474 break;
3475 3455
3476 case XTerm_logfile: 3456 case XTerm_logfile:
3477 // TODO, when secure mode? 3457 // TODO, when secure mode?
3478 break; 3458 break;
3479 3459
3634 // 1037 send DEL for keypad delete NYI 3614 // 1037 send DEL for keypad delete NYI
3635 { 1047, PrivMode_Screen }, 3615 { 1047, PrivMode_Screen },
3636 // 1048 save and restore cursor 3616 // 1048 save and restore cursor
3637 { 1049, PrivMode_Screen }, /* xterm extension, clear screen on ti rather than te */ 3617 { 1049, PrivMode_Screen }, /* xterm extension, clear screen on ti rather than te */
3638 // 1051, 1052, 1060, 1061 keyboard emulation NYI 3618 // 1051, 1052, 1060, 1061 keyboard emulation NYI
3619 { 2004, PrivMode_BracketPaste },
3639 }; 3620 };
3640 3621
3641 if (nargs == 0) 3622 if (nargs == 0)
3642 return; 3623 return;
3643 3624

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines