… | |
… | |
710 | w.start (w.at + TEXT_BLINK_INTERVAL); |
710 | w.start (w.at + TEXT_BLINK_INTERVAL); |
711 | } |
711 | } |
712 | } |
712 | } |
713 | #endif |
713 | #endif |
714 | |
714 | |
|
|
715 | #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING |
|
|
716 | void |
|
|
717 | rxvt_term::cont_scroll_cb (time_watcher &w) |
|
|
718 | { |
|
|
719 | if ((scrollbar_isUp() || scrollbar_isDn()) && |
|
|
720 | scr_page (scrollbar_isUp() ? UP : DN, 1)) |
|
|
721 | { |
|
|
722 | refresh_type |= SMOOTH_REFRESH; |
|
|
723 | want_refresh = 1; |
|
|
724 | w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY); |
|
|
725 | } |
|
|
726 | } |
|
|
727 | #endif |
|
|
728 | |
|
|
729 | #ifdef SELECTION_SCROLLING |
|
|
730 | void |
|
|
731 | rxvt_term::sel_scroll_cb (time_watcher &w) |
|
|
732 | { |
|
|
733 | if (scr_page (scroll_selection_dir, scroll_selection_lines)) |
|
|
734 | { |
|
|
735 | selection_extend (selection_save_x, selection_save_y, selection_save_state); |
|
|
736 | refresh_type |= SMOOTH_REFRESH; |
|
|
737 | want_refresh = 1; |
|
|
738 | w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY); |
|
|
739 | } |
|
|
740 | } |
|
|
741 | #endif |
|
|
742 | |
|
|
743 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
|
|
744 | void |
|
|
745 | rxvt_term::slip_wheel_cb (time_watcher &w) |
|
|
746 | { |
|
|
747 | if (mouse_slip_wheel_speed == 0 |
|
|
748 | || mouse_slip_wheel_speed < 0 ? scr_page (DN, -mouse_slip_wheel_speed) |
|
|
749 | : scr_page (UP, mouse_slip_wheel_speed)) |
|
|
750 | { |
|
|
751 | refresh_type |= SMOOTH_REFRESH; |
|
|
752 | want_refresh = 1; |
|
|
753 | w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY); |
|
|
754 | } |
|
|
755 | } |
|
|
756 | #endif |
|
|
757 | |
715 | bool |
758 | bool |
716 | rxvt_term::pty_fill () |
759 | rxvt_term::pty_fill () |
717 | { |
760 | { |
718 | ssize_t n = cmdbuf_endp - cmdbuf_ptr; |
761 | ssize_t n = cmdbuf_endp - cmdbuf_ptr; |
719 | |
762 | |
… | |
… | |
753 | while (pty_fill ()) |
796 | while (pty_fill ()) |
754 | if (cmd_parse ()) |
797 | if (cmd_parse ()) |
755 | break; |
798 | break; |
756 | } |
799 | } |
757 | |
800 | |
758 | #ifdef POINTER_BLANK |
|
|
759 | void |
801 | void |
760 | rxvt_term::pointer_unblank () |
802 | rxvt_term::pointer_unblank () |
761 | { |
803 | { |
762 | XDefineCursor (display->display, TermWin.vt, TermWin_cursor); |
804 | XDefineCursor (display->display, TermWin.vt, TermWin_cursor); |
763 | recolour_cursor (); |
805 | recolour_cursor (); |
764 | |
806 | |
|
|
807 | #ifdef POINTER_BLANK |
765 | hidden_pointer = 0; |
808 | hidden_pointer = 0; |
766 | |
809 | |
767 | if (Options & Opt_pointerBlank) |
810 | if (Options & Opt_pointerBlank) |
768 | pointer_ev.start (NOW + pointerBlankDelay); |
811 | pointer_ev.start (NOW + pointerBlankDelay); |
|
|
812 | #endif |
769 | } |
813 | } |
770 | |
814 | |
|
|
815 | #ifdef POINTER_BLANK |
771 | void |
816 | void |
772 | rxvt_term::pointer_blank () |
817 | rxvt_term::pointer_blank () |
773 | { |
818 | { |
774 | if (! (Options & Opt_pointerBlank)) |
819 | if (! (Options & Opt_pointerBlank)) |
775 | return; |
820 | return; |
… | |
… | |
971 | break; |
1016 | break; |
972 | |
1017 | |
973 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
1018 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
974 | case KeyRelease: |
1019 | case KeyRelease: |
975 | { |
1020 | { |
976 | if (! (ev.xkey.state & ControlMask)) |
1021 | if (!(ev.xkey.state & ControlMask)) |
977 | mouse_slip_wheel_speed = 0; |
1022 | slip_wheel_ev.stop (); |
978 | else |
1023 | else |
979 | { |
1024 | { |
980 | KeySym ks; |
1025 | KeySym ks; |
981 | |
1026 | |
982 | ks = XKeycodeToKeysym (display->display, ev.xkey.keycode, 0); |
1027 | ks = XKeycodeToKeysym (display->display, ev.xkey.keycode, 0); |
983 | if (ks == XK_Control_L || ks == XK_Control_R) |
1028 | if (ks == XK_Control_L || ks == XK_Control_R) |
984 | mouse_slip_wheel_speed = 0; |
1029 | mouse_slip_wheel_speed = 0; |
985 | } |
1030 | } |
… | |
… | |
1070 | #endif |
1115 | #endif |
1071 | #ifdef CURSOR_BLINK |
1116 | #ifdef CURSOR_BLINK |
1072 | if (Options & Opt_cursorBlink) |
1117 | if (Options & Opt_cursorBlink) |
1073 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1118 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1074 | #endif |
1119 | #endif |
|
|
1120 | #ifdef OFF_FOCUS_FADING |
|
|
1121 | if (rs[Rs_fade]) |
|
|
1122 | { |
|
|
1123 | PixColors = PixColorsFocused; |
|
|
1124 | set_colorfgbg (); |
|
|
1125 | scr_clear (); |
|
|
1126 | scr_touch (true); |
|
|
1127 | } |
|
|
1128 | #endif |
1075 | |
1129 | |
1076 | } |
1130 | } |
1077 | break; |
1131 | break; |
1078 | |
1132 | |
1079 | case FocusOut: |
1133 | case FocusOut: |
… | |
… | |
1087 | #endif |
1141 | #endif |
1088 | #ifdef CURSOR_BLINK |
1142 | #ifdef CURSOR_BLINK |
1089 | if (Options & Opt_cursorBlink) |
1143 | if (Options & Opt_cursorBlink) |
1090 | cursor_blink_ev.stop (); |
1144 | cursor_blink_ev.stop (); |
1091 | hidden_cursor = 0; |
1145 | hidden_cursor = 0; |
|
|
1146 | #endif |
|
|
1147 | #ifdef OFF_FOCUS_FADING |
|
|
1148 | if (rs[Rs_fade]) |
|
|
1149 | { |
|
|
1150 | PixColors = PixColorsUnFocused; |
|
|
1151 | set_colorfgbg (); |
|
|
1152 | scr_clear (); |
|
|
1153 | scr_touch (true); |
|
|
1154 | } |
1092 | #endif |
1155 | #endif |
1093 | |
1156 | |
1094 | } |
1157 | } |
1095 | break; |
1158 | break; |
1096 | |
1159 | |
… | |
… | |
1238 | if (ev.xbutton.y < TermWin.int_bwidth |
1301 | if (ev.xbutton.y < TermWin.int_bwidth |
1239 | || Pixel2Row (ev.xbutton.y) > (TermWin.nrow-1)) |
1302 | || Pixel2Row (ev.xbutton.y) > (TermWin.nrow-1)) |
1240 | { |
1303 | { |
1241 | int dist; |
1304 | int dist; |
1242 | |
1305 | |
1243 | pending_scroll_selection=1; |
|
|
1244 | |
|
|
1245 | /* don't clobber the current delay if we are |
1306 | /* don't clobber the current delay if we are |
1246 | * already in the middle of scrolling. |
1307 | * already in the middle of scrolling. |
1247 | */ |
1308 | */ |
1248 | if (scroll_selection_delay<=0) |
1309 | if (!sel_scroll_ev.active) |
1249 | scroll_selection_delay=SCROLLBAR_CONTINUOUS_DELAY; |
1310 | sel_scroll_ev.start (NOW + SCROLLBAR_INITIAL_DELAY); |
1250 | |
1311 | |
1251 | /* save the event params so we can highlight |
1312 | /* save the event params so we can highlight |
1252 | * the selection in the pending-scroll loop |
1313 | * the selection in the pending-scroll loop |
1253 | */ |
1314 | */ |
1254 | selection_save_x=ev.xbutton.x; |
1315 | selection_save_x=ev.xbutton.x; |
… | |
… | |
1276 | else |
1337 | else |
1277 | { |
1338 | { |
1278 | /* we are within the text window, so we |
1339 | /* we are within the text window, so we |
1279 | * shouldn't be scrolling |
1340 | * shouldn't be scrolling |
1280 | */ |
1341 | */ |
1281 | pending_scroll_selection = 0; |
1342 | if (sel_scroll_ev.active) |
|
|
1343 | sel_scroll_ev.stop(); |
1282 | } |
1344 | } |
1283 | #endif |
1345 | #endif |
1284 | #ifdef MOUSE_THRESHOLD |
1346 | #ifdef MOUSE_THRESHOLD |
1285 | |
1347 | |
1286 | } |
1348 | } |
… | |
… | |
1503 | upordown = 1; /* down */ |
1565 | upordown = 1; /* down */ |
1504 | } |
1566 | } |
1505 | if (upordown) |
1567 | if (upordown) |
1506 | { |
1568 | { |
1507 | #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING |
1569 | #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING |
1508 | scroll_arrow_delay = SCROLLBAR_INITIAL_DELAY; |
1570 | cont_scroll_ev.start (NOW + SCROLLBAR_INITIAL_DELAY); |
1509 | #endif |
1571 | #endif |
1510 | if (scr_page (upordown < 0 ? UP : DN, 1)) |
1572 | if (scr_page (upordown < 0 ? UP : DN, 1)) |
1511 | { |
1573 | { |
1512 | if (upordown < 0) |
1574 | if (upordown < 0) |
1513 | scrollBar.setUp (); |
1575 | scrollBar.setUp (); |
… | |
… | |
1600 | refresh_type &= ~SMOOTH_REFRESH; |
1662 | refresh_type &= ~SMOOTH_REFRESH; |
1601 | #endif |
1663 | #endif |
1602 | |
1664 | |
1603 | } |
1665 | } |
1604 | #ifdef SELECTION_SCROLLING |
1666 | #ifdef SELECTION_SCROLLING |
1605 | pending_scroll_selection=0; |
1667 | if (sel_scroll_ev.active) |
|
|
1668 | sel_scroll_ev.stop(); |
1606 | #endif |
1669 | #endif |
1607 | if (ev.window == TermWin.vt) |
1670 | if (ev.window == TermWin.vt) |
1608 | { |
1671 | { |
1609 | if (reportmode) |
1672 | if (reportmode) |
1610 | { |
1673 | { |
… | |
… | |
1652 | case Button5: |
1715 | case Button5: |
1653 | { |
1716 | { |
1654 | int i; |
1717 | int i; |
1655 | page_dirn v; |
1718 | page_dirn v; |
1656 | |
1719 | |
1657 | v = (ev.button == Button4) ? UP : DN; |
1720 | v = ev.button == Button4 ? UP : DN; |
|
|
1721 | |
1658 | if (ev.state & ShiftMask) |
1722 | if (ev.state & ShiftMask) |
1659 | i = 1; |
1723 | i = 1; |
1660 | else if ((Options & Opt_mouseWheelScrollPage)) |
1724 | else if (Options & Opt_mouseWheelScrollPage) |
1661 | i = TermWin.nrow - 1; |
1725 | i = TermWin.nrow - 1; |
1662 | else |
1726 | else |
1663 | i = 5; |
1727 | i = 5; |
|
|
1728 | |
1664 | # ifdef MOUSE_SLIP_WHEELING |
1729 | # ifdef MOUSE_SLIP_WHEELING |
1665 | if (ev.state & ControlMask) |
1730 | if (ev.state & ControlMask) |
1666 | { |
1731 | { |
1667 | mouse_slip_wheel_speed += (v ? -1 : 1); |
1732 | mouse_slip_wheel_speed += v ? -1 : 1; |
|
|
1733 | if (mouse_slip_wheel_speed < -TermWin.nrow) mouse_slip_wheel_speed = -TermWin.nrow; |
|
|
1734 | if (mouse_slip_wheel_speed > +TermWin.nrow) mouse_slip_wheel_speed = +TermWin.nrow; |
|
|
1735 | |
|
|
1736 | if (slip_wheel_ev.at < NOW) |
1668 | mouse_slip_wheel_delay = SCROLLBAR_CONTINUOUS_DELAY; |
1737 | slip_wheel_ev.at = NOW + SCROLLBAR_CONTINUOUS_DELAY; |
|
|
1738 | |
|
|
1739 | slip_wheel_ev.start (); |
1669 | } |
1740 | } |
|
|
1741 | else |
|
|
1742 | { |
1670 | # endif |
1743 | # endif |
1671 | # ifdef JUMP_MOUSE_WHEEL |
1744 | # ifdef JUMP_MOUSE_WHEEL |
1672 | scr_page (v, i); |
|
|
1673 | scr_refresh (SMOOTH_REFRESH); |
|
|
1674 | scrollbar_show (1); |
|
|
1675 | # else |
|
|
1676 | while (i--) |
|
|
1677 | { |
|
|
1678 | scr_page (v, 1); |
1745 | scr_page (v, i); |
1679 | scr_refresh (SMOOTH_REFRESH); |
1746 | scr_refresh (SMOOTH_REFRESH); |
1680 | scrollbar_show (1); |
1747 | scrollbar_show (1); |
|
|
1748 | # else |
|
|
1749 | while (i--) |
|
|
1750 | { |
|
|
1751 | scr_page (v, 1); |
|
|
1752 | scr_refresh (SMOOTH_REFRESH); |
|
|
1753 | scrollbar_show (1); |
|
|
1754 | } |
|
|
1755 | # endif |
|
|
1756 | # ifdef MOUSE_SLIP_WHEELING |
1681 | } |
1757 | } |
1682 | # endif |
1758 | #endif |
1683 | |
|
|
1684 | } |
1759 | } |
1685 | break; |
1760 | break; |
1686 | #endif |
1761 | #endif |
1687 | |
|
|
1688 | } |
1762 | } |
1689 | } |
1763 | } |
1690 | #ifdef MENUBAR |
1764 | #ifdef MENUBAR |
1691 | else if (isMenuBarWindow (ev.window)) |
1765 | else if (isMenuBarWindow (ev.window)) |
1692 | menubar_control (ev); |
1766 | menubar_control (ev); |
… | |
… | |
1957 | if (rootdepth != wattr.depth) |
2031 | if (rootdepth != wattr.depth) |
1958 | { |
2032 | { |
1959 | if (am_transparent) |
2033 | if (am_transparent) |
1960 | { |
2034 | { |
1961 | pchanged = 1; |
2035 | pchanged = 1; |
1962 | XSetWindowBackground (display->display, TermWin.vt, PixColors[Color_bg]); |
2036 | XSetWindowBackground (display->display, TermWin.vt, PixColorsFocused[Color_bg]); |
1963 | am_transparent = am_pixmap_trans = 0; |
2037 | am_transparent = am_pixmap_trans = 0; |
1964 | } |
2038 | } |
1965 | |
2039 | |
1966 | return pchanged; /* Don't try any more */ |
2040 | return pchanged; /* Don't try any more */ |
1967 | } |
2041 | } |
… | |
… | |
1983 | i = (xa[XA_XSETROOTID] |
2057 | i = (xa[XA_XSETROOTID] |
1984 | && XGetWindowProperty (display->display, display->root, xa[XA_XSETROOTID], |
2058 | && XGetWindowProperty (display->display, display->root, xa[XA_XSETROOTID], |
1985 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
2059 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
1986 | &nitems, &bytes_after, &prop) == Success); |
2060 | &nitems, &bytes_after, &prop) == Success); |
1987 | |
2061 | |
1988 | if (!i || prop == NULL) |
2062 | if (!i || prop == NULL || !rs[Rs_color + Color_tint]) |
1989 | have_pixmap = 0; |
2063 | have_pixmap = 0; |
1990 | else |
2064 | else |
1991 | { |
2065 | { |
1992 | have_pixmap = 1; |
2066 | have_pixmap = 1; |
1993 | rootpixmap = *(Pixmap *)prop; |
2067 | rootpixmap = *(Pixmap *)prop; |
… | |
… | |
2004 | Window cr; |
2078 | Window cr; |
2005 | XImage *image; |
2079 | XImage *image; |
2006 | GC gc; |
2080 | GC gc; |
2007 | XGCValues gcvalue; |
2081 | XGCValues gcvalue; |
2008 | |
2082 | |
2009 | XTranslateCoordinates (display->display, TermWin.parent[0], display->root, |
2083 | XTranslateCoordinates (display->display, TermWin.vt, display->root, |
2010 | 0, 0, &sx, &sy, &cr); |
2084 | 0, 0, &sx, &sy, &cr); |
2011 | nw = (unsigned int)szHint.width; |
2085 | nw = (unsigned int)szHint.width; |
2012 | nh = (unsigned int)szHint.height; |
2086 | nh = (unsigned int)szHint.height; |
2013 | nx = ny = 0; |
2087 | nx = ny = 0; |
2014 | |
2088 | |
… | |
… | |
2055 | XFreePixmap (display->display, TermWin.pixmap); |
2129 | XFreePixmap (display->display, TermWin.pixmap); |
2056 | |
2130 | |
2057 | #if TINTING |
2131 | #if TINTING |
2058 | if (ISSET_PIXCOLOR (Color_tint)) |
2132 | if (ISSET_PIXCOLOR (Color_tint)) |
2059 | { |
2133 | { |
2060 | unsigned short shade, rm, gm, bm; |
2134 | unsigned short rm, gm, bm; |
2061 | |
2135 | if (rs[Rs_shade]) |
|
|
2136 | PixColorsFocused[Color_tint].fade (display, atoi (rs[Rs_shade])).get (display, rm, gm, bm); |
|
|
2137 | else |
2062 | PixColors[Color_tint].get (display, rm, gm, bm); |
2138 | PixColorsFocused[Color_tint].get (display, rm, gm, bm); |
2063 | |
2139 | |
2064 | rm >>= 8; gm >>= 8; bm >>= 8; // not 100% correct, but... |
2140 | rm >>= 8; gm >>= 8; bm >>= 8; // not 100% correct, but... |
2065 | |
2141 | |
2066 | /* Determine bitshift and bitmask values */ |
2142 | /* Determine bitshift and bitmask values */ |
2067 | switch (image->bits_per_pixel) |
2143 | switch (image->bits_per_pixel) |
… | |
… | |
2079 | gc = XCreateGC (display->display, TermWin.vt, 0UL, &gcvalue); |
2155 | gc = XCreateGC (display->display, TermWin.vt, 0UL, &gcvalue); |
2080 | XPutImage (display->display, TermWin.pixmap, gc, image, 0, 0, |
2156 | XPutImage (display->display, TermWin.pixmap, gc, image, 0, 0, |
2081 | nx, ny, image->width, image->height); |
2157 | nx, ny, image->width, image->height); |
2082 | XFreeGC (display->display, gc); |
2158 | XFreeGC (display->display, gc); |
2083 | XDestroyImage (image); |
2159 | XDestroyImage (image); |
2084 | XSetWindowBackgroundPixmap (display->display, TermWin.vt, |
2160 | XSetWindowBackgroundPixmap (display->display, TermWin.vt, TermWin.pixmap); |
2085 | TermWin.pixmap); |
|
|
2086 | |
2161 | |
2087 | if (!am_transparent || !am_pixmap_trans) |
2162 | if (!am_transparent || !am_pixmap_trans) |
2088 | pchanged = 1; |
2163 | pchanged = 1; |
2089 | |
2164 | |
2090 | am_transparent = am_pixmap_trans = 1; |
2165 | am_transparent = am_pixmap_trans = 1; |
… | |
… | |
2134 | } |
2209 | } |
2135 | } |
2210 | } |
2136 | |
2211 | |
2137 | if (n > (int) (sizeof (TermWin.parent) / sizeof (TermWin.parent[0]))) |
2212 | if (n > (int) (sizeof (TermWin.parent) / sizeof (TermWin.parent[0]))) |
2138 | { |
2213 | { |
2139 | D_X ((stderr, "InheritPixmap Turning off")); |
2214 | D_X ((stderr, "InheritPixmap Turning off")); /* Mikachu? */ |
2140 | XSetWindowBackground (display->display, TermWin.parent[0], PixColors[Color_fg]); |
2215 | XSetWindowBackground (display->display, TermWin.parent[0], PixColorsFocused[Color_fg]); |
2141 | XSetWindowBackground (display->display, TermWin.vt, PixColors[Color_bg]); |
2216 | XSetWindowBackground (display->display, TermWin.vt, PixColorsFocused[Color_bg]); |
2142 | am_transparent = 0; |
2217 | am_transparent = 0; |
2143 | /* XXX: also turn off Opt_transparent? */ |
2218 | /* XXX: also turn off Opt_transparent? */ |
2144 | } |
2219 | } |
2145 | else |
2220 | else |
2146 | { |
2221 | { |
… | |
… | |
2273 | } |
2348 | } |
2274 | |
2349 | |
2275 | return flag; |
2350 | return flag; |
2276 | } |
2351 | } |
2277 | |
2352 | |
|
|
2353 | // read the next octet |
|
|
2354 | unicode_t |
|
|
2355 | rxvt_term::next_octet () |
|
|
2356 | { |
|
|
2357 | return cmdbuf_ptr < cmdbuf_endp |
|
|
2358 | ? *cmdbuf_ptr++ |
|
|
2359 | : NOCHAR; |
|
|
2360 | } |
|
|
2361 | |
2278 | // read the next character |
2362 | // read the next character |
2279 | unicode_t |
2363 | unicode_t |
2280 | rxvt_term::next_char () |
2364 | rxvt_term::next_char () |
2281 | { |
2365 | { |
2282 | while (cmdbuf_ptr < cmdbuf_endp) |
2366 | while (cmdbuf_ptr < cmdbuf_endp) |
… | |
… | |
2313 | */ |
2397 | */ |
2314 | unicode_t |
2398 | unicode_t |
2315 | rxvt_term::cmd_getc () |
2399 | rxvt_term::cmd_getc () |
2316 | { |
2400 | { |
2317 | unicode_t c = next_char (); |
2401 | unicode_t c = next_char (); |
|
|
2402 | |
|
|
2403 | if (c == NOCHAR) |
|
|
2404 | throw out_of_input; |
|
|
2405 | |
|
|
2406 | return c; |
|
|
2407 | } |
|
|
2408 | |
|
|
2409 | unicode_t |
|
|
2410 | rxvt_term::cmd_get8 () |
|
|
2411 | { |
|
|
2412 | unicode_t c = next_octet (); |
2318 | |
2413 | |
2319 | if (c == NOCHAR) |
2414 | if (c == NOCHAR) |
2320 | throw out_of_input; |
2415 | throw out_of_input; |
2321 | |
2416 | |
2322 | return c; |
2417 | return c; |
… | |
… | |
2452 | break; |
2547 | break; |
2453 | case C0_SI: /* shift in - acs */ |
2548 | case C0_SI: /* shift in - acs */ |
2454 | scr_charset_choose (0); |
2549 | scr_charset_choose (0); |
2455 | break; |
2550 | break; |
2456 | |
2551 | |
|
|
2552 | #ifdef EIGHT_BIT_CONTROLS |
2457 | // 8-bit controls |
2553 | // 8-bit controls |
2458 | case 0x90: /* DCS */ |
2554 | case 0x90: /* DCS */ |
2459 | process_dcs_seq (); |
2555 | process_dcs_seq (); |
2460 | break; |
2556 | break; |
2461 | case 0x9b: /* CSI */ |
2557 | case 0x9b: /* CSI */ |
2462 | process_csi_seq (); |
2558 | process_csi_seq (); |
2463 | break; |
2559 | break; |
2464 | case 0x9d: /* CSI */ |
2560 | case 0x9d: /* CSI */ |
2465 | process_osc_seq (); |
2561 | process_osc_seq (); |
2466 | break; |
2562 | break; |
|
|
2563 | #endif |
2467 | } |
2564 | } |
2468 | } |
2565 | } |
2469 | /*}}} */ |
2566 | /*}}} */ |
2470 | |
2567 | |
2471 | |
2568 | |
… | |
… | |
3089 | * ends_how is terminator used. returned input must be free()'d |
3186 | * ends_how is terminator used. returned input must be free()'d |
3090 | */ |
3187 | */ |
3091 | unsigned char * |
3188 | unsigned char * |
3092 | rxvt_term::get_to_st (unicode_t &ends_how) |
3189 | rxvt_term::get_to_st (unicode_t &ends_how) |
3093 | { |
3190 | { |
3094 | int seen_esc = 0; /* seen escape? */ |
3191 | unicode_t prev = 0, ch; |
3095 | unsigned int n = 0; |
3192 | unsigned int n = 0; |
3096 | unsigned char *s; |
3193 | unsigned char *s; |
3097 | unicode_t ch; |
|
|
3098 | unsigned char string[STRING_MAX]; |
3194 | unsigned char string[STRING_MAX]; |
3099 | |
3195 | |
3100 | while ((ch = cmd_getc ())) |
3196 | while ((ch = cmd_getc ()) != NOCHAR) |
3101 | { |
3197 | { |
3102 | if (ch == C0_BEL || ch == CHAR_ST) |
3198 | if (prev == C0_ESC) |
3103 | break; |
3199 | { |
3104 | |
|
|
3105 | if (seen_esc) |
|
|
3106 | if (ch == 0x5c) /* 7bit ST */ |
3200 | if (ch == 0x5c) /* 7bit ST */ |
3107 | break; |
3201 | break; |
3108 | else |
3202 | else |
3109 | return NULL; |
3203 | return NULL; |
3110 | |
|
|
3111 | if (ch == C0_ESC) |
|
|
3112 | { |
3204 | } |
3113 | seen_esc = 1; |
3205 | else if (ch == C0_BEL || ch == CHAR_ST) |
3114 | continue; |
3206 | break; |
3115 | } |
|
|
3116 | else if (ch == C0_HT) |
3207 | else if (ch < 0x20) |
3117 | ch = ' '; /* translate '\t' to space */ |
|
|
3118 | else if (ch < 0x20 && (ch != C0_LF && ch != C0_CR)) |
|
|
3119 | return NULL; /* other control character - exit */ |
3208 | return NULL; /* other control character - exit */ |
3120 | |
3209 | |
3121 | if (n >= sizeof (string) - 1) |
3210 | if (n >= sizeof (string) - 1) |
3122 | // stop at some sane length |
3211 | // stop at some sane length |
3123 | return NULL; |
3212 | return NULL; |
3124 | |
3213 | |
|
|
3214 | if (ch == C0_SYN) |
|
|
3215 | { |
|
|
3216 | string[n++] = cmd_get8 (); |
|
|
3217 | prev = 0; |
|
|
3218 | } |
|
|
3219 | else |
3125 | string[n++] = ch; |
3220 | string[n++] = prev = ch; |
3126 | seen_esc = 0; |
|
|
3127 | } |
3221 | } |
3128 | |
3222 | |
3129 | string[n++] = '\0'; |
3223 | string[n++] = '\0'; |
3130 | |
3224 | |
3131 | if ((s = (unsigned char *)rxvt_malloc (n)) == NULL) |
3225 | if ((s = (unsigned char *)rxvt_malloc (n)) == NULL) |
… | |
… | |
3188 | if (str[0] == '?' && !str[1]) |
3282 | if (str[0] == '?' && !str[1]) |
3189 | { |
3283 | { |
3190 | if (Options & Opt_insecure) |
3284 | if (Options & Opt_insecure) |
3191 | { |
3285 | { |
3192 | unsigned short r, g, b; |
3286 | unsigned short r, g, b; |
3193 | PixColors[color].get (display, r, g, b); |
3287 | PixColorsFocused[color].get (display, r, g, b); |
3194 | tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, r, g, b, resp); |
3288 | tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, r, g, b, resp); |
3195 | } |
3289 | } |
3196 | } |
3290 | } |
3197 | else |
3291 | else |
3198 | set_window_color (color, str); |
3292 | set_window_color (color, str); |
… | |
… | |
3303 | if (name[0] == '?' && !name[1]) |
3397 | if (name[0] == '?' && !name[1]) |
3304 | { |
3398 | { |
3305 | if (Options & Opt_insecure) |
3399 | if (Options & Opt_insecure) |
3306 | { |
3400 | { |
3307 | unsigned short r, g, b; |
3401 | unsigned short r, g, b; |
3308 | PixColors[color + minCOLOR].get (display, r, g, b); |
3402 | PixColorsFocused[color + minCOLOR].get (display, r, g, b); |
3309 | tt_printf ("\033]%d;%d;rgb:%04x/%04x/%04x%c", XTerm_Color, color, r, g, b, resp); |
3403 | tt_printf ("\033]%d;%d;rgb:%04x/%04x/%04x%c", XTerm_Color, color, r, g, b, resp); |
3310 | } |
3404 | } |
3311 | } |
3405 | } |
3312 | else |
3406 | else |
3313 | set_window_color (color + minCOLOR, name); |
3407 | set_window_color (color + minCOLOR, name); |
… | |
… | |
3686 | rendset = 0, rendstyle = ~RS_None; |
3780 | rendset = 0, rendstyle = ~RS_None; |
3687 | break; |
3781 | break; |
3688 | case 1: |
3782 | case 1: |
3689 | rendset = 1, rendstyle = RS_Bold; |
3783 | rendset = 1, rendstyle = RS_Bold; |
3690 | break; |
3784 | break; |
|
|
3785 | //case 2: // faint or second colour |
3691 | case 4: |
3786 | case 4: |
3692 | rendset = 1, rendstyle = RS_Uline; |
3787 | rendset = 1, rendstyle = RS_Uline; |
3693 | break; |
3788 | break; |
3694 | case 5: |
3789 | case 5: // slowly blinking |
|
|
3790 | case 6: // rapidly blinking |
3695 | rendset = 1, rendstyle = RS_Blink; |
3791 | rendset = 1, rendstyle = RS_Blink; |
3696 | break; |
3792 | break; |
3697 | //case 6: // scoansi light background |
3793 | //case 6: // scoansi light background |
3698 | case 7: |
3794 | case 7: |
3699 | rendset = 1, rendstyle = RS_RVid; |
3795 | rendset = 1, rendstyle = RS_RVid; |
3700 | break; |
3796 | break; |
3701 | case 8: |
3797 | case 8: |
3702 | // invisible. NYI |
3798 | // invisible. NYI |
3703 | break; |
3799 | break; |
|
|
3800 | //case 9: // crossed out |
3704 | //case 10: // scoansi acs off |
3801 | //case 10: // scoansi acs off, primary font |
3705 | //case 11: // scoansi acs on |
3802 | //case 11: // scoansi acs on, first alt font |
3706 | //case 12: // scoansi acs on, |0x80 |
3803 | //case 12: // scoansi acs on, |0x80, second alt font |
3707 | case 21: // disable bold, blink and invis (some terminals use this) |
3804 | //... |
|
|
3805 | //case 19: // ninth alt font |
|
|
3806 | //case 20: // gothic |
|
|
3807 | case 21: // disable bold, faint |
3708 | rendset = 0, rendstyle = RS_Bold | RS_Blink; |
3808 | rendset = 0, rendstyle = RS_Bold; |
3709 | break; |
3809 | break; |
3710 | case 22: |
3810 | case 22: |
3711 | rendset = 0, rendstyle = RS_Bold; |
3811 | rendset = 0, rendstyle = RS_Bold; |
3712 | break; |
3812 | break; |
|
|
3813 | //case 23: disable italic |
3713 | case 24: |
3814 | case 24: |
3714 | rendset = 0, rendstyle = RS_Uline; |
3815 | rendset = 0, rendstyle = RS_Uline; |
3715 | break; |
3816 | break; |
3716 | case 25: |
3817 | case 25: |
3717 | rendset = 0, rendstyle = RS_Blink; |
3818 | rendset = 0, rendstyle = RS_Blink; |
3718 | break; |
3819 | break; |
3719 | case 27: |
3820 | case 27: |
3720 | rendset = 0, rendstyle = RS_RVid; |
3821 | rendset = 0, rendstyle = RS_RVid; |
3721 | break; |
3822 | break; |
3722 | case 28: |
|
|
3723 | // visible. NYI |
3823 | //case 28: // visible. NYI |
3724 | break; |
3824 | //case 29: // not crossed-out |
3725 | } |
3825 | } |
3726 | |
3826 | |
3727 | if (rendset != -1) |
3827 | if (rendset != -1) |
3728 | { |
3828 | { |
3729 | scr_rendition (rendset, rendstyle); |
3829 | scr_rendition (rendset, rendstyle); |