ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/urxvt.pm
(Generate patch)

Comparing rxvt-unicode/src/urxvt.pm (file contents):
Revision 1.177 by root, Sat Jul 18 06:11:57 2009 UTC vs.
Revision 1.180 by root, Sat Dec 26 09:42:16 2009 UTC

1124is that you cannot use blocking APIs, but the non-blocking variant should 1124is that you cannot use blocking APIs, but the non-blocking variant should
1125work. 1125work.
1126 1126
1127=cut 1127=cut
1128 1128
1129our $VERSION = '3.4'; 1129our $VERSION = '5.23';
1130 1130
1131$INC{"urxvt/anyevent.pm"} = 1; # mark us as there 1131$INC{"urxvt/anyevent.pm"} = 1; # mark us as there
1132push @AnyEvent::REGISTRY, [urxvt => urxvt::anyevent::]; 1132push @AnyEvent::REGISTRY, [urxvt => urxvt::anyevent::];
1133 1133
1134sub timer { 1134sub timer {
1136 1136
1137 my $cb = $arg{cb}; 1137 my $cb = $arg{cb};
1138 1138
1139 urxvt::timer 1139 urxvt::timer
1140 ->new 1140 ->new
1141 ->after ($arg{after}) 1141 ->after ($arg{after}, $arg{interval})
1142 ->interval ($arg{interval}) 1142 ->cb ($arg{interval} ? $cb : sub {
1143 ->start
1144 ->cb (sub {
1145 #TODO interval?
1146 $_[0]->stop; # need to cancel manually 1143 $_[0]->stop; # need to cancel manually
1147 $cb->(); 1144 $cb->();
1148 }) 1145 })
1149} 1146}
1150 1147
1171 my $cb = $arg{cb}; 1168 my $cb = $arg{cb};
1172 1169
1173 urxvt::iw 1170 urxvt::iw
1174 ->new 1171 ->new
1175 ->start 1172 ->start
1176 ->cb (sub { 1173 ->cb ($cb)
1177 #TODO really cancel?
1178 $_[0]->stop; # need to cancel manually
1179 $cb->();
1180 })
1181} 1174}
1182 1175
1183sub child { 1176sub child {
1184 my ($class, %arg) = @_; 1177 my ($class, %arg) = @_;
1185 1178
1187 1180
1188 urxvt::pw 1181 urxvt::pw
1189 ->new 1182 ->new
1190 ->start ($arg{pid}) 1183 ->start ($arg{pid})
1191 ->cb (sub { 1184 ->cb (sub {
1192 #TODO really cancel?
1193 $_[0]->stop; # need to cancel manually 1185 $_[0]->stop; # need to cancel manually
1194 $cb->($_[0]->rpid, $_[0]->rstatus); 1186 $cb->($_[0]->rpid, $_[0]->rstatus);
1195 }) 1187 })
1196} 1188}
1197 1189
1380 1372
1381=item ($row, $col) = $term->selection_beg ([$row, $col]) 1373=item ($row, $col) = $term->selection_beg ([$row, $col])
1382 1374
1383=item ($row, $col) = $term->selection_end ([$row, $col]) 1375=item ($row, $col) = $term->selection_end ([$row, $col])
1384 1376
1385Return the current values of the selection mark, begin or end positions, 1377Return the current values of the selection mark, begin or end positions.
1386and optionally set them to new values. 1378
1379When arguments are given, then the selection coordinates are set to
1380C<$row> and C<$col>, and the selection screen is set to the current
1381screen.
1382
1383=item $screen = $term->selection_screen ([$screen])
1384
1385Returns the current selection screen, and then optionally sets it.
1387 1386
1388=item $term->selection_make ($eventtime[, $rectangular]) 1387=item $term->selection_make ($eventtime[, $rectangular])
1389 1388
1390Tries to make a selection as set by C<selection_beg> and 1389Tries to make a selection as set by C<selection_beg> and
1391C<selection_end>. If C<$rectangular> is true (default: false), a 1390C<selection_end>. If C<$rectangular> is true (default: false), a
2061 2060
2062=item $timer = $timer->cb (sub { my ($timer) = @_; ... }) 2061=item $timer = $timer->cb (sub { my ($timer) = @_; ... })
2063 2062
2064Set the callback to be called when the timer triggers. 2063Set the callback to be called when the timer triggers.
2065 2064
2066=item $tstamp = $timer->at
2067
2068Return the time this watcher will fire next.
2069
2070=item $timer = $timer->set ($tstamp) 2065=item $timer = $timer->set ($tstamp[, $interval])
2071 2066
2072Set the time the event is generated to $tstamp. 2067Set the time the event is generated to $tstamp (and optionally specifies a
2068new $interval).
2073 2069
2074=item $timer = $timer->interval ($interval) 2070=item $timer = $timer->interval ($interval)
2075 2071
2076Normally (and when C<$interval> is C<0>), the timer will automatically 2072By default (and when C<$interval> is C<0>), the timer will automatically
2077stop after it has fired once. If C<$interval> is non-zero, then the timer 2073stop after it has fired once. If C<$interval> is non-zero, then the timer
2078is automatically rescheduled at the given intervals. 2074is automatically rescheduled at the given intervals.
2079 2075
2080=item $timer = $timer->start 2076=item $timer = $timer->start
2081 2077
2082Start the timer. 2078Start the timer.
2083 2079
2084=item $timer = $timer->start ($tstamp) 2080=item $timer = $timer->start ($tstamp[, $interval])
2085 2081
2086Set the event trigger time to C<$tstamp> and start the timer. 2082Set the event trigger time to C<$tstamp> and start the timer. Optionally
2083also replaces the interval.
2087 2084
2088=item $timer = $timer->after ($delay) 2085=item $timer = $timer->after ($delay[, $interval])
2089 2086
2090Like C<start>, but sets the expiry timer to c<urxvt::NOW + $delay>. 2087Like C<start>, but sets the expiry timer to c<urxvt::NOW + $delay>.
2091 2088
2092=item $timer = $timer->stop 2089=item $timer = $timer->stop
2093 2090

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines