r74469 - in /trunk/libnet-vnc-perl: Build.PL CHANGES LICENSE MANIFEST META.json META.yml Makefile.PL README SIGNATURE debian/changelog debian/control debian/copyright lib/Net/VNC.pm
carnil at users.alioth.debian.org
carnil at users.alioth.debian.org
Sun May 15 14:27:36 UTC 2011
Author: carnil
Date: Sun May 15 14:27:27 2011
New Revision: 74469
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=74469
Log:
* New upstream release
* debian/copyright: Update copyright years for debian/* packaging.
* Bump Standards-Version to 3.9.2.
Added:
trunk/libnet-vnc-perl/LICENSE
- copied unchanged from r74468, branches/upstream/libnet-vnc-perl/current/LICENSE
trunk/libnet-vnc-perl/META.json
- copied unchanged from r74468, branches/upstream/libnet-vnc-perl/current/META.json
trunk/libnet-vnc-perl/SIGNATURE
- copied unchanged from r74468, branches/upstream/libnet-vnc-perl/current/SIGNATURE
Removed:
trunk/libnet-vnc-perl/Makefile.PL
Modified:
trunk/libnet-vnc-perl/Build.PL
trunk/libnet-vnc-perl/CHANGES
trunk/libnet-vnc-perl/MANIFEST
trunk/libnet-vnc-perl/META.yml
trunk/libnet-vnc-perl/README
trunk/libnet-vnc-perl/debian/changelog
trunk/libnet-vnc-perl/debian/control
trunk/libnet-vnc-perl/debian/copyright
trunk/libnet-vnc-perl/lib/Net/VNC.pm
Modified: trunk/libnet-vnc-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-vnc-perl/Build.PL?rev=74469&op=diff
==============================================================================
--- trunk/libnet-vnc-perl/Build.PL (original)
+++ trunk/libnet-vnc-perl/Build.PL Sun May 15 14:27:27 2011
@@ -1,18 +1,24 @@
#!perl
-use Module::Build;
use strict;
use warnings;
+use Module::Build;
my $build = Module::Build->new(
- create_makefile_pl => 'traditional',
+ create_license => 1,
+ create_readme => 1,
license => 'perl',
- module_name => 'Net::VNC',
- requires => {
+ 'meta-spec' => {
+ version => '2',
+ url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
+ },
+ module_name => 'Net::VNC',
+ requires => {
'Class::Accessor::Fast' => '0',
'Crypt::DES' => '0',
'Image::Imlib2' => '0',
'Test::More' => '0',
},
- script_files => { 'bin/vnccapture' },
+ script_files => ['bin/vnccapture'],
+ sign => 1,
);
$build->create_build_script;
Modified: trunk/libnet-vnc-perl/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-vnc-perl/CHANGES?rev=74469&op=diff
==============================================================================
--- trunk/libnet-vnc-perl/CHANGES (original)
+++ trunk/libnet-vnc-perl/CHANGES Sun May 15 14:27:27 2011
@@ -1,4 +1,9 @@
Revision history for Perl module Net::VNC:
+
+0.38 Sat May 14 16:19:03 BST 2011
+ - Better error upon connection problems (patch by Ken Dreyer)
+ - Add key events
+ - More distribution metadata
0.37 Mon Nov 23 15:18:38 GMT 2009
- Perltidy
Modified: trunk/libnet-vnc-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-vnc-perl/MANIFEST?rev=74469&op=diff
==============================================================================
--- trunk/libnet-vnc-perl/MANIFEST (original)
+++ trunk/libnet-vnc-perl/MANIFEST Sun May 15 14:27:27 2011
@@ -2,10 +2,11 @@
Build.PL
CHANGES
lib/Net/VNC.pm
-Makefile.PL
+LICENSE
MANIFEST This list of files
+META.json
META.yml
README
t/pod.t
t/pod_coverage.t
-
+SIGNATURE Added here by Module::Build
Modified: trunk/libnet-vnc-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-vnc-perl/META.yml?rev=74469&op=diff
==============================================================================
--- trunk/libnet-vnc-perl/META.yml (original)
+++ trunk/libnet-vnc-perl/META.yml Sun May 15 14:27:27 2011
@@ -1,25 +1,27 @@
---
+abstract: 'A simple VNC client'
+author:
+ - 'Leon Brocard acme at astray.com'
+ - 'Chris Dolan clotho at cpan.org'
+build_requires: {}
+configure_requires:
+ Module::Build: 0.38
+dynamic_config: 1
+generated_by: 'Module::Build version 0.38, CPAN::Meta::Converter version 2.110930'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
name: Net-VNC
-version: 0.37
-author:
- - Leon Brocard acme at astray.com
- - Chris Dolan clotho at cpan.org
-abstract: A simple VNC client
-license: perl
-resources:
- license: http://dev.perl.org/licenses/
+provides:
+ Net::VNC:
+ file: lib/Net/VNC.pm
+ version: 0.38
requires:
Class::Accessor::Fast: 0
Crypt::DES: 0
Image::Imlib2: 0
Test::More: 0
-configure_requires:
- Module::Build: 0.35
-provides:
- Net::VNC:
- file: lib/Net/VNC.pm
- version: 0.37
-generated_by: Module::Build version 0.35
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+resources:
+ license: http://dev.perl.org/licenses/
+version: 0.38
Modified: trunk/libnet-vnc-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-vnc-perl/README?rev=74469&op=diff
==============================================================================
--- trunk/libnet-vnc-perl/README (original)
+++ trunk/libnet-vnc-perl/README Sun May 15 14:27:27 2011
@@ -5,6 +5,7 @@
use Net::VNC;
my $vnc = Net::VNC->new({hostname => $hostname, password => $password});
+ $vnc->depth(24);
$vnc->login;
print $vnc->name . ": " . $vnc->width . ' x ' . $vnc->height . "\n";
@@ -22,12 +23,19 @@
This module dies upon connection errors (with a timeout of 15 seconds)
and protocol errors.
+ This implementation is based largely on the RFB Protocol Specification,
+ <http://www.realvnc.com/docs/rfbproto.pdf>. That document has an error
+ in the DES encryption description, which is clarified via
+ <http://www.vidarholen.net/contents/junk/vnc.html>.
+
METHODS
new
The constructor. Given a hostname and a password returns a Net::VNC
object:
my $vnc = Net::VNC->new({hostname => $hostname, password => $password});
+
+ Optionally, you can also specify a port, which defaults to 5900.
login
Logs into the remote computer:
@@ -56,13 +64,107 @@
my $image = $vnc->capture;
$image->save("out.png");
-AUTHOR
+ You may call capture() multiple times. Each time, the $image buffer is
+ overwritten with the updated screen. So, to create a series of ten
+ screen shots:
+
+ for my $n (1..10) {
+ my $filename = sprintf 'snapshot%02d.png', $n++;
+ $vnc->capture()->save($filename);
+ print "Wrote $filename\n";
+ }
+
+ depth
+ Specify the bit depth for the screen. The supported choices are 24, 16
+ or 8. If unspecified, the server's default value is used. This property
+ should be set before the call to login().
+
+ save_bandwidth
+ Accepts a boolean, defaults to false. Specifies whether to use more
+ CPU-intensive algorithms to compress the VNC datastream. LAN or
+ localhost connections may prefer to leave this false. This property
+ should be set before the call to login().
+
+ list_encodings
+ Returns a list of encoding number/encoding name pairs. This can be used
+ as a class method like so:
+
+ my %encodings = Net::VNC->list_encodings();
+
+ send_key_event_down
+ Send a key down event. The keys are the same as the corresponding ASCII
+ value. Other common keys:
+
+ BackSpace 0xff08
+ Tab 0xff09
+ Return or Enter 0xff0d
+ Escape 0xff1b
+ Insert 0xff63
+ Delete 0xffff
+ Home 0xff50
+ End 0xff57
+ Page Up 0xff55
+ Page Down 0xff56
+ Left 0xff51
+ Up 0xff52
+ Right 0xff53
+ Down 0xff54
+ F1 0xffbe
+ F2 0xffbf
+ F3 0xffc0
+ F4 0xffc1
+ ... ...
+ F12 0xffc9
+ Shift (left) 0xffe1
+ Shift (right) 0xffe2
+ Control (left) 0xffe3
+ Control (right) 0xffe4
+ Meta (left) 0xffe7
+ Meta (right) 0xffe8
+ Alt (left) 0xffe9
+ Alt (right) 0xffea
+
+ $vnc->send_key_event_down('A');
+
+ send_key_event_up
+ Send a key up event:
+
+ $vnc->send_key_event_up('A');
+
+ send_key_event
+ Send a key down event followed by a key up event:
+
+ $vnc->send_key_event('A');
+
+ send_key_event_string
+ Send key events for every character in a string:
+
+ $vnc->send_key_event_string('Hello');
+
+BUGS AND LIMITATIONS
+ Bit depth
+ We do not yet support 8-bit true-colour mode, which is commonly
+ supported by servers but is rarely employed by clients.
+
+ Byte order
+ We have currently tested this package against servers with the same byte
+ order as the client. This might break with a little-endian
+ server/big-endian client or vice versa. We're working on tests for those
+ latter cases. Testing and patching help would be appreciated.
+
+ Efficiency
+ We've implemented a subset of the data compression algorithms supported
+ by most VNC servers. We hope to add more of the high-compression
+ transfer encodings in the future.
+
+AUTHORS
Leon Brocard acme at astray.com
- Many thanks for Foxtons Ltd for giving me the opportunity to write this
- module.
+ Chris Dolan clotho at cpan.org
-COPYRIGHT
+ Many thanks for Foxtons Ltd for giving Leon the opportunity to write the
+ original version of this module.
+
Copyright (C) 2006, Leon Brocard
This module is free software; you can redistribute it or modify it under
Modified: trunk/libnet-vnc-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-vnc-perl/debian/changelog?rev=74469&op=diff
==============================================================================
--- trunk/libnet-vnc-perl/debian/changelog (original)
+++ trunk/libnet-vnc-perl/debian/changelog Sun May 15 14:27:27 2011
@@ -1,3 +1,11 @@
+libnet-vnc-perl (0.38-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * debian/copyright: Update copyright years for debian/* packaging.
+ * Bump Standards-Version to 3.9.2.
+
+ -- Salvatore Bonaccorso <carnil at debian.org> Sun, 15 May 2011 16:25:37 +0200
+
libnet-vnc-perl (0.37-1) unstable; urgency=low
* Initial Release (Closes: #607469).
Modified: trunk/libnet-vnc-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-vnc-perl/debian/control?rev=74469&op=diff
==============================================================================
--- trunk/libnet-vnc-perl/debian/control (original)
+++ trunk/libnet-vnc-perl/debian/control Sun May 15 14:27:27 2011
@@ -7,7 +7,7 @@
libtest-pod-perl, libtest-pod-coverage-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Salvatore Bonaccorso <carnil at debian.org>
-Standards-Version: 3.9.1
+Standards-Version: 3.9.2
Homepage: http://search.cpan.org/dist/Net-VNC/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libnet-vnc-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libnet-vnc-perl/
Modified: trunk/libnet-vnc-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-vnc-perl/debian/copyright?rev=74469&op=diff
==============================================================================
--- trunk/libnet-vnc-perl/debian/copyright (original)
+++ trunk/libnet-vnc-perl/debian/copyright Sun May 15 14:27:27 2011
@@ -8,7 +8,7 @@
License: Artistic or GPL-1+
Files: debian/*
-Copyright: 2010, Salvatore Bonaccorso <carnil at debian.org>
+Copyright: 2010-2011, Salvatore Bonaccorso <carnil at debian.org>
License: Artistic or GPL-1+
License: Artistic
Modified: trunk/libnet-vnc-perl/lib/Net/VNC.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-vnc-perl/lib/Net/VNC.pm?rev=74469&op=diff
==============================================================================
--- trunk/libnet-vnc-perl/lib/Net/VNC.pm (original)
+++ trunk/libnet-vnc-perl/lib/Net/VNC.pm Sun May 15 14:27:27 2011
@@ -13,7 +13,7 @@
_bpp _true_colour _big_endian _image_format
)
);
-our $VERSION = '0.37';
+our $VERSION = '0.38';
my $MAX_PROTOCOL_VERSION = 'RFB 003.008' . chr(0x0a); # Max version supported
@@ -157,7 +157,7 @@
PeerAddr => $hostname || 'localhost',
PeerPort => $port || '5900',
Proto => 'tcp',
- ) || die "Error connecting to $hostname: $!";
+ ) || die "Error connecting to $hostname: $@";
$socket->timeout(15);
$self->socket($socket);
@@ -495,6 +495,49 @@
return $image;
}
+sub _send_key_event {
+ my ( $self, $down_flag, $key ) = @_;
+
+# A key press or release. Down-flag is non-zero (true) if the key is now pressed, zero
+# (false) if it is now released. The key itself is specified using the âkeysymâ values
+# defined by the X Window System.
+
+ my $socket = $self->socket;
+ $socket->print(
+ pack(
+ 'CCnN',
+ 4, # message_type
+ $down_flag, # down-flag
+ 0, # padding
+ $key, # key
+ )
+ );
+}
+
+sub send_key_event_down {
+ my ( $self, $key ) = @_;
+ $self->_send_key_event( 1, $key );
+}
+
+sub send_key_event_up {
+ my ( $self, $key ) = @_;
+ $self->_send_key_event( 0, $key );
+}
+
+sub send_key_event {
+ my ( $self, $key ) = @_;
+ $self->send_key_event_down($key);
+ $self->send_key_event_up($key);
+}
+
+sub send_key_event_string {
+ my ( $self, $string ) = @_;
+ foreach my $key ( map {ord} split //, $string ) {
+ warn $key;
+ $self->send_key_event($key);
+ }
+}
+
sub _send_pointer_event {
my $self = shift;
@@ -1077,6 +1120,60 @@
my %encodings = Net::VNC->list_encodings();
+=head2 send_key_event_down
+
+Send a key down event. The keys are the same as the
+corresponding ASCII value. Other common keys:
+
+ BackSpace 0xff08
+ Tab 0xff09
+ Return or Enter 0xff0d
+ Escape 0xff1b
+ Insert 0xff63
+ Delete 0xffff
+ Home 0xff50
+ End 0xff57
+ Page Up 0xff55
+ Page Down 0xff56
+ Left 0xff51
+ Up 0xff52
+ Right 0xff53
+ Down 0xff54
+ F1 0xffbe
+ F2 0xffbf
+ F3 0xffc0
+ F4 0xffc1
+ ... ...
+ F12 0xffc9
+ Shift (left) 0xffe1
+ Shift (right) 0xffe2
+ Control (left) 0xffe3
+ Control (right) 0xffe4
+ Meta (left) 0xffe7
+ Meta (right) 0xffe8
+ Alt (left) 0xffe9
+ Alt (right) 0xffea
+
+ $vnc->send_key_event_down('A');
+
+=head2 send_key_event_up
+
+Send a key up event:
+
+ $vnc->send_key_event_up('A');
+
+=head2 send_key_event
+
+Send a key down event followed by a key up event:
+
+ $vnc->send_key_event('A');
+
+=head2 send_key_event_string
+
+Send key events for every character in a string:
+
+ $vnc->send_key_event_string('Hello');
+
=head1 BUGS AND LIMITATIONS
=head2 Bit depth
More information about the Pkg-perl-cvs-commits
mailing list