… | |
… | |
26 | * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> |
26 | * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> |
27 | * Copyright (c) 2001 Marius Gedminas |
27 | * Copyright (c) 2001 Marius Gedminas |
28 | * - Ctrl/Mod4+Tab works like Meta+Tab (options) |
28 | * - Ctrl/Mod4+Tab works like Meta+Tab (options) |
29 | * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> |
29 | * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> |
30 | * Copyright (c) 2003-2014 Marc Lehmann <schmorp@schmorp.de> |
30 | * Copyright (c) 2003-2014 Marc Lehmann <schmorp@schmorp.de> |
31 | * Copyright (c) 2007 Emanuele Giaquinta <e.giaquinta@glauco.it> |
31 | * Copyright (c) 2007,2015 Emanuele Giaquinta <e.giaquinta@glauco.it> |
32 | * |
32 | * |
33 | * This program is free software; you can redistribute it and/or modify |
33 | * This program is free software; you can redistribute it and/or modify |
34 | * it under the terms of the GNU General Public License as published by |
34 | * it under the terms of the GNU General Public License as published by |
35 | * the Free Software Foundation; either version 3 of the License, or |
35 | * the Free Software Foundation; either version 3 of the License, or |
36 | * (at your option) any later version. |
36 | * (at your option) any later version. |
… | |
… | |
210 | |
210 | |
211 | max_it (width, strlen (attr)); |
211 | max_it (width, strlen (attr)); |
212 | |
212 | |
213 | if (y >= 0) |
213 | if (y >= 0) |
214 | { |
214 | { |
215 | y = (y >= nrow - len - 4 && x < width + 2) ? 0 : -1; |
215 | y = (y >= nrow - len - 5 && x < width + 2) ? 0 : -1; |
216 | x = 0; |
216 | x = 0; |
217 | } |
217 | } |
218 | |
218 | |
219 | scr_overlay_new (x, y, width, len * 2 + 2); |
219 | scr_overlay_new (x, y, width, len * 2 + 2); |
220 | |
220 | |
… | |
… | |
676 | { |
676 | { |
677 | char *ch; |
677 | char *ch; |
678 | |
678 | |
679 | for (ch = kbuf; ch < kbuf + len; ch++) |
679 | for (ch = kbuf; ch < kbuf + len; ch++) |
680 | *ch |= 0x80; |
680 | *ch |= 0x80; |
681 | |
|
|
682 | meta = 0; |
|
|
683 | } |
681 | } |
684 | #endif |
682 | #endif |
685 | /* nil */ ; |
683 | /* nil */ ; |
686 | } |
684 | } |
687 | |
685 | |
… | |
… | |
1036 | |
1034 | |
1037 | #ifdef CURSOR_BLINK |
1035 | #ifdef CURSOR_BLINK |
1038 | void |
1036 | void |
1039 | rxvt_term::cursor_blink_reset () |
1037 | rxvt_term::cursor_blink_reset () |
1040 | { |
1038 | { |
|
|
1039 | if (!focus) |
|
|
1040 | return; |
|
|
1041 | |
1041 | if (hidden_cursor) |
1042 | if (hidden_cursor) |
1042 | { |
1043 | { |
1043 | hidden_cursor = 0; |
1044 | hidden_cursor = 0; |
1044 | want_refresh = 1; |
1045 | want_refresh = 1; |
1045 | } |
1046 | } |
1046 | |
1047 | |
1047 | if (option (Opt_cursorBlink)) |
1048 | if (option (Opt_cursorBlink) || (priv_modes & PrivMode_BlinkingCursor)) |
1048 | cursor_blink_ev.again (); |
1049 | cursor_blink_ev.again (); |
1049 | else |
1050 | else |
1050 | cursor_blink_ev.stop (); |
1051 | cursor_blink_ev.stop (); |
1051 | } |
1052 | } |
1052 | |
1053 | |
… | |
… | |
1241 | |
1242 | |
1242 | void ecb_cold |
1243 | void ecb_cold |
1243 | rxvt_term::pointer_unblank () |
1244 | rxvt_term::pointer_unblank () |
1244 | { |
1245 | { |
1245 | XDefineCursor (dpy, vt, TermWin_cursor); |
1246 | XDefineCursor (dpy, vt, TermWin_cursor); |
1246 | recolour_cursor (); |
1247 | recolor_cursor (); |
1247 | |
1248 | |
1248 | #ifdef POINTER_BLANK |
1249 | #ifdef POINTER_BLANK |
1249 | hidden_pointer = 0; |
1250 | hidden_pointer = 0; |
1250 | |
1251 | |
1251 | if (option (Opt_pointerBlank)) |
1252 | if (option (Opt_pointerBlank)) |
… | |
… | |
1611 | case MotionNotify: |
1612 | case MotionNotify: |
1612 | #ifdef POINTER_BLANK |
1613 | #ifdef POINTER_BLANK |
1613 | if (hidden_pointer) |
1614 | if (hidden_pointer) |
1614 | pointer_unblank (); |
1615 | pointer_unblank (); |
1615 | #endif |
1616 | #endif |
|
|
1617 | if (!bypass_keystate |
1616 | if ((priv_modes & PrivMode_MouseBtnEvent && ev.xbutton.state & (Button1Mask|Button2Mask|Button3Mask)) |
1618 | && ((priv_modes & PrivMode_MouseBtnEvent && ev.xbutton.state & (Button1Mask|Button2Mask|Button3Mask)) |
1617 | || priv_modes & PrivMode_MouseAnyEvent) |
1619 | || priv_modes & PrivMode_MouseAnyEvent)) |
1618 | mouse_report (ev.xbutton); |
1620 | mouse_report (ev.xbutton); |
1619 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1621 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1620 | break; |
1622 | break; |
1621 | |
1623 | |
1622 | if (ev.xany.window == vt) |
1624 | if (ev.xany.window == vt) |
… | |
… | |
1634 | &unused_root_x, &unused_root_y, |
1636 | &unused_root_x, &unused_root_y, |
1635 | &ev.xbutton.x, &ev.xbutton.y, |
1637 | &ev.xbutton.x, &ev.xbutton.y, |
1636 | &ev.xbutton.state); |
1638 | &ev.xbutton.state); |
1637 | #ifdef MOUSE_THRESHOLD |
1639 | #ifdef MOUSE_THRESHOLD |
1638 | /* deal with a `jumpy' mouse */ |
1640 | /* deal with a `jumpy' mouse */ |
1639 | if ((ev.xmotion.time - MEvent.time) > MOUSE_THRESHOLD) |
1641 | if (ev.xmotion.time - MEvent.time > MOUSE_THRESHOLD) |
|
|
1642 | #endif |
1640 | { |
1643 | { |
1641 | #endif |
|
|
1642 | #if ISO_14755 |
1644 | #if ISO_14755 |
1643 | // 5.4 |
1645 | // 5.4 |
1644 | if (iso14755buf & (ISO_14755_STARTED | ISO_14755_54)) |
1646 | if (iso14755buf & (ISO_14755_STARTED | ISO_14755_54)) |
1645 | { |
1647 | { |
1646 | iso14755_54 (ev.xbutton.x, ev.xbutton.y); |
1648 | iso14755_54 (ev.xbutton.x, ev.xbutton.y); |
… | |
… | |
1695 | * shouldn't be scrolling |
1697 | * shouldn't be scrolling |
1696 | */ |
1698 | */ |
1697 | sel_scroll_ev.stop(); |
1699 | sel_scroll_ev.stop(); |
1698 | } |
1700 | } |
1699 | #endif |
1701 | #endif |
1700 | #ifdef MOUSE_THRESHOLD |
|
|
1701 | } |
1702 | } |
1702 | #endif |
|
|
1703 | } |
1703 | } |
1704 | } |
1704 | } |
1705 | else if (scrollBar.state == SB_STATE_MOTION && ev.xany.window == scrollBar.win) |
1705 | else if (scrollBar.state == SB_STATE_MOTION && ev.xany.window == scrollBar.win) |
1706 | { |
1706 | { |
1707 | while (XCheckTypedWindowEvent (dpy, scrollBar.win, |
1707 | while (XCheckTypedWindowEvent (dpy, scrollBar.win, |
… | |
… | |
1781 | #endif |
1781 | #endif |
1782 | #if OFF_FOCUS_FADING |
1782 | #if OFF_FOCUS_FADING |
1783 | if (rs[Rs_fade]) |
1783 | if (rs[Rs_fade]) |
1784 | { |
1784 | { |
1785 | pix_colors = pix_colors_focused; |
1785 | pix_colors = pix_colors_focused; |
1786 | scr_recolour (); |
1786 | scr_recolor (); |
1787 | } |
1787 | } |
1788 | #endif |
1788 | #endif |
1789 | #if ENABLE_FRILLS |
1789 | #if ENABLE_FRILLS |
1790 | if (option (Opt_urgentOnBell)) |
1790 | if (option (Opt_urgentOnBell)) |
1791 | set_urgency (0); |
1791 | set_urgency (0); |
|
|
1792 | |
|
|
1793 | if (priv_modes & PrivMode_FocusEvent) |
|
|
1794 | tt_printf ("\x1b[I"); |
1792 | #endif |
1795 | #endif |
1793 | |
1796 | |
1794 | HOOK_INVOKE ((this, HOOK_FOCUS_IN, DT_END)); |
1797 | HOOK_INVOKE ((this, HOOK_FOCUS_IN, DT_END)); |
1795 | } |
1798 | } |
1796 | } |
1799 | } |
… | |
… | |
1804 | want_refresh = 1; |
1807 | want_refresh = 1; |
1805 | |
1808 | |
1806 | #if ENABLE_FRILLS |
1809 | #if ENABLE_FRILLS |
1807 | if (option (Opt_urgentOnBell)) |
1810 | if (option (Opt_urgentOnBell)) |
1808 | set_urgency (0); |
1811 | set_urgency (0); |
|
|
1812 | |
|
|
1813 | if (priv_modes & PrivMode_FocusEvent) |
|
|
1814 | tt_printf ("\x1b[O"); |
1809 | #endif |
1815 | #endif |
1810 | #if ENABLE_FRILLS || ISO_14755 |
1816 | #if ENABLE_FRILLS || ISO_14755 |
1811 | if (iso14755buf) |
1817 | if (iso14755buf) |
1812 | { |
1818 | { |
1813 | iso14755buf = 0; |
1819 | iso14755buf = 0; |
… | |
… | |
1828 | #endif |
1834 | #endif |
1829 | #if OFF_FOCUS_FADING |
1835 | #if OFF_FOCUS_FADING |
1830 | if (rs[Rs_fade]) |
1836 | if (rs[Rs_fade]) |
1831 | { |
1837 | { |
1832 | pix_colors = pix_colors_unfocused; |
1838 | pix_colors = pix_colors_unfocused; |
1833 | scr_recolour (); |
1839 | scr_recolor (); |
1834 | } |
1840 | } |
1835 | #endif |
1841 | #endif |
1836 | |
1842 | |
1837 | HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1843 | HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1838 | } |
1844 | } |
1839 | } |
1845 | } |
1840 | |
1846 | |
1841 | void ecb_cold |
1847 | void ecb_cold |
1842 | rxvt_term::update_fade_color (unsigned int idx) |
1848 | rxvt_term::update_fade_color (unsigned int idx, bool first_time) |
1843 | { |
1849 | { |
1844 | #if OFF_FOCUS_FADING |
1850 | #if OFF_FOCUS_FADING |
1845 | if (rs[Rs_fade]) |
1851 | if (rs[Rs_fade]) |
1846 | { |
1852 | { |
|
|
1853 | if (!first_time) |
|
|
1854 | pix_colors_focused [idx].free (this); |
|
|
1855 | |
1847 | rgba c; |
1856 | rgba c; |
1848 | pix_colors [Color_fade].get (c); |
1857 | pix_colors [Color_fade].get (c); |
1849 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
1858 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
1850 | } |
1859 | } |
1851 | #endif |
1860 | #endif |
… | |
… | |
1913 | iso14755_54 (ev.x, ev.y); |
1922 | iso14755_54 (ev.x, ev.y); |
1914 | return; |
1923 | return; |
1915 | } |
1924 | } |
1916 | #endif |
1925 | #endif |
1917 | |
1926 | |
1918 | clickintime = ev.time - MEvent.time < MULTICLICK_TIME; |
1927 | clickintime = ev.time - MEvent.time < multiClickTime; |
1919 | |
1928 | |
1920 | if (reportmode) |
1929 | if (reportmode) |
1921 | { |
1930 | { |
1922 | /* mouse report from vt window */ |
1931 | /* mouse report from vt window */ |
1923 | /* save the xbutton state (for ButtonRelease) */ |
1932 | /* save the xbutton state (for ButtonRelease) */ |
… | |
… | |
2173 | #ifdef MOUSE_REPORT_DOUBLECLICK |
2182 | #ifdef MOUSE_REPORT_DOUBLECLICK |
2174 | /* only report the release of 'slow' single clicks */ |
2183 | /* only report the release of 'slow' single clicks */ |
2175 | if (MEvent.button != AnyButton |
2184 | if (MEvent.button != AnyButton |
2176 | && (ev.button != MEvent.button |
2185 | && (ev.button != MEvent.button |
2177 | || (ev.time - MEvent.time |
2186 | || (ev.time - MEvent.time |
2178 | > MULTICLICK_TIME / 2))) |
2187 | > multiClickTime / 2))) |
2179 | { |
2188 | { |
2180 | MEvent.clicks = 0; |
2189 | MEvent.clicks = 0; |
2181 | MEvent.button = AnyButton; |
2190 | MEvent.button = AnyButton; |
2182 | mouse_report (ev); |
2191 | mouse_report (ev); |
2183 | } |
2192 | } |
… | |
… | |
2573 | scr_charset_choose (0); |
2582 | scr_charset_choose (0); |
2574 | break; |
2583 | break; |
2575 | |
2584 | |
2576 | #ifdef EIGHT_BIT_CONTROLS |
2585 | #ifdef EIGHT_BIT_CONTROLS |
2577 | // 8-bit controls |
2586 | // 8-bit controls |
2578 | case 0x90: /* DCS */ |
2587 | case 0x90: /* DCS */ |
2579 | process_dcs_seq (); |
2588 | process_dcs_seq (); |
2580 | break; |
2589 | break; |
2581 | case 0x9b: /* CSI */ |
2590 | case 0x9b: /* CSI */ |
2582 | process_csi_seq (); |
2591 | process_csi_seq (); |
2583 | break; |
2592 | break; |
2584 | case 0x9d: /* OSC */ |
2593 | case 0x9d: /* OSC */ |
2585 | process_osc_seq (); |
2594 | process_osc_seq (); |
2586 | break; |
2595 | break; |
2587 | #endif |
2596 | #endif |
2588 | } |
2597 | } |
2589 | } |
2598 | } |
… | |
… | |
3094 | scr_insert_mode (1); |
3103 | scr_insert_mode (1); |
3095 | else if (arg[0] == 20) |
3104 | else if (arg[0] == 20) |
3096 | priv_modes |= PrivMode_LFNL; |
3105 | priv_modes |= PrivMode_LFNL; |
3097 | break; |
3106 | break; |
3098 | |
3107 | |
3099 | case CSI_71: // DESCUSR: set cursor style |
3108 | case CSI_71: // DECSCUSR: set cursor style |
3100 | if (prev_ch == ' ') |
3109 | if (prev_ch == ' ') |
3101 | set_cursor_style (arg[0]); |
3110 | set_cursor_style (arg[0]); |
3102 | break; |
3111 | break; |
3103 | |
3112 | |
3104 | /* |
3113 | /* |
… | |
… | |
3325 | free (s); |
3334 | free (s); |
3326 | } |
3335 | } |
3327 | } |
3336 | } |
3328 | } |
3337 | } |
3329 | |
3338 | |
|
|
3339 | static unsigned int |
|
|
3340 | colorcube_index (unsigned int idx_r, |
|
|
3341 | unsigned int idx_g, |
|
|
3342 | unsigned int idx_b) |
|
|
3343 | { |
|
|
3344 | assert (idx_r < Red_levels); |
|
|
3345 | assert (idx_g < Green_levels); |
|
|
3346 | assert (idx_b < Blue_levels); |
|
|
3347 | |
|
|
3348 | return idx_r * Blue_levels * Green_levels + |
|
|
3349 | idx_g * Blue_levels + |
|
|
3350 | idx_b; |
|
|
3351 | } |
|
|
3352 | |
|
|
3353 | /* |
|
|
3354 | * Find the nearest color slot in the hidden color cube, |
|
|
3355 | * adapt its value to the 24bit RGB color. |
|
|
3356 | */ |
|
|
3357 | unsigned int |
|
|
3358 | rxvt_term::map_rgb24_color (unsigned int r, unsigned int g, unsigned int b) |
|
|
3359 | { |
|
|
3360 | r &= 0xff; |
|
|
3361 | g &= 0xff; |
|
|
3362 | b &= 0xff; |
|
|
3363 | |
|
|
3364 | unsigned int color = (r << 16) | (g << 8) | b; |
|
|
3365 | unsigned int idx_r = r * (Red_levels - 1) / 0xff; |
|
|
3366 | unsigned int idx_g = g * (Green_levels - 1) / 0xff; |
|
|
3367 | unsigned int idx_b = b * (Blue_levels - 1) / 0xff; |
|
|
3368 | unsigned int idx = colorcube_index (idx_r, idx_g, idx_b); |
|
|
3369 | |
|
|
3370 | if (rgb24_color[idx] == color) |
|
|
3371 | return idx + minTermCOLOR24; |
|
|
3372 | |
|
|
3373 | /* we allow one of the 6 directly neighbouring colours */ |
|
|
3374 | /* to replace the current color, if they not used recently */ |
|
|
3375 | static const signed char dxyz[][3] = { |
|
|
3376 | 0, 0, 0, |
|
|
3377 | 0, 0, +1, |
|
|
3378 | 0, 0, -1, |
|
|
3379 | 0, +1, 0, |
|
|
3380 | 0, -1, 0, |
|
|
3381 | +1, 0, 0, |
|
|
3382 | -1, 0, 0, |
|
|
3383 | }; |
|
|
3384 | |
|
|
3385 | for (int n = 0; n < ecb_array_length (dxyz); ++n) |
|
|
3386 | { |
|
|
3387 | int r = idx_r + dxyz[n][0]; |
|
|
3388 | int g = idx_r + dxyz[n][1]; |
|
|
3389 | int b = idx_r + dxyz[n][2]; |
|
|
3390 | |
|
|
3391 | if (!IN_RANGE_EXC (r, 0, Red_levels )) continue; |
|
|
3392 | if (!IN_RANGE_EXC (g, 0, Green_levels)) continue; |
|
|
3393 | if (!IN_RANGE_EXC (b, 0, Blue_levels )) continue; |
|
|
3394 | |
|
|
3395 | unsigned int index = colorcube_index (r, g, b); |
|
|
3396 | |
|
|
3397 | // minor issue: could update index 0 few more times |
|
|
3398 | if ((rgb24_seqno[index] | rgb24_color[index]) == 0) |
|
|
3399 | { |
|
|
3400 | idx = index; |
|
|
3401 | goto update; |
|
|
3402 | } |
|
|
3403 | |
|
|
3404 | if (rgb24_color[index] == color) |
|
|
3405 | return index + minTermCOLOR24; |
|
|
3406 | |
|
|
3407 | // like (rgb24_seqno[idx] > rgb24_seqno[index]) |
|
|
3408 | // but also handles wrap around values good enough |
|
|
3409 | if ((uint16_t)(rgb24_seqno[idx] - rgb24_seqno[index]) < 0x7fff) |
|
|
3410 | idx = index; |
|
|
3411 | } |
|
|
3412 | |
|
|
3413 | update: |
|
|
3414 | rgb24_color[idx] = color; |
|
|
3415 | rgb24_seqno[idx] = ++rgb24_sequence; |
|
|
3416 | |
|
|
3417 | idx += minTermCOLOR24; |
|
|
3418 | pix_colors_focused [idx].free (this); |
|
|
3419 | pix_colors_focused [idx].set (this, rgba (r * 0x0101, g * 0x0101, b * 0x0101)); |
|
|
3420 | update_fade_color (idx, false); |
|
|
3421 | |
|
|
3422 | return idx; |
|
|
3423 | } |
|
|
3424 | |
3330 | void |
3425 | void |
3331 | rxvt_term::process_color_seq (int report, int color, const char *str, char resp) |
3426 | rxvt_term::process_color_seq (int report, int color, const char *str, char resp) |
3332 | { |
3427 | { |
3333 | if (str[0] == '?' && !str[1]) |
3428 | if (str[0] == '?' && !str[1]) |
3334 | { |
3429 | { |
3335 | rgba c; |
3430 | rgba c; |
3336 | pix_colors_focused[color].get (c); |
3431 | pix_colors_focused[color].get (c); |
3337 | |
3432 | |
3338 | #if XFT |
3433 | #if XFT |
3339 | if (c.a != rgba::MAX_CC) |
3434 | if (c.a != rgba::MAX_CC) |
3340 | tt_printf ("\033]%d;rgba:%04x/%04x/%04x/%04x%c", report, c.a, c.r, c.g, c.b, resp); |
3435 | tt_printf ("\033]%d;rgba:%04x/%04x/%04x/%04x%c", report, c.r, c.g, c.b, c.a, resp); |
3341 | else |
3436 | else |
3342 | #endif |
3437 | #endif |
3343 | tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, c.r, c.g, c.b, resp); |
3438 | tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, c.r, c.g, c.b, resp); |
3344 | } |
3439 | } |
3345 | else |
3440 | else |
… | |
… | |
3682 | { 5, PrivMode_rVideo }, // DECSCNM |
3777 | { 5, PrivMode_rVideo }, // DECSCNM |
3683 | { 6, PrivMode_relOrigin }, // DECOM |
3778 | { 6, PrivMode_relOrigin }, // DECOM |
3684 | { 7, PrivMode_Autowrap }, // DECAWM |
3779 | { 7, PrivMode_Autowrap }, // DECAWM |
3685 | // 8, auto-repeat keys // DECARM |
3780 | // 8, auto-repeat keys // DECARM |
3686 | { 9, PrivMode_MouseX10 }, |
3781 | { 9, PrivMode_MouseX10 }, |
|
|
3782 | { 12, PrivMode_BlinkingCursor }, |
3687 | // 18 end FF to printer after print screen |
3783 | // 18 end FF to printer after print screen |
3688 | // 19 Print screen prints full screen/scroll region |
3784 | // 19 Print screen prints full screen/scroll region |
3689 | { 25, PrivMode_VisibleCursor }, // DECTCEM cnorm/cvvis/civis |
3785 | { 25, PrivMode_VisibleCursor }, // DECTCEM cnorm/cvvis/civis |
3690 | #ifdef scrollBar_esc |
3786 | #ifdef scrollBar_esc |
3691 | { scrollBar_esc, PrivMode_scrollBar }, |
3787 | { scrollBar_esc, PrivMode_scrollBar }, |
… | |
… | |
3703 | #endif |
3799 | #endif |
3704 | { 1000, PrivMode_MouseX11 }, |
3800 | { 1000, PrivMode_MouseX11 }, |
3705 | { 1002, PrivMode_MouseBtnEvent }, |
3801 | { 1002, PrivMode_MouseBtnEvent }, |
3706 | { 1003, PrivMode_MouseAnyEvent }, |
3802 | { 1003, PrivMode_MouseAnyEvent }, |
3707 | #if ENABLE_FRILLS |
3803 | #if ENABLE_FRILLS |
|
|
3804 | { 1004, PrivMode_FocusEvent }, |
3708 | { 1005, PrivMode_ExtModeMouse }, |
3805 | { 1005, PrivMode_ExtModeMouse }, |
3709 | #endif |
3806 | #endif |
3710 | { 1010, PrivMode_TtyOutputInh }, // rxvt extension |
3807 | { 1010, PrivMode_TtyOutputInh }, // rxvt extension |
3711 | { 1011, PrivMode_Keypress }, // rxvt extension |
3808 | { 1011, PrivMode_Keypress }, // rxvt extension |
3712 | #if ENABLE_FRILLS |
3809 | #if ENABLE_FRILLS |
… | |
… | |
3800 | scrollBar.map (state); |
3897 | scrollBar.map (state); |
3801 | resize_all_windows (0, 0, 0); |
3898 | resize_all_windows (0, 0, 0); |
3802 | scr_touch (true); |
3899 | scr_touch (true); |
3803 | break; |
3900 | break; |
3804 | #endif |
3901 | #endif |
|
|
3902 | #ifdef CURSOR_BLINK |
|
|
3903 | case 12: |
|
|
3904 | cursor_blink_reset (); |
|
|
3905 | break; |
|
|
3906 | #endif |
3805 | case 25: /* visible/invisible cursor */ |
3907 | case 25: /* visible/invisible cursor */ |
3806 | scr_cursor_visible (state); |
3908 | scr_cursor_visible (state); |
3807 | break; |
3909 | break; |
3808 | /* case 35: - shift keys */ |
3910 | /* case 35: - shift keys */ |
3809 | /* case 40: - 80 <--> 132 mode */ |
3911 | /* case 40: - 80 <--> 132 mode */ |
… | |
… | |
3914 | //case 19: // ninth alt font |
4016 | //case 19: // ninth alt font |
3915 | //case 20: // gothic |
4017 | //case 20: // gothic |
3916 | case 21: // disable bold, faint, sometimes doubly underlined (iso 8613) |
4018 | case 21: // disable bold, faint, sometimes doubly underlined (iso 8613) |
3917 | rendset = 0, rendstyle = RS_Bold; |
4019 | rendset = 0, rendstyle = RS_Bold; |
3918 | break; |
4020 | break; |
3919 | case 22: // normal intensity |
4021 | case 22: // bold off (vt220) |
3920 | rendset = 0, rendstyle = RS_Bold; |
4022 | rendset = 0, rendstyle = RS_Bold; |
3921 | break; |
4023 | break; |
3922 | case 23: // disable italic |
4024 | case 23: // disable italic |
3923 | rendset = 0, rendstyle = RS_Italic; |
4025 | rendset = 0, rendstyle = RS_Italic; |
3924 | break; |
4026 | break; |
3925 | case 24: |
4027 | case 24: // underline off (vt220) |
3926 | rendset = 0, rendstyle = RS_Uline; |
4028 | rendset = 0, rendstyle = RS_Uline; |
3927 | break; |
4029 | break; |
3928 | case 25: |
4030 | case 25: // blink off (vt220) |
3929 | rendset = 0, rendstyle = RS_Blink; |
4031 | rendset = 0, rendstyle = RS_Blink; |
3930 | break; |
4032 | break; |
3931 | case 26: // variable spacing (iso 8613) |
4033 | case 26: // variable spacing (iso 8613) |
3932 | rendset = 0, rendstyle = RS_Blink; |
4034 | rendset = 0, rendstyle = RS_Blink; |
3933 | break; |
4035 | break; |
3934 | case 27: |
4036 | case 27: // reverse off (vt220) |
3935 | rendset = 0, rendstyle = RS_RVid; |
4037 | rendset = 0, rendstyle = RS_RVid; |
3936 | break; |
4038 | break; |
3937 | //case 28: // visible. NYI |
4039 | //case 28: // visible. NYI |
3938 | //case 29: // not crossed-out |
4040 | //case 29: // not crossed-out |
3939 | } |
4041 | } |
… | |
… | |
3960 | if (nargs > i + 2 && arg[i + 1] == 5) |
4062 | if (nargs > i + 2 && arg[i + 1] == 5) |
3961 | { |
4063 | { |
3962 | scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_fg); |
4064 | scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_fg); |
3963 | i += 2; |
4065 | i += 2; |
3964 | } |
4066 | } |
|
|
4067 | else if (nargs > i + 4 && arg[i + 1] == 2) |
|
|
4068 | { |
|
|
4069 | unsigned int r = arg[i + 2]; |
|
|
4070 | unsigned int g = arg[i + 3]; |
|
|
4071 | unsigned int b = arg[i + 4]; |
|
|
4072 | unsigned int idx = map_rgb24_color (r, g, b); |
|
|
4073 | scr_color (idx, Color_fg); |
|
|
4074 | i += 4; |
|
|
4075 | } |
3965 | break; |
4076 | break; |
3966 | case 39: /* default fg */ |
4077 | case 39: /* default fg */ |
3967 | scr_color (Color_fg, Color_fg); |
4078 | scr_color (Color_fg, Color_fg); |
3968 | break; |
4079 | break; |
3969 | |
4080 | |
… | |
… | |
3980 | case 48: // set bg color, ISO 8613-6 |
4091 | case 48: // set bg color, ISO 8613-6 |
3981 | if (nargs > i + 2 && arg[i + 1] == 5) |
4092 | if (nargs > i + 2 && arg[i + 1] == 5) |
3982 | { |
4093 | { |
3983 | scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_bg); |
4094 | scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_bg); |
3984 | i += 2; |
4095 | i += 2; |
|
|
4096 | } |
|
|
4097 | else if (nargs > i + 4 && arg[i + 1] == 2) |
|
|
4098 | { |
|
|
4099 | unsigned int r = arg[i + 2]; |
|
|
4100 | unsigned int g = arg[i + 3]; |
|
|
4101 | unsigned int b = arg[i + 4]; |
|
|
4102 | unsigned int idx = map_rgb24_color (r, g, b); |
|
|
4103 | scr_color (idx, Color_bg); |
|
|
4104 | i += 4; |
3985 | } |
4105 | } |
3986 | break; |
4106 | break; |
3987 | case 49: /* default bg */ |
4107 | case 49: /* default bg */ |
3988 | scr_color (Color_bg, Color_bg); |
4108 | scr_color (Color_bg, Color_bg); |
3989 | break; |
4109 | break; |
… | |
… | |
4017 | } |
4137 | } |
4018 | |
4138 | |
4019 | void |
4139 | void |
4020 | rxvt_term::set_cursor_style (int style) |
4140 | rxvt_term::set_cursor_style (int style) |
4021 | { |
4141 | { |
4022 | if (!IN_RANGE_INC (style, 0, 4)) |
4142 | if (!IN_RANGE_INC (style, 0, 6)) |
4023 | return; |
4143 | return; |
4024 | |
4144 | |
|
|
4145 | if (style == 0) |
|
|
4146 | style = 1; |
|
|
4147 | |
|
|
4148 | cursor_type = (style - 1) / 2; |
4025 | set_option (Opt_cursorUnderline, style >= 3); |
4149 | set_option (Opt_cursorUnderline, cursor_type == 1); |
4026 | |
4150 | |
4027 | #ifdef CURSOR_BLINK |
4151 | #ifdef CURSOR_BLINK |
4028 | set_option (Opt_cursorBlink, !style || (style & 1)); |
4152 | set_option (Opt_cursorBlink, style & 1); |
4029 | cursor_blink_reset (); |
4153 | cursor_blink_reset (); |
4030 | #endif |
4154 | #endif |
4031 | |
4155 | |
4032 | want_refresh = 1; |
4156 | want_refresh = 1; |
4033 | } |
4157 | } |