/*
- * $Id: rb_evas_object.c 302 2005-03-22 17:41:35Z tilman $
+ * $Id: rb_evas_object.c 304 2005-03-22 17:51:51Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
if (!NIL_P (e->callbacks))
rb_gc_mark (e->callbacks);
+
+ if (!NIL_P (e->userdata))
+ rb_gc_mark (e->userdata);
}
void c_evas_object_free (RbEvasObject *e, bool free_mem)
return TO_EVAS_OBJECT (evas_object_below_get (e->real));
}
+static VALUE c_userdata_get (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ if (NIL_P (e->userdata))
+ e->userdata = rb_hash_new ();
+
+ return e->userdata;
+}
+
void Init_EvasObject (void)
{
cEvasObject = rb_define_class_under (mEvas, "EvasObject",
rb_define_method (cEvasObject, "stack_below", c_stack_below, 1);
rb_define_method (cEvasObject, "above", c_above_get, 0);
rb_define_method (cEvasObject, "below", c_below_get, 0);
+ rb_define_method (cEvasObject, "userdata", c_userdata_get, 0);
}
/*
- * $Id: rb_evas_object.h 281 2005-03-14 20:51:40Z tilman $
+ * $Id: rb_evas_object.h 304 2005-03-22 17:51:51Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
Evas_Object *real;
VALUE parent;
VALUE callbacks;
+ VALUE userdata;
} RbEvasObject;
void Init_EvasObject (void);