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.179 by root, Tue Dec 20 22:47:14 2005 UTC vs.
Revision 1.182 by root, Wed Dec 21 10:35:47 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)
2131 2130
2132 if (len != -1) 2131 if (len != -1)
2133 { 2132 {
2134 /* also comes here at end if needed because of >= above */ 2133 /* also comes here at end if needed because of >= above */
2135 if (wlen < len) 2134 if (wlen < len)
2136 SWAP_IT (wlen, len, int); 2135 ::swap (wlen, len);
2137 2136
2138 XCopyArea (display->display, vt, vt, 2137 XCopyArea (display->display, vt, vt,
2139 gc, 0, Row2Pixel (len + i), 2138 gc, 0, Row2Pixel (len + i),
2140 (unsigned int)TermWin_TotalWidth (), 2139 (unsigned int)TermWin_TotalWidth (),
2141 (unsigned int)Height2Pixel (wlen - len + 1), 2140 (unsigned int)Height2Pixel (wlen - len + 1),
2273 fore = Color_UL; 2272 fore = Color_UL;
2274#endif 2273#endif
2275 2274
2276 if (invert) 2275 if (invert)
2277 { 2276 {
2278 SWAP_IT (fore, back, int); 2277 ::swap (fore, back);
2279 2278
2280#ifndef NO_BOLD_UNDERLINE_REVERSE 2279#ifndef NO_BOLD_UNDERLINE_REVERSE
2281 if (ISSET_PIXCOLOR (Color_RV)) 2280 if (ISSET_PIXCOLOR (Color_RV))
2282 back = Color_RV; 2281 back = Color_RV;
2283 2282
3025 want_refresh = 1; 3024 want_refresh = 1;
3026 3025
3027 selection.mark.row = row - view_start; 3026 selection.mark.row = row - view_start;
3028 selection.mark.col = col; 3027 selection.mark.col = col;
3029 3028
3030 selection.mark.row = min (max (selection.mark.row, -nsaved), nrow - 1); 3029 selection.mark.row = clamp (selection.mark.row, -nsaved, nrow - 1);
3031 selection.mark.col = min (max (selection.mark.col, 0), ncol - 1); 3030 selection.mark.col = clamp (selection.mark.col, 0, ncol - 1);
3032 3031
3033 while (selection.mark.col > 0 3032 while (selection.mark.col > 0
3034 && ROW(selection.mark.row).t[selection.mark.col] == NOCHAR) 3033 && ROW(selection.mark.row).t[selection.mark.col] == NOCHAR)
3035 --selection.mark.col; 3034 --selection.mark.col;
3036 3035
3141 * flag == 2 ==> button 3 motion 3140 * flag == 2 ==> button 3 motion
3142 */ 3141 */
3143void 3142void
3144rxvt_term::selection_extend (int x, int y, int flag) 3143rxvt_term::selection_extend (int x, int y, int flag)
3145{ 3144{
3146 int col = min (max (Pixel2Col (x), 0), ncol); 3145 int col = clamp (Pixel2Col (x), 0, ncol);
3147 int row = min (max (Pixel2Row (y), 0), nrow - 1); 3146 int row = clamp (Pixel2Row (y), 0, nrow - 1);
3148 3147
3149 /* 3148 /*
3150 * 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
3151 * 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
3152 * 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
3365 } 3364 }
3366 } 3365 }
3367 3366
3368#if ENABLE_FRILLS 3367#if ENABLE_FRILLS
3369 if (selection.rect && selection.beg.col > selection.end.col) 3368 if (selection.rect && selection.beg.col > selection.end.col)
3370 SWAP_IT (selection.beg.col, selection.end.col, int); 3369 ::swap (selection.beg.col, selection.end.col);
3371#endif 3370#endif
3372} 3371}
3373 3372
3374#if ENABLE_FRILLS 3373#if ENABLE_FRILLS
3375void 3374void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines