eo: add helper to manipulate Eo object as Eina_Value.

This commit is contained in:
Cedric Bail 2017-10-30 16:08:09 -07:00 committed by Cedric BAIL
parent a1e9497461
commit b7066e3352
1 changed files with 32 additions and 0 deletions

View File

@ -2069,6 +2069,38 @@ efl_replace(Eo **storage, Eo *new_obj)
EOAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_OBJECT;
/**
* @brief Create a new #Eina_Value containing the passed parameter
* @param obj The object to use
* @return The #Eina_Value
* @since 1.21
*/
static inline Eina_Value *
eina_value_object_new(Eo *obj)
{
Eina_Value *v;
v = eina_value_new(EINA_VALUE_TYPE_OBJECT);
if (v) eina_value_set(v, obj);
return v;
}
/**
* @brief Create a new #EinaInitializeining the passed parameter
* @param obj The object to use
* @return The #Eina_Value
* @since 1.21
*/
static inline Eina_Value
eina_value_object_init(Eo *obj)
{
Eina_Value v = EINA_VALUE_EMPTY;
if (eina_value_setup(&v, EINA_VALUE_TYPE_OBJECT))
eina_value_set(&v, obj);
return v;
}
/**
* @}
*/