Fixed the build with the latest Ecore snapshot.
[ruby-ecore.git] / src / ecore / rb_event_handler.h
1 /*
2  * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef __RB_EVENT_HANDLER_H
20 #define __RB_EVENT_HANDLER_H
21
22 #define ADD_EVENT(mod, constname, clsname, obj) \
23         rb_remove_method (rb_singleton_class (cEcoreEvent), "inherited"); \
24 \
25         (obj) = rb_define_class_under ((mod), (clsname), cEcoreEvent); \
26         rb_define_private_method (rb_singleton_class ((obj)), \
27                                   "new", NULL, 0); \
28 \
29         rb_define_const ((obj), "TYPE", INT2FIX (constname)); \
30         rb_hash_aset (event_classes, INT2FIX (constname), (obj)); \
31         rb_define_singleton_method (cEcoreEvent, "inherited", c_ev_inherited, 1);
32
33 void Init_EventHandler (void);
34
35 VALUE c_ev_inherited (VALUE klass, VALUE child);
36
37 #ifndef __RB_EVENT_HANDLER_C
38 extern VALUE event_classes, cEcoreEvent;
39 #endif
40
41 #endif