From 672c977a9152e276022f486e7f046c0367aac825 Mon Sep 17 00:00:00 2001 From: sf-exg Date: Sun, 14 Feb 2010 19:34:42 +0000 Subject: [PATCH] Remove '$term->clipboard_copy' and extend '$term->selection' to optionally query/set the clipboard text. --- src/rxvtperl.xs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs index dc2e555e..acf9a5b7 100644 --- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -1598,9 +1598,6 @@ rxvt_term::selection_screen (int screen = -1) void rxvt_term::selection_clear (bool clipboard = false) -void -rxvt_term::clipboard_copy (Time eventtime) - void rxvt_term::selection_make (Time eventtime, bool rect = false) CODE: @@ -1612,20 +1609,23 @@ int rxvt_term::selection_grab (Time eventtime, bool clipboard = false) void -rxvt_term::selection (SV *newtext = 0) +rxvt_term::selection (SV *newtext = 0, bool clipboard = false) PPCODE: { + wchar_t * &text = clipboard ? THIS->selection.clip_text : THIS->selection.text; + unsigned int &len = clipboard ? THIS->selection.clip_len : THIS->selection.len; + if (GIMME_V != G_VOID) - XPUSHs (THIS->selection.text - ? sv_2mortal (wcs2sv (THIS->selection.text, THIS->selection.len)) + XPUSHs (text + ? sv_2mortal (wcs2sv (text, len)) : &PL_sv_undef); if (newtext) { - free (THIS->selection.text); + free (text); - THIS->selection.text = sv2wcs (newtext); - THIS->selection.len = wcslen (THIS->selection.text); + text = sv2wcs (newtext); + len = wcslen (text); } } -- 2.34.1