summaryrefslogtreecommitdiff
path: root/src/lib/eo/eo.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-04-12 14:38:54 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-01 10:39:01 -0700
commit67d9c0c11e4c9860f7d977c240d1d50fcabdcf29 (patch)
tree6582ba05f4e6f1cb96439daf89711960bb23e2b9 /src/lib/eo/eo.c
parent0c3508c2a2c217cf7b930b99d3d71eb4d6529084 (diff)
eo: implement a copy function.
we do not rely on copying the object, but on refcounting it. This seems to match the usage we have with object.
Diffstat (limited to 'src/lib/eo/eo.c')
-rw-r--r--src/lib/eo/eo.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 479938a..203f126 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -3445,13 +3445,25 @@ _eo_value_convert_to(const Eina_Value_Type *type EINA_UNUSED, const Eina_Value_T
3445 return EINA_FALSE; 3445 return EINA_FALSE;
3446} 3446}
3447 3447
3448static Eina_Bool
3449_eo_value_copy(const Eina_Value_Type *type EINA_UNUSED, const void *mem, void *ptr)
3450{
3451 Eo * const *src = mem;
3452 Eo **dst = ptr;
3453
3454 if (!src || !dst) return EINA_FALSE;
3455 *dst = efl_ref(*src);
3456
3457 return EINA_TRUE;
3458}
3459
3448static const Eina_Value_Type _EINA_VALUE_TYPE_OBJECT = { 3460static const Eina_Value_Type _EINA_VALUE_TYPE_OBJECT = {
3449 .version = EINA_VALUE_TYPE_VERSION, 3461 .version = EINA_VALUE_TYPE_VERSION,
3450 .value_size = sizeof(Eo *), 3462 .value_size = sizeof(Eo *),
3451 .name = "Efl_Object", 3463 .name = "Efl_Object",
3452 .setup = _eo_value_setup, 3464 .setup = _eo_value_setup,
3453 .flush = _eo_value_flush, 3465 .flush = _eo_value_flush,
3454 .copy = NULL, 3466 .copy = _eo_value_copy,
3455 .compare = NULL, 3467 .compare = NULL,
3456 .convert_to = _eo_value_convert_to, 3468 .convert_to = _eo_value_convert_to,
3457 .convert_from = NULL, 3469 .convert_from = NULL,