summaryrefslogtreecommitdiff
path: root/src/lib/eo/eo.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2018-12-06 16:36:59 -0800
committerCedric BAIL <cedric.bail@free.fr>2019-01-09 11:02:07 -0800
commite02dba3377a29051ffb5893cc6a117e5d9a1d682 (patch)
tree6cb6e94f3e30709001c0ba81500b340b093efcac /src/lib/eo/eo.c
parent35acfebee44e78b33f52a9a126edec70c1888a49 (diff)
eo: add the ability to get the size of object of a certain class.
Their was two different way to implement this, either like this with a simple function that work on Efl_Class, or by a function on Efl.Object. I leaned on the first one, but I could easily be convinced it should be done on Efl.Object actually. Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es> Differential Revision: https://phab.enlightenment.org/D7441
Diffstat (limited to 'src/lib/eo/eo.c')
-rw-r--r--src/lib/eo/eo.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 3fb7fd6..ed0f371 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -1150,6 +1150,31 @@ err_obj:
1150 return NULL; 1150 return NULL;
1151} 1151}
1152 1152
1153EAPI const size_t
1154efl_class_memory_size_get(const Efl_Class *eo_id)
1155{
1156 const _Efl_Class *klass;
1157
1158 if (_eo_is_a_class(eo_id))
1159 {
1160 EO_CLASS_POINTER_GOTO(eo_id, _klass, err_klass);
1161 klass = _klass;
1162 }
1163 else
1164 {
1165 EO_OBJ_POINTER_GOTO(eo_id, obj, err_obj);
1166 klass = obj->klass;
1167 EO_OBJ_DONE(eo_id);
1168 }
1169 return klass->obj_size;
1170
1171err_klass:
1172 _EO_POINTER_ERR(eo_id, "Class (%p) is an invalid ref.", eo_id);
1173err_obj:
1174 return 0;
1175}
1176
1177
1153static void 1178static void
1154_vtable_init(Eo_Vtable *vtable, size_t size) 1179_vtable_init(Eo_Vtable *vtable, size_t size)
1155{ 1180{