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.339 by sf-exg, Sat Apr 17 06:48:27 2010 UTC vs.
Revision 1.344 by sf-exg, Wed Jul 21 09:00:43 2010 UTC

30 30
31#include <inttypes.h> 31#include <inttypes.h>
32 32
33#include "salloc.C" // HACK, should be a seperate compile! 33#include "salloc.C" // HACK, should be a seperate compile!
34 34
35static inline void
35static inline void fill_text (text_t *start, text_t value, int len) 36fill_text (text_t *start, text_t value, int len)
36{ 37{
37 while (len--) 38 while (len--)
38 *start++ = value; 39 *start++ = value;
39} 40}
40 41
1338 min_it (num, nrow - row); 1339 min_it (num, nrow - row);
1339 1340
1340 // TODO: the code below does not work when view_start != 0 1341 // TODO: the code below does not work when view_start != 0
1341 // the workaround is to disable the clear and use a normal refresh 1342 // the workaround is to disable the clear and use a normal refresh
1342 // when view_start != 0. mysterious. 1343 // when view_start != 0. mysterious.
1343 if (rstyle & (RS_RVid | RS_Uline)) 1344 if (rstyle & (RS_Blink | RS_RVid | RS_Uline))
1344 ren = (rend_t) ~RS_None; 1345 ren = (rend_t) ~RS_None;
1345 else if (GET_BASEBG (rstyle) == Color_bg) 1346 else if (GET_BASEBG (rstyle) == Color_bg)
1346 { 1347 {
1347 ren = DEFAULT_RSTYLE; 1348 ren = DEFAULT_RSTYLE;
1348 1349
2286 */ 2287 */
2287 int fore = fgcolor_of (rend); // desired foreground 2288 int fore = fgcolor_of (rend); // desired foreground
2288 int back = bgcolor_of (rend); // desired background 2289 int back = bgcolor_of (rend); // desired background
2289 2290
2290 // only do special processing if any attributes are set, which is unlikely 2291 // only do special processing if any attributes are set, which is unlikely
2291 if (expect_false (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful))) 2292 if (expect_false (rend & (RS_baseattrMask | RS_Careful | RS_Sel)))
2292 { 2293 {
2293 bool invert = rend & RS_RVid; 2294 bool invert = rend & RS_RVid;
2294 2295
2295#ifndef NO_BOLD_UNDERLINE_REVERSE 2296#ifndef NO_BOLD_UNDERLINE_REVERSE
2296 if (rend & RS_Bold && fore == Color_fg) 2297 if (rend & RS_Bold && fore == Color_fg)
2315 2316
2316 if (rend & RS_Uline && fore == Color_fg && ISSET_PIXCOLOR (Color_UL)) 2317 if (rend & RS_Uline && fore == Color_fg && ISSET_PIXCOLOR (Color_UL))
2317 fore = Color_UL; 2318 fore = Color_UL;
2318#endif 2319#endif
2319 2320
2321#ifdef OPTION_HC
2322 if (rend & RS_Sel)
2323 {
2324 /* invert the column if no highlightColor is set or it is the
2325 * current cursor column */
2326 if (!(showcursor && row == screen.cur.row && text - stp == screen.cur.col)
2327 && ISSET_PIXCOLOR (Color_HC))
2328 {
2329 if (ISSET_PIXCOLOR (Color_HTC))
2330 fore = Color_HTC;
2331 // if invert is 0 reverse video is set so we use bg color as fg color
2332 else if (!invert)
2333 fore = back;
2334
2335 back = Color_HC;
2336 invert = 0;
2337 }
2338 }
2339#endif
2340
2320 if (invert) 2341 if (invert)
2321 { 2342 {
2322#ifdef OPTION_HC
2323 if ((showcursor && row == screen.cur.row && text - stp == screen.cur.col)
2324 || !ISSET_PIXCOLOR (Color_HC))
2325#endif
2326 /* invert the column if no highlightColor is set or it is the
2327 * current cursor column */
2328 ::swap (fore, back); 2343 ::swap (fore, back);
2329#ifdef OPTION_HC
2330 else if (ISSET_PIXCOLOR (Color_HC))
2331 back = Color_HC;
2332#endif
2333 2344
2334#ifndef NO_BOLD_UNDERLINE_REVERSE 2345#ifndef NO_BOLD_UNDERLINE_REVERSE
2335# ifndef OPTION_HC
2336 if (ISSET_PIXCOLOR (Color_RV))
2337 back = Color_RV;
2338# endif
2339 if (fore == back) 2346 if (fore == back)
2340 { 2347 {
2341 fore = Color_bg; 2348 fore = Color_bg;
2342 back = Color_fg; 2349 back = Color_fg;
2343 } 2350 }
2596 { 2603 {
2597#if !ENABLE_MINIMAL 2604#if !ENABLE_MINIMAL
2598 if (selection.rect) 2605 if (selection.rect)
2599 scr_xor_rect (selection.beg.row, selection.beg.col, 2606 scr_xor_rect (selection.beg.row, selection.beg.col,
2600 selection.end.row, selection.end.col, 2607 selection.end.row, selection.end.col,
2601 RS_RVid, RS_RVid | RS_Uline); 2608 RS_Sel | RS_RVid, RS_Sel | RS_RVid | RS_Uline);
2602 else 2609 else
2603#endif 2610#endif
2604 scr_xor_span (selection.beg.row, selection.beg.col, 2611 scr_xor_span (selection.beg.row, selection.beg.col,
2605 selection.end.row, selection.end.col, 2612 selection.end.row, selection.end.col,
2606 RS_RVid); 2613 RS_Sel | RS_RVid);
2607 } 2614 }
2608} 2615}
2609 2616
2610/* ------------------------------------------------------------------------- */ 2617/* ------------------------------------------------------------------------- */
2611/* 2618/*
2967 selection.clip_text = NULL; 2974 selection.clip_text = NULL;
2968 selection.clip_len = 0; 2975 selection.clip_len = 0;
2969 2976
2970 if (display->clipboard_owner == this) 2977 if (display->clipboard_owner == this)
2971 display->clipboard_owner = 0; 2978 display->clipboard_owner = 0;
2972 }
2973}
2974
2975void
2976rxvt_term::clipboard_copy (Time tm)
2977{
2978 if (selection.len > 0)
2979 {
2980 free (selection.clip_text);
2981 selection.clip_len = selection.len;
2982 selection.clip_text = (wchar_t *) malloc (sizeof (wchar_t) * selection.clip_len);
2983 memcpy (selection.clip_text, selection.text,
2984 sizeof (wchar_t) * selection.clip_len);
2985 selection_grab (tm, true);
2986 } 2979 }
2987} 2980}
2988 2981
2989/* ------------------------------------------------------------------------- */ 2982/* ------------------------------------------------------------------------- */
2990/* 2983/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines