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