summaryrefslogtreecommitdiff
path: root/src/lib/eo
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-18 15:09:27 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-21 08:56:13 +0100
commit5284ac36ca090a0870079a59fd9867c47fc9343c (patch)
treeaf2889504d75d9458302bdb48b277ddec9cad18b /src/lib/eo
parenta152ba6d5b7ed1a8d4c111e2b7d7025a733818a9 (diff)
eo: add API for querying the class type
a class can be a interface mixin abstract or regular. This adds a API for getting this information
Diffstat (limited to 'src/lib/eo')
-rw-r--r--src/lib/eo/Eo.h11
-rw-r--r--src/lib/eo/eo.c14
2 files changed, 24 insertions, 1 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 7f90e79653..323a1a97b5 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -776,7 +776,8 @@ enum _Efl_Class_Type
776 EFL_CLASS_TYPE_REGULAR = 0, /**< Regular class. */ 776 EFL_CLASS_TYPE_REGULAR = 0, /**< Regular class. */
777 EFL_CLASS_TYPE_REGULAR_NO_INSTANT, /**< Regular non instant-able class. */ 777 EFL_CLASS_TYPE_REGULAR_NO_INSTANT, /**< Regular non instant-able class. */
778 EFL_CLASS_TYPE_INTERFACE, /**< Interface */ 778 EFL_CLASS_TYPE_INTERFACE, /**< Interface */
779 EFL_CLASS_TYPE_MIXIN /**< Mixin */ 779 EFL_CLASS_TYPE_MIXIN, /**< Mixin */
780 EFL_CLASS_TYPE_INVALID
780}; 781};
781 782
782/** 783/**
@@ -2004,6 +2005,14 @@ EAPI Eina_Value efl_property_reflection_get(Eo *obj, const char *property_name);
2004#include "efl_class.eo.h" 2005#include "efl_class.eo.h"
2005 2006
2006/** 2007/**
2008 * @brief Get the type of this class.
2009 * @param klass The Efl_Class to get the type from.
2010 *
2011 * @return The type of this class or INVALID if the klass parameter was invalid.
2012 */
2013EAPI Efl_Class_Type efl_class_type_get(const Efl_Class *klass);
2014
2015/**
2007 * @} 2016 * @}
2008 */ 2017 */
2009 2018
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 0611643546..c2b5f85b60 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -1516,6 +1516,9 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
1516 return NULL; 1516 return NULL;
1517 } 1517 }
1518 break; 1518 break;
1519 default:
1520 ERR("type cannot be INVALID");
1521 return NULL;
1519 } 1522 }
1520 } 1523 }
1521 1524
@@ -1542,6 +1545,9 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
1542 case EFL_CLASS_TYPE_MIXIN: 1545 case EFL_CLASS_TYPE_MIXIN:
1543 extn_list = eina_list_append(extn_list, extn); 1546 extn_list = eina_list_append(extn_list, extn);
1544 break; 1547 break;
1548 default:
1549 ERR("type cannot be INVALID");
1550 return NULL;
1545 } 1551 }
1546 } 1552 }
1547 extn_id = va_arg(p_list, Eo_Id *); 1553 extn_id = va_arg(p_list, Eo_Id *);
@@ -3660,3 +3666,11 @@ end:
3660 3666
3661 return EINA_VALUE_EMPTY; 3667 return EINA_VALUE_EMPTY;
3662} 3668}
3669
3670EAPI Efl_Class_Type
3671efl_class_type_get(const Efl_Class *klass_id)
3672{
3673 EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, EFL_CLASS_TYPE_INVALID);
3674
3675 return klass->desc->type;
3676}