+static VALUE c_data_get (VALUE self, VALUE key)
+{
+ const char *s;
+
+ GET_OBJ (self, RbEdje, e);
+
+ Check_Type (key, T_STRING);
+
+ s = edje_object_data_get (e->real.real, StringValuePtr (key));
+
+ return s ? rb_str_new2 (s) : Qnil;
+}
+
+static VALUE c_send_message (VALUE self, VALUE msg)
+{
+ Edje_Message_String s;
+ Edje_Message_Int i;
+ Edje_Message_Float f;
+ Edje_Message_Type type;
+ void *data;
+ VALUE v, tmp;
+
+ GET_OBJ (self, RbEdje, e);
+
+ CHECK_CLASS (msg, cMsg);
+
+ v = rb_iv_get (msg, "@value");
+
+ if (NIL_P (v)) {
+ rb_raise (eEdjeError, "value must not be nil");
+ return Qnil;
+ }
+
+ if (!NIL_P (tmp = rb_check_string_type (v))) {
+ type = EDJE_MESSAGE_STRING;
+ s.str = StringValuePtr (tmp);
+ data = &s;
+ } else if (rb_obj_is_kind_of (v, rb_cFixnum)) {
+ type = EDJE_MESSAGE_INT;
+ i.val = FIX2INT (v);
+ data = &i;
+ } else if (rb_obj_is_kind_of (v, rb_cFloat)) {
+ type = EDJE_MESSAGE_FLOAT;
+ f.val = NUM2DBL (v);
+ data = &v;
+ /* } else if (!NIL_P (tmp = rb_check_array_type (v))) { */
+ } else {
+ rb_raise (eEdjeError, "unsupported value");
+ }
+
+ edje_object_message_send (e->real.real, type,
+ NUM2INT (rb_iv_get (msg, "@id")), data);
+
+ return Qnil;
+}
+
+static VALUE c_msg_init (int argc, VALUE *argv, VALUE self)
+{
+ VALUE val;
+
+ rb_scan_args (argc, argv, "01", &val);
+
+ rb_iv_set (self, "@id", UINT2NUM (0));
+ rb_iv_set (self, "@value", val);
+
+ return self;
+}
+