Reworked event handling.
[ruby-ecore.git] / src / ecore / rb_ecore.c
index 345ce0bfbc712285774573a92898b72dd59a9f74..06fa0bb929cf3698263db17ca97a3957737d13c4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_ecore.c 361 2006-02-13 22:37:49Z tilman $
+ * $Id: rb_ecore.c 365 2006-02-14 21:50:47Z tilman $
  *
  * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
  *
@@ -77,30 +77,6 @@ static VALUE m_time_get (VALUE self)
        return rb_float_new (ecore_time_get ());
 }
 
-static VALUE m_new_event_type (VALUE self, VALUE klass)
-{
-       VALUE num;
-
-       num = INT2NUM (ecore_event_type_new());
-       rb_hash_aset (event_classes, num, klass);
-
-       return num;
-}
-
-static void free_ruby_event (void *data, void *event)
-{
-       /* do nothing */
-}
-
-static VALUE m_add_event (VALUE self, VALUE type, VALUE event)
-{
-       Check_Type (type, T_FIXNUM);
-
-       ecore_event_add (FIX2INT (type), (void *) event, free_ruby_event, NULL);
-
-       return Qnil;
-}
-
 #if 0
 static VALUE c_ev_exe_exit_init (VALUE self, VALUE event)
 {
@@ -183,9 +159,6 @@ void Init_ecore (void)
        rb_define_module_function (mEcore, "main_loop_quit",
                                   m_main_loop_quit, 0);
        rb_define_module_function (mEcore, "time", m_time_get, 0);
-       rb_define_module_function (mEcore, "new_event_type",
-                                  m_new_event_type, 1);
-       rb_define_module_function (mEcore, "add_event", m_add_event, 2);
 
        Init_Timer ();
        Init_Animator ();
@@ -195,33 +168,31 @@ void Init_ecore (void)
        Init_FdHandler ();
 
        /* SIGNAL_HUP */
-       ADD_EVENT (mEcore, ECORE_EVENT_SIGNAL_HUP,
+       ADD_EVENT (mEcore, ECORE_EVENT_SIGNAL_HUP,
                   "SignalHup", c);
-       rb_define_private_method (c, "initialize", c_ev_generic_init, 1);
 
        /* SIGNAL_POWER */
-       ADD_EVENT (mEcore, ECORE_EVENT_SIGNAL_POWER,
+       ADD_EVENT (mEcore, ECORE_EVENT_SIGNAL_POWER,
                   "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);
+       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,
+       ADD_EVENT (mEcore, ECORE_EVENT_SIGNAL_USER,
                   "SignalUser", c);
        rb_define_private_method (c, "initialize", c_ev_sig_user_init, 1);
 
        /* SIGNAL_EXIT */
-       ADD_EVENT (mEcore, ECORE_EVENT_SIGNAL_EXIT,
+       ADD_EVENT (mEcore, ECORE_EVENT_SIGNAL_EXIT,
                   "SignalExit", c);
        rb_define_private_method (c, "initialize", c_ev_sig_exit_init, 1);
 
        /* SIGNAL_REALTIME */
-       ADD_EVENT (mEcore, ECORE_EVENT_SIGNAL_REALTIME,
+       ADD_EVENT (mEcore, ECORE_EVENT_SIGNAL_REALTIME,
                   "SignalRealtime", c);
        rb_define_private_method (c, "initialize", c_ev_sig_rt_init, 1);
 }