/*
- * $Id: rb_edje.c 21 2004-06-25 17:41:17Z tilman $
+ * $Id: rb_edje.c 24 2004-06-26 22:59:56Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
return Qnil; \
}
-VALUE cEdje;
-
static VALUE c_new (VALUE klass, VALUE evas)
{
VALUE self, argv[1];
Evas_Object **edje;
+ if (!rb_obj_is_kind_of (evas, cEvas)) {
+ rb_raise (rb_eTypeError,
+ "wrong argument type %s (expected Evas)",
+ rb_obj_classname (evas));
+ return Qnil;
+ }
+
GET_OBJ (evas, Evas, e, "Evas");
self = Data_Make_Struct (klass, Evas_Object *, c_evas_object_mark,
void Init_Edje (void)
{
- cEdje = rb_define_class_under (mEdje, "Edje", cEvasObject);
+ VALUE cEdje = rb_define_class_under (mEdje, "Edje", cEvasObject);
rb_define_singleton_method (cEdje, "new", c_new, 1);
rb_define_method (cEdje, "load", c_load, 2);
rb_define_method (cEdje, "animation?", c_animation_get, 0);
rb_define_method (cEdje, "animation=", c_animation_set, 1);
}
-