Reworked ADD_EVENT() wrt handling of the inherited method.
authorTilman Sauerbeck <tilman@code-monkey.de>
Thu, 16 Feb 2006 20:39:55 +0000 (20:39 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Thu, 16 Feb 2006 20:39:55 +0000 (20:39 +0000)
In that macro, we now remove Ecore#EventHandler.inherited temporarily
when defining C event classes rather than overriding the method.

src/ecore/rb_event_handler.c
src/ecore/rb_event_handler.h

index 4dd45ce6b35e6567d9ab05735949729583b86647..18e2fc7fc5a0562576da4a2dbe9ef8c45d528d05 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_event_handler.c 367 2006-02-14 22:20:14Z tilman $
+ * $Id: rb_event_handler.c 372 2006-02-16 20:39:55Z tilman $
  *
  * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
  *
@@ -196,11 +196,6 @@ static VALUE c_ev_init (int argc, VALUE *argv, VALUE self)
        return self;
 }
 
-VALUE c_ev_inherited_noop (VALUE klass, VALUE child)
-{
-       return Qnil;
-}
-
 static void free_ruby_event (void *data, void *event)
 {
        /* do nothing */
index b9d56a8e6ae74ee6b22deb278d1ce5523d5a515a..34df332d91310f3fc23375b04a6c38c0af97ea06 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_event_handler.h 365 2006-02-14 21:50:47Z tilman $
+ * $Id: rb_event_handler.h 372 2006-02-16 20:39:55Z tilman $
  *
  * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
  *
@@ -22,8 +22,7 @@
 #define __RB_EVENT_HANDLER_H
 
 #define ADD_EVENT(mod, constname, clsname, obj) \
-       rb_define_singleton_method (cEcoreEvent, "inherited", \
-                                   c_ev_inherited_noop, 1); \
+       rb_remove_method (rb_singleton_class (cEcoreEvent), "inherited"); \
 \
        (obj) = rb_define_class_under ((mod), (clsname), cEcoreEvent); \
        rb_define_private_method (rb_singleton_class ((obj)), \
@@ -36,7 +35,6 @@
 void Init_EventHandler (void);
 
 VALUE c_ev_inherited (VALUE klass, VALUE child);
-VALUE c_ev_inherited_noop (VALUE klass, VALUE child);
 
 #ifndef __RB_EVENT_HANDLER_C
 extern VALUE event_classes, cEcoreEvent;