X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fecore%2Frb_timer.c;h=a021106f2cc5d7bcfe917cfac8e2619280e27425;hb=f601b2dd76332041b11da615b01f068690ad0453;hp=fa9ab155cb960d0a10482272215e00b945a1fad2;hpb=f805cf241a9d1fb9765892f0af48ede8359e9b65;p=ruby-ecore.git diff --git a/src/ecore/rb_timer.c b/src/ecore/rb_timer.c index fa9ab15..a021106 100644 --- a/src/ecore/rb_timer.c +++ b/src/ecore/rb_timer.c @@ -1,5 +1,5 @@ /* - * $Id: rb_timer.c 50 2004-08-01 10:18:39Z tilman $ + * $Id: rb_timer.c 67 2004-08-12 20:08:13Z tilman $ * * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de) * @@ -62,6 +62,14 @@ static void c_free (RbTimer *timer) free (timer); } +/* + * call-seq: + * Ecore::Timer.new(interval) { block } => timer + * + * Creates an Ecore::Timer object with the specified interval. + * When the timeout is hit, the block is called. + * If the block returns false, the timer is deleted. + */ static VALUE c_new (VALUE klass, VALUE interval) { VALUE self; @@ -75,6 +83,7 @@ static VALUE c_new (VALUE klass, VALUE interval) ecore_init (); timer->callback = rb_block_proc (); + timer->deleted = false; timer->real = ecore_timer_add (NUM2DBL (interval), on_timer, timer); @@ -83,6 +92,12 @@ static VALUE c_new (VALUE klass, VALUE interval) return self; } +/* + * call-seq: + * timer.delete => nil + * + * Deletes timer. + */ static VALUE c_delete (VALUE self) { GET_OBJ (self, RbTimer, timer);