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

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines