From: Cedric Bail Date: Mon, 30 Oct 2017 23:08:09 +0000 (-0700) Subject: eo: add helper to manipulate Eo object as Eina_Value. X-Git-Tag: submit/sandbox/upgrade/efl120/20180319.053334~1909 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7066e33520531ccffbbd87d6df798208ad3cc31;p=platform%2Fupstream%2Fefl.git eo: add helper to manipulate Eo object as Eina_Value. --- diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index ac09623..d740919 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -2070,6 +2070,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; +} + +/** * @} */