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.9 by sf-exg, Sun Sep 23 08:03:44 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# URxvt.perl-ext-common: macosx-clipboard 28macosx-clipboard - Mac OS X clipboard support
29
30=head1 SYNOPSIS
31
32 urxvt -pe macosx-clipboard
33
34=head1 DESCRIPTION
35
36This extension implements commands to interact with the Mac OS X
37clipboard and requires the C<Mac::Pasteboard> module. It is used like
38this:
39
29# URxvt.keysym.M-c: perl:macosx-clipboard:copy 40 URxvt.keysym.M-c: perl:macosx-clipboard:copy
30# URxvt.keysym.M-v: perl:macosx-clipboard:paste 41 URxvt.keysym.M-v: perl:macosx-clipboard:paste
42
43=cut
31 44
32use Mac::Pasteboard; 45use Mac::Pasteboard;
33 46
34my $pasteboard = new Mac::Pasteboard; 47my $pasteboard = new Mac::Pasteboard;
35 48
43} 56}
44 57
45sub paste { 58sub paste {
46 my ($self) = @_; 59 my ($self) = @_;
47 60
48 # $str = $pasteboard->stringForType_($type)->UTF8String;
49 my $str = $pasteboard->paste; 61 my $str = $pasteboard->paste;
50 utf8::decode $str; 62 utf8::decode $str;
51 $self->tt_write ($self->locale_encode ($str)); 63 $self->tt_write ($self->locale_encode ($str));
52 64
53 () 65 ()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines