… | |
… | |
1957 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
1957 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
1958 | |
1958 | |
1959 | /* |
1959 | /* |
1960 | * B: reverse any characters which are selected |
1960 | * B: reverse any characters which are selected |
1961 | */ |
1961 | */ |
1962 | PERL_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END)); |
|
|
1963 | scr_reverse_selection (); |
1962 | scr_reverse_selection (); |
1964 | |
1963 | |
1965 | /* |
1964 | /* |
1966 | * C: set the cursor character (s) |
1965 | * C: set the cursor character (s) |
1967 | */ |
1966 | */ |
… | |
… | |
2048 | oldcursor.col = screen.cur.col; |
2047 | oldcursor.col = screen.cur.col; |
2049 | } |
2048 | } |
2050 | } |
2049 | } |
2051 | } |
2050 | } |
2052 | |
2051 | |
|
|
2052 | PERL_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END)); |
2053 | #if ENABLE_OVERLAY |
2053 | #if ENABLE_OVERLAY |
2054 | scr_swap_overlay (); |
2054 | scr_swap_overlay (); |
2055 | #endif |
2055 | #endif |
2056 | |
2056 | |
2057 | #ifndef NO_SLOW_LINK_SUPPORT |
2057 | #ifndef NO_SLOW_LINK_SUPPORT |
… | |
… | |
2107 | if (wlen < len) |
2107 | if (wlen < len) |
2108 | ::swap (wlen, len); |
2108 | ::swap (wlen, len); |
2109 | |
2109 | |
2110 | XCopyArea (display->display, vt, vt, |
2110 | XCopyArea (display->display, vt, vt, |
2111 | gc, 0, Row2Pixel (len + i), |
2111 | gc, 0, Row2Pixel (len + i), |
2112 | (unsigned int)TermWin_TotalWidth (), |
2112 | (unsigned int)this->width, |
2113 | (unsigned int)Height2Pixel (wlen - len + 1), |
2113 | (unsigned int)Height2Pixel (wlen - len + 1), |
2114 | 0, Row2Pixel (len)); |
2114 | 0, Row2Pixel (len)); |
2115 | len = -1; |
2115 | len = -1; |
2116 | } |
2116 | } |
2117 | } |
2117 | } |
… | |
… | |
2320 | } /* for (row....) */ |
2320 | } /* for (row....) */ |
2321 | |
2321 | |
2322 | #if ENABLE_OVERLAY |
2322 | #if ENABLE_OVERLAY |
2323 | scr_swap_overlay (); |
2323 | scr_swap_overlay (); |
2324 | #endif |
2324 | #endif |
|
|
2325 | PERL_INVOKE ((this, HOOK_REFRESH_END, DT_END)); |
2325 | |
2326 | |
2326 | /* |
2327 | /* |
2327 | * G: cleanup cursor and display outline cursor if necessary |
2328 | * G: cleanup cursor and display outline cursor if necessary |
2328 | */ |
2329 | */ |
2329 | if (showcursor) |
2330 | if (showcursor) |
… | |
… | |
2367 | |
2368 | |
2368 | /* |
2369 | /* |
2369 | * H: cleanup selection |
2370 | * H: cleanup selection |
2370 | */ |
2371 | */ |
2371 | scr_reverse_selection (); |
2372 | scr_reverse_selection (); |
2372 | PERL_INVOKE ((this, HOOK_REFRESH_END, DT_END)); |
|
|
2373 | |
2373 | |
2374 | if (refresh_type & SMOOTH_REFRESH) |
2374 | if (refresh_type & SMOOTH_REFRESH) |
2375 | XFlush (display->display); |
2375 | XFlush (display->display); |
2376 | |
2376 | |
2377 | num_scr = 0; |
2377 | num_scr = 0; |
… | |
… | |
2564 | /* ------------------------------------------------------------------------- */ |
2564 | /* ------------------------------------------------------------------------- */ |
2565 | /* |
2565 | /* |
2566 | * Paste a selection direct to the command fd |
2566 | * Paste a selection direct to the command fd |
2567 | */ |
2567 | */ |
2568 | void |
2568 | void |
2569 | rxvt_term::paste (unsigned char *data, unsigned int len) |
2569 | rxvt_term::paste (char *data, unsigned int len) |
2570 | { |
2570 | { |
2571 | /* convert normal newline chars into common keyboard Return key sequence */ |
2571 | /* convert normal newline chars into common keyboard Return key sequence */ |
2572 | for (unsigned int i = 0; i < len; i++) |
2572 | for (unsigned int i = 0; i < len; i++) |
2573 | if (data[i] == C0_LF) |
2573 | if (data[i] == C0_LF) |
2574 | data[i] = C0_CR; |
2574 | data[i] = C0_CR; |
… | |
… | |
2718 | { |
2718 | { |
2719 | wchar_t *w = rxvt_utf8towcs ((const char *)ct.value, ct.nitems); |
2719 | wchar_t *w = rxvt_utf8towcs ((const char *)ct.value, ct.nitems); |
2720 | char *s = rxvt_wcstombs (w); |
2720 | char *s = rxvt_wcstombs (w); |
2721 | free (w); |
2721 | free (w); |
2722 | // TODO: strlen == only the first element will be converted. well... |
2722 | // TODO: strlen == only the first element will be converted. well... |
2723 | paste ((unsigned char *)s, strlen (s)); |
2723 | paste (s, strlen (s)); |
2724 | free (s); |
2724 | free (s); |
2725 | } |
2725 | } |
2726 | else |
2726 | else |
2727 | #endif |
2727 | #endif |
2728 | if (XmbTextPropertyToTextList (display->display, &ct, &cl, &cr) >= 0 |
2728 | if (XmbTextPropertyToTextList (display->display, &ct, &cl, &cr) >= 0 |
2729 | && cl) |
2729 | && cl) |
2730 | { |
2730 | { |
2731 | for (int i = 0; i < cr; i++) |
2731 | for (int i = 0; i < cr; i++) |
2732 | paste ((unsigned char *)cl[i], strlen (cl[i])); |
2732 | paste (cl[i], strlen (cl[i])); |
2733 | |
2733 | |
2734 | XFreeStringList (cl); |
2734 | XFreeStringList (cl); |
2735 | } |
2735 | } |
2736 | else |
2736 | else |
2737 | paste (ct.value, ct.nitems); // paste raw |
2737 | paste ((char *)ct.value, ct.nitems); // paste raw |
2738 | |
2738 | |
2739 | bailout: |
2739 | bailout: |
2740 | XFree (ct.value); |
2740 | XFree (ct.value); |
2741 | |
2741 | |
2742 | if (selection_wait == Sel_normal) |
2742 | if (selection_wait == Sel_normal) |
… | |
… | |
2780 | return; /* outside window */ |
2780 | return; /* outside window */ |
2781 | |
2781 | |
2782 | if (selection.text) |
2782 | if (selection.text) |
2783 | { /* internal selection */ |
2783 | { /* internal selection */ |
2784 | char *str = rxvt_wcstombs (selection.text, selection.len); |
2784 | char *str = rxvt_wcstombs (selection.text, selection.len); |
2785 | paste ((unsigned char *)str, strlen (str)); |
2785 | paste (str, strlen (str)); |
2786 | free (str); |
2786 | free (str); |
2787 | return; |
2787 | return; |
2788 | } |
2788 | } |
2789 | else |
2789 | else |
2790 | { |
2790 | { |
… | |
… | |
3136 | } |
3136 | } |
3137 | } |
3137 | } |
3138 | break; |
3138 | break; |
3139 | } |
3139 | } |
3140 | |
3140 | |
3141 | Old_Word_Selection_You_Die: |
|
|
3142 | if (dirn == DN) |
3141 | if (dirn == DN) |
3143 | col++; /* put us on one past the end */ |
3142 | col++; /* put us on one past the end */ |
3144 | |
3143 | |
3145 | /* Poke the values back in */ |
3144 | /* Poke the values back in */ |
3146 | ret->row = row; |
3145 | ret->row = row; |
… | |
… | |
3323 | else if (selection.clicks == 2) |
3322 | else if (selection.clicks == 2) |
3324 | { |
3323 | { |
3325 | if (ROWCOL_IS_AFTER (selection.end, selection.beg)) |
3324 | if (ROWCOL_IS_AFTER (selection.end, selection.beg)) |
3326 | selection.end.col--; |
3325 | selection.end.col--; |
3327 | |
3326 | |
|
|
3327 | if (!PERL_INVOKE ((this, HOOK_SEL_EXTEND, DT_END))) |
|
|
3328 | { |
3328 | selection_delimit_word (UP, &selection.beg, &selection.beg); |
3329 | selection_delimit_word (UP, &selection.beg, &selection.beg); |
3329 | selection_delimit_word (DN, &selection.end, &selection.end); |
3330 | selection_delimit_word (DN, &selection.end, &selection.end); |
|
|
3331 | } |
3330 | } |
3332 | } |
3331 | else if (selection.clicks == 3) |
3333 | else if (selection.clicks == 3) |
3332 | { |
3334 | { |
3333 | #if ENABLE_FRILLS |
3335 | #if ENABLE_FRILLS |
3334 | if (OPTION (Opt_tripleclickwords)) |
3336 | if (OPTION (Opt_tripleclickwords)) |