Implemented Ecore.time.
authorTilman Sauerbeck <tilman@code-monkey.de>
Sat, 27 Nov 2004 15:42:34 +0000 (15:42 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Sat, 27 Nov 2004 15:42:34 +0000 (15:42 +0000)
src/ecore/rb_ecore.c

index 4d7190e6140f31c885470c7ca85c1c6d87cb6b4c..342d0230f997d50efc972625140f5c445fe6feef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_ecore.c 146 2004-11-27 15:38:52Z tilman $
+ * $Id: rb_ecore.c 147 2004-11-27 15:42:34Z tilman $
  *
  * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
  *
@@ -71,6 +71,11 @@ static VALUE m_main_loop_quit (VALUE self)
        return Qnil;
 }
 
+static VALUE m_time_get (VALUE self)
+{
+       return rb_float_new (ecore_time_get ());
+}
+
 static VALUE c_ev_exe_exit_init (VALUE self, VALUE event)
 {
        VALUE c = CLASS_OF (self);
@@ -141,6 +146,7 @@ void Init_ecore (void)
                                   m_main_loop_iterate, 0);
        rb_define_module_function (mEcore, "main_loop_quit",
                                   m_main_loop_quit, 0);
+       rb_define_module_function (mEcore, "time", m_time_get, 0);
 
        Init_Timer ();
        Init_Animator ();