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.493 by sf-exg, Sun Aug 21 20:17:40 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
1666 XQueryPointer (dpy, scrollBar.win, 1666 XQueryPointer (dpy, scrollBar.win,
1667 &unused_root, &unused_child, 1667 &unused_root, &unused_child,
1668 &unused_root_x, &unused_root_y, 1668 &unused_root_x, &unused_root_y,
1669 &ev.xbutton.x, &ev.xbutton.y, 1669 &ev.xbutton.x, &ev.xbutton.y,
1670 &unused_mask); 1670 &unused_mask);
1671 scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, 1671 scr_move_to (scrollBar.position (ev.xbutton.y) - csrO,
1672 scrollBar.size ()); 1672 scrollBar.size ());
1673 want_refresh = 1; 1673 want_refresh = 1;
1674 scrollBar.show (1); 1674 scrollBar.show (1);
1675 } 1675 }
1676 break; 1676 break;
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
2068 scr_page (UP, nrow / 4); 2068 scr_page (UP, nrow / 4);
2069# endif 2069# endif
2070 else if (scrollbar_below_slider (ev.y)) 2070 else if (scrollBar.below_slider (ev.y))
2071# ifdef RXVT_SCROLL_FULL 2071# ifdef RXVT_SCROLL_FULL
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
2083 * scrollbar_position (ev.y) 2083 * scrollBar.position (ev.y)
2084 / scrollBar.size ())); 2084 / scrollBar.size ()));
2085 } 2085 }
2086 2086
2087 break; 2087 break;
2088 } 2088 }
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();
2590 break; 2590 break;
2591 case 'Z': /* identify the terminal type */ 2591 case 'Z': /* identify the terminal type */
2592 tt_printf ("\033/Z"); /* I am a VT100 emulating a VT52 */ 2592 tt_printf ("\033/Z"); /* I am a VT100 emulating a VT52 */
2593 break; 2593 break;
2594 case '<': /* turn off VT52 mode */ 2594 case '<': /* turn off VT52 mode */
2595 set_privmode (PrivMode_vt52, 0); 2595 priv_modes &= ~PrivMode_vt52;
2596 break; 2596 break;
2597 case 'F': /* use special graphics character set */ 2597 case 'F': /* use special graphics character set */
2598 case 'G': /* use regular character set */ 2598 case 'G': /* use regular character set */
2599 /* unimplemented */ 2599 /* unimplemented */
2600 break; 2600 break;
2653 scr_forwardindex (); 2653 scr_forwardindex ();
2654 break; 2654 break;
2655#endif 2655#endif
2656 // DECPAM/DECPNM 2656 // DECPAM/DECPNM
2657 case '=': 2657 case '=':
2658 priv_modes |= PrivMode_aplKP;
2659 break;
2658 case '>': 2660 case '>':
2659 set_privmode (PrivMode_aplKP, ch == '='); 2661 priv_modes &= ~PrivMode_aplKP;
2660 break; 2662 break;
2661 2663
2662 case C1_40: 2664 case C1_40:
2663 cmd_getc (); 2665 cmd_getc ();
2664 break; 2666 break;
3585 if (mode == 'r') 3587 if (mode == 'r')
3586 state = (SavedModes & bit) ? 1 : 0; /* no overlapping */ 3588 state = (SavedModes & bit) ? 1 : 0; /* no overlapping */
3587 else 3589 else
3588 state = (mode == 't') ? ! (priv_modes & bit) : mode; 3590 state = (mode == 't') ? ! (priv_modes & bit) : mode;
3589 3591
3590 set_privmode (bit, state); 3592 if (state)
3593 priv_modes |= bit;
3594 else
3595 priv_modes &= ~bit;
3591 } 3596 }
3592 3597
3593 return state; 3598 return state;
3594} 3599}
3595 3600
3700 case 2: /* VT52 mode */ 3705 case 2: /* VT52 mode */
3701 /* oddball mode. should be set regardless of set/reset 3706 /* oddball mode. should be set regardless of set/reset
3702 * parameter. Return from VT52 mode with an ESC < from 3707 * parameter. Return from VT52 mode with an ESC < from
3703 * within VT52 mode 3708 * within VT52 mode
3704 */ 3709 */
3705 set_privmode (PrivMode_vt52, 1); 3710 priv_modes |= PrivMode_vt52;
3706 break; 3711 break;
3707 case 3: /* 80/132 */ 3712 case 3: /* 80/132 */
3708 if (priv_modes & PrivMode_132OK) 3713 if (priv_modes & PrivMode_132OK)
3709 set_widthheight ((state ? 132 : 80) * fwidth, 24 * fheight); 3714 set_widthheight ((state ? 132 : 80) * fwidth, 24 * fheight);
3710 break; 3715 break;
3725 if (state) /* orthogonal */ 3730 if (state) /* orthogonal */
3726 priv_modes &= ~(PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); 3731 priv_modes &= ~(PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent);
3727 break; 3732 break;
3728#ifdef scrollBar_esc 3733#ifdef scrollBar_esc
3729 case scrollBar_esc: 3734 case scrollBar_esc:
3730 if (scrollBar.map (state)) 3735 scrollBar.map (state);
3731 {
3732 resize_all_windows (0, 0, 0); 3736 resize_all_windows (0, 0, 0);
3733 scr_touch (true); 3737 scr_touch (true);
3734 }
3735 break; 3738 break;
3736#endif 3739#endif
3737 case 25: /* visible/invisible cursor */ 3740 case 25: /* visible/invisible cursor */
3738 scr_cursor_visible (state); 3741 scr_cursor_visible (state);
3739 break; 3742 break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines