/*
- * $Id: rb_ecore_evas.c 25 2004-06-26 23:07:01Z tilman $
+ * $Id: rb_ecore_evas.c 26 2004-07-06 18:27:19Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
return Qnil; \
}
+static VALUE evases;
+
/* called by the child classes */
void c_ecore_evas_free (Ecore_Evas **ee)
{
if (*ee)
ecore_evas_free (*ee);
+ rb_hash_aset (evases, INT2NUM ((long) ee), Qnil);
+
free (ee);
}
static VALUE c_evas (VALUE self)
{
+ VALUE evas;
+
GET_OBJ (self, Ecore_Evas, ee, "EcoreEvas");
- return TO_EVAS (self, ecore_evas_get (*ee));
+ if (NIL_P (evas = rb_hash_aref (evases, INT2NUM ((long) (ee))))) {
+ evas = TO_EVAS (self, ecore_evas_get (*ee));
+ rb_hash_aset (evases, INT2NUM ((long) ee), evas);
+ }
+
+ return evas;
}
static VALUE c_get_size_min (VALUE self)
rb_define_method (cEcoreEvas, "sticky=", c_sticky_set, 1);
rb_define_method (cEcoreEvas, "rotation", c_rotation_get, 0);
rb_define_method (cEcoreEvas, "rotation=", c_rotation_set, 1);
+
+ evases = rb_hash_new ();
+ rb_global_variable (&evases);
}