*** empty log message ***
authorroot <root>
Sat, 26 Dec 2009 09:23:53 +0000 (09:23 +0000)
committerroot <root>
Sat, 26 Dec 2009 09:23:53 +0000 (09:23 +0000)
src/iom_perl.xs
src/urxvt.pm

index b083faf6f25f7e97d0359493ce99cb1129de9abc..fd1bc5ba7f53974bc2b16cef83bbc7bd632238e1 100644 (file)
@@ -62,10 +62,11 @@ timer::new ()
         OUTPUT:
         RETVAL
 
+# deprecated
 NV
 timer::at ()
        CODE:
-        RETVAL = THIS->at;
+        RETVAL = THIS->remaining () + ev_now ();
         OUTPUT:
         RETVAL
 
@@ -77,23 +78,23 @@ timer::interval (NV repeat)
         RETVAL
 
 IOM_CHAINED
-timer::set (NV tstamp)
+timer::set (NV tstamp, NV repeat = THIS->repeat)
        CODE:
-        THIS->set (tstamp);
+        THIS->set (tstamp, repeat);
         OUTPUT:
         RETVAL
 
 IOM_CHAINED
-timer::start (NV tstamp = ev::now ())
+timer::start (NV tstamp = ev::now (), NV repeat = THIS->repeat)
        CODE:
-        THIS->start (tstamp - ev::now ());
+        THIS->start (tstamp - ev::now (), repeat);
         OUTPUT:
         RETVAL
 
 IOM_CHAINED
-timer::after (NV delay)
+timer::after (NV delay, NV repeat = THIS->repeat)
        CODE:
-        THIS->start (delay);
+        THIS->start (delay, repeat);
         OUTPUT:
         RETVAL
 
index 8fa61c3f63824d1ab39a00e6dd2e6f04056d5b46..8d73d6f772a1b81e266cb167efc1f225227b1cee 100644 (file)
@@ -1138,10 +1138,8 @@ sub timer {
 
    urxvt::timer
       ->new
-      ->after ($arg{after})
-      ->interval ($arg{interval})
-      ->start
-      ->cb ($argv{interval} ? $cb : sub {
+      ->after ($arg{after}, $arg{interval})
+      ->cb ($arg{interval} ? $cb : sub {
         $_[0]->stop; # need to cancel manually
         $cb->();
       })
@@ -2057,17 +2055,14 @@ immediately.
 
 Set the callback to be called when the timer triggers.
 
-=item $tstamp = $timer->at
-
-Return the time this watcher will fire next.
-
-=item $timer = $timer->set ($tstamp)
+=item $timer = $timer->set ($tstamp[, $interval])
 
-Set the time the event is generated to $tstamp.
+Set the time the event is generated to $tstamp (and optionally specifies a
+new $interval).
 
 =item $timer = $timer->interval ($interval)
 
-Normally (and when C<$interval> is C<0>), the timer will automatically
+By default (and when C<$interval> is C<0>), the timer will automatically
 stop after it has fired once. If C<$interval> is non-zero, then the timer
 is automatically rescheduled at the given intervals.
 
@@ -2075,11 +2070,12 @@ is automatically rescheduled at the given intervals.
 
 Start the timer.
 
-=item $timer = $timer->start ($tstamp)
+=item $timer = $timer->start ($tstamp[, $interval])
 
-Set the event trigger time to C<$tstamp> and start the timer.
+Set the event trigger time to C<$tstamp> and start the timer. Optionally
+also replaces the interval.
 
-=item $timer = $timer->after ($delay)
+=item $timer = $timer->after ($delay[, $interval])
 
 Like C<start>, but sets the expiry timer to c<urxvt::NOW + $delay>.