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.178 by root, Tue Dec 20 22:27:49 2005 UTC vs.
Revision 1.181 by root, Wed Dec 21 10:34:35 2005 UTC

543 if (current_screen == scrn) 543 if (current_screen == scrn)
544 return scrn; 544 return scrn;
545 545
546 selection_check (2); /* check for boundary cross */ 546 selection_check (2); /* check for boundary cross */
547 547
548 SWAP_IT (scrn, current_screen, int); 548 int i = current_screen; current_screen = scrn; scrn = i;
549 549
550 SWAP_IT (screen.cur.row, swap.cur.row, int16_t); 550 ::swap (screen.cur.row, swap.cur.row);
551 SWAP_IT (screen.cur.col, swap.cur.col, int16_t); 551 ::swap (screen.cur.col, swap.cur.col);
552 MAX_IT (screen.cur.row, 0); 552
553 MIN_IT (screen.cur.row, (int32_t)prev_nrow - 1); 553 screen.cur.row = clamp (screen.cur.row, 0, prev_nrow - 1);
554 MAX_IT (screen.cur.col, 0); 554 screen.cur.col = clamp (screen.cur.col, 0, prev_ncol - 1);
555 MIN_IT (screen.cur.col, (int32_t)prev_ncol - 1);
556 555
557#if NSCREENS 556#if NSCREENS
558 if (options & Opt_secondaryScreen) 557 if (options & Opt_secondaryScreen)
559 { 558 {
560 num_scr = 0; 559 num_scr = 0;
561 560
562 for (int i = nrow; i--; ) 561 for (int i = nrow; i--; )
563 SWAP_IT (ROW(i), swap_save[i], line_t); 562 ::swap (ROW(i), swap_save[i]);
564 563
565 SWAP_IT (screen.charset, swap.charset, int16_t); 564 ::swap (screen.charset, swap.charset);
566 SWAP_IT (screen.flags, swap.flags, int); 565 ::swap (screen.flags, swap.flags);
567 screen.flags |= Screen_VisibleCursor; 566 screen.flags |= Screen_VisibleCursor;
568 swap.flags |= Screen_VisibleCursor; 567 swap.flags |= Screen_VisibleCursor;
569 } 568 }
570 else 569 else
571#endif 570#endif
1618 XGCValues gcvalue; 1617 XGCValues gcvalue;
1619 1618
1620 if (rvideo != mode) 1619 if (rvideo != mode)
1621 { 1620 {
1622 rvideo = mode; 1621 rvideo = mode;
1623 SWAP_IT (pix_colors[Color_fg], pix_colors[Color_bg], rxvt_color); 1622 ::swap (pix_colors[Color_fg], pix_colors[Color_bg]);
1624#if XPM_BACKGROUND 1623#if XPM_BACKGROUND
1625 if (bgPixmap.pixmap == None) 1624 if (bgPixmap.pixmap == None)
1626#endif 1625#endif
1627#if TRANSPARENT 1626#if TRANSPARENT
1628 if (! (options & Opt_transparent) || am_transparent == 0) 1627 if (! (options & Opt_transparent) || am_transparent == 0)
1958{ 1957{
1959 unsigned char must_clear, /* use draw_string not draw_image_string */ 1958 unsigned char must_clear, /* use draw_string not draw_image_string */
1960 showcursor; /* show the cursor */ 1959 showcursor; /* show the cursor */
1961 int16_t col, row, /* column/row we're processing */ 1960 int16_t col, row, /* column/row we're processing */
1962 ocrow; /* old cursor row */ 1961 ocrow; /* old cursor row */
1963 int i, /* tmp */ 1962 int i; /* tmp */
1964 row_offset; /* basic offset in screen structure */
1965#ifndef NO_CURSORCOLOR 1963#ifndef NO_CURSORCOLOR
1966 rend_t cc1; /* store colours at cursor position (s) */ 1964 rend_t cc1; /* store colours at cursor position (s) */
1967#endif 1965#endif
1968 rend_t *crp; // cursor rendition pointer 1966 rend_t *crp; // cursor rendition pointer
1969 1967
1975 /* 1973 /*
1976 * A: set up vars 1974 * A: set up vars
1977 */ 1975 */
1978 must_clear = 0; 1976 must_clear = 0;
1979 refresh_count = 0; 1977 refresh_count = 0;
1980
1981 row_offset = term_start - view_start;
1982 1978
1983#if XPM_BACKGROUND 1979#if XPM_BACKGROUND
1984 must_clear |= bgPixmap.pixmap != None; 1980 must_clear |= bgPixmap.pixmap != None;
1985#endif 1981#endif
1986#if TRANSPARENT 1982#if TRANSPARENT
2104 row = i > 0 ? 0 : j - 1; 2100 row = i > 0 ? 0 : j - 1;
2105 for (; j-- >= 0; row += (i > 0 ? 1 : -1)) 2101 for (; j-- >= 0; row += (i > 0 ? 1 : -1))
2106 { 2102 {
2107 if (row + i >= 0 && row + i < nrow && row + i != ocrow) 2103 if (row + i >= 0 && row + i < nrow && row + i != ocrow)
2108 { 2104 {
2109 line_t s = save[(row + row_offset) % total_rows]; 2105 line_t s = ROW(row - view_start);
2110 line_t d = drawn[row]; 2106 line_t d = drawn[row];
2111 line_t d2 = drawn[row + i]; 2107 line_t d2 = drawn[row + i];
2112 2108
2113 for (nits = 0, col = ncol; col--; ) 2109 for (nits = 0, col = ncol; col--; )
2114 if (s.t[col] != d2.t[col] || s.r[col] != d2.r[col]) 2110 if (s.t[col] != d2.t[col] || s.r[col] != d2.r[col])
2152 /* 2148 /*
2153 * E: main pass across every character 2149 * E: main pass across every character
2154 */ 2150 */
2155 for (row = 0; row < nrow; row++) 2151 for (row = 0; row < nrow; row++)
2156 { 2152 {
2157 text_t *stp = save[(row + row_offset) % total_rows].t; 2153 text_t *stp = ROW(row - view_start).t;
2158 rend_t *srp = save[(row + row_offset) % total_rows].r; 2154 rend_t *srp = ROW(row - view_start).r;
2159 text_t *dtp = drawn[row].t; 2155 text_t *dtp = drawn[row].t;
2160 rend_t *drp = drawn[row].r; 2156 rend_t *drp = drawn[row].r;
2161 2157
2162 /* 2158 /*
2163 * E2: OK, now the real pass 2159 * E2: OK, now the real pass
3028 want_refresh = 1; 3024 want_refresh = 1;
3029 3025
3030 selection.mark.row = row - view_start; 3026 selection.mark.row = row - view_start;
3031 selection.mark.col = col; 3027 selection.mark.col = col;
3032 3028
3033 selection.mark.row = min (max (selection.mark.row, -nsaved), nrow - 1); 3029 selection.mark.row = clamp (selection.mark.row, -nsaved, nrow - 1);
3034 selection.mark.col = min (max (selection.mark.col, 0), ncol - 1); 3030 selection.mark.col = clamp (selection.mark.col, 0, ncol - 1);
3035 3031
3036 while (selection.mark.col > 0 3032 while (selection.mark.col > 0
3037 && ROW(selection.mark.row).t[selection.mark.col] == NOCHAR) 3033 && ROW(selection.mark.row).t[selection.mark.col] == NOCHAR)
3038 --selection.mark.col; 3034 --selection.mark.col;
3039 3035
3144 * flag == 2 ==> button 3 motion 3140 * flag == 2 ==> button 3 motion
3145 */ 3141 */
3146void 3142void
3147rxvt_term::selection_extend (int x, int y, int flag) 3143rxvt_term::selection_extend (int x, int y, int flag)
3148{ 3144{
3149 int col = min (max (Pixel2Col (x), 0), ncol); 3145 int col = clamp (Pixel2Col (x), 0, ncol);
3150 int row = min (max (Pixel2Row (y), 0), nrow - 1); 3146 int row = clamp (Pixel2Row (y), 0, nrow - 1);
3151 3147
3152 /* 3148 /*
3153 * If we're selecting characters (single click) then we must check first 3149 * If we're selecting characters (single click) then we must check first
3154 * if we are at the same place as the original mark. If we are then 3150 * if we are at the same place as the original mark. If we are then
3155 * select nothing. Otherwise, if we're to the right of the mark, you have to 3151 * select nothing. Otherwise, if we're to the right of the mark, you have to

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines