projects
/
ruby-ecore.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8df3535
)
Added Ecore.new_event_type and Ecore.add_event.
author
Tilman Sauerbeck
<tilman@code-monkey.de>
Sun, 12 Feb 2006 15:53:44 +0000
(15:53 +0000)
committer
Tilman Sauerbeck
<tilman@code-monkey.de>
Sun, 12 Feb 2006 15:53:44 +0000
(15:53 +0000)
src/ecore/rb_ecore.c
patch
|
blob
|
history
diff --git
a/src/ecore/rb_ecore.c
b/src/ecore/rb_ecore.c
index fd3741514c37c7f5da1edbd9666152e1ec90a419..239da0f89518826932c508c86cec865585c47143 100644
(file)
--- a/
src/ecore/rb_ecore.c
+++ b/
src/ecore/rb_ecore.c
@@
-1,5
+1,5
@@
/*
/*
- * $Id: rb_ecore.c 3
49 2006-01-29 09:17
:44Z tilman $
+ * $Id: rb_ecore.c 3
60 2006-02-12 15:53
:44Z tilman $
*
* Copyright (C) 2004 ruby-ecore team (see AUTHORS)
*
*
* Copyright (C) 2004 ruby-ecore team (see AUTHORS)
*
@@
-77,6
+77,30
@@
static VALUE m_time_get (VALUE self)
return rb_float_new (ecore_time_get ());
}
return rb_float_new (ecore_time_get ());
}
+static VALUE m_new_event_type (VALUE self, VALUE klass)
+{
+ VALUE num;
+
+ num = INT2FIX (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)
{
#if 0
static VALUE c_ev_exe_exit_init (VALUE self, VALUE event)
{
@@
-159,6
+183,9
@@
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, "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 ();
Init_Timer ();
Init_Animator ();