Eo: Rename most of Eo to the Efl prefix.

This includes Eo.Base -> Efl.Object and many (but not all) of the eo
functions. This commit is only for eo itself, not the rest of the EFL.
This commit is contained in:
Tom Hacohen 2016-08-09 14:10:05 +01:00
parent 4bbe8733c4
commit e64e120a51
12 changed files with 442 additions and 442 deletions

View File

@ -2,10 +2,10 @@
### Library
eo_eolian_files = \
lib/eo/eo_base.eo \
lib/eo/eo_class.eo \
lib/eo/eo_override.eo \
lib/eo/eo_interface.eo
lib/eo/efl_object.eo \
lib/eo/efl_class.eo \
lib/eo/efl_object_override.eo \
lib/eo/efl_interface.eo
eo_eolian_c = $(eo_eolian_files:%.eo=%.eo.c)
eo_eolian_h = $(eo_eolian_files:%.eo=%.eo.h)

View File

@ -89,8 +89,8 @@ extern "C" {
*
* Recommended reading:
*
* @li @ref Eo_Class_Base
* @li @ref Eo_Class
* @li @ref Efl_Class_Base
* @li @ref Efl_Class
* @li @ref Eo_Events
* @li @ref Eo_Composite_Objects
*
@ -113,14 +113,14 @@ typedef struct _Eo_Object _Eo_Object;
typedef struct _Eo_Opaque Eo;
/**
* @typedef Eo_Class
* @typedef Efl_Class
* The basic class type - should be removed, just for compat.
*/
typedef Eo Eo_Class;
#define _EO_CLASS_EO_CLASS_TYPE
typedef Eo Efl_Class;
#define _EFL_CLASS_EO_CLASS_TYPE
typedef Eo Eo_Base;
#define _EO_BASE_EO_CLASS_TYPE
typedef Eo Efl_Object;
#define _EFL_BASE_EO_CLASS_TYPE
#ifdef EFL_BETA_API_SUPPORT
@ -174,10 +174,10 @@ typedef enum _Eo_Op_Type Eo_Op_Type;
*/
typedef void (*Eo_Del_Intercept) (Eo *obj_id);
#include "eo_override.eo.h"
#include "eo_base.eo.h"
#include "eo_interface.eo.h"
#define EO_CLASS EO_BASE_CLASS
#include "efl_object_override.eo.h"
#include "efl_object.eo.h"
#include "efl_interface.eo.h"
#define EO_CLASS EFL_OBJECT_CLASS
/**
* @addtogroup Eo_Debug_Information Eo's Debug information helper.
@ -196,10 +196,10 @@ EAPI extern const Eina_Value_Type *EO_DBG_INFO_TYPE;
* @param[in] name name of the list
* @return the new list
*/
static inline Eo_Dbg_Info *
EO_DBG_INFO_LIST_APPEND(Eo_Dbg_Info *list, const char *name)
static inline Efl_Dbg_Info *
EO_DBG_INFO_LIST_APPEND(Efl_Dbg_Info *list, const char *name)
{
Eo_Dbg_Info *tmp = (Eo_Dbg_Info *)calloc(1, sizeof(*tmp));
Efl_Dbg_Info *tmp = (Efl_Dbg_Info *)calloc(1, sizeof(*tmp));
if (!tmp) return NULL;
tmp->name = eina_stringshare_add(name);
@ -214,17 +214,17 @@ EO_DBG_INFO_LIST_APPEND(Eo_Dbg_Info *list, const char *name)
/**
* @def EO_DBG_INFO_APPEND
* Creates a new debug info into a list
* @param[in] LIST list where to append (Eo_Dbg_Info *)
* @param[in] LIST list where to append (Efl_Dbg_Info *)
* @param[in] NAME name of the parameter (const char *)
* @param[in] TYPE type of the parameter (Eina_Value_Type *)
* @param[in] VALUE value of the parameter
*/
#define EO_DBG_INFO_APPEND(LIST, NAME, TYPE, VALUE) \
do { \
Eo_Dbg_Info *List = LIST; \
Efl_Dbg_Info *List = LIST; \
if (List) \
{ \
Eo_Dbg_Info *Tmp = calloc(1, sizeof(*Tmp)); \
Efl_Dbg_Info *Tmp = calloc(1, sizeof(*Tmp)); \
\
if (!Tmp) break; \
Tmp->name = eina_stringshare_add(NAME); \
@ -235,10 +235,10 @@ do { \
} while (0)
/**
* Frees the Eo_Dbg_Info tree. (The whole tree recursively).
* Frees the Efl_Dbg_Info tree. (The whole tree recursively).
* @param[in] info The tree to delete.
*/
EAPI void eo_dbg_info_free(Eo_Dbg_Info *info);
EAPI void eo_dbg_info_free(Efl_Dbg_Info *info);
/**
* @}
@ -262,40 +262,40 @@ typedef unsigned int Eo_Op;
*/
/**
* @def EO_EVENT_DESCRIPTION(name)
* An helper macro to help populating #Eo_Event_Description
* @def EFL_EVENT_DESCRIPTION(name)
* An helper macro to help populating #Efl_Event_Description
* @param name The name of the event.
* @see Eo_Event_Description
* @see Efl_Event_Description
*/
#define EO_EVENT_DESCRIPTION(name) { name, EINA_FALSE, EINA_FALSE, EINA_FALSE }
#define EFL_EVENT_DESCRIPTION(name) { name, EINA_FALSE, EINA_FALSE, EINA_FALSE }
/**
* @def EO_EVENT_DESCRIPTION_HOT(name)
* An helper macro to help populating #Eo_Event_Description and make
* @def EFL_EVENT_DESCRIPTION_HOT(name)
* An helper macro to help populating #Efl_Event_Description and make
* the event impossible to freeze.
* @param name The name of the event.
* @see Eo_Event_Description
* @see EO_EVENT_DESCRIPTION
* @see Efl_Event_Description
* @see EFL_EVENT_DESCRIPTION
*/
#define EO_EVENT_DESCRIPTION_HOT(name) { name, EINA_TRUE, EINA_FALSE, EINA_FALSE }
#define EFL_EVENT_DESCRIPTION_HOT(name) { name, EINA_TRUE, EINA_FALSE, EINA_FALSE }
/**
* @def EO_EVENT_DESCRIPTION(name)
* An helper macro to help populating #Eo_Event_Description
* @def EFL_EVENT_DESCRIPTION(name)
* An helper macro to help populating #Efl_Event_Description
* @param name The name of the event.
* @see Eo_Event_Description
* @see Efl_Event_Description
*/
#define EO_EVENT_DESCRIPTION_RESTART(name) { name, EINA_FALSE, EINA_FALSE, EINA_TRUE }
#define EFL_EVENT_DESCRIPTION_RESTART(name) { name, EINA_FALSE, EINA_FALSE, EINA_TRUE }
/**
* @def EO_EVENT_DESCRIPTION_HOT(name)
* An helper macro to help populating #Eo_Event_Description and make
* @def EFL_EVENT_DESCRIPTION_HOT(name)
* An helper macro to help populating #Efl_Event_Description and make
* the event impossible to freeze.
* @param name The name of the event.
* @see Eo_Event_Description
* @see EO_EVENT_DESCRIPTION
* @see Efl_Event_Description
* @see EFL_EVENT_DESCRIPTION
*/
#define EO_EVENT_DESCRIPTION_HOT_RESTART(name) { name, EINA_TRUE, EINA_FALSE, EINA_TRUE }
#define EFL_EVENT_DESCRIPTION_HOT_RESTART(name) { name, EINA_TRUE, EINA_FALSE, EINA_TRUE }
@ -304,7 +304,7 @@ typedef unsigned int Eo_Op;
*/
/**
* @addtogroup Eo_Class Eo Class
* @addtogroup Efl_Class Efl Class
* @{
*/
@ -321,13 +321,13 @@ typedef unsigned int Eo_Op;
* 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, ...) \
const Eo_Class * \
const Efl_Class * \
class_get_func_name(void) \
{ \
const Eo_Class *_tmp_parent_class; \
const Efl_Class *_tmp_parent_class; \
static volatile unsigned char lk_init = 0; \
static Eina_Spinlock _my_lock; \
static const Eo_Class * volatile _my_class = NULL; \
static const Efl_Class * volatile _my_class = NULL; \
static unsigned int _my_init_generation = 1; \
if (EINA_UNLIKELY(_eo_init_generation != _my_init_generation)) \
{ \
@ -365,7 +365,7 @@ class_get_func_name(void) \
/**
* An enum representing the possible types of an Eo class.
*/
enum _Eo_Class_Type
enum _Efl_Class_Type
{
EO_CLASS_TYPE_REGULAR = 0, /**< Regular class. */
EO_CLASS_TYPE_REGULAR_NO_INSTANT, /**< Regular non instant-able class. */
@ -374,10 +374,10 @@ enum _Eo_Class_Type
};
/**
* @typedef Eo_Class_Type
* A convenience typedef for #_Eo_Class_Type.
* @typedef Efl_Class_Type
* A convenience typedef for #_Efl_Class_Type.
*/
typedef enum _Eo_Class_Type Eo_Class_Type;
typedef enum _Efl_Class_Type Efl_Class_Type;
/**
* @def EO_VERSION
@ -385,12 +385,12 @@ typedef enum _Eo_Class_Type Eo_Class_Type;
*/
#define EO_VERSION 2
typedef struct _Eo_Op_Description
typedef struct _Efl_Op_Description
{
void *api_func; /**< The EAPI function offering this op. (The name of the func on windows) */
void *func; /**< The static function to call for the op. */
Eo_Op_Type op_type; /**< The type of the Op. */
} Eo_Op_Description;
} Efl_Op_Description;
/**
* @struct _Eo_Ops
@ -400,33 +400,33 @@ typedef struct _Eo_Op_Description
*/
typedef struct _Eo_Ops
{
const Eo_Op_Description *descs; /**< The op descriptions array of size count. */
const Efl_Op_Description *descs; /**< The op descriptions array of size count. */
size_t count; /**< Number of op descriptions. */
} Eo_Ops;
/**
* @struct _Eo_Class_Description
* @struct _Efl_Class_Description
* This struct holds the description of a class.
* This description should be passed to eo_class_new.
* Please use the #EO_CLASS_DESCRIPTION_OPS macro when populating it.
*/
struct _Eo_Class_Description
struct _Efl_Class_Description
{
unsigned int version; /**< The current version of eo, use #EO_VERSION */
const char *name; /**< The name of the class. */
Eo_Class_Type type; /**< The type of the class. */
Efl_Class_Type type; /**< The type of the class. */
Eo_Ops ops; /**< The ops description, should be filled using #EO_CLASS_DESCRIPTION_OPS (later sorted by Eo). */
const Eo_Event_Description **events; /**< The event descriptions for this class. */
const Efl_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_Class *klass); /**< The constructor of the class. */
void (*class_destructor)(Eo_Class *klass); /**< The destructor of the class. */
void (*class_constructor)(Efl_Class *klass); /**< The constructor of the class. */
void (*class_destructor)(Efl_Class *klass); /**< The destructor of the class. */
};
/**
* @typedef Eo_Class_Description
* A convenience typedef for #_Eo_Class_Description
* @typedef Efl_Class_Description
* A convenience typedef for #_Efl_Class_Description
*/
typedef struct _Eo_Class_Description Eo_Class_Description;
typedef struct _Efl_Class_Description Efl_Class_Description;
/**
* @brief Create a new class.
@ -440,7 +440,7 @@ typedef struct _Eo_Class_Description Eo_Class_Description;
*
* @see #EO_DEFINE_CLASS
*/
EAPI const Eo_Class *eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent, ...);
EAPI const Efl_Class *eo_class_new(const Efl_Class_Description *desc, const Efl_Class *parent, ...);
/**
* @brief Override Eo functions of this object.
@ -479,7 +479,7 @@ EAPI Eina_Bool eo_override(Eo *obj, const Eo_Ops *ops);
* @see eo_override
*/
#define EO_OVERRIDE_OPS_DEFINE(ops, ...) \
const Eo_Op_Description _##ops##_descs[] = { __VA_ARGS__ }; \
const Efl_Op_Description _##ops##_descs[] = { __VA_ARGS__ }; \
const Eo_Ops ops = { _##ops##_descs, EINA_C_ARRAY_LENGTH(_##ops##_descs) }
/**
@ -490,7 +490,7 @@ EAPI Eina_Bool eo_override(Eo *obj, const Eo_Ops *ops);
*
* Notice: This function does not support composite objects.
*/
EAPI Eina_Bool eo_isa(const Eo *obj, const Eo_Class *klass);
EAPI Eina_Bool eo_isa(const Eo *obj, const Efl_Class *klass);
/**
* @brief Gets the name of the passed class.
@ -499,7 +499,7 @@ EAPI Eina_Bool eo_isa(const Eo *obj, const Eo_Class *klass);
*
* @see eo_class_get()
*/
EAPI const char *eo_class_name_get(const Eo_Class *klass);
EAPI const char *eo_class_name_get(const Efl_Class *klass);
/**
* @}
@ -521,7 +521,7 @@ EAPI Eina_Bool eo_init(void);
*/
EAPI Eina_Bool eo_shutdown(void);
// Helpers macro to help populating #Eo_Class_Description.
// Helpers macro to help populating #Efl_Class_Description.
#define EO_CLASS_DESCRIPTION_NOOPS() { NULL, 0}
#define EO_CLASS_DESCRIPTION_OPS(op_descs) { op_descs, EINA_C_ARRAY_LENGTH(op_descs) }
@ -679,7 +679,7 @@ EAPI void _eo_call_end(Eo_Op_Call_Data *call);
// end of the eo_add. Calls finalize among others
EAPI Eo * _eo_add_end(Eo *obj, Eina_Bool is_ref, Eina_Bool is_fallback);
EAPI Eo *eo_super(const Eo *obj, const Eo_Class *cur_klass);
EAPI Eo *eo_super(const Eo *obj, const Efl_Class *cur_klass);
/*****************************************************************************/
@ -690,7 +690,7 @@ EAPI Eo *eo_super(const Eo *obj, const Eo_Class *cur_klass);
*
* @see eo_class_name_get()
*/
EAPI const Eo_Class *eo_class_get(const Eo *obj);
EAPI const Efl_Class *eo_class_get(const Eo *obj);
EAPI Eo *_eo_self_get(void);
@ -757,7 +757,7 @@ EAPI Eo *_eo_self_get(void);
*/
#define eo_add_ref(klass, parent, ...) _eo_add_common(klass, parent, EINA_TRUE, ##__VA_ARGS__)
EAPI Eo * _eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo *parent, Eina_Bool ref, Eina_Bool is_fallback);
EAPI Eo * _eo_add_internal_start(const char *file, int line, const Efl_Class *klass_id, Eo *parent, Eina_Bool ref, Eina_Bool is_fallback);
/**
* @brief Get a pointer to the data of an object for a specific class.
@ -770,7 +770,7 @@ EAPI Eo * _eo_add_internal_start(const char *file, int line, const Eo_Class *kla
* @see eo_data_ref()
* @see eo_data_unref()
*/
EAPI void *eo_data_scope_get(const Eo *obj, const Eo_Class *klass);
EAPI void *eo_data_scope_get(const Eo *obj, const Efl_Class *klass);
/**
* @def eo_data_xref(obj, klass, ref_obj)
@ -798,7 +798,7 @@ EAPI void *eo_data_scope_get(const Eo *obj, const Eo_Class *klass);
*
* @see eo_data_xunref_internal()
*/
EAPI void *eo_data_xref_internal(const char *file, int line, const Eo *obj, const Eo_Class *klass, const Eo *ref_obj);
EAPI void *eo_data_xref_internal(const char *file, int line, const Eo *obj, const Efl_Class *klass, const Eo *ref_obj);
/**
* @def eo_data_xunref(obj, data, ref_obj)
@ -888,18 +888,18 @@ EAPI int eo_ref_get(const Eo *obj);
* set the intercept function to NULL so it is not called again on the next
* "real deletion".
*
* @see eo_del_intercept_get()
* @see efl_del_intercept_get()
* @see eo_unref()
* @see eo_del()
* @see efl_del()
*/
EAPI void eo_del_intercept_set(Eo *obj, Eo_Del_Intercept del_intercept_func);
EAPI void efl_del_intercept_set(Eo *obj, Eo_Del_Intercept del_intercept_func);
/**
* @brief Get the deletion interceptor function
* @param obj The object to get the interceptor of
* @return The intercept function or NULL if none is set.
*
* This returns the interceptor function set by eo_del_intercept_set(). Note
* This returns the interceptor function set by efl_del_intercept_set(). Note
* that objects by default have no interceptor (NULL) set, but certain
* classes may set one up in a constructor, so it is important to be able
* to get the interceptor function to know if this has happend and
@ -907,9 +907,9 @@ EAPI void eo_del_intercept_set(Eo *obj, Eo_Del_Intercept del_intercept_func);
* own interceptor function has finished. It would generally be a bad idea
* though to override these functions.
*
* @see eo_del_intercept_set()
* @see efl_del_intercept_set()
*/
EAPI Eo_Del_Intercept eo_del_intercept_get(const Eo *obj);
EAPI Eo_Del_Intercept efl_del_intercept_get(const Eo *obj);
/**
* @def eo_xref(obj, ref_obj)
@ -988,27 +988,27 @@ EAPI Eina_Bool eo_manual_free(Eo *obj);
EAPI Eina_Bool eo_destructed_is(const Eo *obj);
/**
* @addtogroup Eo_Class_Class Eo's Class class.
* @addtogroup Efl_Class_Class Eo's Class class.
* @{
*/
#include "eo_class.eo.h"
#include "efl_class.eo.h"
/**
* @}
*/
/**
* @addtogroup Eo_Class_Base Eo's Base class.
* @addtogroup Efl_Class_Base Eo's Base class.
* @{
*/
/**
* @typedef eo_key_data_free_func
* @typedef efl_key_data_free_func
* Data free func prototype.
* XXX: DO NOT USE, only here for legacy.
*/
typedef void (*eo_key_data_free_func)(void *);
typedef void (*efl_key_data_free_func)(void *);
/**
* @def eo_weak_ref
@ -1016,11 +1016,11 @@ typedef void (*eo_key_data_free_func)(void *);
* @param wref the pointer to use for the weak ref
*
* @see eo_weak_unref
* @see eo_wref_add
* @see efl_wref_add
*/
#define eo_weak_ref(wref) \
do { \
if (*wref) eo_wref_add(*wref, wref); \
if (*wref) efl_wref_add(*wref, wref); \
} while (0)
/**
@ -1029,22 +1029,22 @@ typedef void (*eo_key_data_free_func)(void *);
* @param wref the pointer to use for the weak unref
*
* @see eo_weak_ref
* @see eo_wref_del
* @see eo_wref_del_safe
* @see efl_wref_del
* @see efl_wref_del_safe
*/
#define eo_weak_unref(wref) \
do { \
if (*wref) eo_wref_del(*wref, wref); \
if (*wref) efl_wref_del(*wref, wref); \
} while (0)
/**
* @def eo_wref_del_safe
* @def efl_wref_del_safe
* @brief Delete the weak reference passed.
* @param wref the weak reference to free.
*
* @see #eo_wref_del
* @see #efl_wref_del
*/
#define eo_wref_del_safe(wref) eo_weak_unref(wref)
#define efl_wref_del_safe(wref) eo_weak_unref(wref)
/**
* @addtogroup Eo_Events Eo's Event Handling
@ -1057,7 +1057,7 @@ typedef void (*eo_key_data_free_func)(void *);
* anything about them.
* @internal
*/
EAPI const Eo_Event_Description *eo_base_legacy_only_event_description_get(const char *_event_name);
EAPI const Efl_Event_Description *efl_object_legacy_only_event_description_get(const char *_event_name);
/**
* @def EO_CALLBACK_PRIORITY_BEFORE
@ -1081,24 +1081,24 @@ EAPI const Eo_Event_Description *eo_base_legacy_only_event_description_get(const
* external symbols in it, because the addresses are only known at runtime.
*/
#define EO_CALLBACKS_ARRAY_DEFINE(Name, ...) \
static Eo_Callback_Array_Item * \
static Efl_Callback_Array_Item * \
Name(void) \
{ \
static Eo_Callback_Array_Item internal[sizeof ((Eo_Callback_Array_Item[]) { __VA_ARGS__ }) / \
sizeof (Eo_Callback_Array_Item) + \
static Efl_Callback_Array_Item internal[sizeof ((Efl_Callback_Array_Item[]) { __VA_ARGS__ }) / \
sizeof (Efl_Callback_Array_Item) + \
1] = { { 0, 0 } }; \
if (internal[0].desc == NULL) \
{ \
memcpy(internal, \
((Eo_Callback_Array_Item[]) { __VA_ARGS__, { NULL, NULL } }), \
sizeof (Eo_Callback_Array_Item) + \
sizeof ((Eo_Callback_Array_Item[]) { __VA_ARGS__ })); \
((Efl_Callback_Array_Item[]) { __VA_ARGS__, { NULL, NULL } }), \
sizeof (Efl_Callback_Array_Item) + \
sizeof ((Efl_Callback_Array_Item[]) { __VA_ARGS__ })); \
} \
return internal; \
}
/**
* @def eo_event_callback_add(obj, desc, cb, data)
* @def efl_event_callback_add(obj, desc, cb, data)
* Add a callback for an event.
* @param[in] desc The description of the event to listen to.
* @param[in] cb the callback to call.
@ -1106,24 +1106,24 @@ EAPI const Eo_Event_Description *eo_base_legacy_only_event_description_get(const
*
* callbacks of the same priority are called in reverse order of creation.
*
* @see eo_event_callback_priority_add()
* @see efl_event_callback_priority_add()
*/
#define eo_event_callback_add(obj, desc, cb, data) \
eo_event_callback_priority_add(obj, desc, \
#define efl_event_callback_add(obj, desc, cb, data) \
efl_event_callback_priority_add(obj, desc, \
EO_CALLBACK_PRIORITY_DEFAULT, cb, data)
/**
* @def eo_event_callback_array_add(obj, desc, cb, data)
* @def efl_event_callback_array_add(obj, desc, cb, data)
* Add a callback array for an event.
* @param[in] array an #Eo_Callback_Array_Item of events to listen to.
* @param[in] array an #Efl_Callback_Array_Item of events to listen to.
* @param[in] data additional data to pass to the callback.
*
* callbacks of the same priority are called in reverse order of creation.
*
* @see eo_event_callback_array_priority_add()
* @see efl_event_callback_array_priority_add()
*/
#define eo_event_callback_array_add(obj, array, data) \
eo_event_callback_array_priority_add(obj, array, \
#define efl_event_callback_array_add(obj, array, data) \
efl_event_callback_array_priority_add(obj, array, \
EO_CALLBACK_PRIORITY_DEFAULT, data)
/**

4
src/lib/eo/efl_class.eo Normal file
View File

@ -0,0 +1,4 @@
abstract Efl.Class ()
{
data: null;
}

View File

@ -1,7 +1,7 @@
interface Eo.Interface ()
interface Efl.Interface ()
{
[[An interface for other interfaces to inherit from.
This is useful when you want to create interfaces and mixins that expose
functions from a normal class, like for example @Eo.Base.constructor.]]
functions from a normal class, like for example @Efl.Object.constructor.]]
}

View File

@ -1,6 +1,6 @@
import eina_types;
struct Eo.Event.Description {
struct Efl.Event.Description {
[[This struct holds the description of a specific event.]]
name: string; [[name of the event.]]
unfreezable: bool; [[Eina_True if the event cannot be frozen.]]
@ -10,32 +10,32 @@ struct Eo.Event.Description {
struct Eo.Event {
[[Parameter passed in event callbacks holding extra event parameters]]
object: Eo.Base; [[The object the event was called on.]]
desc: ref(const(Eo.Event.Description)); [[The event description.]]
object: Efl.Object; [[The object the event was called on.]]
desc: ref(const(Efl.Event.Description)); [[The event description.]]
info: void_ptr; [[Extra event information passed by the event caller.]]
}
type Eo.Event_Cb: __builtin_event_cb; [[An event callback prototype.
type Efl.Event_Cb: __builtin_event_cb; [[An event callback prototype.
return $EO_CALLBACK_STOP to stop calling additional callbacks for the event, $EO_CALLBACK_CONTINUE to continue.]]
struct Eo.Callback_Array_Item {
struct Efl.Callback_Array_Item {
[[An item in an array of callback desc/func.
See also \@ref eo_event_callback_array_add.
See also \@ref efl_event_callback_array_add.
]]
desc: ref(const(Eo.Event.Description)); [[The event description.]]
func: Eo.Event_Cb; [[The callback function.]]
desc: ref(const(Efl.Event.Description)); [[The event description.]]
func: Efl.Event_Cb; [[The callback function.]]
}
struct Eo.Dbg_Info {
struct Efl.Dbg_Info {
[[The structure for the debug info used by Eo.]]
name: stringshare; [[The name of the part (stringshare).]]
value: generic_value; [[The value.]]
}
type Eo.Callback_Priority: short; [[Callback priority value. Range is -32k - 32k.
type Efl.Callback_Priority: short; [[Callback priority value. Range is -32k - 32k.
The lower the number, the higher the priority.
See \@ref EO_CALLBACK_PRIORITY_AFTER,
@ -43,9 +43,9 @@ type Eo.Callback_Priority: short; [[Callback priority value. Range is -32k - 32k
\@ref EO_CALLBACK_PRIORITY_DEFAULT
]]
abstract Eo.Base ()
abstract Efl.Object ()
{
eo_prefix: eo;
eo_prefix: efl;
methods {
@property parent {
@ -53,7 +53,7 @@ abstract Eo.Base ()
Parents keep references to their children so in order to
delete objects that have parents you need to set parent to
NULL or use eo_del() that does that for you (and also unrefs
NULL or use efl_del() that does that for you (and also unrefs
the object).
The Eo parent is conceptually user set. That means that a parent
@ -70,13 +70,13 @@ abstract Eo.Base ()
get {
}
values {
parent: Eo.Base @nullable; [[the new parent]]
parent: Efl.Object @nullable; [[the new parent]]
}
}
del @const {
[[Unrefs the object and reparents it to NULL.
Because eo_del() unrefs and reparents to NULL, it doesn't really delete the object.
Because efl_del() unrefs and reparents to NULL, it doesn't really delete the object.
This method accepts a const object for convenience, so all objects
could be passed to it easily.
@ -156,16 +156,16 @@ abstract Eo.Base ()
If this is not done the class cannot be found up in the object tree.
]]
params {
klass : const(Eo.Base); [[The class identifier to search for]]
klass : const(Efl.Object); [[The class identifier to search for]]
}
return : Eo.Base;
return : Efl.Object;
}
constructor {
[[Call the object's constructor.
Should not be used with #eo_do. Only use it with #eo_do_super.
]]
return: Eo.Base; [[The new object created, can be NULL if aborting]]
return: Efl.Object; [[The new object created, can be NULL if aborting]]
}
destructor {
[[Call the object's destructor.
@ -175,7 +175,7 @@ abstract Eo.Base ()
}
finalize {
[[Called at the end of #eo_add. Should not be called, just overridden.]]
return: Eo.Base; [[The new object created, can be NULL if aborting]]
return: Efl.Object; [[The new object created, can be NULL if aborting]]
}
name_find {
[[Find a child object with the given name and return it.
@ -188,7 +188,7 @@ abstract Eo.Base ()
params {
@in search: string; [[the name search string]]
}
return: Eo.Base; [[the first object found]]
return: Efl.Object; [[the first object found]]
}
wref_add {
[[Add a new weak reference to obj.
@ -200,13 +200,13 @@ abstract Eo.Base ()
being freed.
]]
params {
@in wref: ref(Eo.Base);
@in wref: ref(Efl.Object);
}
}
wref_del {
[[Delete the weak reference passed.]]
params {
@in wref: ref(Eo.Base);
@in wref: ref(Efl.Object);
}
}
@property key_data {
@ -244,12 +244,12 @@ abstract Eo.Base ()
}
set {
values {
objdata: const(Eo.Base); [[the object to set]]
objdata: const(Efl.Object); [[the object to set]]
}
}
get {
values {
objdata: Eo.Base; [[the object to set]]
objdata: Efl.Object; [[the object to set]]
}
}
}
@ -267,12 +267,12 @@ abstract Eo.Base ()
}
set {
values {
objdata: const(Eo.Base); [[the object to set]]
objdata: const(Efl.Object); [[the object to set]]
}
}
get {
values {
objdata: Eo.Base; [[the object to set]]
objdata: Efl.Object; [[the object to set]]
}
}
}
@ -325,9 +325,9 @@ abstract Eo.Base ()
]]
return: bool; [[Return true when the callback has been successfully added.]]
params {
@in desc: ref(const(Eo.Event.Description)); [[The description of the event to listen to]]
@in priority: Eo.Callback_Priority; [[The priority of the callback]]
@in cb: Eo.Event_Cb; [[the callback to call]]
@in desc: ref(const(Efl.Event.Description)); [[The description of the event to listen to]]
@in priority: Efl.Callback_Priority; [[The priority of the callback]]
@in cb: Efl.Event_Cb; [[the callback to call]]
@in data: const(void_ptr); [[additional data to pass to the callback]]
}
}
@ -335,8 +335,8 @@ abstract Eo.Base ()
[[Del a callback with a specific data associated to it for an event.]]
return: bool; [[Return true when the callback has been successfully removed.]]
params {
@in desc: ref(const(Eo.Event.Description)); [[The description of the event to listen to]]
@in func: Eo.Event_Cb; [[the callback to delete]]
@in desc: ref(const(Efl.Event.Description)); [[The description of the event to listen to]]
@in func: Efl.Event_Cb; [[the callback to delete]]
@in user_data: const(void_ptr); [[The data to compare]]
}
}
@ -348,8 +348,8 @@ abstract Eo.Base ()
]]
return: bool; [[Return true when the callback has been successfully added.]]
params {
@in array: ref(const(Eo.Callback_Array_Item)); [[an #Eo_Callback_Array_Item of events to listen to]]
@in priority: Eo.Callback_Priority; [[The priority of the callback]]
@in array: ref(const(Efl.Callback_Array_Item)); [[an #Efl_Callback_Array_Item of events to listen to]]
@in priority: Efl.Callback_Priority; [[The priority of the callback]]
@in data: const(void_ptr); [[additional data to pass to the callback]]
}
}
@ -359,14 +359,14 @@ abstract Eo.Base ()
]]
return: bool; [[Return true when the callback has been successfully removed.]]
params {
@in array: ref(const(Eo.Callback_Array_Item)); [[an #Eo_Callback_Array_Item of events to listen to]]
@in array: ref(const(Efl.Callback_Array_Item)); [[an #Efl_Callback_Array_Item of events to listen to]]
@in user_data: const(void_ptr); [[The data to compare]]
}
}
event_callback_call {
[[Call the callbacks for an event of an object.]]
params {
@in desc: ref(const(Eo.Event.Description)); [[The description of the event to call]]
@in desc: ref(const(Efl.Event.Description)); [[The description of the event to call]]
@in event_info: void_ptr; [[Extra event info to pass to the callbacks]]
}
return: bool; [[$false if one of the callbacks aborted the call,
@ -385,26 +385,26 @@ abstract Eo.Base ()
event_callback_forwarder_add {
[[Add an event callback forwarder for an event and an object.]]
params {
@in desc: ref(const(Eo.Event.Description)); [[The description of the event to listen to]]
@in new_obj: Eo.Base; [[The object to emit events from]]
@in desc: ref(const(Efl.Event.Description)); [[The description of the event to listen to]]
@in new_obj: Efl.Object; [[The object to emit events from]]
}
}
event_callback_forwarder_del {
[[Remove an event callback forwarder for an event and an object.]]
params {
@in desc: ref(const(Eo.Event.Description)); [[The description of the event to listen to]]
@in new_obj: Eo.Base; [[The object to emit events from]]
@in desc: ref(const(Efl.Event.Description)); [[The description of the event to listen to]]
@in new_obj: Efl.Object; [[The object to emit events from]]
}
}
dbg_info_get {
[[Get dbg information from the object.]]
params {
@in root_node: ref(Eo.Dbg_Info); [[node of the tree]]
@in root_node: ref(Efl.Dbg_Info); [[node of the tree]]
}
}
children_iterator_new {
[[Get an iterator on all childrens]]
return: free(own(iterator<Eo.Base>), eina_iterator_free) @warn_unused;
return: free(own(iterator<Efl.Object>), eina_iterator_free) @warn_unused;
}
composite_attach {
[[Make an object a composite object of another.
@ -416,7 +416,7 @@ abstract Eo.Base ()
See @.composite_detach, @.composite_part_is.
]]
params {
@in comp_obj: Eo.Base; [[the object that will be used to composite the parent.]]
@in comp_obj: Efl.Object; [[the object that will be used to composite the parent.]]
}
return: bool; [[$true if successful. $false otherwise.]]
}
@ -428,7 +428,7 @@ abstract Eo.Base ()
See @.composite_attach, @.composite_part_is.
]]
params {
@in comp_obj: Eo.Base; [[the object that will be removed from the parent.]]
@in comp_obj: Efl.Object; [[the object that will be removed from the parent.]]
}
return: bool; [[$true if successful. $false otherwise.]]
}

View File

@ -1,4 +1,4 @@
abstract Eo.Override ()
abstract Efl.Object.Override ()
{
[[A special class to pass to #eo_super() when using #eo_override()

View File

@ -13,7 +13,7 @@
#include "eo_private.h"
#include "eo_add_fallback.h"
#include "eo_override.eo.c"
#include "efl_object_override.eo.c"
#define EO_CLASS_IDS_FIRST 1
#define EO_OP_IDS_FIRST 1
@ -23,7 +23,7 @@ EAPI Eina_Spinlock _eo_class_creation_lock;
EAPI unsigned int _eo_init_generation = 1;
int _eo_log_dom = -1;
static _Eo_Class **_eo_classes = NULL;
static _Efl_Class **_eo_classes = NULL;
static Eo_Id _eo_classes_last_id = 0;
static Eo_Id _eo_classes_alloc = 0;
static int _eo_init_count = 0;
@ -35,8 +35,8 @@ static size_t _eo_sz = 0;
static size_t _eo_class_sz = 0;
static void _eo_condtor_reset(_Eo_Object *obj);
static inline void *_eo_data_scope_get(const _Eo_Object *obj, const _Eo_Class *klass);
static inline void *_eo_data_xref_internal(const char *file, int line, _Eo_Object *obj, const _Eo_Class *klass, const _Eo_Object *ref_obj);
static inline void *_eo_data_scope_get(const _Eo_Object *obj, const _Efl_Class *klass);
static inline void *_eo_data_xref_internal(const char *file, int line, _Eo_Object *obj, const _Efl_Class *klass, const _Eo_Object *ref_obj);
static inline void _eo_data_xunref_internal(_Eo_Object *obj, void *data, const _Eo_Object *ref_obj);
/* Start of Dich */
@ -53,7 +53,7 @@ static inline void _eo_data_xunref_internal(_Eo_Object *obj, void *data, const _
* substraction at compile time. */
#define _UNMASK_ID(id) ((id) - MASK_CLASS_TAG)
#define ID_CLASS_GET(id) ({ \
(_Eo_Class *) (((_UNMASK_ID(id) <= _eo_classes_last_id) && (_UNMASK_ID(id) > 0)) ? \
(_Efl_Class *) (((_UNMASK_ID(id) <= _eo_classes_last_id) && (_UNMASK_ID(id) > 0)) ? \
(_eo_classes[_UNMASK_ID(id) - 1]) : NULL); \
})
@ -106,10 +106,10 @@ _vtable_func_get(const Eo_Vtable *vtable, Eo_Op op)
}
/* XXX: Only used for a debug message below. Doesn't matter that it's slow. */
static const _Eo_Class *
static const _Efl_Class *
_eo_op_class_get(Eo_Op op)
{
_Eo_Class **itr = _eo_classes;
_Efl_Class **itr = _eo_classes;
int mid, max, min;
min = 0;
@ -130,7 +130,7 @@ _eo_op_class_get(Eo_Op op)
}
static inline Eina_Bool
_vtable_func_set(Eo_Vtable *vtable, const _Eo_Class *klass, Eo_Op op, eo_op_func_type func)
_vtable_func_set(Eo_Vtable *vtable, const _Efl_Class *klass, Eo_Op op, eo_op_func_type func)
{
op_type_funcs *fsrc;
size_t idx1 = DICH_CHAIN1(op);
@ -139,7 +139,7 @@ _vtable_func_set(Eo_Vtable *vtable, const _Eo_Class *klass, Eo_Op op, eo_op_func
fsrc = &chain1->funcs[DICH_CHAIN_LAST(op)];
if (fsrc->src == klass)
{
const _Eo_Class *op_kls = _eo_op_class_get(op);
const _Efl_Class *op_kls = _eo_op_class_get(op);
ERR("Class '%s': Overriding already set func %p for op %d (%s) with %p.",
klass->desc->name, fsrc->func, op, op_kls->desc->name, func);
return EINA_FALSE;
@ -189,18 +189,18 @@ _eo_is_a_class(const Eo *eo_id)
return !!(oid & MASK_CLASS_TAG);
}
static inline _Eo_Class *
_eo_class_pointer_get(const Eo_Class *klass_id)
static inline _Efl_Class *
_eo_class_pointer_get(const Efl_Class *klass_id)
{
#ifdef HAVE_EO_ID
return ID_CLASS_GET((Eo_Id)klass_id);
#else
return (_Eo_Class *) klass_id;
return (_Efl_Class *) klass_id;
#endif
}
static const char *
_eo_op_desc_name_get(const Eo_Op_Description *desc)
_eo_op_desc_name_get(const Efl_Op_Description *desc)
{
static const char *fct_name = "unknown";
@ -222,9 +222,9 @@ _eo_op_desc_name_get(const Eo_Op_Description *desc)
}
static inline const op_type_funcs *
_eo_kls_itr_next(const _Eo_Class *orig_kls, const _Eo_Class *cur_klass, Eo_Op op)
_eo_kls_itr_next(const _Efl_Class *orig_kls, const _Efl_Class *cur_klass, Eo_Op op)
{
const _Eo_Class **kls_itr = NULL;
const _Efl_Class **kls_itr = NULL;
/* Find the kls itr. */
kls_itr = orig_kls->mro;
@ -251,11 +251,11 @@ _eo_kls_itr_next(const _Eo_Class *orig_kls, const _Eo_Class *cur_klass, Eo_Op op
/************************************ EO ************************************/
static const _Eo_Class *_super_class = NULL;
static const _Efl_Class *_super_class = NULL;
static Eina_Spinlock _super_class_lock;
EAPI Eo *
eo_super(const Eo *obj, const Eo_Class *cur_klass)
eo_super(const Eo *obj, const Efl_Class *cur_klass)
{
EO_CLASS_POINTER_RETURN_VAL(cur_klass, klass, NULL);
@ -269,8 +269,8 @@ eo_super(const Eo *obj, const Eo_Class *cur_klass)
EAPI Eina_Bool
_eo_call_resolve(Eo *eo_id, const char *func_name, Eo_Op_Call_Data *call, Eo_Call_Cache *cache, const char *file, int line)
{
const _Eo_Class *klass, *inputklass, *main_klass;
const _Eo_Class *cur_klass = NULL;
const _Efl_Class *klass, *inputklass, *main_klass;
const _Efl_Class *cur_klass = NULL;
_Eo_Object *obj = NULL;
const Eo_Vtable *vtable = NULL;
const op_type_funcs *func;
@ -301,9 +301,9 @@ _eo_call_resolve(Eo *eo_id, const char *func_name, Eo_Op_Call_Data *call, Eo_Cal
vtable = obj->vtable;
if (_obj_is_override(obj) && cur_klass &&
(_eo_class_id_get(cur_klass) == EO_OVERRIDE_CLASS))
(_eo_class_id_get(cur_klass) == EFL_OBJECT_OVERRIDE_CLASS))
{
/* Doing a eo_super(obj, EO_OVERRIDE_CLASS) should result in calling
/* Doing a eo_super(obj, EFL_OBJECT_OVERRIDE_CLASS) should result in calling
* as if it's a normal class. */
vtable = &klass->vtable;
cur_klass = NULL;
@ -494,13 +494,13 @@ _eo_api_func_equal(const void *api_func1, const void *api_func2)
/* api_func should be the pointer to the function on all platforms except windows,
* in which it should be the the name of the function (string).
*/
static inline const Eo_Op_Description *
_eo_api_desc_get(const void *api_func, const _Eo_Class *klass, const _Eo_Class **extns)
static inline const Efl_Op_Description *
_eo_api_desc_get(const void *api_func, const _Efl_Class *klass, const _Efl_Class **extns)
{
const _Eo_Class *cur_klass;
const _Eo_Class **kls_itr = NULL;
const Eo_Op_Description *op_desc;
const Eo_Op_Description *op_descs;
const _Efl_Class *cur_klass;
const _Efl_Class **kls_itr = NULL;
const Efl_Op_Description *op_desc;
const Efl_Op_Description *op_descs;
if (klass)
{
@ -555,13 +555,13 @@ _eo_api_op_id_get(const void *api_func)
/* klass is the klass we are working on. hierarchy_klass is the class whe should
* use when validating. */
static Eina_Bool
_eo_class_funcs_set(Eo_Vtable *vtable, const Eo_Ops *ops, const _Eo_Class *hierarchy_klass, const _Eo_Class *klass, Eina_Bool override_only)
_eo_class_funcs_set(Eo_Vtable *vtable, const Eo_Ops *ops, const _Efl_Class *hierarchy_klass, const _Efl_Class *klass, Eina_Bool override_only)
{
unsigned int i;
int op_id;
const void *last_api_func;
const Eo_Op_Description *op_desc;
const Eo_Op_Description *op_descs;
const Efl_Op_Description *op_desc;
const Efl_Op_Description *op_descs;
op_id = hierarchy_klass->base_id;
op_descs = ops->descs;
@ -610,7 +610,7 @@ _eo_class_funcs_set(Eo_Vtable *vtable, const Eo_Ops *ops, const _Eo_Class *hiera
}
else if ((op_desc->op_type == EO_OP_TYPE_REGULAR_OVERRIDE) || (op_desc->op_type == EO_OP_TYPE_CLASS_OVERRIDE))
{
const Eo_Op_Description *api_desc;
const Efl_Op_Description *api_desc;
if (override_only)
{
api_desc = _eo_api_desc_get(op_desc->api_func, hierarchy_klass, NULL);
@ -649,7 +649,7 @@ _eo_class_funcs_set(Eo_Vtable *vtable, const Eo_Ops *ops, const _Eo_Class *hiera
}
EAPI Eo *
_eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo *parent_id, Eina_Bool ref EINA_UNUSED, Eina_Bool is_fallback)
_eo_add_internal_start(const char *file, int line, const Efl_Class *klass_id, Eo *parent_id, Eina_Bool ref EINA_UNUSED, Eina_Bool is_fallback)
{
_Eo_Object *obj;
Eo_Stack_Frame *fptr = NULL;
@ -700,10 +700,10 @@ _eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo
eo_ref(eo_id);
/* Reference for the parent if is_ref is done in _eo_add_end */
eo_parent_set(eo_id, parent_id);
efl_parent_set(eo_id, parent_id);
/* eo_id can change here. Freeing is done on the resolved object. */
eo_id = eo_constructor(eo_id);
eo_id = efl_constructor(eo_id);
if (!eo_id)
{
ERR("Object of class '%s' - Error while constructing object",
@ -711,7 +711,7 @@ _eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo
/* We have two refs at this point. */
_eo_unref(obj);
eo_del((Eo *) obj->header.id);
efl_del((Eo *) obj->header.id);
return NULL;
}
else if (eo_id != _eo_obj_id_get(obj))
@ -719,7 +719,7 @@ _eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo
EO_OBJ_POINTER_RETURN_VAL(eo_id, new_obj, NULL);
/* We have two refs at this point. */
_eo_unref(obj);
eo_del((Eo *) obj->header.id);
efl_del((Eo *) obj->header.id);
_eo_ref(new_obj);
}
@ -739,7 +739,7 @@ _eo_add_internal_end(Eo *eo_id, Eo *finalized_id)
if (!obj->condtor_done)
{
const _Eo_Class *klass = obj->klass;
const _Efl_Class *klass = obj->klass;
ERR("Object of class '%s' - Not all of the object constructors have been executed.",
klass->desc->name);
@ -770,17 +770,17 @@ _eo_add_internal_end(Eo *eo_id, Eo *finalized_id)
cleanup:
_eo_unref(obj);
eo_del((Eo *) obj->header.id);
efl_del((Eo *) obj->header.id);
return NULL;
}
EAPI Eo *
_eo_add_end(Eo *eo_id, Eina_Bool is_ref, Eina_Bool is_fallback)
{
Eo *ret = eo_finalize(eo_id);
Eo *ret = efl_finalize(eo_id);
ret = _eo_add_internal_end(eo_id, ret);
if (is_ref && eo_parent_get(eo_id))
if (is_ref && efl_parent_get(eo_id))
{
eo_ref(eo_id);
}
@ -795,7 +795,7 @@ _eo_add_end(Eo *eo_id, Eina_Bool is_ref, Eina_Bool is_fallback)
/*****************************************************************************/
EAPI const Eo_Class *
EAPI const Efl_Class *
eo_class_get(const Eo *eo_id)
{
if (_eo_is_a_class(eo_id))
@ -810,9 +810,9 @@ eo_class_get(const Eo *eo_id)
}
EAPI const char *
eo_class_name_get(const Eo_Class *eo_id)
eo_class_name_get(const Efl_Class *eo_id)
{
const _Eo_Class *klass;
const _Efl_Class *klass;
if (_eo_is_a_class(eo_id))
{
@ -836,9 +836,9 @@ _vtable_init(Eo_Vtable *vtable, size_t size)
}
static void
_eo_class_base_op_init(_Eo_Class *klass)
_eo_class_base_op_init(_Efl_Class *klass)
{
const Eo_Class_Description *desc = klass->desc;
const Efl_Class_Description *desc = klass->desc;
klass->base_id = _eo_ops_last_id;
@ -849,9 +849,9 @@ _eo_class_base_op_init(_Eo_Class *klass)
#ifdef EO_DEBUG
static Eina_Bool
_eo_class_mro_has(const _Eo_Class *klass, const _Eo_Class *find)
_eo_class_mro_has(const _Efl_Class *klass, const _Efl_Class *find)
{
const _Eo_Class **itr;
const _Efl_Class **itr;
for (itr = klass->mro ; *itr ; itr++)
{
if (*itr == find)
@ -892,7 +892,7 @@ _eo_class_list_remove_duplicates(Eina_List* list)
}
static Eina_List *
_eo_class_mro_add(Eina_List *mro, const _Eo_Class *klass)
_eo_class_mro_add(Eina_List *mro, const _Efl_Class *klass)
{
if (!klass)
return mro;
@ -901,11 +901,11 @@ _eo_class_mro_add(Eina_List *mro, const _Eo_Class *klass)
/* Recursively add MIXINS extensions. */
{
const _Eo_Class **extn_itr;
const _Efl_Class **extn_itr;
for (extn_itr = klass->extensions ; *extn_itr ; extn_itr++)
{
const _Eo_Class *extn = *extn_itr;
const _Efl_Class *extn = *extn_itr;
if (extn->desc->type == EO_CLASS_TYPE_MIXIN)
mro = _eo_class_mro_add(mro, extn);
}
@ -917,12 +917,12 @@ _eo_class_mro_add(Eina_List *mro, const _Eo_Class *klass)
}
static Eina_List *
_eo_class_mro_init(const Eo_Class_Description *desc, const _Eo_Class *parent, Eina_List *extensions)
_eo_class_mro_init(const Efl_Class_Description *desc, const _Efl_Class *parent, Eina_List *extensions)
{
Eina_List *mro = NULL;
Eina_List *extn_itr = NULL;
Eina_List *extn_pos = NULL;
const _Eo_Class *extn = NULL;
const _Efl_Class *extn = NULL;
/* Add MIXINS extensions. */
EINA_LIST_FOREACH(extensions, extn_itr, extn)
@ -969,7 +969,7 @@ _eo_class_mro_init(const Eo_Class_Description *desc, const _Eo_Class *parent, Ei
}
static void
_eo_class_constructor(_Eo_Class *klass)
_eo_class_constructor(_Efl_Class *klass)
{
klass->constructed = EINA_TRUE;
@ -978,7 +978,7 @@ _eo_class_constructor(_Eo_Class *klass)
}
static void
eo_class_free(_Eo_Class *klass)
eo_class_free(_Efl_Class *klass)
{
void *data;
@ -1015,7 +1015,7 @@ _eo_classes_release(void)
#ifdef HAVE_MMAP
size_t size;
size = _eo_classes_alloc * sizeof(_Eo_Class *);
size = _eo_classes_alloc * sizeof(_Efl_Class *);
if (_eo_classes) munmap(_eo_classes, size);
#else
free(_eo_classes);
@ -1033,10 +1033,10 @@ _eo_classes_expand(void)
_eo_classes_last_id++;
if (_eo_classes_last_id <= _eo_classes_alloc) return;
psize = _eo_classes_alloc * sizeof(_Eo_Class *);
psize = _eo_classes_alloc * sizeof(_Efl_Class *);
#ifdef HAVE_MMAP
_eo_classes_alloc += (MEM_PAGE_SIZE / sizeof(_Eo_Class *));
newsize = _eo_classes_alloc * sizeof(_Eo_Class *);
_eo_classes_alloc += (MEM_PAGE_SIZE / sizeof(_Efl_Class *));
newsize = _eo_classes_alloc * sizeof(_Efl_Class *);
ptr = mmap(NULL, newsize, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANON, -1, 0);
if (ptr == MAP_FAILED)
@ -1048,7 +1048,7 @@ _eo_classes_expand(void)
if (_eo_classes) munmap(_eo_classes, psize);
#else
_eo_classes_alloc += 128;
newsize = _eo_classes_alloc * sizeof(_Eo_Class *);
newsize = _eo_classes_alloc * sizeof(_Efl_Class *);
ptr = realloc(_eo_classes, newsize);
if (!ptr)
{
@ -1057,13 +1057,13 @@ _eo_classes_expand(void)
}
#endif
memset(ptr + psize, 0, newsize - psize);
_eo_classes = (_Eo_Class **)ptr;
_eo_classes = (_Efl_Class **)ptr;
}
EAPI const Eo_Class *
eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
EAPI const Efl_Class *
eo_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...)
{
_Eo_Class *klass;
_Efl_Class *klass;
va_list p_list;
size_t extn_sz, mro_sz, mixins_sz;
Eina_List *extn_list, *mro, *mixins;
@ -1071,7 +1071,7 @@ 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);
_Eo_Class *parent = _eo_class_pointer_get(parent_id);
_Efl_Class *parent = _eo_class_pointer_get(parent_id);
#ifndef HAVE_EO_ID
if (parent && !EINA_MAGIC_CHECK((Eo_Header *) parent, EO_CLASS_EINA_MAGIC))
{
@ -1119,7 +1119,7 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
{
DBG("Started building extensions list for class '%s'", desc->name);
extn_list = NULL;
const _Eo_Class *extn = NULL;
const _Efl_Class *extn = NULL;
const Eo_Id *extn_id = NULL;
va_start(p_list, parent_id);
@ -1127,7 +1127,7 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
extn_id = va_arg(p_list, Eo_Id *);
while (extn_id)
{
extn = _eo_class_pointer_get((Eo_Class *)extn_id);
extn = _eo_class_pointer_get((Efl_Class *)extn_id);
switch (extn->desc->type)
{
case EO_CLASS_TYPE_REGULAR_NO_INSTANT:
@ -1145,7 +1145,7 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
extn_list = _eo_class_list_remove_duplicates(extn_list);
extn_sz = sizeof(_Eo_Class *) * (eina_list_count(extn_list) + 1);
extn_sz = sizeof(_Efl_Class *) * (eina_list_count(extn_list) + 1);
DBG("Finished building extensions list for class '%s'", desc->name);
}
@ -1161,7 +1161,7 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
return NULL;
}
mro_sz = sizeof(_Eo_Class *) * (eina_list_count(mro) + 1);
mro_sz = sizeof(_Efl_Class *) * (eina_list_count(mro) + 1);
DBG("Finished building MRO list for class '%s'", desc->name);
}
@ -1169,7 +1169,7 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
/* Prepare mixins list */
{
Eina_List *itr;
const _Eo_Class *kls_itr;
const _Efl_Class *kls_itr;
DBG("Started building Mixins list for class '%s'", desc->name);
@ -1196,8 +1196,8 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
eina_spinlock_new(&klass->iterators.trash_lock);
klass->parent = parent;
klass->desc = desc;
klass->extensions = (const _Eo_Class **) ((char *) klass + _eo_class_sz);
klass->mro = (const _Eo_Class **) ((char *) klass->extensions + extn_sz);
klass->extensions = (const _Efl_Class **) ((char *) klass + _eo_class_sz);
klass->mro = (const _Efl_Class **) ((char *) klass->extensions + extn_sz);
klass->extn_data_off = (Eo_Extension_Data_Offset *) ((char *) klass->mro + mro_sz);
if (klass->parent)
{
@ -1218,8 +1218,8 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
/* Copy the extensions and free the list */
{
const _Eo_Class *extn = NULL;
const _Eo_Class **extn_itr = klass->extensions;
const _Efl_Class *extn = NULL;
const _Efl_Class **extn_itr = klass->extensions;
EINA_LIST_FREE(extn_list, extn)
{
*(extn_itr++) = extn;
@ -1231,8 +1231,8 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
/* Copy the mro and free the list. */
{
const _Eo_Class *kls_itr = NULL;
const _Eo_Class **mro_itr = klass->mro;
const _Efl_Class *kls_itr = NULL;
const _Efl_Class **mro_itr = klass->mro;
EINA_LIST_FREE(mro, kls_itr)
{
*(mro_itr++) = kls_itr;
@ -1248,7 +1248,7 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
/* Feed the mixins data offsets and free the mixins list. */
{
const _Eo_Class *kls_itr = NULL;
const _Efl_Class *kls_itr = NULL;
Eo_Extension_Data_Offset *extn_data_itr = klass->extn_data_off;
EINA_LIST_FREE(mixins, kls_itr)
{
@ -1275,7 +1275,7 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
/* Flatten the function array */
{
const _Eo_Class **mro_itr = klass->mro;
const _Efl_Class **mro_itr = klass->mro;
for ( ; *mro_itr ; mro_itr++)
;
@ -1288,11 +1288,11 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
/* Mark which classes we implement */
{
const _Eo_Class **extn_itr;
const _Efl_Class **extn_itr;
for (extn_itr = klass->extensions ; *extn_itr ; extn_itr++)
{
const _Eo_Class *extn = *extn_itr;
const _Efl_Class *extn = *extn_itr;
/* Set it in the dich. */
_vtable_func_set(&klass->vtable, klass, extn->base_id +
extn->desc->ops.count, _eo_class_isa_func);
@ -1341,7 +1341,7 @@ EAPI Eina_Bool
eo_override(Eo *eo_id, const Eo_Ops *ops)
{
EO_OBJ_POINTER_RETURN_VAL(eo_id, obj, EINA_FALSE);
EO_CLASS_POINTER_RETURN_VAL(EO_OVERRIDE_CLASS, klass, EINA_FALSE);
EO_CLASS_POINTER_RETURN_VAL(EFL_OBJECT_OVERRIDE_CLASS, klass, EINA_FALSE);
Eo_Vtable *previous = obj->vtable;
if (!ops)
@ -1377,7 +1377,7 @@ eo_override(Eo *eo_id, const Eo_Ops *ops)
}
EAPI Eina_Bool
eo_isa(const Eo *eo_id, const Eo_Class *klass_id)
eo_isa(const Eo *eo_id, const Efl_Class *klass_id)
{
EO_OBJ_POINTER_RETURN_VAL(eo_id, obj, EINA_FALSE);
EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, EINA_FALSE);
@ -1496,7 +1496,7 @@ ___eo_ref2_reset(const Eo *obj_id)
EAPI void
eo_del_intercept_set(Eo *obj_id, Eo_Del_Intercept del_intercept_func)
efl_del_intercept_set(Eo *obj_id, Eo_Del_Intercept del_intercept_func)
{
EO_OBJ_POINTER_RETURN(obj_id, obj);
@ -1504,7 +1504,7 @@ eo_del_intercept_set(Eo *obj_id, Eo_Del_Intercept del_intercept_func)
}
EAPI Eo_Del_Intercept
eo_del_intercept_get(const Eo *obj_id)
efl_del_intercept_get(const Eo *obj_id)
{
EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, NULL);
@ -1525,7 +1525,7 @@ _eo_condtor_done(Eo *obj_id)
}
static inline void *
_eo_data_scope_safe_get(const _Eo_Object *obj, const _Eo_Class *klass)
_eo_data_scope_safe_get(const _Eo_Object *obj, const _Efl_Class *klass)
{
if (EINA_LIKELY(klass->desc->data_size > 0))
{
@ -1536,7 +1536,7 @@ _eo_data_scope_safe_get(const _Eo_Object *obj, const _Eo_Class *klass)
}
static inline void *
_eo_data_scope_get(const _Eo_Object *obj, const _Eo_Class *klass)
_eo_data_scope_get(const _Eo_Object *obj, const _Efl_Class *klass)
{
if (EINA_LIKELY(klass->desc->type != EO_CLASS_TYPE_MIXIN))
return ((char *) obj) + klass->data_offset;
@ -1564,7 +1564,7 @@ _eo_data_scope_get(const _Eo_Object *obj, const _Eo_Class *klass)
}
static inline void *
_eo_data_xref_internal(const char *file, int line, _Eo_Object *obj, const _Eo_Class *klass, const _Eo_Object *ref_obj)
_eo_data_xref_internal(const char *file, int line, _Eo_Object *obj, const _Efl_Class *klass, const _Eo_Object *ref_obj)
{
void *data = NULL;
if (klass != NULL)
@ -1592,7 +1592,7 @@ static inline void
_eo_data_xunref_internal(_Eo_Object *obj, void *data, const _Eo_Object *ref_obj)
{
#ifdef EO_DEBUG
const _Eo_Class *klass = obj->klass;
const _Efl_Class *klass = obj->klass;
Eina_Bool in_range = (((char *)data >= (((char *) obj) + _eo_sz)) &&
((char *)data < (((char *) obj) + klass->obj_size)));
if (!in_range)
@ -1634,7 +1634,7 @@ _eo_data_xunref_internal(_Eo_Object *obj, void *data, const _Eo_Object *ref_obj)
}
EAPI void *
eo_data_scope_get(const Eo *obj_id, const Eo_Class *klass_id)
eo_data_scope_get(const Eo *obj_id, const Efl_Class *klass_id)
{
void *ret;
EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, NULL);
@ -1661,12 +1661,12 @@ eo_data_scope_get(const Eo *obj_id, const Eo_Class *klass_id)
}
EAPI void *
eo_data_xref_internal(const char *file, int line, const Eo *obj_id, const Eo_Class *klass_id, const Eo *ref_obj_id)
eo_data_xref_internal(const char *file, int line, const Eo *obj_id, const Efl_Class *klass_id, const Eo *ref_obj_id)
{
void *ret;
EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, NULL);
EO_OBJ_POINTER_RETURN_VAL(ref_obj_id, ref_obj, NULL);
_Eo_Class *klass = NULL;
_Efl_Class *klass = NULL;
if (klass_id)
{
EO_CLASS_POINTER_RETURN_VAL(klass_id, klass2, NULL);
@ -1711,7 +1711,7 @@ eo_init(void)
eina_init();
_eo_sz = EO_ALIGN_SIZE(sizeof(_Eo_Object));
_eo_class_sz = EO_ALIGN_SIZE(sizeof(_Eo_Class));
_eo_class_sz = EO_ALIGN_SIZE(sizeof(_Efl_Class));
_eo_classes = NULL;
_eo_classes_last_id = EO_CLASS_IDS_FIRST - 1;
@ -1775,7 +1775,7 @@ EAPI Eina_Bool
eo_shutdown(void)
{
size_t i;
_Eo_Class **cls_itr = _eo_classes + _eo_classes_last_id - 1;
_Efl_Class **cls_itr = _eo_classes + _eo_classes_last_id - 1;
if (--_eo_init_count > 0)
return EINA_TRUE;

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +0,0 @@
abstract Eo.Class ()
{
data: null;
}

View File

@ -4,5 +4,5 @@
#include "Eo.h"
#include "eo_class.eo.c"
#include "eo_interface.eo.c"
#include "efl_class.eo.c"
#include "efl_interface.eo.c"

View File

@ -9,7 +9,7 @@
#define EO_FREED_EINA_MAGIC 0xa186bb32
#define EO_FREED_EINA_MAGIC_STR "Eo - Freed object"
#define EO_CLASS_EINA_MAGIC 0xa186ba32
#define EO_CLASS_EINA_MAGIC_STR "Eo Class"
#define EO_CLASS_EINA_MAGIC_STR "Efl Class"
#define EO_MAGIC_RETURN_VAL(d, magic, ret) \
do { \
@ -58,7 +58,7 @@ extern int _eo_log_dom;
#define DBG(...) EINA_LOG_DOM_DBG(_eo_log_dom, __VA_ARGS__)
typedef uintptr_t Eo_Id;
typedef struct _Eo_Class _Eo_Class;
typedef struct _Efl_Class _Eo_Class;
typedef struct _Eo_Header Eo_Header;
/* Retrieves the pointer to the object from the id */
@ -98,7 +98,7 @@ struct _Eo_Object
{
Eo_Header header;
EINA_INLIST;
const _Eo_Class *klass;
const _Efl_Class *klass;
#ifdef EO_DEBUG
Eina_Inlist *xrefs;
Eina_Inlist *data_xrefs;
@ -129,7 +129,7 @@ typedef void (*eo_op_func_type)(Eo *, void *class_data, va_list *list);
typedef struct
{
eo_op_func_type func;
const _Eo_Class *src;
const _Efl_Class *src;
} op_type_funcs;
struct _Dich_Chain1
@ -139,23 +139,23 @@ struct _Dich_Chain1
typedef struct
{
const _Eo_Class *klass;
const _Efl_Class *klass;
size_t offset;
} Eo_Extension_Data_Offset;
struct _Eo_Class
struct _Efl_Class
{
Eo_Header header;
const _Eo_Class *parent;
const Eo_Class_Description *desc;
const _Efl_Class *parent;
const Efl_Class_Description *desc;
Eo_Vtable vtable;
const _Eo_Class **extensions;
const _Efl_Class **extensions;
Eo_Extension_Data_Offset *extn_data_off;
const _Eo_Class **mro;
const _Efl_Class **mro;
/* cached object for faster allocation */
struct {
@ -200,7 +200,7 @@ Eo *_eo_header_id_get(const Eo_Header *header)
}
static inline
Eo_Class *_eo_class_id_get(const _Eo_Class *klass)
Efl_Class *_eo_class_id_get(const _Eo_Class *klass)
{
return _eo_header_id_get((Eo_Header *) klass);
}
@ -218,18 +218,18 @@ _eo_condtor_reset(_Eo_Object *obj)
}
static inline void
_eo_del_internal(const char *file, int line, _Eo_Object *obj)
_efl_del_internal(const char *file, int line, _Eo_Object *obj)
{
/* We need that for the event callbacks that may ref/unref. */
obj->refcount++;
const _Eo_Class *klass = obj->klass;
const _Efl_Class *klass = obj->klass;
eo_event_callback_call(_eo_obj_id_get(obj), EO_EVENT_DEL, NULL);
efl_event_callback_call(_eo_obj_id_get(obj), EFL_EVENT_DEL, NULL);
_eo_condtor_reset(obj);
eo_destructor(_eo_obj_id_get(obj));
efl_destructor(_eo_obj_id_get(obj));
if (!obj->condtor_done)
{
@ -243,7 +243,7 @@ _eo_del_internal(const char *file, int line, _Eo_Object *obj)
Eo *emb_obj;
EINA_LIST_FOREACH_SAFE(obj->composite_objects, itr, itr_n, emb_obj)
{
eo_composite_detach(_eo_obj_id_get(obj), emb_obj);
efl_composite_detach(_eo_obj_id_get(obj), emb_obj);
}
}
@ -260,7 +260,7 @@ _obj_is_override(_Eo_Object *obj)
static inline void
_eo_free(_Eo_Object *obj)
{
_Eo_Class *klass = (_Eo_Class*) obj->klass;
_Efl_Class *klass = (_Eo_Class*) obj->klass;
#ifdef EO_DEBUG
if (obj->datarefcount)
@ -331,7 +331,7 @@ _eo_unref(_Eo_Object *obj)
obj->del_triggered = EINA_TRUE;
_eo_del_internal(__FILE__, __LINE__, obj);
_efl_del_internal(__FILE__, __LINE__, obj);
#ifdef EO_DEBUG
/* If for some reason it's not empty, clear it. */
while (obj->xrefs)

View File

@ -46,7 +46,7 @@ void _eo_pointer_error(const char *msg);
} while (0)
#define EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, ret) \
_Eo_Class *klass; \
_Efl_Class *klass; \
do { \
if (!klass_id) return ret; \
klass = _eo_class_pointer_get(klass_id); \
@ -57,7 +57,7 @@ void _eo_pointer_error(const char *msg);
} while (0)
#define EO_CLASS_POINTER_RETURN(klass_id, klass) \
_Eo_Class *klass; \
_Efl_Class *klass; \
do { \
if (!klass_id) return; \
klass = _eo_class_pointer_get(klass_id); \
@ -96,7 +96,7 @@ void _eo_pointer_error(const char *msg);
} while (0)
#define EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, ret) \
_Eo_Class *klass; \
_Efl_Class *klass; \
do { \
klass = _eo_class_pointer_get(klass_id); \
if (!klass) return (ret); \
@ -104,7 +104,7 @@ void _eo_pointer_error(const char *msg);
} while (0)
#define EO_CLASS_POINTER_RETURN(klass_id, klass) \
_Eo_Class *klass; \
_Efl_Class *klass; \
do { \
klass = _eo_class_pointer_get(klass_id); \
if (!klass) return; \