r50178 - in /branches/upstream/libio-async-loop-glib-perl/current: Build.PL Changes LICENSE MANIFEST META.yml Makefile.PL examples/ examples/hello.pl examples/timer.pl lib/IO/Async/Loop/Glib.pm
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Mon Jan 4 21:33:52 UTC 2010
Author: jawnsy-guest
Date: Mon Jan 4 21:33:47 2010
New Revision: 50178
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=50178
Log:
[svn-upgrade] Integrating new upstream version, libio-async-loop-glib-perl (0.18)
Added:
branches/upstream/libio-async-loop-glib-perl/current/examples/
branches/upstream/libio-async-loop-glib-perl/current/examples/hello.pl
branches/upstream/libio-async-loop-glib-perl/current/examples/timer.pl
Modified:
branches/upstream/libio-async-loop-glib-perl/current/Build.PL
branches/upstream/libio-async-loop-glib-perl/current/Changes
branches/upstream/libio-async-loop-glib-perl/current/LICENSE
branches/upstream/libio-async-loop-glib-perl/current/MANIFEST
branches/upstream/libio-async-loop-glib-perl/current/META.yml
branches/upstream/libio-async-loop-glib-perl/current/Makefile.PL
branches/upstream/libio-async-loop-glib-perl/current/lib/IO/Async/Loop/Glib.pm
Modified: branches/upstream/libio-async-loop-glib-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-loop-glib-perl/current/Build.PL?rev=50178&op=diff
==============================================================================
--- branches/upstream/libio-async-loop-glib-perl/current/Build.PL (original)
+++ branches/upstream/libio-async-loop-glib-perl/current/Build.PL Mon Jan 4 21:33:47 2010
@@ -7,13 +7,14 @@
(
module_name => 'IO::Async::Loop::Glib',
requires => {
- 'IO::Async::Loop' => 0.24,
- 'Glib' => 0,
- },
+ 'Glib' => 0,
+ 'IO::Async::Loop' => 0.24,
+ 'Time::HiRes' => 0,
+ },
build_requires => {
- 'Test::More' => 0,
- 'IO::Async::LoopTests' => '0.24',
- },
+ 'Test::More' => 0,
+ 'IO::Async::LoopTests' => '0.24',
+ },
license => 'perl',
create_makefile_pl => 'traditional',
create_license => 1,
Modified: branches/upstream/libio-async-loop-glib-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-loop-glib-perl/current/Changes?rev=50178&op=diff
==============================================================================
--- branches/upstream/libio-async-loop-glib-perl/current/Changes (original)
+++ branches/upstream/libio-async-loop-glib-perl/current/Changes Mon Jan 4 21:33:47 2010
@@ -1,4 +1,11 @@
Revision history for IO-Async-Loop-Glib
+
+0.18 CHANGES:
+ * Use Time::HiRes for timing accuracy
+ * Added two small Gtk2-based examples
+
+ BUGFIXES:
+ * Clamp negative timer intervals to 0 - fixes RT 53281
0.17 CHANGES:
* Updated for IO-Async 0.24
Modified: branches/upstream/libio-async-loop-glib-perl/current/LICENSE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-loop-glib-perl/current/LICENSE?rev=50178&op=diff
==============================================================================
--- branches/upstream/libio-async-loop-glib-perl/current/LICENSE (original)
+++ branches/upstream/libio-async-loop-glib-perl/current/LICENSE Mon Jan 4 21:33:47 2010
@@ -1,4 +1,4 @@
-This software is copyright (c) 2009 by Paul Evans <leonerd at leonerd.org.uk>.
+This software is copyright (c) 2010 by Paul Evans <leonerd at leonerd.org.uk>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@
--- The GNU General Public License, Version 1, February 1989 ---
-This software is Copyright (c) 2009 by Paul Evans <leonerd at leonerd.org.uk>.
+This software is Copyright (c) 2010 by Paul Evans <leonerd at leonerd.org.uk>.
This is free software, licensed under:
@@ -270,7 +270,7 @@
--- The Artistic License 1.0 ---
-This software is Copyright (c) 2009 by Paul Evans <leonerd at leonerd.org.uk>.
+This software is Copyright (c) 2010 by Paul Evans <leonerd at leonerd.org.uk>.
This is free software, licensed under:
Modified: branches/upstream/libio-async-loop-glib-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-loop-glib-perl/current/MANIFEST?rev=50178&op=diff
==============================================================================
--- branches/upstream/libio-async-loop-glib-perl/current/MANIFEST (original)
+++ branches/upstream/libio-async-loop-glib-perl/current/MANIFEST Mon Jan 4 21:33:47 2010
@@ -1,5 +1,7 @@
Build.PL
Changes
+examples/hello.pl
+examples/timer.pl
lib/IO/Async/Loop/Glib.pm
LICENSE
Makefile.PL
Modified: branches/upstream/libio-async-loop-glib-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-loop-glib-perl/current/META.yml?rev=50178&op=diff
==============================================================================
--- branches/upstream/libio-async-loop-glib-perl/current/META.yml (original)
+++ branches/upstream/libio-async-loop-glib-perl/current/META.yml Mon Jan 4 21:33:47 2010
@@ -1,6 +1,6 @@
---
name: IO-Async-Loop-Glib
-version: 0.17
+version: 0.18
author:
- 'Paul Evans <leonerd at leonerd.org.uk>'
abstract: 'use C<IO::Async> with F<Glib> or F<GTK>'
@@ -13,12 +13,13 @@
requires:
Glib: 0
IO::Async::Loop: 0.24
+ Time::HiRes: 0
configure_requires:
Module::Build: 0.35
provides:
IO::Async::Loop::Glib:
file: lib/IO/Async/Loop/Glib.pm
- version: 0.17
+ version: 0.18
generated_by: Module::Build version 0.35
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
Modified: branches/upstream/libio-async-loop-glib-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-loop-glib-perl/current/Makefile.PL?rev=50178&op=diff
==============================================================================
--- branches/upstream/libio-async-loop-glib-perl/current/Makefile.PL (original)
+++ branches/upstream/libio-async-loop-glib-perl/current/Makefile.PL Mon Jan 4 21:33:47 2010
@@ -8,7 +8,8 @@
'Glib' => 0,
'IO::Async::Loop' => '0.24',
'IO::Async::LoopTests' => '0.24',
- 'Test::More' => 0
+ 'Test::More' => 0,
+ 'Time::HiRes' => 0
},
'INSTALLDIRS' => 'site',
'EXE_FILES' => [],
Added: branches/upstream/libio-async-loop-glib-perl/current/examples/hello.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-loop-glib-perl/current/examples/hello.pl?rev=50178&op=file
==============================================================================
--- branches/upstream/libio-async-loop-glib-perl/current/examples/hello.pl (added)
+++ branches/upstream/libio-async-loop-glib-perl/current/examples/hello.pl Mon Jan 4 21:33:47 2010
@@ -1,0 +1,26 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use IO::Async::Loop::Glib;
+use IO::Async::Timer::Periodic;
+
+use Gtk2 -init;
+
+my $loop = IO::Async::Loop::Glib->new;
+
+my $dialog = Gtk2::MessageDialog->new( undef,
+ 'destroy-with-parent',
+ 'info',
+ 'ok',
+ "Hello world!"
+);
+
+$dialog->signal_connect( response => sub {
+ $loop->loop_stop;
+} );
+
+$dialog->show_all;
+
+$loop->loop_forever;
Added: branches/upstream/libio-async-loop-glib-perl/current/examples/timer.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-loop-glib-perl/current/examples/timer.pl?rev=50178&op=file
==============================================================================
--- branches/upstream/libio-async-loop-glib-perl/current/examples/timer.pl (added)
+++ branches/upstream/libio-async-loop-glib-perl/current/examples/timer.pl Mon Jan 4 21:33:47 2010
@@ -1,0 +1,46 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use IO::Async::Loop::Glib;
+use IO::Async::Timer::Periodic;
+
+use Gtk2 -init;
+
+my $loop = IO::Async::Loop::Glib->new;
+
+my $dialog = Gtk2::MessageDialog->new( undef,
+ 'destroy-with-parent',
+ 'info',
+ 'none',
+ "Hello world!"
+);
+
+$dialog->get_content_area->add( my $message = Gtk2::Label->new );
+
+$loop->add( my $timer = IO::Async::Timer::Periodic->new(
+ interval => 1,
+ on_tick => sub { $message->set_text( "Time is now " . scalar localtime ) },
+) );
+
+$dialog->add_button( "Start", 1 )->signal_connect(
+ clicked => sub {
+ $timer->start;
+ }
+);
+
+$dialog->add_button( "Stop", 2 )->signal_connect(
+ clicked => sub {
+ $timer->stop;
+ $message->set_text( "" );
+ }
+);
+
+$dialog->add_button( "Quit", 'close' )->signal_connect(
+ clicked => sub { $loop->loop_stop }
+);
+
+$dialog->show_all;
+
+$loop->loop_forever;
Modified: branches/upstream/libio-async-loop-glib-perl/current/lib/IO/Async/Loop/Glib.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-loop-glib-perl/current/lib/IO/Async/Loop/Glib.pm?rev=50178&op=diff
==============================================================================
--- branches/upstream/libio-async-loop-glib-perl/current/lib/IO/Async/Loop/Glib.pm (original)
+++ branches/upstream/libio-async-loop-glib-perl/current/lib/IO/Async/Loop/Glib.pm Mon Jan 4 21:33:47 2010
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.17';
+our $VERSION = '0.18';
use constant API_VERSION => '0.24';
use base qw( IO::Async::Loop );
@@ -16,6 +16,8 @@
use Carp;
use Glib;
+
+use Time::HiRes qw( time );
=head1 NAME
@@ -184,6 +186,7 @@
}
my $interval = $delay * 1000; # miliseconds
+ $interval = 0 if $interval < 0; # clamp or Glib gets upset
my $code = delete $params{code};
ref $code eq "CODE" or croak "Expected 'code' to be a CODE reference";
@@ -286,7 +289,9 @@
my $context = Glib::MainContext->default;
my $ret = $context->iteration( 1 );
- Glib::Source->remove( $timerid ) unless $timed_out;
+ if( defined $timerid ) {
+ Glib::Source->remove( $timerid ) unless $timed_out;
+ }
return $ret and not $timed_out ? 1 : 0;
}
More information about the Pkg-perl-cvs-commits
mailing list