diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-09-06 00:27:38 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2013-09-06 00:27:38 +0200 |
commit | 0444f7e3cc6934d76155c3c9b28cc236cbfc768f (patch) | |
tree | 84b1d64266ab8efb253303cebbff225200f5ae3c | |
parent | 9de62bdf4fb9fa5ef8de21a395430161b628eb5b (diff) | |
download | efl-0444f7e3cc6934d76155c3c9b28cc236cbfc768f.tar.gz |
remove eo specific code unused by eo2
-rw-r--r-- | src/lib/eo/Eo.h | 339 | ||||
-rw-r--r-- | src/lib/eo/eo.c | 517 | ||||
-rw-r--r-- | src/lib/eo/eo2_base_class.c | 19 | ||||
-rw-r--r-- | src/lib/eo/eo_private.h | 9 |
4 files changed, 19 insertions, 865 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index bfe0c41a12..1edb986157 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -201,20 +201,6 @@ EAPI void eo_dbg_info_free(Eo_Dbg_Info *info); */ /** - * @def EO_TYPECHECK(type, x) - * - * Checks x is castable to type "type" and casts it to it. - * @param type The C type to check against. - * @param x the variable to test and cast. - */ -#define EO_TYPECHECK(type, x) \ - ({ \ - type __x; \ - __x = x; \ - (type) __x; \ - }) - -/** * @typedef Eo * The basic Object type. */ @@ -246,7 +232,7 @@ typedef struct _Eo_Class_Opaque Eo_Class; * * @see eo_op_func_type_class */ -typedef void (*eo_op_func_type)(Eo *, void *class_data, va_list *list); +typedef void (*eo_op_func_type)(Eo *, void *class_data); /** * @typedef eo_op_func_type_class @@ -256,7 +242,7 @@ typedef void (*eo_op_func_type)(Eo *, void *class_data, va_list *list); * * @see eo_op_func_type */ -typedef void (*eo_op_func_type_class)(const Eo_Class *, va_list *list); +typedef void (*eo_op_func_type_class)(const Eo_Class *); /** * @addtogroup Eo_Events Eo's Event Handling @@ -301,8 +287,6 @@ typedef struct _Eo_Event_Description Eo_Event_Description; */ #define EO_HOT_EVENT_DESCRIPTION(name, doc) { name, doc, EINA_TRUE } - - /** * @} */ @@ -377,70 +361,11 @@ enum _Eo_Class_Type typedef enum _Eo_Class_Type Eo_Class_Type; /** - * @struct _Eo_Op_Func_Description - * Used to associate an Op with a func. - * @see eo_class_funcs_set - */ -struct _Eo_Op_Func_Description -{ - Eo_Op op; /**< The op */ - eo_op_func_type func; /**< The function to call for the op. */ - Eo_Op_Type op_type; /**< The type of the op */ -}; - -/** - * @typedef Eo_Op_Func_Description - * A convenience typedef for #_Eo_Op_Func_Description - */ -typedef struct _Eo_Op_Func_Description Eo_Op_Func_Description; - -/** - * @def EO_OP_FUNC(op, func) - * A convenience macro to be used when populating the #Eo_Op_Func_Description - * array. - */ -#define EO_OP_FUNC(op, func) { op, EO_TYPECHECK(eo_op_func_type, func), EO_OP_TYPE_REGULAR } - -/** - * @def EO_OP_FUNC_CLASS(op, func) - * A convenience macro to be used when populating the #Eo_Op_Func_Description - * array. - * The same as #EO_OP_FUNC but for class functions. - * - * @see EO_OP_FUNC - */ -#define EO_OP_FUNC_CLASS(op, func) { op, (eo_op_func_type) EO_TYPECHECK(eo_op_func_type_class, func), EO_OP_TYPE_CLASS } - -/** - * @def EO_OP_FUNC_SENTINEL - * A convenience macro to be used when populating the #Eo_Op_Func_Description - * array. It must appear at the end of the ARRAY. - */ -#define EO_OP_FUNC_SENTINEL { 0, NULL, EO_OP_TYPE_INVALID } - -/** - * @struct _Eo_Op_Description - * This struct holds the description of a specific op. - */ -struct _Eo_Op_Description -{ - Eo_Op sub_op; /**< The sub_id of the op in it's class. */ - const char *name; /**< The name of the op. */ - const char *doc; /**< Explanation about the Op. */ - Eo_Op_Type op_type; /**< The type of the Op. */ -}; - -/** - * @typedef Eo_Op_Description - * A convenience typedef for #_Eo_Op_Description - */ -typedef struct _Eo_Op_Description Eo_Op_Description; - -/** * @def EO_VERSION * The current version of EO. */ -#define EO_VERSION 1 +#define EO_VERSION 2 +#define EO2_VERSION 2 typedef struct _Eo2_Op_Description { @@ -464,7 +389,6 @@ struct _Eo_Class_Description Eo_Class_Type type; /**< The type of the class. */ struct { Eo_Op *base_op_id; - const Eo_Op_Description *descs; Eo2_Op_Description *descs2; /**< EO2 */ size_t count; } ops; /**< The ops description, should be filled using #EO_CLASS_DESCRIPTION_OPS */ @@ -481,60 +405,6 @@ struct _Eo_Class_Description typedef struct _Eo_Class_Description Eo_Class_Description; /** - * @def EO_CLASS_DESCRIPTION_OPS(base_op_id, op_descs, count) - * An helper macro to help populating #Eo_Class_Description. - * @param base_op_id A pointer to the base op id of the class. - * @param op_descs the op descriptions array. - * @param count the number of ops in the op descriptions array. - */ -#define EO_CLASS_DESCRIPTION_OPS(base_op_id, op_descs, count) { base_op_id, op_descs, NULL, count } - -/** - * @def EO_OP_DESCRIPTION(op, doc) - * An helper macro to help populating #Eo_Op_Description - * @param sub_id The sub id of the op being described. - * @param doc Additional doc for the op. - * @see Eo_Op_Description - * @see EO_OP_DESCRIPTION_CLASS - * @see EO_OP_DESCRIPTION_SENTINEL - */ -#define EO_OP_DESCRIPTION(sub_id, doc) { sub_id, #sub_id, doc, EO_OP_TYPE_REGULAR } - -/** - * @def EO_OP_DESCRIPTION_CLASS(op, doc) - * An helper macro to help populating #Eo_Op_Description - * This macro is the same as EO_OP_DESCRIPTION but indicates that the op's - * implementation is of type CLASS. - * @param sub_id The sub id of the op being described. - * @param doc Additional doc for the op. - * @see Eo_Op_Description - * @see EO_OP_DESCRIPTION - * @see EO_OP_DESCRIPTION_SENTINEL - */ -#define EO_OP_DESCRIPTION_CLASS(sub_id, doc) { sub_id, #sub_id, doc, EO_OP_TYPE_CLASS } - -/** - * @def EO_OP_DESCRIPTION_SENTINEL - * An helper macro to help populating #Eo_Op_Description - * Should be placed at the end of the array. - * @see Eo_Op_Description - * @see EO_OP_DESCRIPTION - */ -#define EO_OP_DESCRIPTION_SENTINEL { 0, NULL, NULL, EO_OP_TYPE_INVALID } - -/** - * @def EO_PARAMETER_GET - * An helper macro to get parameter with less mistake - */ -#define EO_PARAMETER_GET(Type, Name, List) Type Name = va_arg(*List, Type); - -/** - * @def EO_PARAMETER_ENUM_GET - * An helper macro to get parameter that are enum with less mistake (require to ask an int) - */ -#define EO_PARAMETER_ENUM_GET(Type, Name, List) Type Name = va_arg(*List, int); - -/** * @brief Create a new class. * @param desc the class description to create the class with. * @param parent the class to inherit from. @@ -559,15 +429,6 @@ EAPI const Eo_Class *eo_class_new(const Eo_Class_Description *desc, const Eo_Cla EAPI Eina_Bool eo_isa(const Eo *obj, const Eo_Class *klass); /** - * @brief Sets the OP functions for a class. - * @param klass the class to set the functions to. - * @param func_descs a NULL terminated array of #Eo_Op_Func_Description - * - * Should be called from within the class constructor. - */ -EAPI void eo_class_funcs_set(Eo_Class *klass, const Eo_Op_Func_Description *func_descs); - -/** * @brief Gets the name of the passed class. * @param klass the class to work on. * @return The class's name. @@ -598,13 +459,11 @@ EAPI Eina_Bool eo_shutdown(void); /************************************ EO2 ************************************/ -#define EO2_VERSION 2 - // computes size of Eo2_Op_Description[] #define EO2_OP_DESC_SIZE(desc) (sizeof(desc)/sizeof(*desc) - 1) // An helper macro to help populating #Eo_Class_Description. -#define EO2_CLASS_DESCRIPTION_OPS(op_descs) { NULL, NULL, op_descs, EO2_OP_DESC_SIZE(op_descs) } +#define EO2_CLASS_DESCRIPTION_OPS(op_descs) { NULL, op_descs, EO2_OP_DESC_SIZE(op_descs) } // to fetch internal function and object data at once typedef struct _Eo2_Op_Call_Data @@ -822,125 +681,6 @@ EAPI int eo2_call_stack_depth(); /*****************************************************************************/ /** - * @def eo_do - * A convenience wrapper around eo_do_internal() - * @see eo_do_internal - */ -#define eo_do(obj, ...) eo_do_internal(__FILE__, __LINE__, obj, EO_OP_TYPE_REGULAR, __VA_ARGS__, EO_NOOP) - -/** - * @def eo_vdo - * A convenience wrapper around eo_vdo_internal() - * @see eo_vdo_internal - */ -#define eo_vdo(obj, args) eo_vdo_internal(__FILE__, __LINE__, obj, EO_OP_TYPE_REGULAR, args) - -/** - * @def eo_class_do - * A convenience wrapper around eo_class_do_internal() - * @see eo_class_do_internal - */ -#define eo_class_do(klass, ...) eo_class_do_internal(__FILE__, __LINE__, klass, __VA_ARGS__, EO_NOOP) - -/** - * @brief Calls op functions of an object - * @param obj The object to work on - * @param op_type The type of the ops that are passed. - * @param ... NULL terminated list of OPs and parameters. - * @return @c EINA_TRUE on success. - * - * Use the helper macros, don't pass the parameters manually. - * Use #eo_do instead of this function. - * - * @see #eo_do - */ -EAPI Eina_Bool eo_do_internal(const char *file, int line, Eo *obj, Eo_Op_Type op_type, ...); - -/** - * @brief Calls op functions of an object - * @param obj The object to work on - * @param op_type The type of the ops that are passed. - * @param ops NULL terminated list of OPs and parameters. - * @return @c EINA_TRUE on success. - * - * Use the helper macros, don't pass the parameters manually. - * Use #eo_vdo instead of this function. - * - * @see #eo_vdo - */ -EAPI Eina_Bool eo_vdo_internal(const char *file, int line, Eo *obj, Eo_Op_Type op_type, va_list *ops); - -/** - * @brief Calls op functions of a class. - * @param klass The class to work on - * @param ... NULL terminated list of OPs and parameters. - * @return @c EINA_TRUE on success. - * - * Use the helper macros, don't pass the parameters manually. - * Use #eo_do instead of this function. - * - * @see #eo_class_do - */ -EAPI Eina_Bool eo_class_do_internal(const char *file, int line, const Eo_Class *klass, ...); - -/** - * @brief Calls the super function for the specific op. - * @param obj The object to work on - * @param cur_klass The *current* class (use the class *after* this in the MRO). - * @param ... list of parameters. - * @return @c EINA_TRUE on success. - * - * Unlike eo_do(), this function only accepts one op. - * - * @see #eo_do - */ -#define eo_do_super(obj, cur_klass, ...) eo_do_super_internal(__FILE__, __LINE__, obj, cur_klass, EO_OP_TYPE_REGULAR, __VA_ARGS__) - -/** - * @brief Calls the super function for the specific op. - * @param klass The klass to work on - * @param cur_klass The *current* class (use the class *after* this in the MRO). - * @param ... list of parameters. - * @return @c EINA_TRUE on success. - * - * Unlike eo_class_do(), this function only accepts one op. - * - * @see #eo_class_do - */ -#define eo_class_do_super(klass, cur_klass, ...) eo_class_do_super_internal(__FILE__, __LINE__, klass, cur_klass, __VA_ARGS__) - -/** - * @brief Calls the super function for the specific op. - * @param obj The object to work on - * @param cur_klass The *current* class (use the class *after* this in the MRO). - * @param op_type The type of the ops that are passed. - * @param op The wanted op. - * @param ... list of parameters. - * @return @c EINA_TRUE on success. - * - * Don't use this function, use the wrapping macros instead. - * - * @see #eo_do - * @see #eo_do_super - */ -EAPI Eina_Bool eo_do_super_internal(const char *file, int line, Eo *obj, const Eo_Class *cur_klass, Eo_Op_Type op_type, Eo_Op op, ...); - -/** - * @brief Calls the super function for the specific op. - * @param klass The klass to work on - * @param cur_klass The *current* class (use the class *after* this in the MRO). - * @param op The wanted op. - * @param ... list of parameters. - * @return @c EINA_TRUE on success. - * - * Don't use this function, use the wrapping macros instead. - * - * @see #eo_class_do - * @see #eo_class_do_super - */ -EAPI Eina_Bool eo_class_do_super_internal(const char *file, int line, const Eo_Class *klass, const Eo_Class *cur_klass, Eo_Op op, ...); - -/** * @brief Gets the class of the object. * @param obj The object to work on * @return The object's class. @@ -950,19 +690,6 @@ EAPI Eina_Bool eo_class_do_super_internal(const char *file, int line, const Eo_C EAPI const Eo_Class *eo_class_get(const Eo *obj); /** - * @def eo_error_set - * @brief Notify eo that there was an error when constructing, destructing or calling a function of the object. - * @param obj the object to work on. - * - * @see eo_error_get() - */ -#define eo_error_set(obj) eo_error_set_internal(obj, __FILE__, __LINE__) - -/* @cond 0 */ -EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line); -/* @endcond */ - -/** * @def eo_add * @brief Create a new object with the default constructor. * @param klass the class of the object to create. @@ -972,11 +699,6 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line); * * @see #eo_add_custom */ -#define eo_add(klass, parent, ...) \ - ({ \ - const Eo_Class *_tmp_klass = klass; \ - eo_add_internal(__FILE__, __LINE__, _tmp_klass, parent, eo_constructor(), ## __VA_ARGS__, EO_NOOP); \ - }) #define eo2_add(klass, parent, ...) \ ({ \ const Eo_Class *_tmp_klass = klass; \ @@ -999,11 +721,6 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line); * * @see #eo_add */ -#define eo_add_custom(klass, parent, ...) \ - ({ \ - const Eo_Class *_tmp_klass = klass; \ - eo_add_internal(__FILE__, __LINE__, _tmp_klass, parent, ## __VA_ARGS__, EO_NOOP); \ - }) #define eo2_add_custom(klass, parent, ...) \ ({ \ const Eo_Class *_tmp_klass = klass; \ @@ -1027,7 +744,6 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line); * * @see #eo_add */ -EAPI Eo *eo_add_internal(const char *file, int line, const Eo_Class *klass, Eo *parent, ...); EAPI Eo * eo2_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo *parent_id); EAPI Eo * eo2_add_internal_end(const char *file, int line, const Eo *obj); @@ -1307,13 +1023,11 @@ EAPI Eina_Bool eo_composite_is(const Eo *comp_obj); * @def EO_BASE_CLASS * The class type for the Eo base class. */ -#define EO_BASE_CLASS eo_base_class_get() #define EO2_BASE_CLASS eo2_base_class_get() /** * @brief Use #EO_BASE_CLASS * @internal * */ -EAPI const Eo_Class *eo_base_class_get(void); EAPI const Eo_Class *eo2_base_class_get(void); /** @@ -1354,13 +1068,6 @@ enum { }; /** - * @def EO_BASE_ID(sub_id) - * Helper macro to get the full Op ID out of the sub_id for EO_BASE. - * @param sub_id the sub id inside EO_BASE. - */ -#define EO_BASE_ID(sub_id) (EO_BASE_BASE_ID + (sub_id)) - -/** * @def eo_base_data_set(key, data, free_func) * Set generic data to object. * @param[in] key the key associated with the data @@ -1370,7 +1077,6 @@ enum { * @see #eo_base_data_get * @see #eo_base_data_del */ -#define eo_base_data_set(key, data, free_func) EO_BASE_ID(EO_BASE_SUB_ID_DATA_SET), EO_TYPECHECK(const char *, key), EO_TYPECHECK(const void *, data), EO_TYPECHECK(eo_base_data_free_func, free_func) EAPI void eo2_base_data_set(const char *key, const void *data, eo_base_data_free_func free_func); @@ -1383,7 +1089,6 @@ eo2_base_data_set(const char *key, const void *data, eo_base_data_free_func free * @see #eo_base_data_set * @see #eo_base_data_del */ -#define eo_base_data_get(key, data) EO_BASE_ID(EO_BASE_SUB_ID_DATA_GET), EO_TYPECHECK(const char *, key), EO_TYPECHECK(void **, data) EAPI void eo2_base_data_get(const char *key); @@ -1392,7 +1097,6 @@ eo2_base_data_get(const char *key); * Get dbg information from the object. * @param[in] root node of the tree */ -#define eo_dbg_info_get(root_node) EO_BASE_ID(EO_BASE_SUB_ID_DBG_INFO_GET), EO_TYPECHECK(Eo_Dbg_Info *, root_node) EAPI void eo2_dbg_info_get(Eo_Dbg_Info *root_node); @@ -1404,7 +1108,6 @@ eo2_dbg_info_get(Eo_Dbg_Info *root_node); * @see #eo_base_data_set * @see #eo_base_data_get */ -#define eo_base_data_del(key) EO_BASE_ID(EO_BASE_SUB_ID_DATA_DEL), EO_TYPECHECK(const char *, key) EAPI void eo2_base_data_del(const char *key); @@ -1420,7 +1123,6 @@ eo2_base_data_del(const char *key); * * @see #eo_wref_del */ -#define eo_wref_add(wref) EO_BASE_ID(EO_BASE_SUB_ID_WREF_ADD), EO_TYPECHECK(Eo **, wref) EAPI void eo2_wref_add(Eo **wref); @@ -1431,7 +1133,6 @@ eo2_wref_add(Eo **wref); * * @see #eo_wref_add */ -#define eo_wref_del(wref) EO_BASE_ID(EO_BASE_SUB_ID_WREF_DEL), EO_TYPECHECK(Eo **, wref) EAPI void eo2_wref_del(Eo **wref); @@ -1447,10 +1148,6 @@ eo2_wref_del(Eo **wref); * @see eo_weak_unref * @see eo_wref_add */ -#define eo_weak_ref(wref) \ - do { \ - if (*wref) eo_do(*wref, eo_wref_add(wref)); \ - } while (0); #define eo2_weak_ref(wref) \ do { \ if (*wref) eo2_do(*wref, eo2_wref_add(wref)); \ @@ -1469,10 +1166,6 @@ eo2_wref_del(Eo **wref); * @see eo_wref_del * @see eo_wref_del_safe */ -#define eo_weak_unref(wref) \ - do { \ - if (*wref) eo_do(*wref, eo_wref_del(wref)); \ - } while (0); #define eo2_weak_unref(wref) \ do { \ if (*wref) eo2_do(*wref, eo2_wref_del(wref)); \ @@ -1488,7 +1181,6 @@ eo2_wref_del(Eo **wref); * * @see #eo_wref_del */ -#define eo_wref_del_safe(wref) eo_weak_unref(wref) #define eo2_wref_del_safe(wref) eo2_weak_unref(wref) /** @@ -1499,7 +1191,6 @@ eo2_wref_del(Eo **wref); * * @see #eo_destructor */ -#define eo_constructor() EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR) EAPI void eo2_constructor(); @@ -1511,7 +1202,6 @@ eo2_constructor(); * * @see #eo_constructor */ -#define eo_destructor() EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR) EAPI void eo2_destructor(); @@ -1600,7 +1290,6 @@ struct _Eo_Callback_Array_Item * * @see eo_event_callback_forwarder_del() */ -#define eo_event_callback_forwarder_add(desc, new_obj) EO_BASE_ID(EO_BASE_SUB_ID_EVENT_CALLBACK_FORWARDER_ADD), EO_TYPECHECK(const Eo_Event_Description *, desc), EO_TYPECHECK(Eo *, new_obj) EAPI void eo2_event_callback_forwarder_add(const Eo_Event_Description *desc, Eo *new_obj); @@ -1612,7 +1301,6 @@ eo2_event_callback_forwarder_add(const Eo_Event_Description *desc, Eo *new_obj); * * @see eo_event_callback_forwarder_add() */ -#define eo_event_callback_forwarder_del(desc, new_obj) EO_BASE_ID(EO_BASE_SUB_ID_EVENT_CALLBACK_FORWARDER_DEL), EO_TYPECHECK(const Eo_Event_Description *, desc), EO_TYPECHECK(Eo *, new_obj) EAPI void eo2_event_callback_forwarder_del(const Eo_Event_Description *desc, Eo *new_obj); @@ -1624,7 +1312,6 @@ eo2_event_callback_forwarder_del(const Eo_Event_Description *desc, Eo *new_obj); * * @see #eo_event_thaw */ -#define eo_event_freeze() EO_BASE_ID(EO_BASE_SUB_ID_EVENT_FREEZE) EAPI void eo2_event_freeze(); @@ -1636,7 +1323,6 @@ eo2_event_freeze(); * * @see #eo_event_freeze */ -#define eo_event_thaw() EO_BASE_ID(EO_BASE_SUB_ID_EVENT_THAW) EAPI void eo2_event_thaw(); @@ -1651,7 +1337,6 @@ eo2_event_thaw(); * @see #eo_event_freeze * @see #eo_event_thaw */ -#define eo_event_freeze_get(fcount) EO_BASE_ID(EO_BASE_SUB_ID_EVENT_FREEZE_GET), EO_TYPECHECK(int *, fcount) EAPI int eo2_event_freeze_get(); @@ -1664,7 +1349,6 @@ eo2_event_freeze_get(); * @see #eo_event_freeze * @see #eo_event_global_thaw */ -#define eo_event_global_freeze() EO_BASE_ID(EO_BASE_SUB_ID_EVENT_GLOBAL_FREEZE) EAPI void eo2_event_global_freeze(); @@ -1677,7 +1361,6 @@ eo2_event_global_freeze(); * @see #eo_event_thaw * @see #eo_event_global_freeze */ -#define eo_event_global_thaw() EO_BASE_ID(EO_BASE_SUB_ID_EVENT_GLOBAL_THAW) EAPI void eo2_event_global_thaw(); @@ -1693,7 +1376,6 @@ eo2_event_global_thaw(); * @see #eo_event_global_freeze * @see #eo_event_global_thaw */ -#define eo_event_global_freeze_get(fcount) EO_BASE_ID(EO_BASE_SUB_ID_EVENT_GLOBAL_FREEZE_GET), EO_TYPECHECK(int *, fcount) EAPI int eo2_event_global_freeze_get(); @@ -1708,9 +1390,6 @@ eo2_event_global_freeze_get(); * * @see eo_event_callback_priority_add() */ -#define eo_event_callback_add(desc, cb, data) \ - eo_event_callback_priority_add(desc, \ - EO_CALLBACK_PRIORITY_DEFAULT, cb, data) #define eo2_event_callback_add(desc, cb, data) \ eo2_event_callback_priority_add(desc, \ EO_CALLBACK_PRIORITY_DEFAULT, cb, data) @@ -1727,7 +1406,6 @@ eo2_event_global_freeze_get(); * * @see #eo_event_callback_add */ -#define eo_event_callback_priority_add(desc, priority, cb, data) EO_BASE_ID(EO_BASE_SUB_ID_EVENT_CALLBACK_PRIORITY_ADD), EO_TYPECHECK(const Eo_Event_Description *, desc), EO_TYPECHECK(Eo_Callback_Priority, priority), EO_TYPECHECK(Eo_Event_Cb, cb), EO_TYPECHECK(const void *, data) EAPI void eo2_event_callback_priority_add(const Eo_Event_Description *desc, Eo_Callback_Priority priority, @@ -1742,7 +1420,6 @@ eo2_event_callback_priority_add(const Eo_Event_Description *desc, * @param[in] user_data The data to compare. * */ -#define eo_event_callback_del(desc, func, user_data) EO_BASE_ID(EO_BASE_SUB_ID_EVENT_CALLBACK_DEL), EO_TYPECHECK(const Eo_Event_Description *, desc), EO_TYPECHECK(Eo_Event_Cb, func), EO_TYPECHECK(const void *, user_data) EAPI void eo2_event_callback_del(const Eo_Event_Description *desc, Eo_Event_Cb func, @@ -1758,9 +1435,6 @@ eo2_event_callback_del(const Eo_Event_Description *desc, * * @see eo_event_callback_array_priority_add() */ -#define eo_event_callback_array_add(array, data) \ - eo_event_callback_array_priority_add(array, \ - EO_CALLBACK_PRIORITY_DEFAULT, data) #define eo2_event_callback_array_add(array, data) \ eo2_event_callback_array_priority_add(array, \ EO_CALLBACK_PRIORITY_DEFAULT, data) @@ -1776,7 +1450,6 @@ eo2_event_callback_del(const Eo_Event_Description *desc, * * @see #eo_event_callback_add */ -#define eo_event_callback_array_priority_add(array, priority, data) EO_BASE_ID(EO_BASE_SUB_ID_EVENT_CALLBACK_ARRAY_PRIORITY_ADD), EO_TYPECHECK(const Eo_Callback_Array_Item *, array), EO_TYPECHECK(Eo_Callback_Priority, priority), EO_TYPECHECK(const void *, data) EAPI void eo2_event_callback_array_priority_add(const Eo_Callback_Array_Item *array, Eo_Callback_Priority priority, @@ -1789,7 +1462,6 @@ eo2_event_callback_array_priority_add(const Eo_Callback_Array_Item *array, * @param[in] user_data The data to compare. * */ -#define eo_event_callback_array_del(array, user_data) EO_BASE_ID(EO_BASE_SUB_ID_EVENT_CALLBACK_ARRAY_DEL), EO_TYPECHECK(const Eo_Callback_Array_Item *, array), EO_TYPECHECK(const void *, user_data) EAPI void eo2_event_callback_array_del(const Eo_Callback_Array_Item *array, const void *user_data); @@ -1801,7 +1473,6 @@ eo2_event_callback_array_del(const Eo_Callback_Array_Item *array, * @param[in] event_info Extra event info to pass to the callbacks. * @param[out] aborted @c EINA_TRUE if one of the callbacks aborted the call, @c EINA_FALSE otherwise. */ -#define eo_event_callback_call(desc, event_info, aborted) EO_BASE_ID(EO_BASE_SUB_ID_EVENT_CALLBACK_CALL), EO_TYPECHECK(const Eo_Event_Description *, desc), EO_TYPECHECK(const void *, event_info), EO_TYPECHECK(Eina_Bool *, aborted) EAPI Eina_Bool eo2_event_callback_call(const Eo_Event_Description *desc, void *event_info); diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index f113b01822..930b3a2048 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -28,8 +28,6 @@ static void _eo_condtor_reset(_Eo *obj); static inline void *_eo_data_scope_get(const _Eo *obj, const _Eo_Class *klass); static inline void *_eo_data_xref_internal(const char *file, int line, _Eo *obj, const _Eo_Class *klass, const _Eo *ref_obj); static inline void _eo_data_xunref_internal(_Eo *obj, void *data, const _Eo *ref_obj); -static const _Eo_Class *_eo_op_class_get(Eo_Op op); -static const Eo_Op_Description *_eo_op_id_desc_get(Eo_Op op); /* Start of Dich */ @@ -104,10 +102,7 @@ _dich_func_set(_Eo_Class *klass, Eo_Op op, eo_op_func_type func) _dich_chain_alloc(chain1); if (chain1->funcs[DICH_CHAIN_LAST(op)].src == klass) { - const _Eo_Class *op_kls = _eo_op_class_get(op); - const Eo_Op_Description *op_desc = _eo_op_id_desc_get(op); - ERR("Already set function for op 0x%x (%s:%s). Overriding with func %p", - op, op_kls->desc->name, op_desc->name, func); + ERR("Already set function for op 0x%x. Overriding with func %p", op,func); } chain1->funcs[DICH_CHAIN_LAST(op)].func = func; @@ -131,9 +126,6 @@ _dich_func_clean_all(_Eo_Class *klass) /* END OF DICH */ -static const Eo_Op_Description noop_desc = - EO_OP_DESCRIPTION(EO_NOOP, "No operation."); - static inline _Eo_Class * _eo_class_pointer_get(const Eo_Class *klass_id) { @@ -154,102 +146,6 @@ Eo_Class * _eo_class_id_get(const _Eo_Class *klass) #endif } -static const _Eo_Class * -_eo_op_class_get(Eo_Op op) -{ - /* FIXME: Make it fast. */ - _Eo_Class **itr = _eo_classes; - int mid, max, min; - - min = 0; - max = _eo_classes_last_id - 1; - while (min <= max) - { - mid = (min + max) / 2; - - if (itr[mid]->base_id + itr[mid]->desc->ops.count < op) - min = mid + 1; - else if (itr[mid]->base_id > op) - max = mid - 1; - else - return itr[mid]; - } - - return NULL; -} - -static const Eo_Op_Description * -_eo_op_id_desc_get(Eo_Op op) -{ - const _Eo_Class *klass; - - if (op == EO_NOOP) - return &noop_desc; - - klass = _eo_op_class_get(op); - - if (klass) - { - Eo_Op sub_id = op - klass->base_id; - if (sub_id < klass->desc->ops.count) - return klass->desc->ops.descs + sub_id; - } - - return NULL; -} - -static const char * -_eo_op_id_name_get(Eo_Op op) -{ - const Eo_Op_Description *desc = _eo_op_id_desc_get(op); - return (desc) ? desc->name : NULL; -} - -static inline const _Eo_Class * -_eo_kls_itr_next(const _Eo_Class *orig_kls, const _Eo_Class *cur_klass, Eo_Op op) -{ - const _Eo_Class **kls_itr = NULL; - - /* Find the kls itr. */ - kls_itr = orig_kls->mro; - while (*kls_itr && (*kls_itr != cur_klass)) - kls_itr++; - - if (*kls_itr) - { - kls_itr++; - while (*kls_itr) - { - const op_type_funcs *fsrc = _dich_func_get(*kls_itr, op); - if (!fsrc || !fsrc->func) - { - kls_itr++; - continue; - } - return fsrc->src; - } - } - - return NULL; -} - -static inline const op_type_funcs * -_eo_kls_itr_func_get(const _Eo_Class *cur_klass, Eo_Op op) -{ - const _Eo_Class *klass = cur_klass; - if (klass) - { - const op_type_funcs *func = _dich_func_get(klass, op); - - if (func && func->func) - { - return func; - } - } - - return NULL; -} - /************************************ EO2 ************************************/ EAPI Eo2_Hook_Call eo2_hook_call_pre = NULL; @@ -673,236 +569,6 @@ eo2_add_internal_end(const char *file, int line, const Eo *obj_id) /*****************************************************************************/ -#define _EO_OP_ERR_NO_OP_PRINT(file, line, op, klass) \ - do \ - { \ - const _Eo_Class *op_klass = _eo_op_class_get(op); \ - const char *_dom_name = (op_klass) ? op_klass->desc->name : NULL; \ - ERR("in %s:%d: Can't execute function %s:%s (op 0x%x) for class '%s'. Aborting.", \ - file, line, _dom_name, _eo_op_id_name_get(op), op, \ - (klass) ? klass->desc->name : NULL); \ - } \ - while (0) - -static inline Eina_Bool -_eo_op_internal(const char *file, int line, _Eo *obj, const _Eo_Class *cur_klass, - Eo_Op_Type op_type, Eo_Op op, va_list *p_list) -{ -#ifdef EO_DEBUG - const Eo_Op_Description *op_desc = _eo_op_id_desc_get(op); - - if (op_desc) - { - if (op_desc->op_type == EO_OP_TYPE_CLASS) - { - ERR("in %s:%d: Tried calling a class op '%s' (0x%x) from a non-class context.", - file, line, (op_desc) ? op_desc->name : NULL, op); - return EINA_FALSE; - } - } -#endif - - { - const op_type_funcs *func = _eo_kls_itr_func_get(cur_klass, op); - if (EINA_LIKELY(func != NULL)) - { - void *func_data = _eo_data_scope_get(obj, func->src); - func->func((Eo *)obj->obj_id, func_data, p_list); - return EINA_TRUE; - } - } - - /* Try composite objects */ - { - Eina_List *itr; - Eo *emb_obj_id; - EINA_LIST_FOREACH(obj->composite_objects, itr, emb_obj_id) - { - /* FIXME: Clean this up a bit. */ - EO_OBJ_POINTER_RETURN_VAL(emb_obj_id, emb_obj, EINA_FALSE); - if (_eo_op_internal(file, line, emb_obj, emb_obj->klass, op_type, op, p_list)) - { - return EINA_TRUE; - } - } - } - return EINA_FALSE; -} - -static inline Eina_Bool -_eo_dov_internal(const char *file, int line, _Eo *obj, Eo_Op_Type op_type, va_list *p_list) -{ - Eina_Bool prev_error; - Eina_Bool ret = EINA_TRUE; - Eo_Op op = EO_NOOP; - - prev_error = obj->do_error; - _eo_ref(obj); - - op = va_arg(*p_list, Eo_Op); - while (op) - { - if (!_eo_op_internal(file, line, obj, obj->klass, op_type, op, p_list)) - { - _EO_OP_ERR_NO_OP_PRINT(file, line, op, obj->klass); - ret = EINA_FALSE; - break; - } - op = va_arg(*p_list, Eo_Op); - } - - if (obj->do_error) - ret = EINA_FALSE; - - obj->do_error = prev_error; - - _eo_unref(obj); - - return ret; -} - -EAPI Eina_Bool -eo_do_internal(const char *file, int line, Eo *obj_id, Eo_Op_Type op_type, ...) -{ - Eina_Bool ret = EINA_TRUE; - va_list p_list; - - EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, EINA_FALSE); - - va_start(p_list, op_type); - - ret = _eo_dov_internal(file, line, obj, op_type, &p_list); - - va_end(p_list); - - return ret; -} - -EAPI Eina_Bool -eo_vdo_internal(const char *file, int line, Eo *obj_id, Eo_Op_Type op_type, va_list *ops) -{ - EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, EINA_FALSE); - - return _eo_dov_internal(file, line, obj, op_type, ops); -} - -EAPI Eina_Bool -eo_do_super_internal(const char *file, int line, Eo *obj_id, const Eo_Class *cur_klass_id, - Eo_Op_Type op_type, Eo_Op op, ...) -{ - const _Eo_Class *nklass; - Eina_Bool ret = EINA_TRUE; - va_list p_list; - - EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, EINA_FALSE); - _Eo_Class *cur_klass = _eo_class_pointer_get(cur_klass_id); - EO_MAGIC_RETURN_VAL(cur_klass, EO_CLASS_EINA_MAGIC, EINA_FALSE); - - /* Advance the kls itr. */ - nklass = _eo_kls_itr_next(obj->klass, cur_klass, op); - - va_start(p_list, op); - if (!_eo_op_internal(file, line, obj, nklass, op_type, op, &p_list)) - { - _EO_OP_ERR_NO_OP_PRINT(file, line, op, nklass); - ret = EINA_FALSE; - } - va_end(p_list); - - if (obj->do_error) - ret = EINA_FALSE; - - return ret; -} - -static Eina_Bool -_eo_class_op_internal(const char *file, int line, _Eo_Class *klass, const _Eo_Class *cur_klass, - Eo_Op op, va_list *p_list) -{ -#ifdef EO_DEBUG - const Eo_Op_Description *op_desc = _eo_op_id_desc_get(op); - - if (op_desc) - { - if (op_desc->op_type != EO_OP_TYPE_CLASS) - { - ERR("in %s:%d: Tried calling an instance op '%s' (0x%x) from a class context.", - file, line, (op_desc) ? op_desc->name : NULL, op); - return EINA_FALSE; - } - } -#else - (void) file; - (void) line; -#endif - - { - const op_type_funcs *func = _eo_kls_itr_func_get(cur_klass, op); - if (func) - { - ((eo_op_func_type_class) func->func)(_eo_class_id_get(klass), p_list); - return EINA_TRUE; - } - } - - return EINA_FALSE; -} - -EAPI Eina_Bool -eo_class_do_internal(const char *file, int line, const Eo_Class *klass_id, ...) -{ - Eina_Bool ret = EINA_TRUE; - Eo_Op op = EO_NOOP; - va_list p_list; - - _Eo_Class *klass = _eo_class_pointer_get(klass_id); - EO_MAGIC_RETURN_VAL(klass, EO_CLASS_EINA_MAGIC, EINA_FALSE); - - va_start(p_list, klass_id); - - op = va_arg(p_list, Eo_Op); - while (op) - { - if (!_eo_class_op_internal(file, line, (_Eo_Class *) klass, klass, op, &p_list)) - { - _EO_OP_ERR_NO_OP_PRINT(file, line, op, klass); - ret = EINA_FALSE; - break; - } - op = va_arg(p_list, Eo_Op); - } - - va_end(p_list); - - return ret; -} - -EAPI Eina_Bool -eo_class_do_super_internal(const char *file, int line, const Eo_Class *klass_id, - const Eo_Class *cur_klass_id, Eo_Op op, ...) -{ - _Eo_Class *klass = _eo_class_pointer_get(klass_id); - _Eo_Class *cur_klass = _eo_class_pointer_get(cur_klass_id); - const _Eo_Class *nklass; - Eina_Bool ret = EINA_TRUE; - va_list p_list; - EO_MAGIC_RETURN_VAL(klass, EO_CLASS_EINA_MAGIC, EINA_FALSE); - EO_MAGIC_RETURN_VAL(cur_klass, EO_CLASS_EINA_MAGIC, EINA_FALSE); - - /* Advance the kls itr. */ - nklass = _eo_kls_itr_next(klass, cur_klass, op); - - va_start(p_list, op); - if (!_eo_class_op_internal(file, line, (_Eo_Class *) klass, nklass, op, &p_list)) - { - _EO_OP_ERR_NO_OP_PRINT(file, line, op, nklass); - ret = EINA_FALSE; - } - va_end(p_list); - - return ret; -} - EAPI const Eo_Class * eo_class_get(const Eo *obj_id) { @@ -1067,48 +733,12 @@ _eo_class_constructor(_Eo_Class *klass) klass->constructed = EINA_TRUE; - if (klass->desc->version == EO2_VERSION) - _eo2_class_funcs_set(klass); + _eo2_class_funcs_set(klass); if (klass->desc->class_constructor) klass->desc->class_constructor(_eo_class_id_get(klass)); } -EAPI void -eo_class_funcs_set(Eo_Class *klass_id, const Eo_Op_Func_Description *func_descs) -{ - _Eo_Class *klass = _eo_class_pointer_get(klass_id); - EO_MAGIC_RETURN(klass, EO_CLASS_EINA_MAGIC); - - const Eo_Op_Func_Description *itr; - itr = func_descs; - if (itr) - { - for ( ; itr->op_type != EO_OP_TYPE_INVALID ; itr++) - { - const Eo_Op_Description *op_desc = _eo_op_id_desc_get(itr->op); - - if (EINA_UNLIKELY(!op_desc || (itr->op == EO_NOOP))) - { - ERR("Setting implementation for non-existent op 0x%x for class '%s'. Func index: %lu", itr->op, klass->desc->name, (unsigned long) (itr - func_descs)); - } - else if (EINA_LIKELY(itr->op_type == op_desc->op_type)) - { - _dich_func_set(klass, itr->op, itr->func); - } - else - { - ERR("Set function's op type (0x%x) is different than the one in the op description (%d) for op '%s:%s'. Func index: %lu", - itr->op_type, - (op_desc) ? op_desc->op_type : EO_OP_TYPE_REGULAR, - klass->desc->name, - (op_desc) ? op_desc->name : NULL, - (unsigned long) (itr - func_descs)); - } - } - } -} - static void eo_class_free(_Eo_Class *klass) { @@ -1123,59 +753,9 @@ eo_class_free(_Eo_Class *klass) free(klass); } -/* DEVCHECK */ -static Eina_Bool -_eo_class_check_op_descs(const Eo_Class_Description *desc) -{ - const Eo_Op_Description *itr; - size_t i; - - if (desc->ops.count > 0) - { - if (!desc->ops.base_op_id) - { - ERR("Class '%s' has a non-zero ops count, but base_id is NULL.", - desc->name); - return EINA_FALSE; - } - - if (!desc->ops.descs) - { - ERR("Class '%s' has a non-zero ops count, but there are no descs.", - desc->name); - return EINA_FALSE; - } - } - - itr = desc->ops.descs; - for (i = 0 ; i < desc->ops.count ; i++, itr++) - { - if (itr->sub_op != i) - { - if (itr->name) - { - ERR("Wrong order in Ops description for class '%s'. Expected 0x%lx and got 0x%lx", desc->name, (unsigned long) i, (unsigned long) itr->sub_op); - } - else - { - ERR("Found too few Ops description for class '%s'. Expected 0x%lx descriptions, but found 0x%lx.", desc->name, (unsigned long) desc->ops.count, (unsigned long) i); - } - return EINA_FALSE; - } - } - - if (itr && itr->name) - { - ERR("Found extra Ops description for class '%s'. Expected %lu descriptions, but found more.", desc->name, (unsigned long) desc->ops.count); - return EINA_FALSE; - } - - return EINA_TRUE; -} - /* Not really called, just used for the ptr... */ static void -_eo_class_isa_func(Eo *obj_id EINA_UNUSED, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) +_eo_class_isa_func(Eo *obj_id EINA_UNUSED, void *class_data EINA_UNUSED) { /* Do nonthing. */ } @@ -1198,17 +778,11 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...) EINA_SAFETY_ON_NULL_RETURN_VAL(desc, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(desc->name, NULL); - if (desc->version == EO2_VERSION) { // FIXME: eo2 /* if (!_eo2_class_check_op_descs(desc)) */ /* return NULL; */ } - else - { - if (!_eo_class_check_op_descs(desc)) - return NULL; - } /* Check restrictions on Interface types. */ if (desc->type == EO_CLASS_TYPE_INTERFACE) @@ -1430,11 +1004,8 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...) eina_lock_take(&_eo_class_creation_lock); - if (klass->desc->version == EO2_VERSION) - /* klass->class_id = _eo_id_allocate(klass); */ - klass->class_id = ++_eo_classes_last_id; - else - klass->class_id = ++_eo_classes_last_id; + /* klass->class_id = _eo_id_allocate(klass); */ + klass->class_id = ++_eo_classes_last_id; { /* FIXME: Handle errors. */ @@ -1509,74 +1080,6 @@ eo_parent_set(Eo *obj_id, const Eo *parent_id) return EINA_TRUE; } -EAPI Eo * -eo_add_internal(const char *file, int line, const Eo_Class *klass_id, Eo *parent_id, ...) -{ - Eina_Bool do_err; - _Eo_Class *klass = _eo_class_pointer_get(klass_id); - EO_MAGIC_RETURN_VAL(klass, EO_CLASS_EINA_MAGIC, NULL); - - if (parent_id) - { - EO_OBJ_POINTER_RETURN_VAL(parent_id, parent, NULL); - } - - if (EINA_UNLIKELY(klass->desc->type != EO_CLASS_TYPE_REGULAR)) - { - ERR("in %s:%d: Class '%s' is not instantiate-able. Aborting.", file, line, klass->desc->name); - return NULL; - } - - _Eo *obj = calloc(1, klass->obj_size); - obj->refcount++; - obj->klass = klass; - -#ifndef HAVE_EO_ID - EINA_MAGIC_SET(obj, EO_EINA_MAGIC); -#endif - Eo_Id obj_id = _eo_id_allocate(obj); - obj->obj_id = obj_id; - eo_parent_set((Eo *)obj_id, parent_id); - - _eo_condtor_reset(obj); - - _eo_ref(obj); - - if (klass->desc->version == EO2_VERSION) - eo2_do((Eo *)obj_id, eo2_constructor()); - /* Run the relevant do stuff. */ - { - va_list p_list; - va_start(p_list, parent_id); - do_err = !_eo_dov_internal(file, line, obj, EO_OP_TYPE_REGULAR, &p_list); - va_end(p_list); - } - - if (EINA_UNLIKELY(do_err)) - { - ERR("in %s:%d, Object of class '%s' - One of the object constructors have failed.", - file, line, klass->desc->name); - goto fail; - } - - if (!obj->condtor_done) - { - ERR("in %s:%d: Object of class '%s' - Not all of the object constructors have been executed.", - file, line, klass->desc->name); - goto fail; - } - - _eo_unref(obj); - - return (Eo *)obj_id; - -fail: - /* Unref twice, once for the ref above, and once for the basic object ref. */ - _eo_unref(obj); - _eo_unref(obj); - return NULL; -} - typedef struct { EINA_INLIST; @@ -1676,16 +1179,6 @@ eo_parent_get(const Eo *obj_id) return obj->parent; } -EAPI void -eo_error_set_internal(const Eo *obj_id, const char *file, int line) -{ - EO_OBJ_POINTER_RETURN(obj_id, obj); - - ERR("Error with obj '%p' at %s:%d", obj, file, line); - - obj->do_error = EINA_TRUE; -} - void _eo_condtor_done(Eo *obj_id) { diff --git a/src/lib/eo/eo2_base_class.c b/src/lib/eo/eo2_base_class.c index 7848d2b7c8..375d66aed8 100644 --- a/src/lib/eo/eo2_base_class.c +++ b/src/lib/eo/eo2_base_class.c @@ -736,22 +736,19 @@ EAPI const Eina_Value_Type *EO2_DBG_INFO_TYPE = &_EO2_DBG_INFO_TYPE; /* EOF event callbacks */ -/* EO_BASE_CLASS stuff */ -#define MY_CLASS EO_BASE_CLASS - /* FIXME: Set proper type descriptions. */ // FIXME: eo2 multiple definition -/* EAPI const Eo_Event_Description _EO_EV_CALLBACK_ADD = */ -/* EO_EVENT_DESCRIPTION("callback,add", "A callback was added."); */ -/* EAPI const Eo_Event_Description _EO_EV_CALLBACK_DEL = */ -/* EO_EVENT_DESCRIPTION("callback,del", "A callback was deleted."); */ -/* EAPI const Eo_Event_Description _EO_EV_DEL = */ -/* EO_HOT_EVENT_DESCRIPTION("del", "Obj is being deleted."); */ +EAPI const Eo_Event_Description _EO_EV_CALLBACK_ADD = + EO_EVENT_DESCRIPTION("callback,add", "A callback was added."); +EAPI const Eo_Event_Description _EO_EV_CALLBACK_DEL = + EO_EVENT_DESCRIPTION("callback,del", "A callback was deleted."); +EAPI const Eo_Event_Description _EO_EV_DEL = + EO_HOT_EVENT_DESCRIPTION("del", "Obj is being deleted."); static void _constructor(Eo *obj, void *class_data EINA_UNUSED) { - DBG("%p - %s.", obj, eo_class_name_get(MY_CLASS)); + DBG("%p - %s.", obj, eo_class_name_get(EO2_BASE_CLASS)); _eo_condtor_done(obj); } @@ -760,7 +757,7 @@ EAPI EO2_VOID_FUNC_BODY(eo2_constructor); static void _destructor(Eo *obj, void *class_data) { - DBG("%p - %s.", obj, eo_class_name_get(MY_CLASS)); + DBG("%p - %s.", obj, eo_class_name_get(EO2_BASE_CLASS)); _eo_generic_data_del_all(class_data); _wref_destruct(class_data); diff --git a/src/lib/eo/eo_private.h b/src/lib/eo/eo_private.h index 0dffb54b50..bfa3c150f4 100644 --- a/src/lib/eo/eo_private.h +++ b/src/lib/eo/eo_private.h @@ -91,7 +91,6 @@ struct _Eo_Internal { int refcount; int datarefcount; - Eina_Bool do_error:1; Eina_Bool condtor_done:1; Eina_Bool composite:1; @@ -165,21 +164,15 @@ _eo_del_internal(const char *file, int line, _Eo *obj) const _Eo_Class *klass = obj->klass; - if (klass->desc->version == EO2_VERSION) - eo2_do((Eo *)obj->obj_id, eo2_event_callback_call(EO_EV_DEL, NULL);); - else - eo_do((Eo *) obj->obj_id, eo_event_callback_call(EO_EV_DEL, NULL, NULL)); + eo2_do((Eo *)obj->obj_id, eo2_event_callback_call(EO_EV_DEL, NULL);); _eo_condtor_reset(obj); - if (klass->desc->version == EO2_VERSION) { // FIXME: eo2 do_err = EINA_FALSE; eo2_do((Eo *)obj->obj_id, eo2_destructor();); } - else - do_err = !eo_do((Eo *)obj->obj_id, eo_destructor()); if (EINA_UNLIKELY(do_err)) { |