summaryrefslogtreecommitdiff
path: root/src/lib/eo
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-04-19 11:32:28 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-04-19 11:35:48 +0900
commit28d785ccb8494812ead7c8db578cd226081b76ef (patch)
tree8914c80f77747d43a585109bfcbd943fdecb300b /src/lib/eo
parent19b9234f23af78daf73784bd37d3458e94e3459f (diff)
eo: Add docs for efl_super and efl_cast (doxygen)
Diffstat (limited to 'src/lib/eo')
-rw-r--r--src/lib/eo/Eo.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 9d0cb3bb4e..11b36cace2 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -926,7 +926,77 @@ EAPI void _efl_object_call_end(Efl_Object_Op_Call_Data *call);
926// end of the efl_add. Calls finalize among others 926// end of the efl_add. Calls finalize among others
927EAPI Eo * _efl_add_end(Eo *obj, Eina_Bool is_ref, Eina_Bool is_fallback); 927EAPI Eo * _efl_add_end(Eo *obj, Eina_Bool is_ref, Eina_Bool is_fallback);
928 928
929/*****************************************************************************/
930
931/**
932 * @brief Prepare a call to the parent class implementation of a function
933 *
934 * @param obj The object to call (can be a class)
935 * @param cur_klass The current class
936 * @return An EO handle that must be used as part of an EO function call.
937 *
938 * @warning The returned value must always be used as the first argument (the
939 * object) of a method or property function call, and should never be handled
940 * in any other way. Do not call any function from this file on the returned
941 * value (eg. efl_ref, etc...).
942 *
943 * Usage:
944 * @code
945 * // Inside the implementation code for MY_CLASS
946 * my_property_set(efl_super(obj, MY_CLASS), value);
947 * @endcode
948 *
949 * A common usage pattern is to forward function calls to the parent function:
950 * @code
951 * EOLIAN static void
952 * _my_class_my_property_set(Eo *obj, My_Class_Data *pd, int value)
953 * {
954 * // Do some processing on this class data, or on the value
955 * if (value < 0) value = 0;
956 * pd->last_value = value;
957 * // Pass the call to the parent class
958 * my_property_set(efl_super(obj, MY_CLASS), value);
959 * // Do some more processing
960 * }
961 * @endcode
962 *
963 * @p cur_klass must be a valid class in the inheritance hierarchy of @p obj's
964 * class. Invalid values will lead to undefined behaviour.
965 *
966 * @see efl_cast
967 */
929EAPI Eo *efl_super(const Eo *obj, const Efl_Class *cur_klass); 968EAPI Eo *efl_super(const Eo *obj, const Efl_Class *cur_klass);
969
970/**
971 * @brief Prepare a call to cast to a parent class implementation of a function
972 *
973 * @param obj The object to call (can be a class)
974 * @param cur_klass The class to cast into
975 * @return An EO handle that must be used as part of an EO function call.
976 *
977 * @warning The returned value must always be used as the first argument (the
978 * object) of a method or property function call, and should never be handled
979 * in any other way. Do not call any function from this file on the returned
980 * value (eg. efl_ref, etc...).
981 *
982 * Usage:
983 * @code
984 * // Inside the implementation code for MY_CLASS
985 * my_property_set(efl_cast(obj, SOME_OTHER_CLASS), value);
986 * @endcode
987 *
988 * In the above example, @p obj is assumed to inherit from @c SOME_OTHER_CLASS
989 * as either a mixin or direct class inheritance. If @c SOME_OTHER_CLASS
990 * implements @c my_property.set then that implementation shall be called,
991 * otherwise the call will be propagated to the parent implementation (if any).
992 *
993 * @p cur_klass must be a valid class in the inheritance hierarchy of @p obj's
994 * class. Invalid values will lead to undefined behaviour.
995 *
996 * @see efl_cast
997 *
998 * @since 1.20
999 */
930EAPI Eo *efl_cast(const Eo *obj, const Efl_Class *cur_klass); 1000EAPI Eo *efl_cast(const Eo *obj, const Efl_Class *cur_klass);
931 1001
932/*****************************************************************************/ 1002/*****************************************************************************/