ecore_init and ecore_shutdown aren't exported anymore.
[ruby-ecore.git] / src / ecore / rb_ecore.c
1 /*
2  * $Id: rb_ecore.c 27 2004-07-08 18:25:05Z tilman $
3  *
4  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include <ruby.h>
22
23 #include <Ecore.h>
24
25 #include "rb_ecore.h"
26 #include "rb_timer.h"
27 #include "rb_idler.h"
28
29 #ifdef DEBUG
30 static VALUE m_init (VALUE self)
31 {
32         return INT2FIX (ecore_init ());
33 }
34
35 static VALUE m_shutdown (VALUE self)
36 {
37         return INT2FIX (ecore_shutdown ());
38 }
39 #endif
40
41 static VALUE m_main_loop_begin (VALUE self)
42 {
43         ecore_main_loop_begin ();
44
45         return Qnil;
46 }
47
48 static VALUE m_main_loop_iterate (VALUE self)
49 {
50         ecore_main_loop_iterate ();
51
52         return Qnil;
53 }
54
55 static VALUE m_main_loop_quit (VALUE self)
56 {
57         ecore_main_loop_quit ();
58
59         return Qnil;
60 }
61
62 void Init_ecore (void)
63 {
64         mEcore = rb_define_module ("Ecore");
65
66 #ifdef DEBUG
67         rb_define_module_function (mEcore, "init",
68                                    m_init, 0);
69         rb_define_module_function (mEcore, "shutdown",
70                                    m_shutdown, 0);
71 #endif
72
73         rb_define_module_function (mEcore, "main_loop_begin",
74                                    m_main_loop_begin, 0);
75         rb_define_module_function (mEcore, "main_loop_iterate",
76                                    m_main_loop_iterate, 0);
77         rb_define_module_function (mEcore, "main_loop_quit",
78                                    m_main_loop_quit, 0);
79
80         Init_Timer ();
81         Init_Idler ();
82 }
83