… | |
… | |
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 | |
|
|
32 | These two modules implement an extended clipboard for Mac OS X. They are |
|
|
33 | used 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 | |
|
|
39 | The difference between them is that the native variant requires a |
|
|
40 | perl from apple's devkit or so, and C<macosx-clipboard> requires the |
|
|
41 | C<Mac::Pasteboard> module, works with other perls, has fewer bugs, is |
|
|
42 | simpler etc. etc. |
|
|
43 | |
|
|
44 | =cut |
31 | |
45 | |
32 | use Mac::Pasteboard; |
46 | use Mac::Pasteboard; |
33 | |
47 | |
34 | my $pasteboard = new Mac::Pasteboard; |
48 | my $pasteboard = new Mac::Pasteboard; |
35 | |
49 | |
… | |
… | |
43 | } |
57 | } |
44 | |
58 | |
45 | sub paste { |
59 | sub 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 | () |