diff --git a/src/Makefile_Eo.am b/src/Makefile_Eo.am index ab2435073c..b0d15bd1bc 100644 --- a/src/Makefile_Eo.am +++ b/src/Makefile_Eo.am @@ -10,6 +10,7 @@ lib_eo_libeo_la_SOURCES = \ lib/eo/eo.c \ lib/eo/eo_ptr_indirection.c \ lib/eo/eo_ptr_indirection.h \ +lib/eo/eo_class_class.c \ lib/eo/eo_base_class.c \ lib/eo/eo_private.h diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index fb7ccc2501..36a7948de4 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -965,6 +965,36 @@ EAPI void eo_composite_detach(Eo *comp_obj, Eo *parent); */ EAPI Eina_Bool eo_composite_is(const Eo *comp_obj); +/** + * @} + */ + +/** + * @addtogroup Eo_Class_Class Eo's Class class. + * @{ + */ + +/** + * @def EO_CLASS_CLASS + * The class type for the Eo Class class. + */ +#define EO_CLASS_CLASS eo_class_class_get() +/** + * @brief Use #EO_CLASS_CLASS + * @internal + * */ +EAPI const Eo_Class *eo_class_class_get(void); + +/** + * @var EO_CLASS_CLASS_BASE_ID + * #EO_CLASS_CLASS 's base id. + */ +extern EAPI Eo_Op EO_CLASS_CLASS_BASE_ID; + +enum { + EO_CLASS_CLASS_SUB_ID_LAST +}; + /** * @} */ diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index 3e1d3c1c21..bc4cd8a0fa 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -460,7 +460,7 @@ eo_class_get(const Eo *obj_id) if (_eo_is_a_class(obj_id)) { EO_CLASS_POINTER_RETURN_VAL(obj_id, _klass, NULL); - return NULL; + return eo_class_class_get(); } EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, NULL); @@ -1446,6 +1446,9 @@ eo_init(void) EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT); + /* bootstrap EO_CLASS_CLASS */ + (void) eo_class_class_get(); + return EINA_TRUE; } diff --git a/src/lib/eo/eo_class_class.c b/src/lib/eo/eo_class_class.c new file mode 100644 index 0000000000..f9844c5f94 --- /dev/null +++ b/src/lib/eo/eo_class_class.c @@ -0,0 +1,20 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "Eo.h" + +EAPI Eo_Op EO_CLASS_CLASS_BASE_ID = 0; + +static const Eo_Class_Description class_desc = { + EO_VERSION, + "Eo Abstract Class", + EO_CLASS_TYPE_REGULAR_NO_INSTANT, + EO_CLASS_DESCRIPTION_OPS(&EO_CLASS_CLASS_BASE_ID, NULL, EO_CLASS_CLASS_SUB_ID_LAST), + NULL, + 0, + NULL, + NULL +}; + +EO_DEFINE_CLASS(eo_class_class_get, &class_desc, NULL, NULL)