projects
/
ruby-edje.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2bcc79d
)
Made the src argument of Edje#signal_emit optional.
author
Tilman Sauerbeck
<tilman@code-monkey.de>
Mon, 23 Aug 2004 15:21:41 +0000
(15:21 +0000)
committer
Tilman Sauerbeck
<tilman@code-monkey.de>
Mon, 23 Aug 2004 15:21:41 +0000
(15:21 +0000)
src/rb_edje.c
patch
|
blob
|
history
diff --git
a/src/rb_edje.c
b/src/rb_edje.c
index 50ba39b4369a613393ada20ff00e67098f65019e..4b76cce71a771229b01f52254012c3852ecf2224 100644
(file)
--- a/
src/rb_edje.c
+++ b/
src/rb_edje.c
@@
-1,5
+1,5
@@
/*
/*
- * $Id: rb_edje.c
66 2004-08-12 19:37:52
Z tilman $
+ * $Id: rb_edje.c
96 2004-08-23 15:21:41
Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
@@
-285,21
+285,29
@@
static void on_signal (void *data, Evas_Object *o,
/*
* call-seq:
/*
* call-seq:
- * edje.on_signal(signal
, source
) { |signal, source| block } => nil
+ * edje.on_signal(signal
[, source]
) { |signal, source| block } => nil
*
* Registers a callback that will get called when <i>signal</i>
* is emitted by <i>source</i>.
*
* Registers a callback that will get called when <i>signal</i>
* is emitted by <i>source</i>.
+ * If source is nil, "*" will be used instead.
* The block is passed two strings, signal and source, which identify
* the emission.
*/
* The block is passed two strings, signal and source, which identify
* the emission.
*/
-static VALUE c_on_signal (
VALUE self, VALUE signal, VALUE src
)
+static VALUE c_on_signal (
int argc, VALUE *argv, VALUE self
)
{
{
- VALUE cb;
+ VALUE signal, src, cb;
+ char *ssrc = "*";
GET_OBJ (self, RbEdje, e);
GET_OBJ (self, RbEdje, e);
+ rb_scan_args (argc, argv, "11", &signal, &src);
+
Check_Type (signal, T_STRING);
Check_Type (signal, T_STRING);
- Check_Type (src, T_STRING);
+
+ if (!NIL_P (src)) {
+ Check_Type (src, T_STRING);
+ ssrc = StringValuePtr (src);
+ }
if (!rb_block_given_p ())
return Qnil;
if (!rb_block_given_p ())
return Qnil;
@@
-309,8
+317,7
@@
static VALUE c_on_signal (VALUE self, VALUE signal, VALUE src)
edje_object_signal_callback_add (e->real.real,
StringValuePtr (signal),
edje_object_signal_callback_add (e->real.real,
StringValuePtr (signal),
- StringValuePtr (src), on_signal,
- (void *) cb);
+ ssrc, on_signal, (void *) cb);
return Qnil;
}
return Qnil;
}
@@
-389,7
+396,7
@@
void Init_Edje (void)
rb_define_method (cEdje, "part", c_part_get, 1);
rb_define_method (cEdje, "on_text_changed", c_on_text_changed, 0);
rb_define_method (cEdje, "emit_signal", c_emit_signal, 2);
rb_define_method (cEdje, "part", c_part_get, 1);
rb_define_method (cEdje, "on_text_changed", c_on_text_changed, 0);
rb_define_method (cEdje, "emit_signal", c_emit_signal, 2);
- rb_define_method (cEdje, "on_signal", c_on_signal,
2
);
+ rb_define_method (cEdje, "on_signal", c_on_signal,
-1
);
rb_define_method (cEdje, "play?", c_play_get, 0);
rb_define_method (cEdje, "play=", c_play_set, 1);
rb_define_method (cEdje, "animation?", c_animation_get, 0);
rb_define_method (cEdje, "play?", c_play_get, 0);
rb_define_method (cEdje, "play=", c_play_set, 1);
rb_define_method (cEdje, "animation?", c_animation_get, 0);