ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/screen.C
(Generate patch)

Comparing rxvt-unicode/src/screen.C (file contents):
Revision 1.161 by root, Tue Feb 22 21:41:50 2005 UTC vs.
Revision 1.164 by root, Wed Jun 22 14:33:23 2005 UTC

2013/* 2013/*
2014 * Refresh the screen 2014 * Refresh the screen
2015 * drawn_text/drawn_rend contain the screen information before the update. 2015 * drawn_text/drawn_rend contain the screen information before the update.
2016 * screen.text/screen.rend contain what the screen will change to. 2016 * screen.text/screen.rend contain what the screen will change to.
2017 */ 2017 */
2018
2019#define FONT_WIDTH(X, Y) \
2020 (X)->per_char[ (Y) - (X)->min_char_or_byte2].width
2021#define FONT_RBEAR(X, Y) \
2022 (X)->per_char[ (Y) - (X)->min_char_or_byte2].rbearing
2023#define FONT_LBEAR(X, Y) \
2024 (X)->per_char[ (Y) - (X)->min_char_or_byte2].lbearing
2025#define IS_FONT_CHAR(X, Y) \
2026 ((Y) >= (X)->min_char_or_byte2 && (Y) <= (X)->max_char_or_byte2)
2027
2028void 2018void
2029rxvt_term::scr_refresh (unsigned char refresh_type) 2019rxvt_term::scr_refresh (unsigned char refresh_type)
2030{ 2020{
2031 unsigned char must_clear, /* use draw_string not draw_image_string */ 2021 unsigned char must_clear, /* use draw_string not draw_image_string */
2032 showcursor; /* show the cursor */ 2022 showcursor; /* show the cursor */
2051 refresh_count = 0; 2041 refresh_count = 0;
2052 2042
2053 row_offset = TermWin.saveLines - TermWin.view_start; 2043 row_offset = TermWin.saveLines - TermWin.view_start;
2054 2044
2055#if XPM_BACKGROUND 2045#if XPM_BACKGROUND
2056 must_clear |= (bgPixmap.pixmap != None); 2046 must_clear |= bgPixmap.pixmap != None;
2057#endif 2047#endif
2058#if TRANSPARENT 2048#if TRANSPARENT
2059 must_clear |= ((options & Opt_transparent) && am_transparent); 2049 must_clear |= (options & Opt_transparent) && am_transparent;
2060#endif 2050#endif
2061 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ 2051 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */
2062 2052
2063 /* 2053 /*
2064 * B: reverse any characters which are selected 2054 * B: reverse any characters which are selected
2088 2078
2089 crp = &screen.rend[screen.cur.row + TermWin.saveLines][col]; 2079 crp = &screen.rend[screen.cur.row + TermWin.saveLines][col];
2090 2080
2091 if (showcursor && TermWin.focus) 2081 if (showcursor && TermWin.focus)
2092 { 2082 {
2083 if (options & Opt_cursorUnderline)
2084 *crp ^= RS_Uline;
2085 else
2086 {
2093 *crp ^= RS_RVid; 2087 *crp ^= RS_RVid;
2088
2094#ifndef NO_CURSORCOLOR 2089#ifndef NO_CURSORCOLOR
2095 cc1 = *crp & (RS_fgMask | RS_bgMask); 2090 cc1 = *crp & (RS_fgMask | RS_bgMask);
2096 if (ISSET_PIXCOLOR (Color_cursor)) 2091 if (ISSET_PIXCOLOR (Color_cursor))
2097 ccol1 = Color_cursor; 2092 ccol1 = Color_cursor;
2098 else 2093 else
2099#ifdef CURSOR_COLOR_IS_RENDITION_COLOR 2094#ifdef CURSOR_COLOR_IS_RENDITION_COLOR
2100 ccol1 = GET_FGCOLOR (rstyle); 2095 ccol1 = GET_FGCOLOR (rstyle);
2101#else 2096#else
2102 ccol1 = Color_fg; 2097 ccol1 = Color_fg;
2103#endif 2098#endif
2104 if (ISSET_PIXCOLOR (Color_cursor2)) 2099 if (ISSET_PIXCOLOR (Color_cursor2))
2105 ccol2 = Color_cursor2; 2100 ccol2 = Color_cursor2;
2106 else 2101 else
2107#ifdef CURSOR_COLOR_IS_RENDITION_COLOR 2102#ifdef CURSOR_COLOR_IS_RENDITION_COLOR
2108 ccol2 = GET_BGCOLOR (rstyle); 2103 ccol2 = GET_BGCOLOR (rstyle);
2109#else 2104#else
2110 ccol2 = Color_bg; 2105 ccol2 = Color_bg;
2111#endif 2106#endif
2112 *crp = SET_FGCOLOR (*crp, ccol1); 2107 *crp = SET_FGCOLOR (*crp, ccol1);
2113 *crp = SET_BGCOLOR (*crp, ccol2); 2108 *crp = SET_BGCOLOR (*crp, ccol2);
2114#endif 2109#endif
2110 }
2115 } 2111 }
2116 } 2112 }
2117 2113
2118 /* make sure no outline cursor is left around */ 2114 /* make sure no outline cursor is left around */
2119 setoldcursor = 0; 2115 setoldcursor = 0;
2425 */ 2421 */
2426 if (showcursor) 2422 if (showcursor)
2427 { 2423 {
2428 if (TermWin.focus) 2424 if (TermWin.focus)
2429 { 2425 {
2426 if (options & Opt_cursorUnderline)
2427 *crp ^= RS_Uline;
2428 else
2429 {
2430 *crp ^= RS_RVid; 2430 *crp ^= RS_RVid;
2431#ifndef NO_CURSORCOLOR 2431#ifndef NO_CURSORCOLOR
2432 *crp = (*crp & ~ (RS_fgMask | RS_bgMask)) | cc1; 2432 *crp = (*crp & ~ (RS_fgMask | RS_bgMask)) | cc1;
2433#endif 2433#endif
2434 }
2434 } 2435 }
2435 else if (oldcursor.row >= 0) 2436 else if (oldcursor.row >= 0)
2436 { 2437 {
2438 int cursorwidth = 1;
2439 int col = oldcursor.col;
2440
2441 while (col && screen.text[screen.cur.row + TermWin.saveLines][col] == NOCHAR)
2442 col--;
2443
2444 while (col + cursorwidth < TermWin.ncol
2445 && drawn_text[oldcursor.row][col + cursorwidth] == NOCHAR)
2446 cursorwidth++;
2447
2437#ifndef NO_CURSORCOLOR 2448#ifndef NO_CURSORCOLOR
2438 if (ISSET_PIXCOLOR (Color_cursor)) 2449 if (ISSET_PIXCOLOR (Color_cursor))
2439 XSetForeground (display->display, TermWin.gc, pix_colors[Color_cursor]); 2450 XSetForeground (display->display, TermWin.gc, pix_colors[Color_cursor]);
2440#endif 2451#endif
2441 int cursorwidth = 1;
2442 while (oldcursor.col + cursorwidth < TermWin.ncol
2443 && drawn_text[oldcursor.row][oldcursor.col + cursorwidth] == NOCHAR)
2444 cursorwidth++;
2445 2452
2446 XDrawRectangle (display->display, drawBuffer, TermWin.gc, 2453 XDrawRectangle (display->display, drawBuffer, TermWin.gc,
2447 Col2Pixel (oldcursor.col), 2454 Col2Pixel (col),
2448 Row2Pixel (oldcursor.row), 2455 Row2Pixel (oldcursor.row),
2449 (unsigned int) (Width2Pixel (cursorwidth) - 1), 2456 (unsigned int) (Width2Pixel (cursorwidth) - 1),
2450 (unsigned int) (Height2Pixel (1) - TermWin.lineSpace - 1)); 2457 (unsigned int) (Height2Pixel (1) - TermWin.lineSpace - 1));
2451 } 2458 }
2452 } 2459 }
3795 while (*s) 3802 while (*s)
3796 scr_overlay_set (x++, y, *s++); 3803 scr_overlay_set (x++, y, *s++);
3797} 3804}
3798 3805
3799void 3806void
3807rxvt_term::scr_overlay_set (int x, int y, const wchar_t *s)
3808{
3809 while (*s)
3810 {
3811 text_t t = *s++;
3812 int width = wcwidth (t);
3813
3814 while (width--)
3815 {
3816 scr_overlay_set (x++, y, t);
3817 t = NOCHAR;
3818 }
3819 }
3820}
3821
3822void
3800rxvt_term::scr_swap_overlay () 3823rxvt_term::scr_swap_overlay ()
3801{ 3824{
3802 if (!ov_text) 3825 if (!ov_text)
3803 return; 3826 return;
3804 3827

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines