projects
/
ruby-ecore.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f3e4005
)
Don't create a new Evas Ruby object everytime ecore_evas_get() is called.
author
Tilman Sauerbeck
<tilman@code-monkey.de>
Tue, 6 Jul 2004 18:27:19 +0000
(18:27 +0000)
committer
Tilman Sauerbeck
<tilman@code-monkey.de>
Tue, 6 Jul 2004 18:27:19 +0000
(18:27 +0000)
src/ecore_evas/rb_ecore_evas.c
patch
|
blob
|
history
diff --git
a/src/ecore_evas/rb_ecore_evas.c
b/src/ecore_evas/rb_ecore_evas.c
index 18ac0e02d00992bf0d81d9a89171718f6cb71590..52b78a87747298234782a8e20fb3b92649715a15 100644
(file)
--- a/
src/ecore_evas/rb_ecore_evas.c
+++ b/
src/ecore_evas/rb_ecore_evas.c
@@
-1,5
+1,5
@@
/*
/*
- * $Id: rb_ecore_evas.c 2
5 2004-06-26 23:07:01
Z tilman $
+ * $Id: rb_ecore_evas.c 2
6 2004-07-06 18:27:19
Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
@@
-44,12
+44,16
@@
return Qnil; \
}
return Qnil; \
}
+static VALUE evases;
+
/* called by the child classes */
void c_ecore_evas_free (Ecore_Evas **ee)
{
if (*ee)
ecore_evas_free (*ee);
/* 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);
}
free (ee);
}
@@
-128,9
+132,16
@@
static VALUE c_layer_set (VALUE self, VALUE val)
static VALUE c_evas (VALUE self)
{
static VALUE c_evas (VALUE self)
{
+ VALUE evas;
+
GET_OBJ (self, Ecore_Evas, ee, "EcoreEvas");
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)
}
static VALUE c_get_size_min (VALUE self)
@@
-343,4
+354,7
@@
void Init_EcoreEvas (void)
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);
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);
}
}