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.496 by sf-exg, Wed Aug 31 22:39:49 2011 UTC vs.
Revision 1.497 by sf-exg, Thu Sep 1 08:11:26 2011 UTC

1042 1042
1043#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1043#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
1044void 1044void
1045rxvt_term::cont_scroll_cb (ev::timer &w, int revents) 1045rxvt_term::cont_scroll_cb (ev::timer &w, int revents)
1046{ 1046{
1047 if ((scrollBar.state == STATE_UP || scrollBar.state == STATE_DOWN) 1047 if ((scrollBar.state == SB_STATE_UP || scrollBar.state == SB_STATE_DOWN)
1048 && scr_page (scrollBar.state == STATE_UP ? UP : DN, 1)) 1048 && scr_page (scrollBar.state == SB_STATE_UP ? UP : DN, 1))
1049 { 1049 {
1050 want_refresh = 1; 1050 want_refresh = 1;
1051 refresh_check (); 1051 refresh_check ();
1052 } 1052 }
1053 else 1053 else
1557 while (XCheckTypedWindowEvent (dpy, ev.xany.window, GraphicsExpose, &unused_event)) 1557 while (XCheckTypedWindowEvent (dpy, ev.xany.window, GraphicsExpose, &unused_event))
1558 ; 1558 ;
1559 1559
1560 if (scrollBar.state && ev.xany.window == scrollBar.win) 1560 if (scrollBar.state && ev.xany.window == scrollBar.win)
1561 { 1561 {
1562 scrollBar.state = STATE_IDLE; 1562 scrollBar.state = SB_STATE_IDLE;
1563 scrollBar.show (0); 1563 scrollBar.show (0);
1564 } 1564 }
1565 } 1565 }
1566 break; 1566 break;
1567 1567
1655#ifdef MOUSE_THRESHOLD 1655#ifdef MOUSE_THRESHOLD
1656 } 1656 }
1657#endif 1657#endif
1658 } 1658 }
1659 } 1659 }
1660 else if (scrollBar.state == STATE_MOTION && ev.xany.window == scrollBar.win) 1660 else if (scrollBar.state == SB_STATE_MOTION && ev.xany.window == scrollBar.win)
1661 { 1661 {
1662 while (XCheckTypedWindowEvent (dpy, scrollBar.win, 1662 while (XCheckTypedWindowEvent (dpy, scrollBar.win,
1663 MotionNotify, &ev)) 1663 MotionNotify, &ev))
1664 ; 1664 ;
1665 1665
1972 if (scrollBar.upButton (ev.y)) 1972 if (scrollBar.upButton (ev.y))
1973 direction = UP; /* up */ 1973 direction = UP; /* up */
1974 else if (scrollBar.dnButton (ev.y)) 1974 else if (scrollBar.dnButton (ev.y))
1975 direction = DN; /* down */ 1975 direction = DN; /* down */
1976 1976
1977 scrollBar.state = STATE_IDLE; 1977 scrollBar.state = SB_STATE_IDLE;
1978 /* 1978 /*
1979 * Rxvt-style scrollbar: 1979 * Rxvt-style scrollbar:
1980 * move up if mouse is above slider 1980 * move up if mouse is above slider
1981 * move dn if mouse is below slider 1981 * move dn if mouse is below slider
1982 * 1982 *
2021 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 2021 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
2022#endif 2022#endif
2023 if (scr_page (direction, 1)) 2023 if (scr_page (direction, 1))
2024 { 2024 {
2025 if (direction == UP) 2025 if (direction == UP)
2026 scrollBar.state = STATE_UP; 2026 scrollBar.state = SB_STATE_UP;
2027 else 2027 else
2028 scrollBar.state = STATE_DOWN; 2028 scrollBar.state = SB_STATE_DOWN;
2029 } 2029 }
2030 } 2030 }
2031 else 2031 else
2032 switch (ev.button) 2032 switch (ev.button)
2033 { 2033 {
2034 case Button2: 2034 case Button2:
2035 switch (scrollBar.align) 2035 switch (scrollBar.align)
2036 { 2036 {
2037 case R_SB_ALIGN_TOP: 2037 case SB_ALIGN_TOP:
2038 csrO = 0; 2038 csrO = 0;
2039 break; 2039 break;
2040 case R_SB_ALIGN_CENTRE: 2040 case SB_ALIGN_CENTRE:
2041 csrO = (scrollBar.bot - scrollBar.top) / 2; 2041 csrO = (scrollBar.bot - scrollBar.top) / 2;
2042 break; 2042 break;
2043 case R_SB_ALIGN_BOTTOM: 2043 case SB_ALIGN_BOTTOM:
2044 csrO = scrollBar.bot - scrollBar.top; 2044 csrO = scrollBar.bot - scrollBar.top;
2045 break; 2045 break;
2046 } 2046 }
2047 2047
2048 if (scrollBar.style == R_SB_XTERM 2048 if (scrollBar.style == SB_STYLE_XTERM
2049 || scrollBar.above_slider (ev.y) 2049 || scrollBar.above_slider (ev.y)
2050 || scrollBar.below_slider (ev.y)) 2050 || scrollBar.below_slider (ev.y))
2051 scr_move_to (scrollBar.position (ev.y) - csrO, scrollBar.size ()); 2051 scr_move_to (scrollBar.position (ev.y) - csrO, scrollBar.size ());
2052 2052
2053 scrollBar.state = STATE_MOTION; 2053 scrollBar.state = SB_STATE_MOTION;
2054 break; 2054 break;
2055 2055
2056 case Button1: 2056 case Button1:
2057 if (scrollBar.align == R_SB_ALIGN_CENTRE) 2057 if (scrollBar.align == SB_ALIGN_CENTRE)
2058 csrO = ev.y - scrollBar.top; 2058 csrO = ev.y - scrollBar.top;
2059 /* FALLTHROUGH */ 2059 /* FALLTHROUGH */
2060 2060
2061 case Button3: 2061 case Button3:
2062 if (scrollBar.style != R_SB_XTERM) 2062 if (scrollBar.style != SB_STYLE_XTERM)
2063 { 2063 {
2064 if (scrollBar.above_slider (ev.y)) 2064 if (scrollBar.above_slider (ev.y))
2065# ifdef RXVT_SCROLL_FULL 2065# ifdef RXVT_SCROLL_FULL
2066 scr_page (UP, nrow - 1); 2066 scr_page (UP, nrow - 1);
2067# else 2067# else
2072 scr_page (DN, nrow - 1); 2072 scr_page (DN, nrow - 1);
2073# else 2073# else
2074 scr_page (DN, nrow / 4); 2074 scr_page (DN, nrow / 4);
2075# endif 2075# endif
2076 else 2076 else
2077 scrollBar.state = STATE_MOTION; 2077 scrollBar.state = SB_STATE_MOTION;
2078 } 2078 }
2079 else 2079 else
2080 { 2080 {
2081 scr_page ((ev.button == Button1 ? DN : UP), 2081 scr_page ((ev.button == Button1 ? DN : UP),
2082 (nrow 2082 (nrow
2099 2099
2100 csrO = 0; /* reset csr Offset */ 2100 csrO = 0; /* reset csr Offset */
2101 if (!bypass_keystate) 2101 if (!bypass_keystate)
2102 reportmode = !! (priv_modes & PrivMode_mouse_report); 2102 reportmode = !! (priv_modes & PrivMode_mouse_report);
2103 2103
2104 if (scrollBar.state == STATE_UP || scrollBar.state == STATE_DOWN) 2104 if (scrollBar.state == SB_STATE_UP || scrollBar.state == SB_STATE_DOWN)
2105 { 2105 {
2106 scrollBar.state = STATE_IDLE; 2106 scrollBar.state = SB_STATE_IDLE;
2107 scrollBar.show (0); 2107 scrollBar.show (0);
2108 } 2108 }
2109 2109
2110#ifdef SELECTION_SCROLLING 2110#ifdef SELECTION_SCROLLING
2111 sel_scroll_ev.stop(); 2111 sel_scroll_ev.stop();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines