*/
EAPI Eina_Bool eolian_function_is_virtual_pure(const Eolian_Function *function_id, Eolian_Function_Type f_type);
+/*
+ * @brief Indicates if a function is auto.
+ *
+ * @param[in] function_id Id of the function
+ * @param[in] f_type The function type, for property get/set distinction.
+ * @return EINA_TRUE if auto, EINA_FALSE othrewise.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Bool eolian_function_is_auto(const Eolian_Function *function_id, Eolian_Function_Type f_type);
+
+/*
+ * @brief Indicates if a function is empty.
+ *
+ * @param[in] function_id Id of the function
+ * @param[in] f_type The function type, for property get/set distinction.
+ * @return EINA_TRUE if empty, EINA_FALSE othrewise.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Bool eolian_function_is_empty(const Eolian_Function *function_id, Eolian_Function_Type f_type);
+
/*
* @brief Indicates if a function is legacy only.
*
return EINA_TRUE;
}
+static int
+_func_error(Eolian_Class *cl, Eolian_Implement *impl)
+{
+ ERR("Error - %s%s not known in class %s", impl->full_name,
+ eolian_class_name_get(cl), (impl->is_prop_get ? ".get"
+ : (impl->is_prop_set ? ".set" : "")));
+ return -1;
+}
+
static int
_db_fill_implement(Eolian_Class *cl, Eolian_Implement *impl)
{
const char *impl_name = impl->full_name;
- if (impl->is_virtual)
- {
- Eolian_Function_Type ftype = EOLIAN_UNRESOLVED;
+ Eolian_Function_Type ftype = EOLIAN_UNRESOLVED;
- if (impl->is_prop_get)
- ftype = EOLIAN_PROP_GET;
- else if (impl->is_prop_set)
- ftype = EOLIAN_PROP_SET;
+ if (impl->is_prop_get)
+ ftype = EOLIAN_PROP_GET;
+ else if (impl->is_prop_set)
+ ftype = EOLIAN_PROP_SET;
+ if (impl->is_virtual)
+ {
Eolian_Function *foo_id = (Eolian_Function*)
eolian_class_function_get_by_name(cl,
impl_name,
ftype);
- if (!foo_id)
- {
- ERR("Error - %s%s not known in class %s", impl_name,
- eolian_class_name_get(cl), (impl->is_prop_get ? ".get"
- : (impl->is_prop_set ? ".set" : "")));
- return -1;
- }
+ if (!foo_id) return _func_error(cl, impl);
if (impl->is_prop_set)
foo_id->set_virtual_pure = EINA_TRUE;
return 1;
}
+ else if (impl->is_auto)
+ {
+ const char *inm = impl_name;
+ if (inm[0] == '.') ++inm;
+ if (strchr(inm, '.')) goto pasttags;
+ Eolian_Function *foo_id = (Eolian_Function*)
+ eolian_class_function_get_by_name(cl, inm,
+ ftype);
+ if (!foo_id) return _func_error(cl, impl);
+ if (impl->is_auto)
+ foo_id->set_auto = EINA_TRUE;
+ else
+ foo_id->get_auto = EINA_TRUE;
+ }
+ else if (impl->is_empty)
+ {
+ const char *inm = impl_name;
+ if (inm[0] == '.') ++inm;
+ if (strchr(inm, '.')) goto pasttags;
+ Eolian_Function *foo_id = (Eolian_Function*)
+ eolian_class_function_get_by_name(cl, inm,
+ ftype);
+ if (!foo_id) return _func_error(cl, impl);
+ if (impl->is_auto)
+ foo_id->set_empty = EINA_TRUE;
+ else
+ foo_id->get_empty = EINA_TRUE;
+ }
else if (impl->is_class_ctor)
{
cl->class_ctor_enable = EINA_TRUE;
return 1;
}
+pasttags:
if (impl_name[0] == '.')
{
impl->full_name = eina_stringshare_printf("%s%s", cl->full_name,
}
}
+EAPI Eina_Bool
+eolian_function_is_auto(const Eolian_Function *fid, Eolian_Function_Type ftype)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
+ switch (ftype)
+ {
+ case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_auto; break;
+ case EOLIAN_PROP_SET: return fid->set_auto; break;
+ default: return EINA_FALSE;
+ }
+}
+
+EAPI Eina_Bool
+eolian_function_is_empty(const Eolian_Function *fid, Eolian_Function_Type ftype)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
+ switch (ftype)
+ {
+ case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_empty; break;
+ case EOLIAN_PROP_SET: return fid->set_empty; break;
+ default: return EINA_FALSE;
+ }
+}
+
EAPI Eina_Bool
eolian_function_is_legacy_only(const Eolian_Function *fid, Eolian_Function_Type ftype)
{