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.199 by root, Tue Dec 27 01:46:06 2005 UTC vs.
Revision 1.203 by root, Sat Dec 31 19:30:25 2005 UTC

46 46
47/* ------------------------------------------------------------------------- * 47/* ------------------------------------------------------------------------- *
48 * GENERAL SCREEN AND SELECTION UPDATE ROUTINES * 48 * GENERAL SCREEN AND SELECTION UPDATE ROUTINES *
49 * ------------------------------------------------------------------------- */ 49 * ------------------------------------------------------------------------- */
50#define ZERO_SCROLLBACK() \ 50#define ZERO_SCROLLBACK() \
51 if (options & Opt_scrollTtyOutput) \ 51 if (OPTION (Opt_scrollTtyOutput)) \
52 view_start = 0 52 view_start = 0
53#define CLEAR_SELECTION() \ 53#define CLEAR_SELECTION() \
54 selection.beg.row = selection.beg.col \ 54 selection.beg.row = selection.beg.col \
55 = selection.end.row = selection.end.col = 0 55 = selection.end.row = selection.end.col = 0
56#define CLEAR_ALL_SELECTION() \ 56#define CLEAR_ALL_SELECTION() \
530 530
531 screen.cur.row = clamp (screen.cur.row, 0, prev_nrow - 1); 531 screen.cur.row = clamp (screen.cur.row, 0, prev_nrow - 1);
532 screen.cur.col = clamp (screen.cur.col, 0, prev_ncol - 1); 532 screen.cur.col = clamp (screen.cur.col, 0, prev_ncol - 1);
533 533
534#if NSCREENS 534#if NSCREENS
535 if (options & Opt_secondaryScreen) 535 if (OPTION (Opt_secondaryScreen))
536 { 536 {
537 num_scr = 0; 537 num_scr = 0;
538 538
539 for (int i = prev_nrow; i--; ) 539 for (int i = prev_nrow; i--; )
540 ::swap (ROW(i), swap_buf [i]); 540 ::swap (ROW(i), swap_buf [i]);
544 screen.flags |= Screen_VisibleCursor; 544 screen.flags |= Screen_VisibleCursor;
545 swap.flags |= Screen_VisibleCursor; 545 swap.flags |= Screen_VisibleCursor;
546 } 546 }
547 else 547 else
548#endif 548#endif
549 if (options & Opt_secondaryScroll) 549 if (OPTION (Opt_secondaryScroll))
550 scr_scroll_text (0, prev_nrow - 1, prev_nrow); 550 scr_scroll_text (0, prev_nrow - 1, prev_nrow);
551 551
552 return scrn; 552 return scrn;
553} 553}
554 554
616 num_scr += count; 616 num_scr += count;
617 617
618 if (count > 0 618 if (count > 0
619 && row1 == 0 619 && row1 == 0
620 && row2 == nrow - 1 620 && row2 == nrow - 1
621 && (current_screen == PRIMARY || options & Opt_secondaryScroll)) 621 && (current_screen == PRIMARY || OPTION (Opt_secondaryScroll)))
622 { 622 {
623 nsaved = min (nsaved + count, saveLines); 623 nsaved = min (nsaved + count, saveLines);
624 term_start = (term_start + count) % total_rows; 624 term_start = (term_start + count) % total_rows;
625 625
626 if (selection.op && current_screen == selection.screen) 626 if (selection.op && current_screen == selection.screen)
642 { 642 {
643 ROW(row2 - i).l = 0; 643 ROW(row2 - i).l = 0;
644 scr_blank_screen_mem (ROW(row2 - i), rstyle); 644 scr_blank_screen_mem (ROW(row2 - i), rstyle);
645 } 645 }
646 646
647 if ((options & Opt_scrollWithBuffer) 647 if (OPTION (Opt_scrollWithBuffer)
648 && view_start != 0 648 && view_start != 0
649 && view_start != saveLines) 649 && view_start != saveLines)
650 scr_page (UP, count); 650 scr_page (UP, count);
651 } 651 }
652 else 652 else
1018 if (count) 1018 if (count)
1019 x = ncol - 1; 1019 x = ncol - 1;
1020 1020
1021 // store horizontal tab commands as characters inside the text 1021 // store horizontal tab commands as characters inside the text
1022 // buffer so they can be selected and pasted. 1022 // buffer so they can be selected and pasted.
1023 if (ht && options & Opt_pastableTabs) 1023 if (ht && OPTION (Opt_pastableTabs))
1024 { 1024 {
1025 base_rend = SET_FONT (base_rend, 0); 1025 base_rend = SET_FONT (base_rend, 0);
1026 1026
1027 if (!l.is_longer ()) /* XXX: think about this */ 1027 if (!l.is_longer ()) /* XXX: think about this */
1028 max_it (l.l, x); 1028 max_it (l.l, x);
1284 CLEAR_ROWS (row, num); 1284 CLEAR_ROWS (row, num);
1285 } 1285 }
1286 else 1286 else
1287 { 1287 {
1288 ren = rstyle & (RS_fgMask | RS_bgMask); 1288 ren = rstyle & (RS_fgMask | RS_bgMask);
1289 gcvalue.foreground = pix_colors[GET_BGCOLOR (rstyle)]; 1289 gcvalue.foreground = pix_colors[bgcolor_of (rstyle)];
1290 XChangeGC (display->display, gc, GCForeground, &gcvalue); 1290 XChangeGC (display->display, gc, GCForeground, &gcvalue);
1291 ERASE_ROWS (row, num); 1291 ERASE_ROWS (row, num);
1292 gcvalue.foreground = pix_colors[Color_fg]; 1292 gcvalue.foreground = pix_colors[Color_fg];
1293 XChangeGC (display->display, gc, GCForeground, &gcvalue); 1293 XChangeGC (display->display, gc, GCForeground, &gcvalue);
1294 } 1294 }
1593 ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); 1593 ::swap (pix_colors[Color_fg], pix_colors[Color_bg]);
1594#if XPM_BACKGROUND 1594#if XPM_BACKGROUND
1595 if (bgPixmap.pixmap == None) 1595 if (bgPixmap.pixmap == None)
1596#endif 1596#endif
1597#if TRANSPARENT 1597#if TRANSPARENT
1598 if (! (options & Opt_transparent) || am_transparent == 0) 1598 if (! OPTION (Opt_transparent) || am_transparent == 0)
1599#endif 1599#endif
1600 XSetWindowBackground (display->display, vt, 1600 XSetWindowBackground (display->display, vt,
1601 pix_colors[Color_bg]); 1601 pix_colors[Color_bg]);
1602 1602
1603 gcvalue.foreground = pix_colors[Color_fg]; 1603 gcvalue.foreground = pix_colors[Color_fg];
1836{ 1836{
1837#ifndef NO_BELL 1837#ifndef NO_BELL
1838 1838
1839# ifndef NO_MAPALERT 1839# ifndef NO_MAPALERT
1840# ifdef MAPALERT_OPTION 1840# ifdef MAPALERT_OPTION
1841 if (options & Opt_mapAlert) 1841 if (OPTION (Opt_mapAlert))
1842# endif 1842# endif
1843 XMapWindow (display->display, parent[0]); 1843 XMapWindow (display->display, parent[0]);
1844# endif 1844# endif
1845 1845
1846 if (options & Opt_visualBell) 1846 if (OPTION (Opt_visualBell))
1847 { 1847 {
1848 scr_rvideo_mode (!rvideo); /* refresh also done */ 1848 scr_rvideo_mode (!rvideo); /* refresh also done */
1849 rxvt_usleep (VISUAL_BELL_DURATION); 1849 rxvt_usleep (VISUAL_BELL_DURATION);
1850 scr_rvideo_mode (!rvideo); /* refresh also done */ 1850 scr_rvideo_mode (!rvideo); /* refresh also done */
1851 } 1851 }
1942 1942
1943#if XPM_BACKGROUND 1943#if XPM_BACKGROUND
1944 must_clear |= bgPixmap.pixmap != None; 1944 must_clear |= bgPixmap.pixmap != None;
1945#endif 1945#endif
1946#if TRANSPARENT 1946#if TRANSPARENT
1947 must_clear |= (options & Opt_transparent) && am_transparent; 1947 must_clear |= OPTION (Opt_transparent) && am_transparent;
1948#endif 1948#endif
1949 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ 1949 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */
1950 1950
1951 /* 1951 /*
1952 * B: reverse any characters which are selected 1952 * B: reverse any characters which are selected
1976 1976
1977 crp = &ROW(screen.cur.row).r[col]; 1977 crp = &ROW(screen.cur.row).r[col];
1978 1978
1979 if (showcursor && focus) 1979 if (showcursor && focus)
1980 { 1980 {
1981 if (options & Opt_cursorUnderline) 1981 if (OPTION (Opt_cursorUnderline))
1982 *crp ^= RS_Uline; 1982 *crp ^= RS_Uline;
1983 else 1983 else
1984 { 1984 {
1985 *crp ^= RS_RVid; 1985 *crp ^= RS_RVid;
1986 1986
1988 cc1 = *crp & (RS_fgMask | RS_bgMask); 1988 cc1 = *crp & (RS_fgMask | RS_bgMask);
1989 if (ISSET_PIXCOLOR (Color_cursor)) 1989 if (ISSET_PIXCOLOR (Color_cursor))
1990 ccol1 = Color_cursor; 1990 ccol1 = Color_cursor;
1991 else 1991 else
1992#ifdef CURSOR_COLOR_IS_RENDITION_COLOR 1992#ifdef CURSOR_COLOR_IS_RENDITION_COLOR
1993 ccol1 = GET_FGCOLOR (rstyle); 1993 ccol1 = fgcolor_of (rstyle);
1994#else 1994#else
1995 ccol1 = Color_fg; 1995 ccol1 = Color_fg;
1996#endif 1996#endif
1997 if (ISSET_PIXCOLOR (Color_cursor2)) 1997 if (ISSET_PIXCOLOR (Color_cursor2))
1998 ccol2 = Color_cursor2; 1998 ccol2 = Color_cursor2;
1999 else 1999 else
2000#ifdef CURSOR_COLOR_IS_RENDITION_COLOR 2000#ifdef CURSOR_COLOR_IS_RENDITION_COLOR
2001 ccol2 = GET_BGCOLOR (rstyle); 2001 ccol2 = bgcolor_of (rstyle);
2002#else 2002#else
2003 ccol2 = Color_bg; 2003 ccol2 = Color_bg;
2004#endif 2004#endif
2005 *crp = SET_FGCOLOR (*crp, ccol1); 2005 *crp = SET_FGCOLOR (*crp, ccol1);
2006 *crp = SET_BGCOLOR (*crp, ccol2); 2006 *crp = SET_BGCOLOR (*crp, ccol2);
2187 count++, i--; 2187 count++, i--;
2188 2188
2189 /* 2189 /*
2190 * Determine the attributes for the string 2190 * Determine the attributes for the string
2191 */ 2191 */
2192 int fore = GET_FGCOLOR (rend); // desired foreground 2192 int fore = fgcolor_of (rend); // desired foreground
2193 int back = GET_BGCOLOR (rend); // desired background 2193 int back = bgcolor_of (rend); // desired background
2194 2194
2195 // only do special processing if any attributes are set, which is unlikely 2195 // only do special processing if any attributes are set, which is unlikely
2196 if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) 2196 if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful))
2197 { 2197 {
2198#if ENABLE_STYLES 2198#if ENABLE_STYLES
2319 */ 2319 */
2320 if (showcursor) 2320 if (showcursor)
2321 { 2321 {
2322 if (focus) 2322 if (focus)
2323 { 2323 {
2324 if (options & Opt_cursorUnderline) 2324 if (OPTION (Opt_cursorUnderline))
2325 *crp ^= RS_Uline; 2325 *crp ^= RS_Uline;
2326 else 2326 else
2327 { 2327 {
2328 *crp ^= RS_RVid; 2328 *crp ^= RS_RVid;
2329#ifndef NO_CURSORCOLOR 2329#ifndef NO_CURSORCOLOR
2456 2456
2457 for (col = selection.beg.col; col < selection.end.col; col++) 2457 for (col = selection.beg.col; col < selection.end.col; col++)
2458 srp[col] ^= RS_RVid; 2458 srp[col] ^= RS_RVid;
2459 2459
2460 while (col-- > selection.beg.col && (stp[col] == NOCHAR || unicode::is_space (stp[col]))) 2460 while (col-- > selection.beg.col && (stp[col] == NOCHAR || unicode::is_space (stp[col])))
2461 srp[col] ^= RS_RVid | RS_Uline;
2462
2463 if (++col < selection.end.col)
2461 srp[col] ^= RS_RVid | RS_Uline; 2464 srp[col] ^= RS_RVid | RS_Uline;
2462 } 2465 }
2463 } 2466 }
2464 else 2467 else
2465#endif 2468#endif
2894#endif 2897#endif
2895 end_col = ROW(row).is_longer () ? ncol : ROW(row).l; //TODO//FIXME//LEN 2898 end_col = ROW(row).is_longer () ? ncol : ROW(row).l; //TODO//FIXME//LEN
2896 2899
2897 col = max (col, 0); 2900 col = max (col, 0);
2898 2901
2899 if (row == selection.end.row || selection.rect) 2902 if (row == selection.end.row
2903#if ENABLE_FRILLS
2904 || selection.rect
2905#endif
2906 )
2900 min_it (end_col, selection.end.col); 2907 min_it (end_col, selection.end.col);
2901 2908
2902 t = ROW(row).t + col; 2909 t = ROW(row).t + col;
2903 for (; col < end_col; col++) 2910 for (; col < end_col; col++)
2904 { 2911 {
3297 selection_delimit_word (DN, &selection.end, &selection.end); 3304 selection_delimit_word (DN, &selection.end, &selection.end);
3298 } 3305 }
3299 else if (selection.clicks == 3) 3306 else if (selection.clicks == 3)
3300 { 3307 {
3301#if ENABLE_FRILLS 3308#if ENABLE_FRILLS
3302 if (options & Opt_tripleclickwords) 3309 if (OPTION (Opt_tripleclickwords))
3303 { 3310 {
3304 selection_delimit_word (UP, &selection.beg, &selection.beg); 3311 selection_delimit_word (UP, &selection.beg, &selection.beg);
3305 3312
3306 for (int end_row = selection.mark.row; end_row < nrow; end_row++) 3313 for (int end_row = selection.mark.row; end_row < nrow; end_row++)
3307 { 3314 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines