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.160 by root, Mon Feb 21 19:30:58 2005 UTC vs.
Revision 1.164 by root, Wed Jun 22 14:33:23 2005 UTC

1397rxvt_term::scr_erase_savelines () 1397rxvt_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
2033void 2018void
2034rxvt_term::scr_refresh (unsigned char refresh_type) 2019rxvt_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 {
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
2442#ifndef NO_CURSORCOLOR 2448#ifndef NO_CURSORCOLOR
2443 if (ISSET_PIXCOLOR (Color_cursor)) 2449 if (ISSET_PIXCOLOR (Color_cursor))
2444 XSetForeground (display->display, TermWin.gc, pix_colors[Color_cursor]); 2450 XSetForeground (display->display, TermWin.gc, pix_colors[Color_cursor]);
2445#endif 2451#endif
2446 int cursorwidth = 1;
2447 while (oldcursor.col + cursorwidth < TermWin.ncol
2448 && drawn_text[oldcursor.row][oldcursor.col + cursorwidth] == NOCHAR)
2449 cursorwidth++;
2450 2452
2451 XDrawRectangle (display->display, drawBuffer, TermWin.gc, 2453 XDrawRectangle (display->display, drawBuffer, TermWin.gc,
2452 Col2Pixel (oldcursor.col), 2454 Col2Pixel (col),
2453 Row2Pixel (oldcursor.row), 2455 Row2Pixel (oldcursor.row),
2454 (unsigned int) (Width2Pixel (cursorwidth) - 1), 2456 (unsigned int) (Width2Pixel (cursorwidth) - 1),
2455 (unsigned int) (Height2Pixel (1) - TermWin.lineSpace - 1)); 2457 (unsigned int) (Height2Pixel (1) - TermWin.lineSpace - 1));
2456 } 2458 }
2457 } 2459 }
2916 2918
2917int 2919int
2918rxvt_term::selection_request_other (Atom target, int selnum) 2920rxvt_term::selection_request_other (Atom target, int selnum)
2919{ 2921{
2920 Atom sel; 2922 Atom sel;
2921#ifdef DEBUG_SELECT
2922 char *debug_xa_names[] = { "PRIMARY", "SECONDARY", "CLIPBOARD" };
2923#endif
2924 2923
2925 selection_type |= selnum; 2924 selection_type |= selnum;
2926 2925
2927 if (selnum == Sel_Primary) 2926 if (selnum == Sel_Primary)
2928 sel = XA_PRIMARY; 2927 sel = XA_PRIMARY;
3803 while (*s) 3802 while (*s)
3804 scr_overlay_set (x++, y, *s++); 3803 scr_overlay_set (x++, y, *s++);
3805} 3804}
3806 3805
3807void 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
3808rxvt_term::scr_swap_overlay () 3823rxvt_term::scr_swap_overlay ()
3809{ 3824{
3810 if (!ov_text) 3825 if (!ov_text)
3811 return; 3826 return;
3812 3827

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines