… | |
… | |
572 | * Change the colour for following text |
572 | * Change the colour for following text |
573 | */ |
573 | */ |
574 | void |
574 | void |
575 | rxvt_term::scr_color (unsigned int color, int fgbg) |
575 | rxvt_term::scr_color (unsigned int color, int fgbg) |
576 | { |
576 | { |
577 | if (color > maxTermCOLOR) |
577 | if (!IN_RANGE_INC (color, minCOLOR, maxTermCOLOR)) |
578 | color = fgbg; |
578 | color = fgbg; |
579 | |
579 | |
580 | if (fgbg == Color_fg) |
580 | if (fgbg == Color_fg) |
581 | rstyle = SET_FGCOLOR (rstyle, color); |
581 | rstyle = SET_FGCOLOR (rstyle, color); |
582 | else |
582 | else |
… | |
… | |
2381 | /* |
2381 | /* |
2382 | * H: cleanup selection |
2382 | * H: cleanup selection |
2383 | */ |
2383 | */ |
2384 | scr_reverse_selection (); |
2384 | scr_reverse_selection (); |
2385 | |
2385 | |
2386 | if (refresh_type & SMOOTH_REFRESH) |
|
|
2387 | XFlush (display->display); |
|
|
2388 | |
|
|
2389 | num_scr = 0; |
2386 | num_scr = 0; |
2390 | num_scr_allow = 1; |
2387 | num_scr_allow = 1; |
2391 | } |
2388 | } |
2392 | |
2389 | |
2393 | void |
2390 | void |
… | |
… | |
2498 | row = -view_start; |
2495 | row = -view_start; |
2499 | } |
2496 | } |
2500 | |
2497 | |
2501 | for (; row < min (end_row, view_end); row++, col = 0) |
2498 | for (; row < min (end_row, view_end); row++, col = 0) |
2502 | for (rend_t *srp = ROW(row).r; col < ncol; col++) |
2499 | for (rend_t *srp = ROW(row).r; col < ncol; col++) |
2503 | srp[col] ^= RS_RVid; |
2500 | srp[col] ^= rstyle; |
2504 | |
2501 | |
2505 | if (row == end_row) |
2502 | if (row == end_row) |
2506 | for (rend_t *srp = ROW(row).r; col < end_col; col++) |
2503 | for (rend_t *srp = ROW(row).r; col < end_col; col++) |
2507 | srp[col] ^= RS_RVid; |
2504 | srp[col] ^= rstyle; |
2508 | } |
2505 | } |
2509 | |
2506 | |
2510 | /* ------------------------------------------------------------------------- */ |
2507 | /* ------------------------------------------------------------------------- */ |
2511 | void |
2508 | void |
2512 | rxvt_term::scr_reverse_selection () |
2509 | rxvt_term::scr_reverse_selection () |
… | |
… | |
3024 | { |
3021 | { |
3025 | display->set_selection_owner (this); |
3022 | display->set_selection_owner (this); |
3026 | return true; |
3023 | return true; |
3027 | } |
3024 | } |
3028 | else |
3025 | else |
|
|
3026 | { |
|
|
3027 | selection_clear (); |
3029 | return false; |
3028 | return false; |
|
|
3029 | } |
3030 | |
3030 | |
3031 | #if 0 |
3031 | #if 0 |
3032 | XTextProperty ct; |
3032 | XTextProperty ct; |
3033 | |
3033 | |
3034 | if (XwcTextListToTextProperty (display->display, &selection.text, 1, XStringStyle, &ct) >= 0) |
3034 | if (XwcTextListToTextProperty (display->display, &selection.text, 1, XStringStyle, &ct) >= 0) |
… | |
… | |
3047 | void |
3047 | void |
3048 | rxvt_term::selection_click (int clicks, int x, int y) |
3048 | rxvt_term::selection_click (int clicks, int x, int y) |
3049 | { |
3049 | { |
3050 | clicks = ((clicks - 1) % 3) + 1; |
3050 | clicks = ((clicks - 1) % 3) + 1; |
3051 | selection.clicks = clicks; /* save clicks so extend will work */ |
3051 | selection.clicks = clicks; /* save clicks so extend will work */ |
|
|
3052 | |
|
|
3053 | if (clicks == 2 && !selection.rect |
|
|
3054 | && HOOK_INVOKE ((this, HOOK_SEL_EXTEND, DT_END))) |
|
|
3055 | { |
|
|
3056 | MEvent.clicks = 1; // what a mess |
|
|
3057 | return; |
|
|
3058 | } |
3052 | |
3059 | |
3053 | selection_start_colrow (Pixel2Col (x), Pixel2Row (y)); |
3060 | selection_start_colrow (Pixel2Col (x), Pixel2Row (y)); |
3054 | |
3061 | |
3055 | if (clicks == 2 || clicks == 3) |
3062 | if (clicks == 2 || clicks == 3) |
3056 | selection_extend_colrow (selection.mark.col, |
3063 | selection_extend_colrow (selection.mark.col, |
… | |
… | |
3352 | else if (selection.clicks == 2) |
3359 | else if (selection.clicks == 2) |
3353 | { |
3360 | { |
3354 | if (ROWCOL_IS_AFTER (selection.end, selection.beg)) |
3361 | if (ROWCOL_IS_AFTER (selection.end, selection.beg)) |
3355 | selection.end.col--; |
3362 | selection.end.col--; |
3356 | |
3363 | |
3357 | if (!HOOK_INVOKE ((this, HOOK_SEL_EXTEND, DT_END))) |
|
|
3358 | { |
|
|
3359 | selection_delimit_word (UP, &selection.beg, &selection.beg); |
3364 | selection_delimit_word (UP, &selection.beg, &selection.beg); |
3360 | selection_delimit_word (DN, &selection.end, &selection.end); |
3365 | selection_delimit_word (DN, &selection.end, &selection.end); |
3361 | } |
|
|
3362 | } |
3366 | } |
3363 | else if (selection.clicks == 3) |
3367 | else if (selection.clicks == 3) |
3364 | { |
3368 | { |
3365 | #if ENABLE_FRILLS |
3369 | #if ENABLE_FRILLS |
3366 | if (OPTION (Opt_tripleclickwords)) |
3370 | if (OPTION (Opt_tripleclickwords)) |