2014-09-23 12:48:16 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2014-07-10 05:13:46 -07:00
|
|
|
#include <Eina.h>
|
|
|
|
#include "eolian_database.h"
|
|
|
|
|
|
|
|
EAPI Eina_Stringshare *
|
|
|
|
eolian_implement_full_name_get(const Eolian_Implement *impl)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(impl, NULL);
|
|
|
|
return impl->full_name;
|
|
|
|
}
|
|
|
|
|
2014-08-13 05:09:03 -07:00
|
|
|
EAPI const Eolian_Class *
|
|
|
|
eolian_implement_class_get(const Eolian_Implement *impl)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(impl, NULL);
|
2016-05-06 04:56:16 -07:00
|
|
|
Eolian_Implement *mimpl = (Eolian_Implement *)impl;
|
|
|
|
return database_object_class_fill(impl->full_name, &mimpl->klass);
|
2014-08-13 05:09:03 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const Eolian_Function *
|
|
|
|
eolian_implement_function_get(const Eolian_Implement *impl,
|
|
|
|
Eolian_Function_Type *func_type)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(impl, NULL);
|
2014-09-04 07:15:38 -07:00
|
|
|
|
|
|
|
if (impl->foo_id)
|
|
|
|
{
|
|
|
|
if (!func_type)
|
|
|
|
return impl->foo_id;
|
|
|
|
|
|
|
|
if (impl->is_prop_get)
|
|
|
|
*func_type = EOLIAN_PROP_GET;
|
|
|
|
else if (impl->is_prop_set)
|
|
|
|
*func_type = EOLIAN_PROP_SET;
|
|
|
|
else
|
|
|
|
*func_type = eolian_function_type_get(impl->foo_id);
|
|
|
|
|
|
|
|
return impl->foo_id;
|
|
|
|
}
|
|
|
|
|
2014-08-13 05:09:03 -07:00
|
|
|
const Eolian_Class *klass = eolian_implement_class_get(impl);
|
|
|
|
if (!klass)
|
|
|
|
return NULL;
|
|
|
|
|
2014-08-29 07:06:48 -07:00
|
|
|
const char *func_name = impl->full_name + strlen(klass->full_name) + 1;
|
2014-08-13 05:09:03 -07:00
|
|
|
|
|
|
|
Eolian_Function_Type tp = EOLIAN_UNRESOLVED;
|
2014-08-29 07:06:48 -07:00
|
|
|
|
|
|
|
if (impl->is_prop_get)
|
|
|
|
tp = EOLIAN_PROP_GET;
|
|
|
|
else if (impl->is_prop_set)
|
|
|
|
tp = EOLIAN_PROP_SET;
|
2014-07-10 05:13:46 -07:00
|
|
|
|
2014-08-13 05:09:03 -07:00
|
|
|
const Eolian_Function *fid = eolian_class_function_get_by_name(klass,
|
|
|
|
func_name,
|
|
|
|
tp);
|
2014-08-29 02:17:55 -07:00
|
|
|
|
|
|
|
if (fid && tp == EOLIAN_UNRESOLVED && (fid->type == EOLIAN_PROP_GET
|
|
|
|
|| fid->type == EOLIAN_PROP_SET))
|
|
|
|
{
|
2015-05-14 08:33:09 -07:00
|
|
|
fprintf(stderr, "eolian:%s:%d:%d: both get and set required for property '%s'\n",
|
|
|
|
impl->base.file, impl->base.line, impl->base.column, func_name);
|
2014-08-29 02:17:55 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-08-13 05:09:03 -07:00
|
|
|
if (func_type)
|
|
|
|
{
|
|
|
|
if (tp == EOLIAN_UNRESOLVED)
|
|
|
|
*func_type = eolian_function_type_get(fid);
|
|
|
|
else
|
|
|
|
*func_type = tp;
|
|
|
|
}
|
2014-09-04 07:15:38 -07:00
|
|
|
|
|
|
|
((Eolian_Implement*)impl)->foo_id = fid;
|
|
|
|
|
2014-08-13 05:09:03 -07:00
|
|
|
return fid;
|
2014-07-10 05:13:46 -07:00
|
|
|
}
|
2014-08-29 07:22:14 -07:00
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_implement_is_auto(const Eolian_Implement *impl)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(impl, EINA_FALSE);
|
|
|
|
return impl->is_auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_implement_is_empty(const Eolian_Implement *impl)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(impl, EINA_FALSE);
|
|
|
|
return impl->is_empty;
|
|
|
|
}
|
2014-08-29 07:30:51 -07:00
|
|
|
|
2014-09-05 08:04:08 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_implement_is_virtual(const Eolian_Implement *impl)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(impl, EINA_FALSE);
|
|
|
|
return impl->is_virtual;
|
|
|
|
}
|
|
|
|
|
2014-08-29 07:30:51 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_implement_is_prop_get(const Eolian_Implement *impl)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(impl, EINA_FALSE);
|
|
|
|
return impl->is_prop_get;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_implement_is_prop_set(const Eolian_Implement *impl)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(impl, EINA_FALSE);
|
|
|
|
return impl->is_prop_set;
|
|
|
|
}
|