forked from enlightenment/efl
Eolian: fix virtual pure support.
When a property needs be defined as virtual pure, its type could not be given. It means that, even it was explicit that e.g only the get property if virtual pure, both (set and get) were considered as virtual pure. @fix
This commit is contained in:
parent
149509249b
commit
c863154a79
|
@ -369,7 +369,7 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun
|
||||||
Eina_Bool ret_const = EINA_FALSE;
|
Eina_Bool ret_const = EINA_FALSE;
|
||||||
Eina_Bool add_star = EINA_FALSE;
|
Eina_Bool add_star = EINA_FALSE;
|
||||||
|
|
||||||
if (!impl_name && eolian_function_is_virtual_pure(funcid)) return EINA_TRUE;
|
if (!impl_name && eolian_function_is_virtual_pure(funcid, ftype)) return EINA_TRUE;
|
||||||
Eina_Strbuf *fbody = eina_strbuf_new();
|
Eina_Strbuf *fbody = eina_strbuf_new();
|
||||||
Eina_Strbuf *va_args = eina_strbuf_new();
|
Eina_Strbuf *va_args = eina_strbuf_new();
|
||||||
Eina_Strbuf *params = eina_strbuf_new(); /* only variables names */
|
Eina_Strbuf *params = eina_strbuf_new(); /* only variables names */
|
||||||
|
@ -759,7 +759,7 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf)
|
||||||
eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
|
eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
|
||||||
free(desc);
|
free(desc);
|
||||||
|
|
||||||
if (!eolian_function_is_virtual_pure(fn))
|
if (!eolian_function_is_virtual_pure(fn, SET))
|
||||||
eo1_eo_func_desc_generate(classname, NULL, tmpstr, tmpbuf);
|
eo1_eo_func_desc_generate(classname, NULL, tmpstr, tmpbuf);
|
||||||
else
|
else
|
||||||
eina_strbuf_reset(tmpbuf);
|
eina_strbuf_reset(tmpbuf);
|
||||||
|
@ -774,7 +774,7 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf)
|
||||||
free(desc);
|
free(desc);
|
||||||
eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
|
eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
|
||||||
|
|
||||||
if (!eolian_function_is_virtual_pure(fn))
|
if (!eolian_function_is_virtual_pure(fn, GET))
|
||||||
eo1_eo_func_desc_generate(classname, NULL, tmpstr, tmpbuf);
|
eo1_eo_func_desc_generate(classname, NULL, tmpstr, tmpbuf);
|
||||||
else
|
else
|
||||||
eina_strbuf_reset(tmpbuf);
|
eina_strbuf_reset(tmpbuf);
|
||||||
|
@ -792,7 +792,7 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf)
|
||||||
free(desc);
|
free(desc);
|
||||||
eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
|
eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
|
||||||
|
|
||||||
if (!eolian_function_is_virtual_pure(fn))
|
if (!eolian_function_is_virtual_pure(fn, METHOD_FUNC))
|
||||||
eo1_eo_func_desc_generate(classname, NULL, funcname, tmpbuf);
|
eo1_eo_func_desc_generate(classname, NULL, funcname, tmpbuf);
|
||||||
else
|
else
|
||||||
eina_strbuf_reset(tmpbuf);
|
eina_strbuf_reset(tmpbuf);
|
||||||
|
|
|
@ -329,7 +329,7 @@ EAPI const char *eolian_function_data_get(Eolian_Function function_id, const cha
|
||||||
*
|
*
|
||||||
* @ingroup Eolian
|
* @ingroup Eolian
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Bool eolian_function_is_virtual_pure(Eolian_Function function_id);
|
EAPI Eina_Bool eolian_function_is_virtual_pure(Eolian_Function function_id, Eolian_Function_Type f_type);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief Returns a specific description for a function.
|
* @brief Returns a specific description for a function.
|
||||||
|
|
|
@ -4517,7 +4517,7 @@ eo_tokenizer_database_fill(const char *filename)
|
||||||
ERR("Error - %s not known in class %s", class + 9, kls->name);
|
ERR("Error - %s not known in class %s", class + 9, kls->name);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
database_function_set_as_virtual_pure(foo_id);
|
database_function_set_as_virtual_pure(foo_id, ftype);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Eolian_Implement impl_desc = database_implement_new(class, func, ftype);
|
Eolian_Implement impl_desc = database_implement_new(class, func, ftype);
|
||||||
|
|
|
@ -1490,7 +1490,7 @@ eo_tokenizer_database_fill(const char *filename)
|
||||||
ERR("Error - %s not known in class %s", class + 9, kls->name);
|
ERR("Error - %s not known in class %s", class + 9, kls->name);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
database_function_set_as_virtual_pure(foo_id);
|
database_function_set_as_virtual_pure(foo_id, ftype);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Eolian_Implement impl_desc = database_implement_new(class, func, ftype);
|
Eolian_Implement impl_desc = database_implement_new(class, func, ftype);
|
||||||
|
|
|
@ -38,7 +38,8 @@ typedef struct
|
||||||
Eolian_Function_Type type;
|
Eolian_Function_Type type;
|
||||||
Eina_Hash *data;
|
Eina_Hash *data;
|
||||||
Eina_Bool obj_is_const :1; /* True if the object has to be const. Useful for a few methods. */
|
Eina_Bool obj_is_const :1; /* True if the object has to be const. Useful for a few methods. */
|
||||||
Eina_Bool virtual_pure :1;
|
Eina_Bool get_virtual_pure :1;
|
||||||
|
Eina_Bool set_virtual_pure :1;
|
||||||
Eina_Bool get_return_warn_unused :1; /* also used for methods */
|
Eina_Bool get_return_warn_unused :1; /* also used for methods */
|
||||||
Eina_Bool set_return_warn_unused :1;
|
Eina_Bool set_return_warn_unused :1;
|
||||||
Eina_Bool get_return_own :1; /* also used for methods */
|
Eina_Bool get_return_own :1; /* also used for methods */
|
||||||
|
@ -551,7 +552,7 @@ eolian_class_function_find_by_name(const char *class_name, const char *func_name
|
||||||
EINA_LIST_FOREACH(desc->properties, itr, foo_id)
|
EINA_LIST_FOREACH(desc->properties, itr, foo_id)
|
||||||
{
|
{
|
||||||
_Function_Id *fid = (_Function_Id *) foo_id;
|
_Function_Id *fid = (_Function_Id *) foo_id;
|
||||||
if (!strcmp(fid->name, func_name) && (f_type == UNRESOLVED || f_type == PROPERTY_FUNC || f_type == fid->type))
|
if (!strcmp(fid->name, func_name))
|
||||||
return foo_id;
|
return foo_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -631,20 +632,30 @@ eolian_function_name_get(Eolian_Function function_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
database_function_set_as_virtual_pure(Eolian_Function function_id)
|
database_function_set_as_virtual_pure(Eolian_Function function_id, Eolian_Function_Type ftype)
|
||||||
{
|
{
|
||||||
_Function_Id *fid = (_Function_Id *)function_id;
|
_Function_Id *fid = (_Function_Id *)function_id;
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
||||||
fid->virtual_pure = EINA_TRUE;
|
switch (ftype)
|
||||||
|
{
|
||||||
|
case UNRESOLVED: case METHOD_FUNC: case GET: fid->get_virtual_pure = EINA_TRUE; break;
|
||||||
|
case SET: fid->set_virtual_pure = EINA_TRUE; break;
|
||||||
|
default: return EINA_FALSE;
|
||||||
|
}
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
eolian_function_is_virtual_pure(Eolian_Function function_id)
|
eolian_function_is_virtual_pure(Eolian_Function function_id, Eolian_Function_Type ftype)
|
||||||
{
|
{
|
||||||
_Function_Id *fid = (_Function_Id *)function_id;
|
_Function_Id *fid = (_Function_Id *)function_id;
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
||||||
return fid->virtual_pure;
|
switch (ftype)
|
||||||
|
{
|
||||||
|
case UNRESOLVED: case METHOD_FUNC: case GET: return fid->get_virtual_pure; break;
|
||||||
|
case SET: return fid->set_virtual_pure; break;
|
||||||
|
default: return EINA_FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -105,7 +105,7 @@ void database_function_return_flag_set_own(Eolian_Function foo_id,
|
||||||
void database_function_object_set_as_const(Eolian_Function foo_id, Eina_Bool is_const);
|
void database_function_object_set_as_const(Eolian_Function foo_id, Eina_Bool is_const);
|
||||||
|
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
database_function_set_as_virtual_pure(Eolian_Function function_id);
|
database_function_set_as_virtual_pure(Eolian_Function function_id, Eolian_Function_Type type);
|
||||||
|
|
||||||
/* Need to add API for callbacks and implements */
|
/* Need to add API for callbacks and implements */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue