… | |
… | |
1114 | * Process DEC Back Index |
1114 | * Process DEC Back Index |
1115 | * XTERM_SEQ: ESC 6 |
1115 | * XTERM_SEQ: ESC 6 |
1116 | * Move cursor left in row. If we're at the left boundary, shift everything |
1116 | * Move cursor left in row. If we're at the left boundary, shift everything |
1117 | * in that row right. Clear left column. |
1117 | * in that row right. Clear left column. |
1118 | */ |
1118 | */ |
1119 | #if ENABLE_FRILLS |
1119 | #if !ENABLE_MINIMAL |
1120 | void |
1120 | void |
1121 | rxvt_term::scr_backindex () NOTHROW |
1121 | rxvt_term::scr_backindex () NOTHROW |
1122 | { |
1122 | { |
1123 | if (screen.cur.col > 0) |
1123 | if (screen.cur.col > 0) |
1124 | scr_gotorc (0, -1, R_RELATIVE | C_RELATIVE); |
1124 | scr_gotorc (0, -1, R_RELATIVE | C_RELATIVE); |
… | |
… | |
1131 | * Process DEC Forward Index |
1131 | * Process DEC Forward Index |
1132 | * XTERM_SEQ: ESC 9 |
1132 | * XTERM_SEQ: ESC 9 |
1133 | * Move cursor right in row. If we're at the right boundary, shift everything |
1133 | * Move cursor right in row. If we're at the right boundary, shift everything |
1134 | * in that row left. Clear right column. |
1134 | * in that row left. Clear right column. |
1135 | */ |
1135 | */ |
1136 | #if ENABLE_FRILLS |
1136 | #if !ENABLE_MINIMAL |
1137 | void |
1137 | void |
1138 | rxvt_term::scr_forwardindex () NOTHROW |
1138 | rxvt_term::scr_forwardindex () NOTHROW |
1139 | { |
1139 | { |
1140 | if (screen.cur.col < ncol - 1) |
1140 | if (screen.cur.col < ncol - 1) |
1141 | scr_gotorc (0, 1, R_RELATIVE | C_RELATIVE); |
1141 | scr_gotorc (0, 1, R_RELATIVE | C_RELATIVE); |
… | |
… | |
1355 | scr_blank_screen_mem (ROW(row), rstyle); |
1355 | scr_blank_screen_mem (ROW(row), rstyle); |
1356 | scr_blank_line (drawn_buf [row], 0, ncol, ren); |
1356 | scr_blank_line (drawn_buf [row], 0, ncol, ren); |
1357 | } |
1357 | } |
1358 | } |
1358 | } |
1359 | |
1359 | |
1360 | #if ENABLE_FRILLS |
1360 | #if !ENABLE_MINIMAL |
1361 | void |
1361 | void |
1362 | rxvt_term::scr_erase_savelines () NOTHROW |
1362 | rxvt_term::scr_erase_savelines () NOTHROW |
1363 | { |
1363 | { |
1364 | want_refresh = 1; |
1364 | want_refresh = 1; |
1365 | ZERO_SCROLLBACK (); |
1365 | ZERO_SCROLLBACK (); |
… | |
… | |
1754 | { |
1754 | { |
1755 | bool found = false; |
1755 | bool found = false; |
1756 | |
1756 | |
1757 | for (int i = 0; i < nrow; i++) |
1757 | for (int i = 0; i < nrow; i++) |
1758 | { |
1758 | { |
1759 | int col = 0; |
|
|
1760 | rend_t *drp = drawn_buf[i].r; |
1759 | rend_t *drp = drawn_buf[i].r; |
1761 | |
1760 | |
1762 | for (; col < ncol; col++, drp++) |
1761 | for (int col = 0; col < ncol; col++, drp++) |
1763 | if ((*drp & mask) == value) |
1762 | if ((*drp & mask) == value) |
1764 | { |
1763 | { |
1765 | found = true; |
1764 | found = true; |
1766 | *drp = ~value; |
1765 | *drp = ~value; |
1767 | } |
1766 | } |
… | |
… | |
2258 | && RS_SAME (rend, srp[text - stp - 1])) |
2257 | && RS_SAME (rend, srp[text - stp - 1])) |
2259 | text--, count++, xpixel -= fwidth; |
2258 | text--, count++, xpixel -= fwidth; |
2260 | |
2259 | |
2261 | // force redraw after "careful" characters to avoid pixel droppings |
2260 | // force redraw after "careful" characters to avoid pixel droppings |
2262 | for (int i = 0; srp[col + i] & RS_Careful && col + i < ncol - 1; i++) |
2261 | for (int i = 0; srp[col + i] & RS_Careful && col + i < ncol - 1; i++) |
2263 | drp[col + i + 1] = ~srp[col + i + 1]; |
2262 | drp[col + i + 1] = srp[col + i + 1] ^ RS_redraw; |
2264 | |
2263 | |
2265 | // force redraw before "careful" characters to avoid pixel droppings |
2264 | // force redraw before "careful" characters to avoid pixel droppings |
2266 | for (int i = 0; srp[text - stp - i] & RS_Careful && text - i > stp; i++) |
2265 | for (int i = 0; srp[text - stp - i] & RS_Careful && text - i > stp; i++) |
2267 | drp[text - stp - i - 1] = ~srp[text - stp - i - 1]; |
2266 | drp[text - stp - i - 1] = srp[text - stp - i - 1] ^ RS_redraw; |
2268 | #endif |
2267 | #endif |
2269 | |
2268 | |
2270 | bool invert = rend & RS_RVid; |
2269 | bool invert = rend & RS_RVid; |
2271 | |
2270 | |
2272 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2271 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
… | |
… | |
2549 | { |
2548 | { |
2550 | if (selection.op |
2549 | if (selection.op |
2551 | && current_screen == selection.screen |
2550 | && current_screen == selection.screen |
2552 | && selection.end.row >= view_start) |
2551 | && selection.end.row >= view_start) |
2553 | { |
2552 | { |
2554 | #if ENABLE_FRILLS |
2553 | #if !ENABLE_MINIMAL |
2555 | if (selection.rect) |
2554 | if (selection.rect) |
2556 | scr_xor_rect (selection.beg.row, selection.beg.col, |
2555 | scr_xor_rect (selection.beg.row, selection.beg.col, |
2557 | selection.end.row, selection.end.col, |
2556 | selection.end.row, selection.end.col, |
2558 | RS_RVid, RS_RVid | RS_Uline); |
2557 | RS_RVid, RS_RVid | RS_Uline); |
2559 | else |
2558 | else |
… | |
… | |
2774 | } |
2773 | } |
2775 | |
2774 | |
2776 | char **cl; |
2775 | char **cl; |
2777 | int cr; |
2776 | int cr; |
2778 | |
2777 | |
2779 | #if ENABLE_FRILLS |
2778 | #if !ENABLE_MINIMAL |
2780 | // xlib is horribly broken with respect to UTF8_STRING, and nobody cares to fix it |
2779 | // xlib is horribly broken with respect to UTF8_STRING, and nobody cares to fix it |
2781 | // so recode it manually |
2780 | // so recode it manually |
2782 | if (ct.encoding == xa[XA_UTF8_STRING]) |
2781 | if (ct.encoding == xa[XA_UTF8_STRING]) |
2783 | { |
2782 | { |
2784 | wchar_t *w = rxvt_utf8towcs ((const char *)ct.value, ct.nitems); |
2783 | wchar_t *w = rxvt_utf8towcs ((const char *)ct.value, ct.nitems); |
… | |
… | |
2955 | |
2954 | |
2956 | int end_col; |
2955 | int end_col; |
2957 | |
2956 | |
2958 | for (; row <= selection.end.row; row++, col = 0) |
2957 | for (; row <= selection.end.row; row++, col = 0) |
2959 | { |
2958 | { |
2960 | #if ENABLE_FRILLS |
2959 | #if !ENABLE_MINIMAL |
2961 | if (selection.rect) |
2960 | if (selection.rect) |
2962 | { |
2961 | { |
2963 | col = selection.beg.col; |
2962 | col = selection.beg.col; |
2964 | end_col = ncol + 1; |
2963 | end_col = ncol + 1; |
2965 | } |
2964 | } |
… | |
… | |
2968 | end_col = ROW(row).l; |
2967 | end_col = ROW(row).l; |
2969 | |
2968 | |
2970 | col = max (col, 0); |
2969 | col = max (col, 0); |
2971 | |
2970 | |
2972 | if (row == selection.end.row |
2971 | if (row == selection.end.row |
2973 | #if ENABLE_FRILLS |
2972 | #if !ENABLE_MINIMAL |
2974 | || selection.rect |
2973 | || selection.rect |
2975 | #endif |
2974 | #endif |
2976 | ) |
2975 | ) |
2977 | min_it (end_col, selection.end.col); |
2976 | min_it (end_col, selection.end.col); |
2978 | |
2977 | |
… | |
… | |
3001 | #endif |
3000 | #endif |
3002 | else |
3001 | else |
3003 | new_selection_text[ofs++] = *t++; |
3002 | new_selection_text[ofs++] = *t++; |
3004 | } |
3003 | } |
3005 | |
3004 | |
3006 | #if ENABLE_FRILLS |
3005 | #if !ENABLE_MINIMAL |
3007 | if (selection.rect) |
3006 | if (selection.rect) |
3008 | { |
3007 | { |
3009 | while (ofs |
3008 | while (ofs |
3010 | && new_selection_text[ofs - 1] != C0_LF |
3009 | && new_selection_text[ofs - 1] != C0_LF |
3011 | && unicode::is_space (new_selection_text[ofs - 1])) |
3010 | && unicode::is_space (new_selection_text[ofs - 1])) |
… | |
… | |
3372 | |
3371 | |
3373 | if (selection.clicks == 1) |
3372 | if (selection.clicks == 1) |
3374 | { |
3373 | { |
3375 | if (selection.beg.col > ROW(selection.beg.row).l //TODO//FIXME//LEN |
3374 | if (selection.beg.col > ROW(selection.beg.row).l //TODO//FIXME//LEN |
3376 | && !ROW(selection.beg.row).is_longer () |
3375 | && !ROW(selection.beg.row).is_longer () |
3377 | #if ENABLE_FRILLS |
3376 | #if !ENABLE_MINIMAL |
3378 | && !selection.rect |
3377 | && !selection.rect |
3379 | #endif |
3378 | #endif |
3380 | ) |
3379 | ) |
3381 | selection.beg.col = ncol; |
3380 | selection.beg.col = ncol; |
3382 | |
3381 | |
3383 | if ( |
3382 | if ( |
3384 | selection.end.col > ROW(selection.end.row).l //TODO//FIXME//LEN |
3383 | selection.end.col > ROW(selection.end.row).l //TODO//FIXME//LEN |
3385 | && !ROW(selection.end.row).is_longer () |
3384 | && !ROW(selection.end.row).is_longer () |
3386 | #if ENABLE_FRILLS |
3385 | #if !ENABLE_MINIMAL |
3387 | && !selection.rect |
3386 | && !selection.rect |
3388 | #endif |
3387 | #endif |
3389 | ) |
3388 | ) |
3390 | selection.end.col = ncol; |
3389 | selection.end.col = ncol; |
3391 | } |
3390 | } |
… | |
… | |
3408 | { |
3407 | { |
3409 | if (!ROW(end_row).is_longer ()) |
3408 | if (!ROW(end_row).is_longer ()) |
3410 | { |
3409 | { |
3411 | selection.end.row = end_row; |
3410 | selection.end.row = end_row; |
3412 | selection.end.col = ROW(end_row).l; |
3411 | selection.end.col = ROW(end_row).l; |
|
|
3412 | # if !ENABLE_MINIMAL |
3413 | selection_remove_trailing_spaces (); |
3413 | selection_remove_trailing_spaces (); |
|
|
3414 | # endif |
3414 | break; |
3415 | break; |
3415 | } |
3416 | } |
3416 | } |
3417 | } |
3417 | } |
3418 | } |
3418 | else |
3419 | else |
… | |
… | |
3447 | selection.mark.row = selection.beg.row; |
3448 | selection.mark.row = selection.beg.row; |
3448 | selection.mark.col = selection.beg.col; |
3449 | selection.mark.col = selection.beg.col; |
3449 | } |
3450 | } |
3450 | } |
3451 | } |
3451 | |
3452 | |
3452 | #if ENABLE_FRILLS |
3453 | #if !ENABLE_MINIMAL |
3453 | if (selection.rect && selection.beg.col > selection.end.col) |
3454 | if (selection.rect && selection.beg.col > selection.end.col) |
3454 | ::swap (selection.beg.col, selection.end.col); |
3455 | ::swap (selection.beg.col, selection.end.col); |
3455 | #endif |
3456 | #endif |
3456 | } |
3457 | } |
3457 | |
3458 | |
3458 | #if ENABLE_FRILLS |
3459 | #if !ENABLE_MINIMAL |
3459 | void |
3460 | void |
3460 | rxvt_term::selection_remove_trailing_spaces () NOTHROW |
3461 | rxvt_term::selection_remove_trailing_spaces () NOTHROW |
3461 | { |
3462 | { |
3462 | int32_t end_col, end_row; |
3463 | int32_t end_col, end_row; |
3463 | text_t *stp; |
3464 | text_t *stp; |
… | |
… | |
3588 | style = enc_string; |
3589 | style = enc_string; |
3589 | else if (target == xa[XA_TEXT]) |
3590 | else if (target == xa[XA_TEXT]) |
3590 | style = enc_text; |
3591 | style = enc_text; |
3591 | else if (target == xa[XA_COMPOUND_TEXT]) |
3592 | else if (target == xa[XA_COMPOUND_TEXT]) |
3592 | style = enc_compound_text; |
3593 | style = enc_compound_text; |
3593 | #if ENABLE_FRILLS |
3594 | #if !ENABLE_MINIMAL |
3594 | else if (target == xa[XA_UTF8_STRING]) |
3595 | else if (target == xa[XA_UTF8_STRING]) |
3595 | style = enc_utf8; |
3596 | style = enc_utf8; |
3596 | #endif |
3597 | #endif |
3597 | else |
3598 | else |
3598 | { |
3599 | { |
… | |
… | |
3609 | { |
3610 | { |
3610 | cl = L""; |
3611 | cl = L""; |
3611 | selectlen = 0; |
3612 | selectlen = 0; |
3612 | } |
3613 | } |
3613 | |
3614 | |
3614 | #if ENABLE_FRILLS |
3615 | #if !ENABLE_MINIMAL |
3615 | // xlib is horribly broken with respect to UTF8_STRING, and nobody cares to fix it |
3616 | // xlib is horribly broken with respect to UTF8_STRING, and nobody cares to fix it |
3616 | // so recode it manually |
3617 | // so recode it manually |
3617 | if (style == enc_utf8) |
3618 | if (style == enc_utf8) |
3618 | { |
3619 | { |
3619 | freect = 1; |
3620 | freect = 1; |