… | |
… | |
43 | * along with this program; if not, write to the Free Software |
43 | * along with this program; if not, write to the Free Software |
44 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
44 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
45 | *----------------------------------------------------------------------*/ |
45 | *----------------------------------------------------------------------*/ |
46 | |
46 | |
47 | /*{{{ includes: */ |
47 | /*{{{ includes: */ |
48 | #include "../config.h" /* NECESSARY */ |
48 | #include "../config.h" |
49 | #include "rxvt.h" /* NECESSARY */ |
49 | #include "rxvt.h" |
|
|
50 | #include "rxvtperl.h" |
50 | #include "version.h" |
51 | #include "version.h" |
51 | #include "command.h" |
52 | #include "command.h" |
|
|
53 | |
|
|
54 | #if HAVE_SCHED_YIELD |
|
|
55 | # include <sched.h> |
|
|
56 | #endif |
52 | |
57 | |
53 | #ifdef KEYSYM_RESOURCE |
58 | #ifdef KEYSYM_RESOURCE |
54 | # include "keyboard.h" |
59 | # include "keyboard.h" |
55 | #endif |
60 | #endif |
56 | |
61 | |
… | |
… | |
155 | } |
160 | } |
156 | |
161 | |
157 | x--; |
162 | x--; |
158 | } |
163 | } |
159 | } |
164 | } |
160 | #endif |
|
|
161 | |
165 | |
162 | void |
166 | void |
163 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
167 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
164 | { |
168 | { |
165 | #if ENABLE_OVERLAY |
|
|
166 | rxvt_fontset *fs = FONTSET (r); |
169 | rxvt_fontset *fs = FONTSET (r); |
167 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
170 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
168 | wchar_t *chr, *alloc, ch2, *fname; |
171 | wchar_t *chr, *alloc, ch2, *fname; |
169 | int len; |
172 | int len; |
170 | |
173 | |
… | |
… | |
238 | |
241 | |
239 | # if ENABLE_COMBINING |
242 | # if ENABLE_COMBINING |
240 | if (alloc) |
243 | if (alloc) |
241 | delete [] alloc; |
244 | delete [] alloc; |
242 | # endif |
245 | # endif |
243 | #endif |
|
|
244 | } |
246 | } |
|
|
247 | #endif |
245 | |
248 | |
246 | void |
249 | void |
247 | rxvt_term::commit_iso14755 () |
250 | rxvt_term::commit_iso14755 () |
248 | { |
251 | { |
249 | wchar_t ch[2]; |
252 | wchar_t ch[2]; |
… | |
… | |
866 | } |
869 | } |
867 | |
870 | |
868 | if (len <= 0) |
871 | if (len <= 0) |
869 | return; /* not mapped */ |
872 | return; /* not mapped */ |
870 | |
873 | |
871 | if (options & Opt_scrollTtyKeypress) |
874 | if (OPTION (Opt_scrollTtyKeypress)) |
872 | if (view_start) |
875 | if (view_start) |
873 | { |
876 | { |
874 | view_start = 0; |
877 | view_start = 0; |
875 | want_refresh = 1; |
878 | want_refresh = 1; |
876 | } |
879 | } |
… | |
… | |
982 | SET_LOCALE (locale); |
985 | SET_LOCALE (locale); |
983 | |
986 | |
984 | display->flush (); |
987 | display->flush (); |
985 | |
988 | |
986 | if (want_refresh && !flush_ev.active) |
989 | if (want_refresh && !flush_ev.active) |
987 | flush_ev.start (NOW + 0.01); |
990 | flush_ev.start (NOW + 1. / 60.); // refresh at max. 60 hz normally |
988 | } |
991 | } |
989 | |
992 | |
990 | void |
993 | void |
991 | rxvt_term::flush_cb (time_watcher &w) |
994 | rxvt_term::flush_cb (time_watcher &w) |
992 | { |
995 | { |
… | |
… | |
1067 | w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY); |
1070 | w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY); |
1068 | } |
1071 | } |
1069 | } |
1072 | } |
1070 | #endif |
1073 | #endif |
1071 | |
1074 | |
|
|
1075 | #if HAVE_SCHED_YIELD |
|
|
1076 | static struct event_handler |
|
|
1077 | { |
|
|
1078 | check_watcher cw_yield; |
|
|
1079 | |
|
|
1080 | void yield (check_watcher &w) |
|
|
1081 | { |
|
|
1082 | sched_yield (); |
|
|
1083 | w.stop (); |
|
|
1084 | } |
|
|
1085 | |
|
|
1086 | event_handler () |
|
|
1087 | : cw_yield (this, &event_handler::yield) |
|
|
1088 | { |
|
|
1089 | } |
|
|
1090 | } event_handler; |
|
|
1091 | #endif |
|
|
1092 | |
1072 | bool |
1093 | bool |
1073 | rxvt_term::pty_fill () |
1094 | rxvt_term::pty_fill () |
1074 | { |
1095 | { |
1075 | ssize_t n = cmdbuf_endp - cmdbuf_ptr; |
1096 | ssize_t n = cmdbuf_endp - cmdbuf_ptr; |
1076 | |
1097 | |
… | |
… | |
1082 | |
1103 | |
1083 | memmove (cmdbuf_base, cmdbuf_ptr, n); |
1104 | memmove (cmdbuf_base, cmdbuf_ptr, n); |
1084 | cmdbuf_ptr = cmdbuf_base; |
1105 | cmdbuf_ptr = cmdbuf_base; |
1085 | cmdbuf_endp = cmdbuf_ptr + n; |
1106 | cmdbuf_endp = cmdbuf_ptr + n; |
1086 | |
1107 | |
1087 | n = read (pty.pty, cmdbuf_endp, CBUFSIZ - n); |
1108 | ssize_t r = read (pty.pty, cmdbuf_endp, CBUFSIZ - n); |
1088 | |
1109 | |
1089 | if (n > 0) |
1110 | if (r > 0) |
1090 | { |
1111 | { |
1091 | cmdbuf_endp += n; |
1112 | cmdbuf_endp += r; |
1092 | return true; |
1113 | return true; |
1093 | } |
1114 | } |
1094 | else if ((n < 0 && errno != EAGAIN && errno != EINTR) || n == 0) |
1115 | else if (r < 0 && (errno == EAGAIN || errno == EINTR)) |
|
|
1116 | { |
|
|
1117 | #if HAVE_SCHED_YIELD |
|
|
1118 | event_handler.cw_yield.start (); |
|
|
1119 | #endif |
|
|
1120 | } |
|
|
1121 | else |
1095 | { |
1122 | { |
1096 | pty_ev.stop (); |
1123 | pty_ev.stop (); |
1097 | |
1124 | |
1098 | if (!(options & Opt_hold)) |
1125 | if (!OPTION (Opt_hold)) |
1099 | destroy (); |
1126 | destroy (); |
1100 | } |
1127 | } |
1101 | |
1128 | |
1102 | return false; |
1129 | return false; |
1103 | } |
1130 | } |
… | |
… | |
1125 | recolour_cursor (); |
1152 | recolour_cursor (); |
1126 | |
1153 | |
1127 | #ifdef POINTER_BLANK |
1154 | #ifdef POINTER_BLANK |
1128 | hidden_pointer = 0; |
1155 | hidden_pointer = 0; |
1129 | |
1156 | |
1130 | if (options & Opt_pointerBlank) |
1157 | if (OPTION (Opt_pointerBlank)) |
1131 | pointer_ev.start (NOW + pointerBlankDelay); |
1158 | pointer_ev.start (NOW + pointerBlankDelay); |
1132 | #endif |
1159 | #endif |
1133 | } |
1160 | } |
1134 | |
1161 | |
1135 | #ifdef POINTER_BLANK |
1162 | #ifdef POINTER_BLANK |
1136 | void |
1163 | void |
1137 | rxvt_term::pointer_blank () |
1164 | rxvt_term::pointer_blank () |
1138 | { |
1165 | { |
1139 | if (! (options & Opt_pointerBlank)) |
1166 | if (! OPTION (Opt_pointerBlank)) |
1140 | return; |
1167 | return; |
1141 | |
1168 | |
1142 | XDefineCursor (display->display, vt, display->blank_cursor); |
1169 | XDefineCursor (display->display, vt, display->blank_cursor); |
1143 | XFlush (display->display); |
1170 | XFlush (display->display); |
1144 | |
1171 | |
… | |
… | |
1242 | |
1269 | |
1243 | SET_R (this); |
1270 | SET_R (this); |
1244 | SET_LOCALE (locale); |
1271 | SET_LOCALE (locale); |
1245 | |
1272 | |
1246 | #if defined(CURSOR_BLINK) |
1273 | #if defined(CURSOR_BLINK) |
1247 | if ((options & Opt_cursorBlink) && ev.type == KeyPress) |
1274 | if (OPTION (Opt_cursorBlink) && ev.type == KeyPress) |
1248 | { |
1275 | { |
1249 | if (hidden_cursor) |
1276 | if (hidden_cursor) |
1250 | { |
1277 | { |
1251 | hidden_cursor = 0; |
1278 | hidden_cursor = 0; |
1252 | want_refresh = 1; |
1279 | want_refresh = 1; |
… | |
… | |
1255 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1282 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1256 | } |
1283 | } |
1257 | #endif |
1284 | #endif |
1258 | |
1285 | |
1259 | #if defined(POINTER_BLANK) |
1286 | #if defined(POINTER_BLANK) |
1260 | if ((options & Opt_pointerBlank) && pointerBlankDelay > 0) |
1287 | if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0) |
1261 | { |
1288 | { |
1262 | if (ev.type == MotionNotify |
1289 | if (ev.type == MotionNotify |
1263 | || ev.type == ButtonPress |
1290 | || ev.type == ButtonPress |
1264 | || ev.type == ButtonRelease) |
1291 | || ev.type == ButtonRelease) |
1265 | if (hidden_pointer) |
1292 | if (hidden_pointer) |
… | |
… | |
1461 | seen_resize = 1; |
1488 | seen_resize = 1; |
1462 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1489 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1463 | } |
1490 | } |
1464 | |
1491 | |
1465 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1492 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1466 | if (options & Opt_transparent) |
1493 | if (OPTION (Opt_transparent)) |
1467 | check_our_parents (); |
1494 | check_our_parents (); |
1468 | #endif |
1495 | #endif |
1469 | } |
1496 | } |
1470 | break; |
1497 | break; |
1471 | |
1498 | |
… | |
… | |
1672 | { |
1699 | { |
1673 | if (!focus) |
1700 | if (!focus) |
1674 | { |
1701 | { |
1675 | focus = 1; |
1702 | focus = 1; |
1676 | want_refresh = 1; |
1703 | want_refresh = 1; |
|
|
1704 | |
|
|
1705 | PERL_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
|
|
1706 | |
1677 | #if USE_XIM |
1707 | #if USE_XIM |
1678 | if (Input_Context != NULL) |
1708 | if (Input_Context != NULL) |
1679 | { |
1709 | { |
1680 | IMSetStatusPosition (); |
1710 | IMSetStatusPosition (); |
1681 | XSetICFocus (Input_Context); |
1711 | XSetICFocus (Input_Context); |
1682 | } |
1712 | } |
1683 | #endif |
1713 | #endif |
1684 | #if CURSOR_BLINK |
1714 | #if CURSOR_BLINK |
1685 | if (options & Opt_cursorBlink) |
1715 | if (OPTION (Opt_cursorBlink)) |
1686 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1716 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1687 | #endif |
1717 | #endif |
1688 | #if OFF_FOCUS_FADING |
1718 | #if OFF_FOCUS_FADING |
1689 | if (rs[Rs_fade]) |
1719 | if (rs[Rs_fade]) |
1690 | { |
1720 | { |
… | |
… | |
1701 | if (focus) |
1731 | if (focus) |
1702 | { |
1732 | { |
1703 | focus = 0; |
1733 | focus = 0; |
1704 | want_refresh = 1; |
1734 | want_refresh = 1; |
1705 | |
1735 | |
|
|
1736 | PERL_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
|
|
1737 | |
1706 | #if ENABLE_FRILLS || ISO_14755 |
1738 | #if ENABLE_FRILLS || ISO_14755 |
|
|
1739 | if (iso14755buf) |
|
|
1740 | { |
1707 | iso14755buf = 0; |
1741 | iso14755buf = 0; |
1708 | #endif |
|
|
1709 | #if ENABLE_OVERLAY |
1742 | # if ENABLE_OVERLAY |
1710 | scr_overlay_off (); |
1743 | scr_overlay_off (); |
|
|
1744 | # endif |
|
|
1745 | } |
1711 | #endif |
1746 | #endif |
1712 | #if USE_XIM |
1747 | #if USE_XIM |
1713 | if (Input_Context != NULL) |
1748 | if (Input_Context != NULL) |
1714 | XUnsetICFocus (Input_Context); |
1749 | XUnsetICFocus (Input_Context); |
1715 | #endif |
1750 | #endif |
1716 | #if CURSOR_BLINK |
1751 | #if CURSOR_BLINK |
1717 | if (options & Opt_cursorBlink) |
1752 | if (OPTION (Opt_cursorBlink)) |
1718 | cursor_blink_ev.stop (); |
1753 | cursor_blink_ev.stop (); |
1719 | hidden_cursor = 0; |
1754 | hidden_cursor = 0; |
1720 | #endif |
1755 | #endif |
1721 | #if OFF_FOCUS_FADING |
1756 | #if OFF_FOCUS_FADING |
1722 | if (rs[Rs_fade]) |
1757 | if (rs[Rs_fade]) |
… | |
… | |
1746 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1781 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1747 | return; |
1782 | return; |
1748 | |
1783 | |
1749 | /* FALLTHROUGH */ |
1784 | /* FALLTHROUGH */ |
1750 | case ReparentNotify: |
1785 | case ReparentNotify: |
1751 | if ((options & Opt_transparent) && check_our_parents () && am_transparent) |
1786 | if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) |
1752 | want_refresh = want_full_refresh = 1; |
1787 | want_refresh = want_full_refresh = 1; |
1753 | break; |
1788 | break; |
1754 | } |
1789 | } |
1755 | } |
1790 | } |
1756 | #endif |
1791 | #endif |
… | |
… | |
2098 | |
2133 | |
2099 | v = ev.button == Button4 ? UP : DN; |
2134 | v = ev.button == Button4 ? UP : DN; |
2100 | |
2135 | |
2101 | if (ev.state & ShiftMask) |
2136 | if (ev.state & ShiftMask) |
2102 | i = 1; |
2137 | i = 1; |
2103 | else if (options & Opt_mouseWheelScrollPage) |
2138 | else if (OPTION (Opt_mouseWheelScrollPage)) |
2104 | i = nrow - 1; |
2139 | i = nrow - 1; |
2105 | else |
2140 | else |
2106 | i = 5; |
2141 | i = 5; |
2107 | |
2142 | |
2108 | # ifdef MOUSE_SLIP_WHEELING |
2143 | # ifdef MOUSE_SLIP_WHEELING |
… | |
… | |
2394 | XWindowAttributes wattr, wrootattr; |
2429 | XWindowAttributes wattr, wrootattr; |
2395 | dDisp; |
2430 | dDisp; |
2396 | |
2431 | |
2397 | pchanged = 0; |
2432 | pchanged = 0; |
2398 | |
2433 | |
2399 | if (!(options & Opt_transparent)) |
2434 | if (!OPTION (Opt_transparent)) |
2400 | return pchanged; /* Don't try any more */ |
2435 | return pchanged; /* Don't try any more */ |
2401 | |
2436 | |
2402 | XGetWindowAttributes (disp, display->root, &wrootattr); |
2437 | XGetWindowAttributes (disp, display->root, &wrootattr); |
2403 | rootdepth = wrootattr.depth; |
2438 | rootdepth = wrootattr.depth; |
2404 | |
2439 | |
… | |
… | |
2682 | if (ch == C0_LF) |
2717 | if (ch == C0_LF) |
2683 | nlines++; |
2718 | nlines++; |
2684 | |
2719 | |
2685 | refresh_count++; |
2720 | refresh_count++; |
2686 | |
2721 | |
2687 | if (!(options & Opt_jumpScroll) |
2722 | if (!OPTION (Opt_jumpScroll) |
2688 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2723 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2689 | { |
2724 | { |
2690 | refreshnow = true; |
2725 | refreshnow = true; |
|
|
2726 | refresh_count = 0; |
2691 | ch = NOCHAR; |
2727 | ch = NOCHAR; |
2692 | break; |
2728 | break; |
2693 | } |
2729 | } |
2694 | |
2730 | |
2695 | // scr_add_lines only works for nlines <= nrow - 1. |
2731 | // scr_add_lines only works for nlines <= nrow - 1. |
… | |
… | |
2726 | * the number of pages between refreshes is refresh_limit, which |
2762 | * the number of pages between refreshes is refresh_limit, which |
2727 | * is incremented here because we must be doing flat-out scrolling. |
2763 | * is incremented here because we must be doing flat-out scrolling. |
2728 | */ |
2764 | */ |
2729 | if (refreshnow) |
2765 | if (refreshnow) |
2730 | { |
2766 | { |
2731 | if ((options & Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2767 | if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2732 | refresh_limit++; |
2768 | refresh_limit++; |
2733 | else |
2769 | else |
2734 | { |
2770 | { |
2735 | flag = true; |
2771 | flag = true; |
2736 | scr_refresh (refresh_type); |
2772 | scr_refresh (refresh_type); |
|
|
2773 | flush_ev.stop (); |
2737 | } |
2774 | } |
2738 | } |
2775 | } |
2739 | |
2776 | |
2740 | } |
2777 | } |
2741 | else |
2778 | else |
… | |
… | |
3400 | break; |
3437 | break; |
3401 | case 6: /* CPR requested */ |
3438 | case 6: /* CPR requested */ |
3402 | scr_report_position (); |
3439 | scr_report_position (); |
3403 | break; |
3440 | break; |
3404 | case 7: /* unofficial extension */ |
3441 | case 7: /* unofficial extension */ |
3405 | if (options & Opt_insecure) |
3442 | if (OPTION (Opt_insecure)) |
3406 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3443 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3407 | break; |
3444 | break; |
3408 | case 8: /* unofficial extension */ |
3445 | case 8: /* unofficial extension */ |
3409 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3446 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3410 | break; |
3447 | break; |
… | |
… | |
3574 | break; |
3611 | break; |
3575 | case 20: /* report icon label */ |
3612 | case 20: /* report icon label */ |
3576 | { |
3613 | { |
3577 | char *s; |
3614 | char *s; |
3578 | XGetIconName (disp, parent[0], &s); |
3615 | XGetIconName (disp, parent[0], &s); |
3579 | tt_printf ("\033]L%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3616 | tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3580 | XFree (s); |
3617 | XFree (s); |
3581 | } |
3618 | } |
3582 | break; |
3619 | break; |
3583 | case 21: /* report window title */ |
3620 | case 21: /* report window title */ |
3584 | { |
3621 | { |
3585 | char *s; |
3622 | char *s; |
3586 | XFetchName (disp, parent[0], &s); |
3623 | XFetchName (disp, parent[0], &s); |
3587 | tt_printf ("\033]l%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3624 | tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3588 | XFree (s); |
3625 | XFree (s); |
3589 | } |
3626 | } |
3590 | break; |
3627 | break; |
3591 | } |
3628 | } |
3592 | } |
3629 | } |
… | |
… | |
3868 | // TODO, when secure mode? |
3905 | // TODO, when secure mode? |
3869 | break; |
3906 | break; |
3870 | |
3907 | |
3871 | #ifdef MENUBAR |
3908 | #ifdef MENUBAR |
3872 | case URxvt_Menu: |
3909 | case URxvt_Menu: |
3873 | if (options & Opt_insecure) |
3910 | if (OPTION (Opt_insecure)) |
3874 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3911 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3875 | break; |
3912 | break; |
3876 | #endif |
3913 | #endif |
3877 | #if 0 |
3914 | #if 0 |
3878 | case XTerm_dumpscreen: /* no error notices */ |
3915 | case XTerm_dumpscreen: /* no error notices */ |
… | |
… | |
3894 | case URxvt_italicFont: |
3931 | case URxvt_italicFont: |
3895 | case URxvt_boldItalicFont: |
3932 | case URxvt_boldItalicFont: |
3896 | #endif |
3933 | #endif |
3897 | if (query) |
3934 | if (query) |
3898 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3935 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3899 | (options & Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3936 | OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3900 | ? fontset[op - URxvt_font]->fontdesc : "", |
3937 | ? fontset[op - URxvt_font]->fontdesc : "", |
3901 | resp); |
3938 | resp); |
3902 | else |
3939 | else |
3903 | { |
3940 | { |
3904 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
3941 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
… | |
… | |
3910 | break; |
3947 | break; |
3911 | |
3948 | |
3912 | #if ENABLE_FRILLS |
3949 | #if ENABLE_FRILLS |
3913 | case URxvt_locale: |
3950 | case URxvt_locale: |
3914 | if (query) |
3951 | if (query) |
3915 | tt_printf ("\33]%d;%-.250s%c", URxvt_locale, (options & Opt_insecure) ? locale : "", resp); |
3952 | tt_printf ("\33]%d;%-.250s%c", URxvt_locale, OPTION (Opt_insecure) ? locale : "", resp); |
3916 | else |
3953 | else |
3917 | { |
3954 | { |
3918 | set_locale (str); |
3955 | set_locale (str); |
3919 | pty.set_utf8_mode (enc_utf8); |
3956 | pty.set_utf8_mode (enc_utf8); |
3920 | init_xlocale (); |
3957 | init_xlocale (); |
… | |
… | |
4048 | } |
4085 | } |
4049 | |
4086 | |
4050 | /* extra handling for values with state unkept */ |
4087 | /* extra handling for values with state unkept */ |
4051 | switch (arg[i]) |
4088 | switch (arg[i]) |
4052 | { |
4089 | { |
|
|
4090 | #if ENABLE_STYLES |
|
|
4091 | case 1021: |
|
|
4092 | if (mode) |
|
|
4093 | SET_OPTION (Opt_intensityStyles); |
|
|
4094 | else |
|
|
4095 | CLR_OPTION (Opt_intensityStyles); |
|
|
4096 | |
|
|
4097 | scr_touch (true); |
|
|
4098 | break; |
|
|
4099 | #endif |
4053 | case 1048: /* alternative cursor save */ |
4100 | case 1048: /* alternative cursor save */ |
4054 | case 1049: |
4101 | case 1049: |
4055 | if (options & Opt_secondaryScreen) |
4102 | if (OPTION (Opt_secondaryScreen)) |
4056 | if (mode == 0) |
4103 | if (mode == 0) |
4057 | scr_cursor (RESTORE); |
4104 | scr_cursor (RESTORE); |
4058 | else if (mode == 1) |
4105 | else if (mode == 1) |
4059 | scr_cursor (SAVE); |
4106 | scr_cursor (SAVE); |
4060 | break; |
4107 | break; |
… | |
… | |
4075 | case 3: /* 80/132 */ |
4122 | case 3: /* 80/132 */ |
4076 | if (priv_modes & PrivMode_132OK) |
4123 | if (priv_modes & PrivMode_132OK) |
4077 | set_widthheight (((state ? 132 : 80) * fwidth), height); |
4124 | set_widthheight (((state ? 132 : 80) * fwidth), height); |
4078 | break; |
4125 | break; |
4079 | case 4: /* smooth scrolling */ |
4126 | case 4: /* smooth scrolling */ |
4080 | if (state) |
4127 | if (!state) |
4081 | options &= ~Opt_jumpScroll; |
4128 | SET_OPTION (Opt_jumpScroll); |
4082 | else |
4129 | else |
4083 | options |= Opt_jumpScroll; |
4130 | CLR_OPTION (Opt_jumpScroll); |
4084 | break; |
4131 | break; |
4085 | case 5: /* reverse video */ |
4132 | case 5: /* reverse video */ |
4086 | scr_rvideo_mode (state); |
4133 | scr_rvideo_mode (state); |
4087 | break; |
4134 | break; |
4088 | case 6: /* relative/absolute origins */ |
4135 | case 6: /* relative/absolute origins */ |
… | |
… | |
4129 | #if 0 |
4176 | #if 0 |
4130 | case 1001: |
4177 | case 1001: |
4131 | break; /* X11 mouse highlighting */ |
4178 | break; /* X11 mouse highlighting */ |
4132 | #endif |
4179 | #endif |
4133 | case 1010: /* scroll to bottom on TTY output inhibit */ |
4180 | case 1010: /* scroll to bottom on TTY output inhibit */ |
4134 | if (state) |
4181 | if (!state) |
4135 | options &= ~Opt_scrollTtyOutput; |
4182 | SET_OPTION (Opt_scrollTtyOutput); |
4136 | else |
4183 | else |
4137 | options |= Opt_scrollTtyOutput; |
4184 | CLR_OPTION (Opt_scrollTtyOutput); |
4138 | break; |
4185 | break; |
4139 | case 1011: /* scroll to bottom on key press */ |
4186 | case 1011: /* scroll to bottom on key press */ |
4140 | if (state) |
4187 | if (state) |
4141 | options |= Opt_scrollTtyKeypress; |
4188 | SET_OPTION (Opt_scrollTtyKeypress); |
4142 | else |
4189 | else |
4143 | options &= ~Opt_scrollTtyKeypress; |
4190 | CLR_OPTION (Opt_scrollTtyKeypress); |
4144 | break; |
4191 | break; |
4145 | case 1047: /* secondary screen w/ clearing last */ |
4192 | case 1047: /* secondary screen w/ clearing last */ |
4146 | if (options & Opt_secondaryScreen) |
4193 | if (OPTION (Opt_secondaryScreen)) |
4147 | if (current_screen != PRIMARY) |
4194 | if (current_screen != PRIMARY) |
4148 | scr_erase_screen (2); |
4195 | scr_erase_screen (2); |
4149 | scr_change_screen (state); |
4196 | scr_change_screen (state); |
4150 | break; |
4197 | break; |
4151 | case 1049: /* secondary screen w/ clearing first */ |
4198 | case 1049: /* secondary screen w/ clearing first */ |
4152 | scr_change_screen (state); |
4199 | scr_change_screen (state); |
4153 | if (options & Opt_secondaryScreen) |
4200 | if (OPTION (Opt_secondaryScreen)) |
4154 | if (current_screen != PRIMARY) |
4201 | if (current_screen != PRIMARY) |
4155 | scr_erase_screen (2); |
4202 | scr_erase_screen (2); |
4156 | break; |
4203 | break; |
4157 | default: |
4204 | default: |
4158 | break; |
4205 | break; |
… | |
… | |
4308 | case 106: |
4355 | case 106: |
4309 | case 107: |
4356 | case 107: |
4310 | scr_color ((unsigned int) (minBrightCOLOR + (arg[i] - 100)), Color_bg); |
4357 | scr_color ((unsigned int) (minBrightCOLOR + (arg[i] - 100)), Color_bg); |
4311 | break; |
4358 | break; |
4312 | #endif |
4359 | #endif |
4313 | |
|
|
4314 | } |
4360 | } |
4315 | } |
4361 | } |
4316 | } |
4362 | } |
4317 | /*}}} */ |
4363 | /*}}} */ |
4318 | |
4364 | |