… | |
… | |
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 | |
|
|
35 | static inline void |
35 | static inline void fill_text (text_t *start, text_t value, int len) |
36 | fill_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 | |
… | |
… | |
2328 | if (ISSET_PIXCOLOR (Color_HTC)) |
2329 | if (ISSET_PIXCOLOR (Color_HTC)) |
2329 | fore = Color_HTC; |
2330 | fore = Color_HTC; |
2330 | // if invert is 0 reverse video is set so we use bg color as fg color |
2331 | // if invert is 0 reverse video is set so we use bg color as fg color |
2331 | else if (!invert) |
2332 | else if (!invert) |
2332 | fore = back; |
2333 | fore = back; |
|
|
2334 | |
2333 | back = Color_HC; |
2335 | back = Color_HC; |
2334 | invert = 0; |
2336 | invert = 0; |
2335 | } |
2337 | } |
2336 | } |
2338 | } |
2337 | #endif |
2339 | #endif |
… | |
… | |
2677 | /* ------------------------------------------------------------------------- */ |
2679 | /* ------------------------------------------------------------------------- */ |
2678 | /* |
2680 | /* |
2679 | * Paste a selection direct to the command fd |
2681 | * Paste a selection direct to the command fd |
2680 | */ |
2682 | */ |
2681 | void |
2683 | void |
2682 | rxvt_term::paste (char *data, unsigned int len) NOTHROW |
2684 | rxvt_term::tt_paste (char *data, unsigned int len) NOTHROW |
2683 | { |
2685 | { |
2684 | /* convert normal newline chars into common keyboard Return key sequence */ |
2686 | /* convert normal newline chars into common keyboard Return key sequence */ |
2685 | for (unsigned int i = 0; i < len; i++) |
2687 | for (unsigned int i = 0; i < len; i++) |
2686 | if (data[i] == C0_LF) |
2688 | if (data[i] == C0_LF) |
2687 | data[i] = C0_CR; |
2689 | data[i] = C0_CR; |
… | |
… | |
2691 | |
2693 | |
2692 | tt_write (data, len); |
2694 | tt_write (data, len); |
2693 | |
2695 | |
2694 | if (priv_modes & PrivMode_BracketPaste) |
2696 | if (priv_modes & PrivMode_BracketPaste) |
2695 | tt_printf ("\e[201~"); |
2697 | tt_printf ("\e[201~"); |
|
|
2698 | } |
|
|
2699 | |
|
|
2700 | void |
|
|
2701 | rxvt_term::paste (char *data, unsigned int len) NOTHROW |
|
|
2702 | { |
|
|
2703 | if (HOOK_INVOKE ((this, HOOK_TT_PASTE, DT_STR_LEN, data, len, DT_END))) |
|
|
2704 | return; |
|
|
2705 | |
|
|
2706 | tt_paste (data, len); |
2696 | } |
2707 | } |
2697 | |
2708 | |
2698 | /* ------------------------------------------------------------------------- */ |
2709 | /* ------------------------------------------------------------------------- */ |
2699 | /* |
2710 | /* |
2700 | * Respond to a notification that a primary selection has been sent |
2711 | * Respond to a notification that a primary selection has been sent |
… | |
… | |
2972 | selection.clip_text = NULL; |
2983 | selection.clip_text = NULL; |
2973 | selection.clip_len = 0; |
2984 | selection.clip_len = 0; |
2974 | |
2985 | |
2975 | if (display->clipboard_owner == this) |
2986 | if (display->clipboard_owner == this) |
2976 | display->clipboard_owner = 0; |
2987 | display->clipboard_owner = 0; |
2977 | } |
|
|
2978 | } |
|
|
2979 | |
|
|
2980 | void |
|
|
2981 | rxvt_term::clipboard_copy (Time tm) |
|
|
2982 | { |
|
|
2983 | if (selection.len > 0) |
|
|
2984 | { |
|
|
2985 | free (selection.clip_text); |
|
|
2986 | selection.clip_len = selection.len; |
|
|
2987 | selection.clip_text = (wchar_t *) malloc (sizeof (wchar_t) * selection.clip_len); |
|
|
2988 | memcpy (selection.clip_text, selection.text, |
|
|
2989 | sizeof (wchar_t) * selection.clip_len); |
|
|
2990 | selection_grab (tm, true); |
|
|
2991 | } |
2988 | } |
2992 | } |
2989 | } |
2993 | |
2990 | |
2994 | /* ------------------------------------------------------------------------- */ |
2991 | /* ------------------------------------------------------------------------- */ |
2995 | /* |
2992 | /* |