--- rxvt-unicode/src/urxvt.pm 2009/05/30 08:47:07 1.174 +++ rxvt-unicode/src/urxvt.pm 2009/12/26 09:02:42 1.178 @@ -1126,7 +1126,7 @@ =cut -our $VERSION = '3.4'; +our $VERSION = '5.23'; $INC{"urxvt/anyevent.pm"} = 1; # mark us as there push @AnyEvent::REGISTRY, [urxvt => urxvt::anyevent::]; @@ -1138,8 +1138,10 @@ urxvt::timer ->new - ->start (urxvt::NOW + $arg{after}) - ->cb (sub { + ->after ($arg{after}) + ->interval ($arg{interval}) + ->start + ->cb ($argv{interval} ? $cb : sub { $_[0]->stop; # need to cancel manually $cb->(); }) @@ -1149,18 +1151,42 @@ my ($class, %arg) = @_; my $cb = $arg{cb}; + my $fd = fileno $arg{fh}; + defined $fd or $fd = $arg{fh}; bless [$arg{fh}, urxvt::iow ->new - ->fd (fileno $arg{fh}) + ->fd ($fd) ->events (($arg{poll} =~ /r/ ? 1 : 0) | ($arg{poll} =~ /w/ ? 2 : 0)) ->start - ->cb (sub { - $cb->(($_[1] & 1 ? 'r' : '') - . ($_[1] & 2 ? 'w' : '')); - })], - urxvt::anyevent:: + ->cb ($cb) + ], urxvt::anyevent:: +} + +sub idle { + my ($class, %arg) = @_; + + my $cb = $arg{cb}; + + urxvt::iw + ->new + ->start + ->cb ($cb) +} + +sub child { + my ($class, %arg) = @_; + + my $cb = $arg{cb}; + + urxvt::pw + ->new + ->start ($arg{pid}) + ->cb (sub { + $_[0]->stop; # need to cancel manually + $cb->($_[0]->rpid, $_[0]->rstatus); + }) } sub DESTROY { @@ -1300,9 +1326,9 @@ borderLess chdir color cursorBlink cursorUnderline cutchars delete_key display_name embed ext_bwidth fade font geometry hold iconName imFont imLocale inputMethod insecure int_bwidth intensityStyles - italicFont jumpScroll lineSpace loginShell mapAlert meta8 modifier - mouseWheelScrollPage name override_redirect pastableTabs path perl_eval - perl_ext_1 perl_ext_2 perl_lib pointerBlank pointerBlankDelay + italicFont jumpScroll lineSpace letterSpace loginShell mapAlert meta8 + modifier mouseWheelScrollPage name override_redirect pastableTabs path + perl_eval perl_ext_1 perl_ext_2 perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput scrollWithBuffer scrollstyle