[poe-commits] poe/POE/Loop Event.pm,1.34,1.35 Gtk.pm,1.41,1.42 Poll.pm,1.25,1.26 Select.pm,1.52,1.53
Brought to you by:
rcaputo
From: <rc...@us...> - 2003-12-12 04:05:09
|
Update of /cvsroot/poe/poe/POE/Loop In directory sc8-pr-cvs1:/tmp/cvs-serv7282/POE/Loop Modified Files: Event.pm Gtk.pm Poll.pm Select.pm Tk.pm TkActiveState.pm TkCommon.pm Log Message: Remove the hardcoding for POE::Loop classes. Now POE::Kernel will walk %INC and compare each module against the files in ./Loop (where "." is wherever POE::Kernel is, according to __FILE__). Index: Event.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Loop/Event.pm,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Event.pm 21 Nov 2003 05:08:26 -0000 1.34 --- Event.pm 12 Dec 2003 04:05:05 -0000 1.35 *************** *** 16,29 **** use strict; - # Declare which event loop bridge is being used, but first ensure that - # no other bridge has been loaded. - - BEGIN { - die( "POE can't use Event and " . &POE_LOOP . "\n" ) - if defined &POE_LOOP; - }; - - sub POE_LOOP () { LOOP_EVENT } - my $_watcher_timer; my @fileno_watcher; --- 16,19 ---- *************** *** 36,45 **** my $self = shift; ! $_watcher_timer = ! Event->timer ! ( cb => \&_loop_event_callback, ! after => 0, ! parked => 1, ! ); } --- 26,34 ---- my $self = shift; ! $_watcher_timer = Event->timer( ! cb => \&_loop_event_callback, ! after => 0, ! parked => 1, ! ); } *************** *** 63,70 **** } ! $poe_kernel->_data_ev_enqueue ! ( $poe_kernel, $poe_kernel, EN_SIGNAL, ET_SIGNAL, [ $_[0]->w->signal ], ! __FILE__, __LINE__, time(), ! ); } --- 52,59 ---- } ! $poe_kernel->_data_ev_enqueue( ! $poe_kernel, $poe_kernel, EN_SIGNAL, ET_SIGNAL, [ $_[0]->w->signal ], ! __FILE__, __LINE__, time(), ! ); } *************** *** 74,82 **** } ! $poe_kernel->_data_ev_enqueue ! ( $poe_kernel->get_active_session(), $poe_kernel, ! EN_SIGNAL, ET_SIGNAL, [ $_[0]->w->signal ], ! __FILE__, __LINE__, time(), ! ); } --- 63,71 ---- } ! $poe_kernel->_data_ev_enqueue( ! $poe_kernel->get_active_session(), $poe_kernel, ! EN_SIGNAL, ET_SIGNAL, [ $_[0]->w->signal ], ! __FILE__, __LINE__, time(), ! ); } *************** *** 86,93 **** } ! $poe_kernel->_data_ev_enqueue ! ( $poe_kernel, $poe_kernel, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__, time(), ! ); } --- 75,82 ---- } ! $poe_kernel->_data_ev_enqueue( ! $poe_kernel, $poe_kernel, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__, time(), ! ); } *************** *** 104,111 **** # CHLD doesn't exist. $SIG{$signal} = 'DEFAULT'; ! $self->_data_ev_enqueue ! ( $self, $self, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__, time() + 1, ! ) if $signal eq 'CHLD' or not exists $SIG{CHLD}; return; --- 93,100 ---- # CHLD doesn't exist. $SIG{$signal} = 'DEFAULT'; ! $self->_data_ev_enqueue( ! $self, $self, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__, time() + 1, ! ) if $signal eq 'CHLD' or not exists $SIG{CHLD}; return; *************** *** 114,121 **** # Broken pipe. if ($signal eq 'PIPE') { ! $signal_watcher{$signal} = ! Event->signal( signal => $signal, ! cb => \&_loop_signal_handler_pipe ! ); return; } --- 103,110 ---- # Broken pipe. if ($signal eq 'PIPE') { ! $signal_watcher{$signal} = Event->signal( ! signal => $signal, ! cb => \&_loop_signal_handler_pipe ! ); return; } *************** *** 125,132 **** # Everything else. ! $signal_watcher{$signal} = ! Event->signal( signal => $signal, ! cb => \&_loop_signal_handler_generic ! ); } --- 114,121 ---- # Everything else. ! $signal_watcher{$signal} = Event->signal( ! signal => $signal, ! cb => \&_loop_signal_handler_generic ! ); } *************** *** 175,190 **** } ! $fileno_watcher[$fileno]->[$mode] = ! Event->io ! ( fd => $fileno, ! poll => ( ( $mode == MODE_RD ) ! ? 'r' ! : ( ( $mode == MODE_WR ) ! ? 'w' ! : 'e' ! ) ! ), ! cb => \&_loop_select_callback, ! ); } --- 164,180 ---- } ! $fileno_watcher[$fileno]->[$mode] = Event->io( ! fd => $fileno, ! poll => ( ! ( $mode == MODE_RD ) ! ? 'r' ! : ( ! ( $mode == MODE_WR ) ! ? 'w' ! : 'e' ! ) ! ), ! cb => \&_loop_select_callback, ! ); } *************** *** 249,262 **** my $watcher = $event->w; my $fileno = $watcher->fd; ! my $mode = ( ( $event->got eq 'r' ) ! ? MODE_RD ! : ( ( $event->got eq 'w' ) ! ? MODE_WR ! : ( ( $event->got eq 'e' ) ! ? MODE_EX ! : return ! ) ! ) ! ); $self->_data_handle_enqueue_ready($mode, $fileno); --- 239,255 ---- my $watcher = $event->w; my $fileno = $watcher->fd; ! my $mode = ( ! ( $event->got eq 'r' ) ! ? MODE_RD ! : ( ! ( $event->got eq 'w' ) ! ? MODE_WR ! : ( ! ( $event->got eq 'e' ) ! ? MODE_EX ! : return ! ) ! ) ! ); $self->_data_handle_enqueue_ready($mode, $fileno); Index: Gtk.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Loop/Gtk.pm,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Gtk.pm 22 Nov 2003 17:45:10 -0000 1.41 --- Gtk.pm 12 Dec 2003 04:05:06 -0000 1.42 *************** *** 19,33 **** use strict; - # Delcare which event loop bridge is being used, but first ensure that - # no other bridge has been loaded. - - BEGIN { - die( "POE can't use Gtk and " . &POE_LOOP . "\n" ) - if defined &POE_LOOP; - }; - - # Declare the loop we're using. - sub POE_LOOP () { LOOP_GTK } - my $_watcher_timer; my @fileno_watcher; --- 19,22 ---- *************** *** 42,53 **** # Must Gnome->init() yourselves, as it takes parameters. unless (exists $INC{'Gnome.pm'}) { - # Gtk can only be initialized once. # So if we've initalized it already, skip the whole deal. unless($gtk_init_check) { $gtk_init_check++; ! my $res = Gtk->init_check(); ! # Now check whether the init was ok. # undefined == icky; TRUE (whatever that means in gtk land) means Ok. --- 31,41 ---- # Must Gnome->init() yourselves, as it takes parameters. unless (exists $INC{'Gnome.pm'}) { # Gtk can only be initialized once. # So if we've initalized it already, skip the whole deal. unless($gtk_init_check) { $gtk_init_check++; ! my $res = Gtk->init_check(); ! # Now check whether the init was ok. # undefined == icky; TRUE (whatever that means in gtk land) means Ok. *************** *** 84,100 **** # think this is a bit of a kludge: the situation where a window # lasts longer than POE::Kernel should never occur. ! $window->signal_connect ! ( delete_event => ! sub { ! if ($self->_data_ses_count()) { ! $self->_dispatch_event ! ( $self, $self, ! EN_SIGNAL, ET_SIGNAL, [ 'UIDESTROY' ], ! __FILE__, __LINE__, time(), -__LINE__ ! ); ! } ! return 0; } ! ); } --- 72,87 ---- # think this is a bit of a kludge: the situation where a window # lasts longer than POE::Kernel should never occur. ! $window->signal_connect( ! delete_event => sub { ! if ($self->_data_ses_count()) { ! $self->_dispatch_event ! ( $self, $self, ! EN_SIGNAL, ET_SIGNAL, [ 'UIDESTROY' ], ! __FILE__, __LINE__, time(), -__LINE__ ! ); } ! return 0; ! } ! ); } Index: Poll.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Loop/Poll.pm,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Poll.pm 26 Nov 2003 03:52:07 -0000 1.25 --- Poll.pm 12 Dec 2003 04:05:06 -0000 1.26 *************** *** 19,35 **** use strict; ! use Errno qw(EINPROGRESS EWOULDBLOCK EINTR); ! ! # Delcare which event loop bridge is being used, but first ensure that ! # no other bridge has been loaded. BEGIN { ! die "POE can't use IO::Poll and " . &POE_LOOP . "\n" ! if defined &POE_LOOP; ! die "IO::Poll is version $IO::Poll::VERSION (POE needs 0.05 or newer)\n" ! if $IO::Poll::VERSION < 0.05; ! }; ! sub POE_LOOP () { LOOP_POLL } use IO::Poll qw( POLLRDNORM POLLWRNORM POLLRDBAND --- 19,36 ---- use strict; ! # Be sure we're using a contemporary version of IO::Poll. ! use IO::Poll 0.05; + # Hand off to POE::Loop::Select if we're running under ActivePerl. BEGIN { ! if ($^O eq "MSWin32") { ! warn "IO::Poll is defective on $^O. Falling back to IO::Select.\n"; ! require POE::Loop::Select; ! POE::Loop::Select->import(); ! die "not really dying"; ! } ! } ! use Errno qw(EINPROGRESS EWOULDBLOCK EINTR); use IO::Poll qw( POLLRDNORM POLLWRNORM POLLRDBAND Index: Select.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Loop/Select.pm,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Select.pm 26 Nov 2003 03:52:07 -0000 1.52 --- Select.pm 12 Dec 2003 04:05:06 -0000 1.53 *************** *** 20,33 **** use Errno qw(EINPROGRESS EWOULDBLOCK EINTR); - # Delcare which event loop bridge is being used, but first ensure that - # no other bridge has been loaded. - - BEGIN { - die( "POE can't use its own loop and " . &POE_LOOP . "\n" ) - if defined &POE_LOOP; - }; - - sub POE_LOOP () { LOOP_SELECT } - # Linux has a bug on "polled" select() calls. If select() is called # with a zero-second timeout, and a signal manages to interrupt it --- 20,23 ---- Index: Tk.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Loop/Tk.pm,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Tk.pm 21 Nov 2003 05:08:26 -0000 1.42 --- Tk.pm 12 Dec 2003 04:05:06 -0000 1.43 *************** *** 13,22 **** $VERSION = do {my@r=(q$Revision$=~/\d+/g);sprintf"%d."."%04d"x$#r,@r}; ! BEGIN { ! die "POE's Tk support requires version Tk 800.021 or higher.\n" ! unless defined($Tk::VERSION) and $Tk::VERSION >= 800.021; ! die "POE's Tk support requires Perl 5.005_03 or later.\n" ! if $] < 5.00503; ! }; # Everything plugs into POE::Kernel. --- 13,18 ---- $VERSION = do {my@r=(q$Revision$=~/\d+/g);sprintf"%d."."%04d"x$#r,@r}; ! use Tk 800.021; ! use 5.00503; # Everything plugs into POE::Kernel. *************** *** 24,27 **** --- 20,33 ---- use strict; + + # Hand off to POE::Loop::TkActiveState if we're running under + # ActivePerl. + BEGIN { + if ($^O eq "MSWin32") { + require POE::Loop::TkActiveState; + POE::Loop::TkActiveState->import(); + die "not really dying"; + } + } my @_fileno_refcount; Index: TkActiveState.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Loop/TkActiveState.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TkActiveState.pm 21 Nov 2003 05:08:26 -0000 1.6 --- TkActiveState.pm 12 Dec 2003 04:05:06 -0000 1.7 *************** *** 13,22 **** $VERSION = do {my@r=(q$Revision$=~/\d+/g);sprintf"%d."."%04d"x$#r,@r}; ! BEGIN { ! die "POE's Tk support requires version Tk 800.021 or higher.\n" ! unless defined($Tk::VERSION) and $Tk::VERSION >= 800.021; ! die "POE's Tk support requires Perl 5.005_03 or later.\n" ! if $] < 5.00503; ! }; # Everything plugs into POE::Kernel. --- 13,18 ---- $VERSION = do {my@r=(q$Revision$=~/\d+/g);sprintf"%d."."%04d"x$#r,@r}; ! use Tk 800.021; ! use 5.00503; # Everything plugs into POE::Kernel. *************** *** 24,27 **** --- 20,24 ---- use strict; + use Errno qw(EINPROGRESS EWOULDBLOCK EINTR); # select() vectors. They're stored in an array so that the MODE_* Index: TkCommon.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Loop/TkCommon.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TkCommon.pm 21 Nov 2003 05:08:26 -0000 1.3 --- TkCommon.pm 12 Dec 2003 04:05:06 -0000 1.4 *************** *** 13,22 **** $VERSION = do {my@r=(q$Revision$=~/\d+/g);sprintf"%d."."%04d"x$#r,@r}; ! BEGIN { ! die "POE's Tk support requires version Tk 800.021 or higher.\n" ! unless defined($Tk::VERSION) and $Tk::VERSION >= 800.021; ! die "POE's Tk support requires Perl 5.005_03 or later.\n" ! if $] < 5.00503; ! }; # Everything plugs into POE::Kernel. --- 13,18 ---- $VERSION = do {my@r=(q$Revision$=~/\d+/g);sprintf"%d."."%04d"x$#r,@r}; ! use Tk 800.021; ! use 5.00503; # Everything plugs into POE::Kernel. *************** *** 24,37 **** use strict; - - # Delcare which event loop bridge is being used, but first ensure that - # no other bridge has been loaded. - - BEGIN { - die( "POE can't use Tk and " . &POE_LOOP_NAME . "\n" ) - if defined &POE_LOOP; - }; - - sub POE_LOOP () { LOOP_TK } my $_watcher_timer; --- 20,23 ---- |