Manually revert "eo: replace Eo_Class with Eo"

This reverts commit ee1b0833ed

I did it manually because the code changed too much.

We actually want this type, it makes things more clear and easier to
understand.
This commit is contained in:
Tom Hacohen 2013-09-27 16:38:15 +01:00
parent ba5af54f6d
commit 832fc5b5ce
4 changed files with 37 additions and 37 deletions

View File

@ -45,7 +45,7 @@ typedef struct _Eo_Opaque Eo;
* The basic class type - should be removed, just for compat.
* @deprecated
*/
typedef struct _Eo_Opaque Eo_Class;
typedef Eo Eo_Class;
/**
* @typedef Eo_Callback_Priority
@ -329,13 +329,13 @@ typedef struct _Eo_Event_Description Eo_Event_Description;
* You must use this macro if you want thread safety in class creation.
*/
#define EO_DEFINE_CLASS(class_get_func_name, class_desc, parent_class, ...) \
EAPI const Eo * \
EAPI const Eo_Class * \
class_get_func_name(void) \
{ \
const Eo *_tmp_parent_class; \
const Eo_Class *_tmp_parent_class; \
static volatile char lk_init = 0; \
static Eina_Lock _my_lock; \
static const Eo * volatile _my_class = NULL; \
static const Eo_Class * volatile _my_class = NULL; \
if (EINA_LIKELY(!!_my_class)) return _my_class; \
\
eina_lock_take(&_eo_class_creation_lock); \
@ -464,8 +464,8 @@ struct _Eo_Class_Description
} ops; /**< The ops description, should be filled using #EO_CLASS_DESCRIPTION_OPS */
const Eo_Event_Description **events; /**< The event descriptions for this class. */
size_t data_size; /**< The size of data (private + protected + public) this class needs per object. */
void (*class_constructor)(Eo *klass); /**< The constructor of the class. */
void (*class_destructor)(Eo *klass); /**< The destructor of the class. */
void (*class_constructor)(Eo_Class *klass); /**< The constructor of the class. */
void (*class_destructor)(Eo_Class *klass); /**< The destructor of the class. */
};
/**
@ -540,7 +540,7 @@ typedef struct _Eo_Class_Description Eo_Class_Description;
*
* @see #EO_DEFINE_CLASS
*/
EAPI const Eo *eo_class_new(const Eo_Class_Description *desc, const Eo *parent, ...);
EAPI const Eo_Class *eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent, ...);
/**
* @brief Check if an object "is a" klass.
@ -550,7 +550,7 @@ EAPI const Eo *eo_class_new(const Eo_Class_Description *desc, const Eo *parent,
*
* Notice: This function does not support composite objects.
*/
EAPI Eina_Bool eo_isa(const Eo *obj, const Eo *klass);
EAPI Eina_Bool eo_isa(const Eo *obj, const Eo_Class *klass);
/**
* @brief Sets the OP functions for a class.
@ -559,7 +559,7 @@ EAPI Eina_Bool eo_isa(const Eo *obj, const Eo *klass);
*
* Should be called from within the class constructor.
*/
EAPI void eo_class_funcs_set(Eo *klass, const Eo_Op_Func_Description *func_descs);
EAPI void eo_class_funcs_set(Eo_Class *klass, const Eo_Op_Func_Description *func_descs);
/**
* @brief Gets the name of the passed class.
@ -568,7 +568,7 @@ EAPI void eo_class_funcs_set(Eo *klass, const Eo_Op_Func_Description *func_descs
*
* @see eo_class_get()
*/
EAPI const char *eo_class_name_get(const Eo *obj);
EAPI const char *eo_class_name_get(const Eo_Class *klass);
/**
* @}
@ -676,7 +676,7 @@ EAPI Eina_Bool eo_vdo_internal(const char *file, int line, const Eo *obj, va_lis
* @see #eo_do
* @see #eo_do_super
*/
EAPI Eina_Bool eo_do_super_internal(const char *file, int line, const Eo *obj, const Eo *cur_klass, Eo_Op op, ...);
EAPI Eina_Bool eo_do_super_internal(const char *file, int line, const Eo *obj, const Eo_Class *cur_klass, Eo_Op op, ...);
/**
* @brief Gets the class of the object.
@ -685,7 +685,7 @@ EAPI Eina_Bool eo_do_super_internal(const char *file, int line, const Eo *obj, c
*
* @see eo_class_name_get()
*/
EAPI const Eo *eo_class_get(const Eo *obj);
EAPI const Eo_Class *eo_class_get(const Eo *obj);
/**
* @def eo_error_set
@ -712,7 +712,7 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line);
*/
#define eo_add(klass, parent, ...) \
({ \
const Eo *_tmp_klass = klass; \
const Eo_Class *_tmp_klass = klass; \
eo_add_internal(__FILE__, __LINE__, _tmp_klass, parent, eo_constructor(), ## __VA_ARGS__, EO_NOOP); \
})
@ -728,7 +728,7 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line);
*/
#define eo_add_custom(klass, parent, ...) \
({ \
const Eo *_tmp_klass = klass; \
const Eo_Class *_tmp_klass = klass; \
eo_add_internal(__FILE__, __LINE__, _tmp_klass, parent, ## __VA_ARGS__, EO_NOOP); \
})
@ -744,7 +744,7 @@ 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 *klass, Eo *parent, ...);
EAPI Eo *eo_add_internal(const char *file, int line, const Eo_Class *klass, Eo *parent, ...);
/**
* @brief Get a pointer to the data of an object for a specific class.
@ -753,7 +753,7 @@ EAPI Eo *eo_add_internal(const char *file, int line, const Eo *klass, Eo *parent
* @return a pointer to the data.
* @deprecated use eo_data_scope_get or eo_data_ref instead.
*/
EAPI void *eo_data_get(const Eo *obj, const Eo *klass) EINA_DEPRECATED;
EAPI void *eo_data_get(const Eo *obj, const Eo_Class *klass) EINA_DEPRECATED;
/**
* @brief Get a pointer to the data of an object for a specific class.
@ -766,7 +766,7 @@ EAPI void *eo_data_get(const Eo *obj, const Eo *klass) EINA_DEPRECATED;
* @see eo_data_ref()
* @see eo_data_unref()
*/
EAPI void *eo_data_scope_get(const Eo *obj, const Eo *klass);
EAPI void *eo_data_scope_get(const Eo *obj, const Eo_Class *klass);
/**
* @def eo_data_xref(obj, klass, ref_obj)
@ -794,7 +794,7 @@ EAPI void *eo_data_scope_get(const Eo *obj, const Eo *klass);
*
* @see eo_data_xunref_internal()
*/
EAPI void *eo_data_xref_internal(const char *file, int line, const Eo *obj, const Eo *klass, const Eo *ref_obj);
EAPI void *eo_data_xref_internal(const char *file, int line, const Eo *obj, const Eo_Class *klass, const Eo *ref_obj);
/**
* @def eo_data_xunref(obj, data, ref_obj)
@ -1003,7 +1003,7 @@ EAPI Eina_Bool eo_composite_is(const Eo *comp_obj);
* @brief Use #EO_BASE_CLASS
* @internal
* */
EAPI const Eo *eo_base_class_get(void);
EAPI const Eo_Class *eo_base_class_get(void);
/**
* @typedef eo_base_data_free_func

View File

@ -149,7 +149,7 @@ _eo_is_a_class(const Eo *obj_id)
}
static inline _Eo_Class *
_eo_class_pointer_get(const Eo *klass_id)
_eo_class_pointer_get(const Eo_Class *klass_id)
{
#ifdef HAVE_EO_ID
return ID_CLASS_GET((Eo_Id)klass_id);
@ -419,7 +419,7 @@ eo_vdo_internal(const char *file, int line, const Eo *obj_id, va_list *ops)
}
EAPI Eina_Bool
eo_do_super_internal(const char *file, int line, const Eo *obj_id, const Eo *cur_klass_id, Eo_Op op, ...)
eo_do_super_internal(const char *file, int line, const Eo *obj_id, const Eo_Class *cur_klass_id, Eo_Op op, ...)
{
const _Eo_Class *nklass;
Eina_Bool op_ret = EINA_TRUE;
@ -451,7 +451,7 @@ eo_do_super_internal(const char *file, int line, const Eo *obj_id, const Eo *cur
return (ret & op_ret);
}
EAPI const Eo *
EAPI const Eo_Class *
eo_class_get(const Eo *obj_id)
{
if (_eo_is_a_class(obj_id))
@ -468,7 +468,7 @@ eo_class_get(const Eo *obj_id)
}
EAPI const char *
eo_class_name_get(const Eo *obj_id)
eo_class_name_get(const Eo_Class *obj_id)
{
const _Eo_Class *klass;
@ -636,7 +636,7 @@ _eo_class_constructor(_Eo_Class *klass)
}
EAPI void
eo_class_funcs_set(Eo *klass_id, const Eo_Op_Func_Description *func_descs)
eo_class_funcs_set(Eo_Class *klass_id, const Eo_Op_Func_Description *func_descs)
{
EO_CLASS_POINTER_RETURN(klass_id, klass);
@ -751,8 +751,8 @@ _eo_class_isa_func(Eo *obj_id EINA_UNUSED, void *class_data EINA_UNUSED, va_list
/* Do nonthing. */
}
EAPI const Eo *
eo_class_new(const Eo_Class_Description *desc, const Eo *parent_id, ...)
EAPI const Eo_Class *
eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
{
_Eo_Class *klass;
va_list p_list;
@ -821,7 +821,7 @@ eo_class_new(const Eo_Class_Description *desc, const Eo *parent_id, ...)
extn_id = va_arg(p_list, Eo_Id *);
while (extn_id)
{
extn = _eo_class_pointer_get((Eo *)extn_id);
extn = _eo_class_pointer_get((Eo_Class *)extn_id);
switch (extn->desc->type)
{
case EO_CLASS_TYPE_REGULAR:
@ -1019,7 +1019,7 @@ eo_class_new(const Eo_Class_Description *desc, const Eo *parent_id, ...)
}
EAPI Eina_Bool
eo_isa(const Eo *obj_id, const Eo *klass_id)
eo_isa(const Eo *obj_id, const Eo_Class *klass_id)
{
EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, EINA_FALSE);
EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, EINA_FALSE);
@ -1045,7 +1045,7 @@ _eo_parent_internal_set(_Eo_Object *obj, ...)
}
EAPI Eo *
eo_add_internal(const char *file, int line, const Eo *klass_id, Eo *parent_id, ...)
eo_add_internal(const char *file, int line, const Eo_Class *klass_id, Eo *parent_id, ...)
{
Eina_Bool do_err;
_Eo_Object *obj;
@ -1326,13 +1326,13 @@ _eo_data_xunref_internal(_Eo_Object *obj, void *data, const _Eo_Object *ref_obj)
}
EAPI void *
eo_data_get(const Eo *obj_id, const Eo *klass_id)
eo_data_get(const Eo *obj_id, const Eo_Class *klass_id)
{
return eo_data_scope_get(obj_id, klass_id);
}
EAPI void *
eo_data_scope_get(const Eo *obj_id, const Eo *klass_id)
eo_data_scope_get(const Eo *obj_id, const Eo_Class *klass_id)
{
void *ret;
EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, NULL);
@ -1359,7 +1359,7 @@ eo_data_scope_get(const Eo *obj_id, const Eo *klass_id)
}
EAPI void *
eo_data_xref_internal(const char *file, int line, const Eo *obj_id, const Eo *klass_id, const Eo *ref_obj_id)
eo_data_xref_internal(const char *file, int line, const Eo *obj_id, const Eo_Class *klass_id, const Eo *ref_obj_id)
{
void *ret;
EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, NULL);

