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.342 by root, Thu Jul 1 20:02:43 2010 UTC vs.
Revision 1.346 by sf-exg, Mon Jul 26 09:57:53 2010 UTC

28#include "rxvt.h" /* NECESSARY */ 28#include "rxvt.h" /* NECESSARY */
29#include "rxvtperl.h" /* NECESSARY */ 29#include "rxvtperl.h" /* NECESSARY */
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 separate 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
2678/* ------------------------------------------------------------------------- */ 2679/* ------------------------------------------------------------------------- */
2679/* 2680/*
2680 * Paste a selection direct to the command fd 2681 * Paste a selection direct to the command fd
2681 */ 2682 */
2682void 2683void
2683rxvt_term::paste (char *data, unsigned int len) NOTHROW 2684rxvt_term::tt_paste (char *data, unsigned int len) NOTHROW
2684{ 2685{
2685 /* convert normal newline chars into common keyboard Return key sequence */ 2686 /* convert normal newline chars into common keyboard Return key sequence */
2686 for (unsigned int i = 0; i < len; i++) 2687 for (unsigned int i = 0; i < len; i++)
2687 if (data[i] == C0_LF) 2688 if (data[i] == C0_LF)
2688 data[i] = C0_CR; 2689 data[i] = C0_CR;
2692 2693
2693 tt_write (data, len); 2694 tt_write (data, len);
2694 2695
2695 if (priv_modes & PrivMode_BracketPaste) 2696 if (priv_modes & PrivMode_BracketPaste)
2696 tt_printf ("\e[201~"); 2697 tt_printf ("\e[201~");
2698}
2699
2700void
2701rxvt_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);
2697} 2707}
2698 2708
2699/* ------------------------------------------------------------------------- */ 2709/* ------------------------------------------------------------------------- */
2700/* 2710/*
2701 * Respond to a notification that a primary selection has been sent 2711 * Respond to a notification that a primary selection has been sent
2973 selection.clip_text = NULL; 2983 selection.clip_text = NULL;
2974 selection.clip_len = 0; 2984 selection.clip_len = 0;
2975 2985
2976 if (display->clipboard_owner == this) 2986 if (display->clipboard_owner == this)
2977 display->clipboard_owner = 0; 2987 display->clipboard_owner = 0;
2978 }
2979}
2980
2981void
2982rxvt_term::clipboard_copy (Time tm)
2983{
2984 if (selection.len > 0)
2985 {
2986 free (selection.clip_text);
2987 selection.clip_len = selection.len;
2988 selection.clip_text = (wchar_t *) malloc (sizeof (wchar_t) * selection.clip_len);
2989 memcpy (selection.clip_text, selection.text,
2990 sizeof (wchar_t) * selection.clip_len);
2991 selection_grab (tm, true);
2992 } 2988 }
2993} 2989}
2994 2990
2995/* ------------------------------------------------------------------------- */ 2991/* ------------------------------------------------------------------------- */
2996/* 2992/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines