… | |
… | |
1161 | */ |
1161 | */ |
1162 | #if ENABLE_FRILLS |
1162 | #if ENABLE_FRILLS |
1163 | void |
1163 | void |
1164 | rxvt_term::scr_forwardindex () |
1164 | rxvt_term::scr_forwardindex () |
1165 | { |
1165 | { |
1166 | int row; |
1166 | int row; |
1167 | |
1167 | |
1168 | if (screen.cur.col < TermWin.ncol - 1) |
1168 | if (screen.cur.col < TermWin.ncol - 1) |
1169 | scr_gotorc (0, 1, R_RELATIVE | C_RELATIVE); |
1169 | scr_gotorc (0, 1, R_RELATIVE | C_RELATIVE); |
1170 | else |
1170 | else |
1171 | { |
1171 | { |
… | |
… | |
1390 | screen.tlen[row + row_offset] = 0; |
1390 | screen.tlen[row + row_offset] = 0; |
1391 | scr_blank_line (drawn_text[row], drawn_rend[row], (unsigned int)TermWin.ncol, ren); |
1391 | scr_blank_line (drawn_text[row], drawn_rend[row], (unsigned int)TermWin.ncol, ren); |
1392 | } |
1392 | } |
1393 | } |
1393 | } |
1394 | |
1394 | |
|
|
1395 | #if ENABLE_FRILLS |
1395 | void |
1396 | void |
1396 | rxvt_term::scr_erase_savelines () |
1397 | rxvt_term::scr_erase_savelines () |
1397 | { |
1398 | { |
1398 | want_refresh = 1; |
1399 | want_refresh = 1; |
1399 | ZERO_SCROLLBACK (); |
1400 | ZERO_SCROLLBACK (); |
1400 | |
1401 | |
1401 | for (int i = 0; i < TermWin.saveLines; ++i) |
1402 | TermWin.nscrolled = 0; |
1402 | if (screen.text [i]) |
|
|
1403 | { |
|
|
1404 | screen.tlen[i] = 0; |
|
|
1405 | scr_blank_line (screen.text [i], screen.rend [i], (unsigned int)TermWin.ncol, DEFAULT_RSTYLE); |
|
|
1406 | } |
|
|
1407 | } |
1403 | } |
|
|
1404 | #endif |
1408 | |
1405 | |
1409 | /* ------------------------------------------------------------------------- */ |
1406 | /* ------------------------------------------------------------------------- */ |
1410 | /* |
1407 | /* |
1411 | * Fill the screen with `E's |
1408 | * Fill the screen with `E's |
1412 | * XTERM_SEQ: Screen Alignment Test: ESC # 8 |
1409 | * XTERM_SEQ: Screen Alignment Test: ESC # 8 |
… | |
… | |
2016 | /* |
2013 | /* |
2017 | * Refresh the screen |
2014 | * Refresh the screen |
2018 | * drawn_text/drawn_rend contain the screen information before the update. |
2015 | * drawn_text/drawn_rend contain the screen information before the update. |
2019 | * screen.text/screen.rend contain what the screen will change to. |
2016 | * screen.text/screen.rend contain what the screen will change to. |
2020 | */ |
2017 | */ |
2021 | |
|
|
2022 | #define FONT_WIDTH(X, Y) \ |
|
|
2023 | (X)->per_char[ (Y) - (X)->min_char_or_byte2].width |
|
|
2024 | #define FONT_RBEAR(X, Y) \ |
|
|
2025 | (X)->per_char[ (Y) - (X)->min_char_or_byte2].rbearing |
|
|
2026 | #define FONT_LBEAR(X, Y) \ |
|
|
2027 | (X)->per_char[ (Y) - (X)->min_char_or_byte2].lbearing |
|
|
2028 | #define IS_FONT_CHAR(X, Y) \ |
|
|
2029 | ((Y) >= (X)->min_char_or_byte2 && (Y) <= (X)->max_char_or_byte2) |
|
|
2030 | |
|
|
2031 | void |
2018 | void |
2032 | rxvt_term::scr_refresh (unsigned char refresh_type) |
2019 | rxvt_term::scr_refresh (unsigned char refresh_type) |
2033 | { |
2020 | { |
2034 | unsigned char must_clear, /* use draw_string not draw_image_string */ |
2021 | unsigned char must_clear, /* use draw_string not draw_image_string */ |
2035 | showcursor; /* show the cursor */ |
2022 | showcursor; /* show the cursor */ |
… | |
… | |
2054 | refresh_count = 0; |
2041 | refresh_count = 0; |
2055 | |
2042 | |
2056 | row_offset = TermWin.saveLines - TermWin.view_start; |
2043 | row_offset = TermWin.saveLines - TermWin.view_start; |
2057 | |
2044 | |
2058 | #if XPM_BACKGROUND |
2045 | #if XPM_BACKGROUND |
2059 | must_clear |= (bgPixmap.pixmap != None); |
2046 | must_clear |= bgPixmap.pixmap != None; |
2060 | #endif |
2047 | #endif |
2061 | #if TRANSPARENT |
2048 | #if TRANSPARENT |
2062 | must_clear |= ((options & Opt_transparent) && am_transparent); |
2049 | must_clear |= (options & Opt_transparent) && am_transparent; |
2063 | #endif |
2050 | #endif |
2064 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
2051 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
2065 | |
2052 | |
2066 | /* |
2053 | /* |
2067 | * B: reverse any characters which are selected |
2054 | * B: reverse any characters which are selected |
… | |
… | |
2091 | |
2078 | |
2092 | crp = &screen.rend[screen.cur.row + TermWin.saveLines][col]; |
2079 | crp = &screen.rend[screen.cur.row + TermWin.saveLines][col]; |
2093 | |
2080 | |
2094 | if (showcursor && TermWin.focus) |
2081 | if (showcursor && TermWin.focus) |
2095 | { |
2082 | { |
|
|
2083 | if (options & Opt_cursorUnderline) |
|
|
2084 | *crp ^= RS_Uline; |
|
|
2085 | else |
|
|
2086 | { |
2096 | *crp ^= RS_RVid; |
2087 | *crp ^= RS_RVid; |
|
|
2088 | |
2097 | #ifndef NO_CURSORCOLOR |
2089 | #ifndef NO_CURSORCOLOR |
2098 | cc1 = *crp & (RS_fgMask | RS_bgMask); |
2090 | cc1 = *crp & (RS_fgMask | RS_bgMask); |
2099 | if (ISSET_PIXCOLOR (Color_cursor)) |
2091 | if (ISSET_PIXCOLOR (Color_cursor)) |
2100 | ccol1 = Color_cursor; |
2092 | ccol1 = Color_cursor; |
2101 | else |
2093 | else |
2102 | #ifdef CURSOR_COLOR_IS_RENDITION_COLOR |
2094 | #ifdef CURSOR_COLOR_IS_RENDITION_COLOR |
2103 | ccol1 = GET_FGCOLOR (rstyle); |
2095 | ccol1 = GET_FGCOLOR (rstyle); |
2104 | #else |
2096 | #else |
2105 | ccol1 = Color_fg; |
2097 | ccol1 = Color_fg; |
2106 | #endif |
2098 | #endif |
2107 | if (ISSET_PIXCOLOR (Color_cursor2)) |
2099 | if (ISSET_PIXCOLOR (Color_cursor2)) |
2108 | ccol2 = Color_cursor2; |
2100 | ccol2 = Color_cursor2; |
2109 | else |
2101 | else |
2110 | #ifdef CURSOR_COLOR_IS_RENDITION_COLOR |
2102 | #ifdef CURSOR_COLOR_IS_RENDITION_COLOR |
2111 | ccol2 = GET_BGCOLOR (rstyle); |
2103 | ccol2 = GET_BGCOLOR (rstyle); |
2112 | #else |
2104 | #else |
2113 | ccol2 = Color_bg; |
2105 | ccol2 = Color_bg; |
2114 | #endif |
2106 | #endif |
2115 | *crp = SET_FGCOLOR (*crp, ccol1); |
2107 | *crp = SET_FGCOLOR (*crp, ccol1); |
2116 | *crp = SET_BGCOLOR (*crp, ccol2); |
2108 | *crp = SET_BGCOLOR (*crp, ccol2); |
2117 | #endif |
2109 | #endif |
|
|
2110 | } |
2118 | } |
2111 | } |
2119 | } |
2112 | } |
2120 | |
2113 | |
2121 | /* make sure no outline cursor is left around */ |
2114 | /* make sure no outline cursor is left around */ |
2122 | setoldcursor = 0; |
2115 | setoldcursor = 0; |
… | |
… | |
2428 | */ |
2421 | */ |
2429 | if (showcursor) |
2422 | if (showcursor) |
2430 | { |
2423 | { |
2431 | if (TermWin.focus) |
2424 | if (TermWin.focus) |
2432 | { |
2425 | { |
|
|
2426 | if (options & Opt_cursorUnderline) |
|
|
2427 | *crp ^= RS_Uline; |
|
|
2428 | else |
|
|
2429 | { |
2433 | *crp ^= RS_RVid; |
2430 | *crp ^= RS_RVid; |
2434 | #ifndef NO_CURSORCOLOR |
2431 | #ifndef NO_CURSORCOLOR |
2435 | *crp = (*crp & ~ (RS_fgMask | RS_bgMask)) | cc1; |
2432 | *crp = (*crp & ~ (RS_fgMask | RS_bgMask)) | cc1; |
2436 | #endif |
2433 | #endif |
|
|
2434 | } |
2437 | } |
2435 | } |
2438 | else if (oldcursor.row >= 0) |
2436 | else if (oldcursor.row >= 0) |
2439 | { |
2437 | { |
2440 | #ifndef NO_CURSORCOLOR |
2438 | #ifndef NO_CURSORCOLOR |
2441 | if (ISSET_PIXCOLOR (Color_cursor)) |
2439 | if (ISSET_PIXCOLOR (Color_cursor)) |
… | |
… | |
2914 | |
2912 | |
2915 | int |
2913 | int |
2916 | rxvt_term::selection_request_other (Atom target, int selnum) |
2914 | rxvt_term::selection_request_other (Atom target, int selnum) |
2917 | { |
2915 | { |
2918 | Atom sel; |
2916 | Atom sel; |
2919 | #ifdef DEBUG_SELECT |
|
|
2920 | char *debug_xa_names[] = { "PRIMARY", "SECONDARY", "CLIPBOARD" }; |
|
|
2921 | #endif |
|
|
2922 | |
2917 | |
2923 | selection_type |= selnum; |
2918 | selection_type |= selnum; |
2924 | |
2919 | |
2925 | if (selnum == Sel_Primary) |
2920 | if (selnum == Sel_Primary) |
2926 | sel = XA_PRIMARY; |
2921 | sel = XA_PRIMARY; |
… | |
… | |
3801 | while (*s) |
3796 | while (*s) |
3802 | scr_overlay_set (x++, y, *s++); |
3797 | scr_overlay_set (x++, y, *s++); |
3803 | } |
3798 | } |
3804 | |
3799 | |
3805 | void |
3800 | void |
|
|
3801 | rxvt_term::scr_overlay_set (int x, int y, const wchar_t *s) |
|
|
3802 | { |
|
|
3803 | while (*s) |
|
|
3804 | { |
|
|
3805 | text_t t = *s++; |
|
|
3806 | int width = wcwidth (t); |
|
|
3807 | |
|
|
3808 | while (width--) |
|
|
3809 | { |
|
|
3810 | scr_overlay_set (x++, y, t); |
|
|
3811 | t = NOCHAR; |
|
|
3812 | } |
|
|
3813 | } |
|
|
3814 | } |
|
|
3815 | |
|
|
3816 | void |
3806 | rxvt_term::scr_swap_overlay () |
3817 | rxvt_term::scr_swap_overlay () |
3807 | { |
3818 | { |
3808 | if (!ov_text) |
3819 | if (!ov_text) |
3809 | return; |
3820 | return; |
3810 | |
3821 | |