View File

@ -744,13 +744,13 @@ _ev_freeze_get(Eo *obj EINA_UNUSED, void *class_data, va_list *list)
}
static void
_ev_global_freeze(Eo *klass EINA_UNUSED, void *data EINA_UNUSED, va_list *list EINA_UNUSED)
_ev_global_freeze(Eo_Class *klass EINA_UNUSED, void *data EINA_UNUSED, va_list *list EINA_UNUSED)
{
event_freeze_count++;
}
static void
_ev_global_thaw(Eo *klass EINA_UNUSED, void *data EINA_UNUSED, va_list *list EINA_UNUSED)
_ev_global_thaw(Eo_Class *klass EINA_UNUSED, void *data EINA_UNUSED, va_list *list EINA_UNUSED)
{
if (event_freeze_count > 0)
{
@ -763,7 +763,7 @@ _ev_global_thaw(Eo *klass EINA_UNUSED, void *data EINA_UNUSED, va_list *list EIN
}
static void
_ev_global_freeze_get(Eo *klass EINA_UNUSED, void *data EINA_UNUSED, va_list *list)
_ev_global_freeze_get(Eo_Class *klass EINA_UNUSED, void *data EINA_UNUSED, va_list *list)
{
EO_PARAMETER_GET(int *, ret, list);
@ -905,7 +905,7 @@ _destructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED)
}
static void
_class_constructor(Eo *klass)
_class_constructor(Eo_Class *klass)
{
event_freeze_count = 0;

View File

@ -184,7 +184,7 @@ Eo *_eo_header_id_get(const Eo_Base *header)
}
static inline
Eo *_eo_class_id_get(const _Eo_Class *klass)
Eo_Class *_eo_class_id_get(const _Eo_Class *klass)
{
return _eo_header_id_get((Eo_Base *) klass);
}