ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/macosx-clipboard
(Generate patch)

Comparing rxvt-unicode/src/perl/macosx-clipboard (file contents):
Revision 1.3 by root, Sat May 30 08:47:07 2009 UTC vs.
Revision 1.6 by root, Sun Jun 10 17:31:53 2012 UTC

1#! perl -w 1#! perl -w
2 2
3# ---------------------------------------------------------------------- 3# ----------------------------------------------------------------------
4# File: macosx-clipboard 4# File: macosx-clipboard
5# ---------------------------------------------------------------------- 5# ----------------------------------------------------------------------
6# 6#
7# All portions of code are copyright by their respective author/s. 7# All portions of code are copyright by their respective author/s.
8# Copyright (c) 2006 Samuel Ljungkvist <salj@triplefusion.net> 8# Copyright (c) 2006 Samuel Ljungkvist <salj@triplefusion.net>
9# 2009 Reza Jelveh <reza.jelveh@gmail.com> 9# 2009 Reza Jelveh <reza.jelveh@gmail.com>
10# 10#
11# This program is free software; you can redistribute it and/or modify 11# This program is free software; you can redistribute it and/or modify
21# You should have received a copy of the GNU General Public License 21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software 22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24# ---------------------------------------------------------------------- 24# ----------------------------------------------------------------------
25 25
26# Usage: 26=head1 NAME
27 27
28 macosx-clipboard and macosx-clipboard-native
29
30=head1 DESCRPTION
31
32These two modules implement an extended clipboard for Mac OS X. They are
33used like this:
34
28# URxvt.perl-ext-common: macosx-clipboard 35 URxvt.perl-ext-common: default,macosx-clipboard
29# URxvt.keysym.M-c: perl:macosx-clipboard:copy 36 URxvt.keysym.M-c: perl:macosx-clipboard:copy
30# URxvt.keysym.M-v: perl:macosx-clipboard:paste 37 URxvt.keysym.M-v: perl:macosx-clipboard:paste
38
39The difference between them is that the native variant requires a
40perl from apple's devkit or so, and C<macosx-clipboard> requires the
41C<Mac::Pasteboard> module, works with other perls, has fewer bugs, is
42simpler etc. etc.
43
44=cut
31 45
32use Mac::Pasteboard; 46use Mac::Pasteboard;
33 47
34my $pasteboard = new Mac::Pasteboard; 48my $pasteboard = new Mac::Pasteboard;
35 49
43} 57}
44 58
45sub paste { 59sub paste {
46 my ($self) = @_; 60 my ($self) = @_;
47 61
48 # $str = $pasteboard->stringForType_($type)->UTF8String;
49 my $str = $pasteboard->paste; 62 my $str = $pasteboard->paste;
50 utf8::decode $str; 63 utf8::decode $str;
51 $self->tt_write ($self->locale_encode ($str)); 64 $self->tt_write ($self->locale_encode ($str));
52 65
53 () 66 ()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines