Documentation arrived.
[ruby-ecore.git] / src / ecore / rb_ecore.c
1 /*
2  * $Id: rb_ecore.c 60 2004-08-10 14:12:36Z 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 #define __RB_ECORE_C
26 #include "rb_ecore.h"
27 #include "rb_timer.h"
28 #include "rb_idler.h"
29
30 VALUE mEcore;
31
32 /*
33  * call-seq:
34  *  Ecore.main_loop_begin
35  *
36  * Starts the Ecore main loop.
37  */
38 static VALUE m_main_loop_begin (VALUE self)
39 {
40         ecore_main_loop_begin ();
41
42         return Qnil;
43 }
44
45 /*
46  * call-seq:
47  *  Ecore.main_loop_iterate
48  *
49  * Run one iteration of the Ecore main loop.
50  */
51 static VALUE m_main_loop_iterate (VALUE self)
52 {
53         ecore_main_loop_iterate ();
54
55         return Qnil;
56 }
57
58 /*
59  * call-seq:
60  *  Ecore.main_loop_quit
61  *
62  * Stops the Ecore main loop.
63  */
64 static VALUE m_main_loop_quit (VALUE self)
65 {
66         ecore_main_loop_quit ();
67
68         return Qnil;
69 }
70
71 void Init_ecore (void)
72 {
73         mEcore = rb_define_module ("Ecore");
74
75         rb_define_module_function (mEcore, "main_loop_begin",
76                                    m_main_loop_begin, 0);
77         rb_define_module_function (mEcore, "main_loop_iterate",
78                                    m_main_loop_iterate, 0);
79         rb_define_module_function (mEcore, "main_loop_quit",
80                                    m_main_loop_quit, 0);
81
82         Init_Timer ();
83         Init_Idler ();
84 }
85