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.494 by sf-exg, Mon Aug 22 17:23:56 2011 UTC vs.
Revision 1.499 by root, Wed Nov 16 20:15:45 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
1716 if (XWMHints *h = XGetWMHints (dpy, parent)) 1716 if (XWMHints *h = XGetWMHints (dpy, parent))
1717 { 1717 {
1718 h->flags = h->flags & ~XUrgencyHint | (enable ? XUrgencyHint : 0); 1718 h->flags = h->flags & ~XUrgencyHint | (enable ? XUrgencyHint : 0);
1719 XSetWMHints (dpy, parent, h); 1719 XSetWMHints (dpy, parent, h);
1720 urgency_hint = enable; 1720 urgency_hint = enable;
1721 XFree (h);
1721 } 1722 }
1722} 1723}
1723#endif 1724#endif
1724 1725
1725void 1726void
1972 if (scrollBar.upButton (ev.y)) 1973 if (scrollBar.upButton (ev.y))
1973 direction = UP; /* up */ 1974 direction = UP; /* up */
1974 else if (scrollBar.dnButton (ev.y)) 1975 else if (scrollBar.dnButton (ev.y))
1975 direction = DN; /* down */ 1976 direction = DN; /* down */
1976 1977
1977 scrollBar.state = STATE_IDLE; 1978 scrollBar.state = SB_STATE_IDLE;
1978 /* 1979 /*
1979 * Rxvt-style scrollbar: 1980 * Rxvt-style scrollbar:
1980 * move up if mouse is above slider 1981 * move up if mouse is above slider
1981 * move dn if mouse is below slider 1982 * move dn if mouse is below slider
1982 * 1983 *
2021 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 2022 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
2022#endif 2023#endif
2023 if (scr_page (direction, 1)) 2024 if (scr_page (direction, 1))
2024 { 2025 {
2025 if (direction == UP) 2026 if (direction == UP)
2026 scrollBar.state = STATE_UP; 2027 scrollBar.state = SB_STATE_UP;
2027 else 2028 else
2028 scrollBar.state = STATE_DOWN; 2029 scrollBar.state = SB_STATE_DOWN;
2029 } 2030 }
2030 } 2031 }
2031 else 2032 else
2032 switch (ev.button) 2033 switch (ev.button)
2033 { 2034 {
2034 case Button2: 2035 case Button2:
2035 switch (scrollBar.align) 2036 switch (scrollBar.align)
2036 { 2037 {
2037 case R_SB_ALIGN_TOP: 2038 case SB_ALIGN_TOP:
2038 csrO = 0; 2039 csrO = 0;
2039 break; 2040 break;
2040 case R_SB_ALIGN_CENTRE: 2041 case SB_ALIGN_CENTRE:
2041 csrO = (scrollBar.bot - scrollBar.top) / 2; 2042 csrO = (scrollBar.bot - scrollBar.top) / 2;
2042 break; 2043 break;
2043 case R_SB_ALIGN_BOTTOM: 2044 case SB_ALIGN_BOTTOM:
2044 csrO = scrollBar.bot - scrollBar.top; 2045 csrO = scrollBar.bot - scrollBar.top;
2045 break; 2046 break;
2046 } 2047 }
2047 2048
2048 if (scrollBar.style == R_SB_XTERM 2049 if (scrollBar.style == SB_STYLE_XTERM
2049 || scrollBar.above_slider (ev.y) 2050 || scrollBar.above_slider (ev.y)
2050 || scrollBar.below_slider (ev.y)) 2051 || scrollBar.below_slider (ev.y))
2051 scr_move_to (scrollBar.position (ev.y) - csrO, scrollBar.size ()); 2052 scr_move_to (scrollBar.position (ev.y) - csrO, scrollBar.size ());
2052 2053
2053 scrollBar.state = STATE_MOTION; 2054 scrollBar.state = SB_STATE_MOTION;
2054 break; 2055 break;
2055 2056
2056 case Button1: 2057 case Button1:
2057 if (scrollBar.align == R_SB_ALIGN_CENTRE) 2058 if (scrollBar.align == SB_ALIGN_CENTRE)
2058 csrO = ev.y - scrollBar.top; 2059 csrO = ev.y - scrollBar.top;
2059 /* FALLTHROUGH */ 2060 /* FALLTHROUGH */
2060 2061
2061 case Button3: 2062 case Button3:
2062 if (scrollBar.style != R_SB_XTERM) 2063 if (scrollBar.style != SB_STYLE_XTERM)
2063 { 2064 {
2064 if (scrollBar.above_slider (ev.y)) 2065 if (scrollBar.above_slider (ev.y))
2065# ifdef RXVT_SCROLL_FULL 2066# ifdef RXVT_SCROLL_FULL
2066 scr_page (UP, nrow - 1); 2067 scr_page (UP, nrow - 1);
2067# else 2068# else
2072 scr_page (DN, nrow - 1); 2073 scr_page (DN, nrow - 1);
2073# else 2074# else
2074 scr_page (DN, nrow / 4); 2075 scr_page (DN, nrow / 4);
2075# endif 2076# endif
2076 else 2077 else
2077 scrollBar.state = STATE_MOTION; 2078 scrollBar.state = SB_STATE_MOTION;
2078 } 2079 }
2079 else 2080 else
2080 { 2081 {
2081 scr_page ((ev.button == Button1 ? DN : UP), 2082 scr_page ((ev.button == Button1 ? DN : UP),
2082 (nrow 2083 (nrow
2099 2100
2100 csrO = 0; /* reset csr Offset */ 2101 csrO = 0; /* reset csr Offset */
2101 if (!bypass_keystate) 2102 if (!bypass_keystate)
2102 reportmode = !! (priv_modes & PrivMode_mouse_report); 2103 reportmode = !! (priv_modes & PrivMode_mouse_report);
2103 2104
2104 if (scrollBar.state == STATE_UP || scrollBar.state == STATE_DOWN) 2105 if (scrollBar.state == SB_STATE_UP || scrollBar.state == SB_STATE_DOWN)
2105 { 2106 {
2106 scrollBar.state = STATE_IDLE; 2107 scrollBar.state = SB_STATE_IDLE;
2107 scrollBar.show (0); 2108 scrollBar.show (0);
2108 } 2109 }
2109 2110
2110#ifdef SELECTION_SCROLLING 2111#ifdef SELECTION_SCROLLING
2111 sel_scroll_ev.stop(); 2112 sel_scroll_ev.stop();
2590 break; 2591 break;
2591 case 'Z': /* identify the terminal type */ 2592 case 'Z': /* identify the terminal type */
2592 tt_printf ("\033/Z"); /* I am a VT100 emulating a VT52 */ 2593 tt_printf ("\033/Z"); /* I am a VT100 emulating a VT52 */
2593 break; 2594 break;
2594 case '<': /* turn off VT52 mode */ 2595 case '<': /* turn off VT52 mode */
2595 set_privmode (PrivMode_vt52, 0); 2596 priv_modes &= ~PrivMode_vt52;
2596 break; 2597 break;
2597 case 'F': /* use special graphics character set */ 2598 case 'F': /* use special graphics character set */
2598 case 'G': /* use regular character set */ 2599 case 'G': /* use regular character set */
2599 /* unimplemented */ 2600 /* unimplemented */
2600 break; 2601 break;
2653 scr_forwardindex (); 2654 scr_forwardindex ();
2654 break; 2655 break;
2655#endif 2656#endif
2656 // DECPAM/DECPNM 2657 // DECPAM/DECPNM
2657 case '=': 2658 case '=':
2659 priv_modes |= PrivMode_aplKP;
2660 break;
2658 case '>': 2661 case '>':
2659 set_privmode (PrivMode_aplKP, ch == '='); 2662 priv_modes &= ~PrivMode_aplKP;
2660 break; 2663 break;
2661 2664
2662 case C1_40: 2665 case C1_40:
2663 cmd_getc (); 2666 cmd_getc ();
2664 break; 2667 break;
2883 } 2886 }
2884 break; 2887 break;
2885#endif 2888#endif
2886 2889
2887 case CSI_CUU: /* 8.3.22: (1) CURSOR UP */ 2890 case CSI_CUU: /* 8.3.22: (1) CURSOR UP */
2888 case CSI_VPR: /* 8.3.161: (1) LINE POSITION FORWARD */ 2891 case CSI_VPB: /* 8.3.160: (1) LINE POSITION BACKWARD */
2889 arg[0] = -arg[0]; 2892 arg[0] = -arg[0];
2890 /* FALLTHROUGH */ 2893 /* FALLTHROUGH */
2891 case CSI_CUD: /* 8.3.19: (1) CURSOR DOWN */ 2894 case CSI_CUD: /* 8.3.19: (1) CURSOR DOWN */
2892 case CSI_VPB: /* 8.3.160: (1) LINE POSITION BACKWARD */ 2895 case CSI_VPR: /* 8.3.161: (1) LINE POSITION FORWARD */
2893 scr_gotorc (arg[0], 0, RELATIVE); 2896 scr_gotorc (arg[0], 0, RELATIVE);
2894 break; 2897 break;
2895 2898
2896 case CSI_CUB: /* 8.3.18: (1) CURSOR LEFT */ 2899 case CSI_CUB: /* 8.3.18: (1) CURSOR LEFT */
2897 case CSI_HPB: /* 8.3.59: (1) CHARACTER POSITION BACKWARD */ 2900 case CSI_HPB: /* 8.3.59: (1) CHARACTER POSITION BACKWARD */
3585 if (mode == 'r') 3588 if (mode == 'r')
3586 state = (SavedModes & bit) ? 1 : 0; /* no overlapping */ 3589 state = (SavedModes & bit) ? 1 : 0; /* no overlapping */
3587 else 3590 else
3588 state = (mode == 't') ? ! (priv_modes & bit) : mode; 3591 state = (mode == 't') ? ! (priv_modes & bit) : mode;
3589 3592
3590 set_privmode (bit, state); 3593 if (state)
3594 priv_modes |= bit;
3595 else
3596 priv_modes &= ~bit;
3591 } 3597 }
3592 3598
3593 return state; 3599 return state;
3594} 3600}
3595 3601
3700 case 2: /* VT52 mode */ 3706 case 2: /* VT52 mode */
3701 /* oddball mode. should be set regardless of set/reset 3707 /* oddball mode. should be set regardless of set/reset
3702 * parameter. Return from VT52 mode with an ESC < from 3708 * parameter. Return from VT52 mode with an ESC < from
3703 * within VT52 mode 3709 * within VT52 mode
3704 */ 3710 */
3705 set_privmode (PrivMode_vt52, 1); 3711 priv_modes |= PrivMode_vt52;
3706 break; 3712 break;
3707 case 3: /* 80/132 */ 3713 case 3: /* 80/132 */
3708 if (priv_modes & PrivMode_132OK) 3714 if (priv_modes & PrivMode_132OK)
3709 set_widthheight ((state ? 132 : 80) * fwidth, 24 * fheight); 3715 set_widthheight ((state ? 132 : 80) * fwidth, 24 * fheight);
3710 break; 3716 break;
3725 if (state) /* orthogonal */ 3731 if (state) /* orthogonal */
3726 priv_modes &= ~(PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); 3732 priv_modes &= ~(PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent);
3727 break; 3733 break;
3728#ifdef scrollBar_esc 3734#ifdef scrollBar_esc
3729 case scrollBar_esc: 3735 case scrollBar_esc:
3730 if (scrollBar.map (state)) 3736 scrollBar.map (state);
3731 {
3732 resize_all_windows (0, 0, 0); 3737 resize_all_windows (0, 0, 0);
3733 scr_touch (true); 3738 scr_touch (true);
3734 }
3735 break; 3739 break;
3736#endif 3740#endif
3737 case 25: /* visible/invisible cursor */ 3741 case 25: /* visible/invisible cursor */
3738 scr_cursor_visible (state); 3742 scr_cursor_visible (state);
3739 break; 3743 break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines