Fixed class instantiation.
[ruby-ecore.git] / src / ecore / rb_ecore.c
index 342d0230f997d50efc972625140f5c445fe6feef..fd3741514c37c7f5da1edbd9666152e1ec90a419 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_ecore.c 147 2004-11-27 15:42:34Z tilman $
+ * $Id: rb_ecore.c 349 2006-01-29 09:17:44Z tilman $
  *
  * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
  *
@@ -27,6 +27,7 @@
 #include "rb_timer.h"
 #include "rb_animator.h"
 #include "rb_idler.h"
+#include "rb_idle_enterer.h"
 #include "rb_event_handler.h"
 #include "rb_fd_handler.h"
 
@@ -76,6 +77,7 @@ static VALUE m_time_get (VALUE self)
        return rb_float_new (ecore_time_get ());
 }
 
+#if 0
 static VALUE c_ev_exe_exit_init (VALUE self, VALUE event)
 {
        VALUE c = CLASS_OF (self);
@@ -95,6 +97,7 @@ static VALUE c_ev_exe_exit_init (VALUE self, VALUE event)
 
        return self;
 }
+#endif
 
 static VALUE c_ev_sig_user_init (VALUE self, VALUE event)
 {
@@ -134,10 +137,19 @@ static VALUE c_ev_sig_rt_init (VALUE self, VALUE event)
        return self;
 }
 
+static void at_exit ()
+{
+       ecore_shutdown ();
+}
+
 void Init_ecore (void)
 {
        VALUE c;
 
+       ecore_init ();
+
+       atexit (at_exit);
+
        mEcore = rb_define_module ("Ecore");
 
        rb_define_module_function (mEcore, "main_loop_begin",
@@ -151,6 +163,7 @@ void Init_ecore (void)
        Init_Timer ();
        Init_Animator ();
        Init_Idler ();
+       Init_IdleEnterer ();
        Init_EventHandler ();
        Init_FdHandler ();
 
@@ -164,9 +177,11 @@ void Init_ecore (void)
                   "SignalPower", c);
        rb_define_private_method (c, "initialize", c_ev_generic_init, 1);
 
+#if 0
        /* EXE_EXIT */
        ADD_EVENT (mEcore, ECORE_EVENT_, EXE_EXIT, "ExeExit", c);
        rb_define_private_method (c, "initialize", c_ev_exe_exit_init, 1);
+#endif
 
        /* SIGNAL_USER */
        ADD_EVENT (mEcore, ECORE_EVENT_, SIGNAL_USER,