projects
/
ruby-ecore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't try to convert NULL into a String.
[ruby-ecore.git]
/
src
/
ecore
/
rb_timer.c
diff --git
a/src/ecore/rb_timer.c
b/src/ecore/rb_timer.c
index fa9ab155cb960d0a10482272215e00b945a1fad2..28ef41c6c1010d9e7056e6db00a69d7edebba993 100644
(file)
--- a/
src/ecore/rb_timer.c
+++ b/
src/ecore/rb_timer.c
@@
-1,7
+1,7
@@
/*
/*
- * $Id: rb_timer.c
50 2004-08-01 10:18:3
9Z tilman $
+ * $Id: rb_timer.c
77 2004-08-19 17:39:2
9Z tilman $
*
*
- * Copyright (C) 2004
Tilman Sauerbeck (tilman at code-monkey de
)
+ * Copyright (C) 2004
ruby-ecore team (see AUTHORS
)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@
-62,6
+62,14
@@
static void c_free (RbTimer *timer)
free (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;
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 ();
ecore_init ();
timer->callback = rb_block_proc ();
+ timer->deleted = false;
timer->real = ecore_timer_add (NUM2DBL (interval),
on_timer, timer);
timer->real = ecore_timer_add (NUM2DBL (interval),
on_timer, timer);
@@
-83,6
+92,12
@@
static VALUE c_new (VALUE klass, VALUE interval)
return self;
}
return self;
}
+/*
+ * call-seq:
+ * timer.delete => nil
+ *
+ * Deletes <i>timer</i>.
+ */
static VALUE c_delete (VALUE self)
{
GET_OBJ (self, RbTimer, timer);
static VALUE c_delete (VALUE self)
{
GET_OBJ (self, RbTimer, timer);