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.486 by sf-exg, Fri Apr 29 13:29:45 2011 UTC vs.
Revision 1.497 by sf-exg, Thu Sep 1 08:11:26 2011 UTC

987 } 987 }
988 988
989 scr_refresh (); 989 scr_refresh ();
990 scrollBar.show (1); 990 scrollBar.show (1);
991#ifdef USE_XIM 991#ifdef USE_XIM
992 IMSendSpot (); 992 im_send_spot ();
993#endif 993#endif
994 } 994 }
995 995
996 display->flush (); 996 display->flush ();
997} 997}
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
1473 } 1473 }
1474 else 1474 else
1475 { 1475 {
1476#ifdef HAVE_BG_PIXMAP 1476#ifdef HAVE_BG_PIXMAP
1477 if (moved) 1477 if (moved)
1478 {
1479 if (mapped)
1480 update_background (); 1478 update_background ();
1481 else
1482 bg_invalidate ();
1483 }
1484#endif 1479#endif
1485 } 1480 }
1486 1481
1487 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); 1482 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
1488 } 1483 }
1562 while (XCheckTypedWindowEvent (dpy, ev.xany.window, GraphicsExpose, &unused_event)) 1557 while (XCheckTypedWindowEvent (dpy, ev.xany.window, GraphicsExpose, &unused_event))
1563 ; 1558 ;
1564 1559
1565 if (scrollBar.state && ev.xany.window == scrollBar.win) 1560 if (scrollBar.state && ev.xany.window == scrollBar.win)
1566 { 1561 {
1567 scrollBar.state = STATE_IDLE; 1562 scrollBar.state = SB_STATE_IDLE;
1568 scrollBar.show (0); 1563 scrollBar.show (0);
1569 } 1564 }
1570 } 1565 }
1571 break; 1566 break;
1572 1567
1660#ifdef MOUSE_THRESHOLD 1655#ifdef MOUSE_THRESHOLD
1661 } 1656 }
1662#endif 1657#endif
1663 } 1658 }
1664 } 1659 }
1665 else if (scrollBar.state == STATE_MOTION && ev.xany.window == scrollBar.win) 1660 else if (scrollBar.state == SB_STATE_MOTION && ev.xany.window == scrollBar.win)
1666 { 1661 {
1667 while (XCheckTypedWindowEvent (dpy, scrollBar.win, 1662 while (XCheckTypedWindowEvent (dpy, scrollBar.win,
1668 MotionNotify, &ev)) 1663 MotionNotify, &ev))
1669 ; 1664 ;
1670 1665
1671 XQueryPointer (dpy, scrollBar.win, 1666 XQueryPointer (dpy, scrollBar.win,
1672 &unused_root, &unused_child, 1667 &unused_root, &unused_child,
1673 &unused_root_x, &unused_root_y, 1668 &unused_root_x, &unused_root_y,
1674 &ev.xbutton.x, &ev.xbutton.y, 1669 &ev.xbutton.x, &ev.xbutton.y,
1675 &unused_mask); 1670 &unused_mask);
1676 scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, 1671 scr_move_to (scrollBar.position (ev.xbutton.y) - csrO,
1677 scrollBar.size ()); 1672 scrollBar.size ());
1678 want_refresh = 1; 1673 want_refresh = 1;
1679 scrollBar.show (1); 1674 scrollBar.show (1);
1680 } 1675 }
1681 break; 1676 break;
1736 want_refresh = 1; 1731 want_refresh = 1;
1737 1732
1738#if USE_XIM 1733#if USE_XIM
1739 if (Input_Context != NULL) 1734 if (Input_Context != NULL)
1740 { 1735 {
1741 IMSetPosition (); 1736 im_set_position ();
1742 XSetICFocus (Input_Context); 1737 XSetICFocus (Input_Context);
1743 } 1738 }
1744#endif 1739#endif
1745#if CURSOR_BLINK 1740#if CURSOR_BLINK
1746 if (option (Opt_cursorBlink)) 1741 if (option (Opt_cursorBlink))
1977 if (scrollBar.upButton (ev.y)) 1972 if (scrollBar.upButton (ev.y))
1978 direction = UP; /* up */ 1973 direction = UP; /* up */
1979 else if (scrollBar.dnButton (ev.y)) 1974 else if (scrollBar.dnButton (ev.y))
1980 direction = DN; /* down */ 1975 direction = DN; /* down */
1981 1976
1982 scrollBar.state = STATE_IDLE; 1977 scrollBar.state = SB_STATE_IDLE;
1983 /* 1978 /*
1984 * Rxvt-style scrollbar: 1979 * Rxvt-style scrollbar:
1985 * move up if mouse is above slider 1980 * move up if mouse is above slider
1986 * move dn if mouse is below slider 1981 * move dn if mouse is below slider
1987 * 1982 *
2026 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 2021 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
2027#endif 2022#endif
2028 if (scr_page (direction, 1)) 2023 if (scr_page (direction, 1))
2029 { 2024 {
2030 if (direction == UP) 2025 if (direction == UP)
2031 scrollBar.state = STATE_UP; 2026 scrollBar.state = SB_STATE_UP;
2032 else 2027 else
2033 scrollBar.state = STATE_DOWN; 2028 scrollBar.state = SB_STATE_DOWN;
2034 } 2029 }
2035 } 2030 }
2036 else 2031 else
2037 switch (ev.button) 2032 switch (ev.button)
2038 { 2033 {
2039 case Button2: 2034 case Button2:
2040 switch (scrollBar.align) 2035 switch (scrollBar.align)
2041 { 2036 {
2042 case R_SB_ALIGN_TOP: 2037 case SB_ALIGN_TOP:
2043 csrO = 0; 2038 csrO = 0;
2044 break; 2039 break;
2045 case R_SB_ALIGN_CENTRE: 2040 case SB_ALIGN_CENTRE:
2046 csrO = (scrollBar.bot - scrollBar.top) / 2; 2041 csrO = (scrollBar.bot - scrollBar.top) / 2;
2047 break; 2042 break;
2048 case R_SB_ALIGN_BOTTOM: 2043 case SB_ALIGN_BOTTOM:
2049 csrO = scrollBar.bot - scrollBar.top; 2044 csrO = scrollBar.bot - scrollBar.top;
2050 break; 2045 break;
2051 } 2046 }
2052 2047
2053 if (scrollBar.style == R_SB_XTERM 2048 if (scrollBar.style == SB_STYLE_XTERM
2054 || scrollbar_above_slider (ev.y) 2049 || scrollBar.above_slider (ev.y)
2055 || scrollbar_below_slider (ev.y)) 2050 || scrollBar.below_slider (ev.y))
2056 scr_move_to (scrollbar_position (ev.y) - csrO, scrollBar.size ()); 2051 scr_move_to (scrollBar.position (ev.y) - csrO, scrollBar.size ());
2057 2052
2058 scrollBar.state = STATE_MOTION; 2053 scrollBar.state = SB_STATE_MOTION;
2059 break; 2054 break;
2060 2055
2061 case Button1: 2056 case Button1:
2062 if (scrollBar.align == R_SB_ALIGN_CENTRE) 2057 if (scrollBar.align == SB_ALIGN_CENTRE)
2063 csrO = ev.y - scrollBar.top; 2058 csrO = ev.y - scrollBar.top;
2064 /* FALLTHROUGH */ 2059 /* FALLTHROUGH */
2065 2060
2066 case Button3: 2061 case Button3:
2067 if (scrollBar.style != R_SB_XTERM) 2062 if (scrollBar.style != SB_STYLE_XTERM)
2068 { 2063 {
2069 if (scrollbar_above_slider (ev.y)) 2064 if (scrollBar.above_slider (ev.y))
2070# ifdef RXVT_SCROLL_FULL 2065# ifdef RXVT_SCROLL_FULL
2071 scr_page (UP, nrow - 1); 2066 scr_page (UP, nrow - 1);
2072# else 2067# else
2073 scr_page (UP, nrow / 4); 2068 scr_page (UP, nrow / 4);
2074# endif 2069# endif
2075 else if (scrollbar_below_slider (ev.y)) 2070 else if (scrollBar.below_slider (ev.y))
2076# ifdef RXVT_SCROLL_FULL 2071# ifdef RXVT_SCROLL_FULL
2077 scr_page (DN, nrow - 1); 2072 scr_page (DN, nrow - 1);
2078# else 2073# else
2079 scr_page (DN, nrow / 4); 2074 scr_page (DN, nrow / 4);
2080# endif 2075# endif
2081 else 2076 else
2082 scrollBar.state = STATE_MOTION; 2077 scrollBar.state = SB_STATE_MOTION;
2083 } 2078 }
2084 else 2079 else
2085 { 2080 {
2086 scr_page ((ev.button == Button1 ? DN : UP), 2081 scr_page ((ev.button == Button1 ? DN : UP),
2087 (nrow 2082 (nrow
2088 * scrollbar_position (ev.y) 2083 * scrollBar.position (ev.y)
2089 / scrollBar.size ())); 2084 / scrollBar.size ()));
2090 } 2085 }
2091 2086
2092 break; 2087 break;
2093 } 2088 }
2104 2099
2105 csrO = 0; /* reset csr Offset */ 2100 csrO = 0; /* reset csr Offset */
2106 if (!bypass_keystate) 2101 if (!bypass_keystate)
2107 reportmode = !! (priv_modes & PrivMode_mouse_report); 2102 reportmode = !! (priv_modes & PrivMode_mouse_report);
2108 2103
2109 if (scrollBar.state == STATE_UP || scrollBar.state == STATE_DOWN) 2104 if (scrollBar.state == SB_STATE_UP || scrollBar.state == SB_STATE_DOWN)
2110 { 2105 {
2111 scrollBar.state = STATE_IDLE; 2106 scrollBar.state = SB_STATE_IDLE;
2112 scrollBar.show (0); 2107 scrollBar.show (0);
2113 } 2108 }
2114 2109
2115#ifdef SELECTION_SCROLLING 2110#ifdef SELECTION_SCROLLING
2116 sel_scroll_ev.stop(); 2111 sel_scroll_ev.stop();
2219 wchar_t ch = NOCHAR; 2214 wchar_t ch = NOCHAR;
2220 char *seq_begin; // remember start of esc-sequence here 2215 char *seq_begin; // remember start of esc-sequence here
2221 2216
2222 for (;;) 2217 for (;;)
2223 { 2218 {
2224 if (expect_false (ch == NOCHAR)) 2219 if (ecb_unlikely (ch == NOCHAR))
2225 { 2220 {
2226 seq_begin = cmdbuf_ptr; 2221 seq_begin = cmdbuf_ptr;
2227 ch = next_char (); 2222 ch = next_char ();
2228 2223
2229 if (ch == NOCHAR) 2224 if (ch == NOCHAR)
2230 break; 2225 break;
2231 } 2226 }
2232 2227
2233 if (expect_true (!IS_CONTROL (ch) || ch == C0_LF || ch == C0_CR || ch == C0_HT)) 2228 if (ecb_likely (!IS_CONTROL (ch) || ch == C0_LF || ch == C0_CR || ch == C0_HT))
2234 { 2229 {
2235 if (expect_false (!seen_input)) 2230 if (ecb_unlikely (!seen_input))
2236 { 2231 {
2237 seen_input = 1; 2232 seen_input = 1;
2238 // many badly-written programs (e.g. jed) contain a race condition: 2233 // many badly-written programs (e.g. jed) contain a race condition:
2239 // they first read the screensize and then install a SIGWINCH handler. 2234 // they first read the screensize and then install a SIGWINCH handler.
2240 // some window managers resize the window early, and these programs 2235 // some window managers resize the window early, and these programs
2253 wchar_t *str = buf; 2248 wchar_t *str = buf;
2254 wchar_t *eol = str + min (ncol, UBUFSIZ); 2249 wchar_t *eol = str + min (ncol, UBUFSIZ);
2255 2250
2256 for (;;) 2251 for (;;)
2257 { 2252 {
2258 if (expect_false (ch == NOCHAR || (IS_CONTROL (ch) && ch != C0_LF && ch != C0_CR && ch != C0_HT))) 2253 if (ecb_unlikely (ch == NOCHAR || (IS_CONTROL (ch) && ch != C0_LF && ch != C0_CR && ch != C0_HT)))
2259 break; 2254 break;
2260 2255
2261 *str++ = ch; 2256 *str++ = ch;
2262 2257
2263 if (expect_false (ch == C0_LF || str >= eol)) 2258 if (ecb_unlikely (ch == C0_LF || str >= eol))
2264 { 2259 {
2265 if (ch == C0_LF) 2260 if (ch == C0_LF)
2266 nlines++; 2261 nlines++;
2267 2262
2268 refresh_count++; 2263 refresh_count++;
2346rxvt_term::next_char () NOTHROW 2341rxvt_term::next_char () NOTHROW
2347{ 2342{
2348 while (cmdbuf_ptr < cmdbuf_endp) 2343 while (cmdbuf_ptr < cmdbuf_endp)
2349 { 2344 {
2350 // assume 7-bit to be ascii ALWAYS 2345 // assume 7-bit to be ascii ALWAYS
2351 if (expect_true ((unsigned char)*cmdbuf_ptr <= 0x7f && *cmdbuf_ptr != 0x1b)) 2346 if (ecb_likely ((unsigned char)*cmdbuf_ptr <= 0x7f && *cmdbuf_ptr != 0x1b))
2352 return *cmdbuf_ptr++; 2347 return *cmdbuf_ptr++;
2353 2348
2354 wchar_t wc; 2349 wchar_t wc;
2355 size_t len = mbrtowc (&wc, cmdbuf_ptr, cmdbuf_endp - cmdbuf_ptr, mbstate); 2350 size_t len = mbrtowc (&wc, cmdbuf_ptr, cmdbuf_endp - cmdbuf_ptr, mbstate);
2356 2351
2595 break; 2590 break;
2596 case 'Z': /* identify the terminal type */ 2591 case 'Z': /* identify the terminal type */
2597 tt_printf ("\033/Z"); /* I am a VT100 emulating a VT52 */ 2592 tt_printf ("\033/Z"); /* I am a VT100 emulating a VT52 */
2598 break; 2593 break;
2599 case '<': /* turn off VT52 mode */ 2594 case '<': /* turn off VT52 mode */
2600 set_privmode (PrivMode_vt52, 0); 2595 priv_modes &= ~PrivMode_vt52;
2601 break; 2596 break;
2602 case 'F': /* use special graphics character set */ 2597 case 'F': /* use special graphics character set */
2603 case 'G': /* use regular character set */ 2598 case 'G': /* use regular character set */
2604 /* unimplemented */ 2599 /* unimplemented */
2605 break; 2600 break;
2624 return; 2619 return;
2625 } 2620 }
2626 2621
2627 switch (ch) 2622 switch (ch)
2628 { 2623 {
2629 /* case 1: do_tek_mode (); break; */
2630 case '#': 2624 case '#':
2631 if (cmd_getc () == '8') 2625 if (cmd_getc () == '8')
2632 scr_E (); 2626 scr_E ();
2633 break; 2627 break;
2634 case '(': 2628 case '(':
2657#if !ENABLE_MINIMAL 2651#if !ENABLE_MINIMAL
2658 case '9': 2652 case '9':
2659 scr_forwardindex (); 2653 scr_forwardindex ();
2660 break; 2654 break;
2661#endif 2655#endif
2656 // DECPAM/DECPNM
2662 case '=': 2657 case '=':
2658 priv_modes |= PrivMode_aplKP;
2659 break;
2663 case '>': 2660 case '>':
2664 set_privmode (PrivMode_aplKP, ch == '='); 2661 priv_modes &= ~PrivMode_aplKP;
2665 break; 2662 break;
2666 2663
2667 case C1_40: 2664 case C1_40:
2668 cmd_getc (); 2665 cmd_getc ();
2669 break; 2666 break;
2673 2670
2674 /* 8.3.87: NEXT LINE */ 2671 /* 8.3.87: NEXT LINE */
2675 case C1_NEL: /* ESC E */ 2672 case C1_NEL: /* ESC E */
2676 { 2673 {
2677 wchar_t nlcr[] = { C0_LF, C0_CR }; 2674 wchar_t nlcr[] = { C0_LF, C0_CR };
2678 scr_add_lines (nlcr, ARRAY_LENGTH(nlcr), 1); 2675 scr_add_lines (nlcr, ecb_array_length (nlcr), 1);
2679 } 2676 }
2680 break; 2677 break;
2681 2678
2682 /* kidnapped escape sequence: Should be 8.3.48 */ 2679 /* kidnapped escape sequence: Should be 8.3.48 */
2683 case C1_ESA: /* ESC G */ 2680 case C1_ESA: /* ESC G */
2695 case C1_RI: /* ESC M */ 2692 case C1_RI: /* ESC M */
2696 scr_index (DN); 2693 scr_index (DN);
2697 break; 2694 break;
2698 2695
2699 /* 8.3.142: SINGLE-SHIFT TWO */ 2696 /* 8.3.142: SINGLE-SHIFT TWO */
2700 /*case C1_SS2: scr_single_shift (2); break; */ 2697 /* case C1_SS2: break; */
2701 2698
2702 /* 8.3.143: SINGLE-SHIFT THREE */ 2699 /* 8.3.143: SINGLE-SHIFT THREE */
2703 /*case C1_SS3: scr_single_shift (3); break; */ 2700 /* case C1_SS3: break; */
2704 2701
2705 /* 8.3.27: DEVICE CONTROL STRING */ 2702 /* 8.3.27: DEVICE CONTROL STRING */
2706 case C1_DCS: /* ESC P */ 2703 case C1_DCS: /* ESC P */
2707 process_dcs_seq (); 2704 process_dcs_seq ();
2708 break; 2705 break;
2859 scr_soft_reset (); 2856 scr_soft_reset ();
2860 2857
2861 static const int pm_h[] = { 7, 25 }; 2858 static const int pm_h[] = { 7, 25 };
2862 static const int pm_l[] = { 1, 3, 4, 5, 6, 9, 66, 1000, 1001, 1005, 1015, 1049 }; 2859 static const int pm_l[] = { 1, 3, 4, 5, 6, 9, 66, 1000, 1001, 1005, 1015, 1049 };
2863 2860
2864 process_terminal_mode ('h', 0, ARRAY_LENGTH(pm_h), pm_h); 2861 process_terminal_mode ('h', 0, ecb_array_length (pm_h), pm_h);
2865 process_terminal_mode ('l', 0, ARRAY_LENGTH(pm_l), pm_l); 2862 process_terminal_mode ('l', 0, ecb_array_length (pm_l), pm_l);
2866 } 2863 }
2867 break; 2864 break;
2868 } 2865 }
2869 2866
2870 return; 2867 return;
3453 min (h_align, 32767), min (v_align, 32767)); 3450 min (h_align, 32767), min (v_align, 32767));
3454 process_xterm_seq (XTerm_title, str, CHAR_ST); 3451 process_xterm_seq (XTerm_title, str, CHAR_ST);
3455 } 3452 }
3456 else 3453 else
3457 { 3454 {
3458 int changed = 0; 3455 bool changed = false;
3459 3456
3460 if (*str != ';') 3457 if (*str != ';')
3461 { 3458 {
3462 if (bg_set_file (str)) /* change pixmap */ 3459 if (bg_set_file (str)) /* change pixmap */
3463 {
3464 changed++; 3460 changed = true;
3465 str = strchr (str, ';');
3466 if (str == NULL)
3467 bg_set_default_geometry ();
3468 else
3469 bg_set_geometry (str+1);
3470 }
3471 } 3461 }
3472 else 3462 else
3473 { 3463 {
3474 str++; 3464 str++;
3475 if (bg_set_geometry (str, true)) 3465 if (bg_set_geometry (str, true))
3476 changed++; 3466 changed = true;
3477 } 3467 }
3478 3468
3479 if (changed) 3469 if (changed)
3480 { 3470 {
3481 if (bg_window_position_sensitive ()) 3471 if (bg_window_position_sensitive ())
3597 if (mode == 'r') 3587 if (mode == 'r')
3598 state = (SavedModes & bit) ? 1 : 0; /* no overlapping */ 3588 state = (SavedModes & bit) ? 1 : 0; /* no overlapping */
3599 else 3589 else
3600 state = (mode == 't') ? ! (priv_modes & bit) : mode; 3590 state = (mode == 't') ? ! (priv_modes & bit) : mode;
3601 3591
3602 set_privmode (bit, state); 3592 if (state)
3593 priv_modes |= bit;
3594 else
3595 priv_modes &= ~bit;
3603 } 3596 }
3604 3597
3605 return state; 3598 return state;
3606} 3599}
3607 3600
3608/* we're not using priv _yet_ */ 3601/* we're not using priv _yet_ */
3609void 3602void
3610rxvt_term::process_terminal_mode (int mode, int priv UNUSED, unsigned int nargs, const int *arg) 3603rxvt_term::process_terminal_mode (int mode, int priv ecb_unused, unsigned int nargs, const int *arg)
3611{ 3604{
3612 unsigned int i, j; 3605 unsigned int i, j;
3613 int state; 3606 int state;
3614 3607
3615 static const struct 3608 static const struct
3616 { 3609 {
3617 const int argval; 3610 const int argval;
3618 const unsigned long bit; 3611 const unsigned long bit;
3619 } argtopriv[] = { 3612 } argtopriv[] = {
3620 { 1, PrivMode_aplCUR }, // DECCKM 3613 { 1, PrivMode_aplCUR }, // DECCKM
3621 { 2, PrivMode_vt52 }, 3614 { 2, PrivMode_vt52 }, // DECANM
3622 { 3, PrivMode_132 }, // DECCOLM 3615 { 3, PrivMode_132 }, // DECCOLM
3623 { 4, PrivMode_smoothScroll }, // DECSCLM 3616 { 4, PrivMode_smoothScroll }, // DECSCLM
3624 { 5, PrivMode_rVideo }, // DECSCNM 3617 { 5, PrivMode_rVideo }, // DECSCNM
3625 { 6, PrivMode_relOrigin }, // DECOM 3618 { 6, PrivMode_relOrigin }, // DECOM
3626 { 7, PrivMode_Autowrap }, // DECAWM 3619 { 7, PrivMode_Autowrap }, // DECAWM
3627 // 8, auto-repeat keys // DECARM 3620 // 8, auto-repeat keys // DECARM
3628 { 9, PrivMode_MouseX10 }, 3621 { 9, PrivMode_MouseX10 },
3629 // 18 end FF to printer after print screen 3622 // 18 end FF to printer after print screen
3630 // 19 Print screen prints full screen/scroll region 3623 // 19 Print screen prints full screen/scroll region
3631 { 25, PrivMode_VisibleCursor }, // cnorm/cvvis/civis 3624 { 25, PrivMode_VisibleCursor }, // DECTCEM cnorm/cvvis/civis
3632#ifdef scrollBar_esc 3625#ifdef scrollBar_esc
3633 { scrollBar_esc, PrivMode_scrollBar }, 3626 { scrollBar_esc, PrivMode_scrollBar },
3634#endif 3627#endif
3635 { 35, PrivMode_ShiftKeys }, // rxvt extension 3628 { 35, PrivMode_ShiftKeys }, // rxvt extension
3636 // 38, tektronix mode // DECTEK 3629 // 38, tektronix mode // DECTEK
3637 { 40, PrivMode_132OK }, 3630 { 40, PrivMode_132OK },
3638 // 41 xterm more fixes NYI 3631 // 41 xterm more fixes NYI
3639 // 45 margin bell NYI 3632 // 45 margin bell NYI
3640 // 46 start logging 3633 // 46 start logging
3641 { 47, PrivMode_Screen }, 3634 { 47, PrivMode_Screen },
3642 { 66, PrivMode_aplKP }, // DECPAM/DECPNM 3635 { 66, PrivMode_aplKP }, // DECNKM
3643#ifndef NO_BACKSPACE_KEY 3636#ifndef NO_BACKSPACE_KEY
3644 { 67, PrivMode_BackSpace }, // DECBKM 3637 { 67, PrivMode_BackSpace }, // DECBKM
3645#endif 3638#endif
3646 { 1000, PrivMode_MouseX11 }, 3639 { 1000, PrivMode_MouseX11 },
3647 { 1002, PrivMode_MouseBtnEvent }, 3640 { 1002, PrivMode_MouseBtnEvent },
3676 for (i = 0; i < nargs; i++) 3669 for (i = 0; i < nargs; i++)
3677 { 3670 {
3678 state = -1; 3671 state = -1;
3679 3672
3680 /* basic handling */ 3673 /* basic handling */
3681 for (j = 0; j < ARRAY_LENGTH(argtopriv); j++) 3674 for (j = 0; j < ecb_array_length (argtopriv); j++)
3682 if (argtopriv[j].argval == arg[i]) 3675 if (argtopriv[j].argval == arg[i])
3683 { 3676 {
3684 state = privcases (mode, argtopriv[j].bit); 3677 state = privcases (mode, argtopriv[j].bit);
3685 break; 3678 break;
3686 } 3679 }
3712 case 2: /* VT52 mode */ 3705 case 2: /* VT52 mode */
3713 /* oddball mode. should be set regardless of set/reset 3706 /* oddball mode. should be set regardless of set/reset
3714 * parameter. Return from VT52 mode with an ESC < from 3707 * parameter. Return from VT52 mode with an ESC < from
3715 * within VT52 mode 3708 * within VT52 mode
3716 */ 3709 */
3717 set_privmode (PrivMode_vt52, 1); 3710 priv_modes |= PrivMode_vt52;
3718 break; 3711 break;
3719 case 3: /* 80/132 */ 3712 case 3: /* 80/132 */
3720 if (priv_modes & PrivMode_132OK) 3713 if (priv_modes & PrivMode_132OK)
3721 set_widthheight ((state ? 132 : 80) * fwidth, 24 * fheight); 3714 set_widthheight ((state ? 132 : 80) * fwidth, 24 * fheight);
3722 break; 3715 break;
3737 if (state) /* orthogonal */ 3730 if (state) /* orthogonal */
3738 priv_modes &= ~(PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); 3731 priv_modes &= ~(PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent);
3739 break; 3732 break;
3740#ifdef scrollBar_esc 3733#ifdef scrollBar_esc
3741 case scrollBar_esc: 3734 case scrollBar_esc:
3742 if (scrollBar.map (state)) 3735 scrollBar.map (state);
3743 {
3744 resize_all_windows (0, 0, 0); 3736 resize_all_windows (0, 0, 0);
3745 scr_touch (true); 3737 scr_touch (true);
3746 }
3747 break; 3738 break;
3748#endif 3739#endif
3749 case 25: /* visible/invisible cursor */ 3740 case 25: /* visible/invisible cursor */
3750 scr_cursor_visible (state); 3741 scr_cursor_visible (state);
3751 break; 3742 break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines