forked from enlightenment/efl
eolian-cxx: Fixed complex-types.
This commit is contained in:
parent
f60394c1af
commit
e807421f60
|
@ -51,13 +51,36 @@ type_lookup(const Eolian_Type* type,
|
|||
lookup_table_type const& lut = type_lookup_table)
|
||||
{
|
||||
if (type == NULL) return { efl::eolian::void_type }; // XXX shouldn't
|
||||
size_t n = ::eina_list_count(type->subtypes) + 1;
|
||||
assert(n > 0);
|
||||
efl::eolian::eolian_type_instance v(n);
|
||||
for (size_t i=0; i<n; i++)
|
||||
|
||||
Eina_List const* lt = NULL;
|
||||
Eina_Iterator *it = NULL;
|
||||
unsigned int n_;
|
||||
if ( (it = ::eolian_type_subtypes_list_get(type)) != NULL)
|
||||
{
|
||||
lt = static_cast<Eina_List const*>(::eina_iterator_container_get(it));
|
||||
n_ = ::eina_list_count(lt) + 1;
|
||||
::eina_iterator_free(it);
|
||||
}
|
||||
else
|
||||
{
|
||||
n_ = 1;
|
||||
}
|
||||
// assert(n_ > 0);
|
||||
efl::eolian::eolian_type_instance v(n_);
|
||||
for (size_t i=0; i<n_; i++)
|
||||
{
|
||||
v[i] = type_find(lut.begin(), lut.end(), type_from_eolian(*type));
|
||||
assert (i == n-1 || type_is_complex(v[i]));
|
||||
// XXX temporary workaround to allow incomplete complex-types until
|
||||
// we don't have a full support.
|
||||
if (type_is_complex(v[i]))
|
||||
{
|
||||
assert(i == 0);
|
||||
efl::eolian::eolian_type tmp = v[i];
|
||||
v.clear();
|
||||
v.push_back(efl::eolian::type_to_native(tmp));
|
||||
return v;
|
||||
}
|
||||
assert(i == n_-1 || type_is_complex(v[i]));
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ type_lookup_table
|
|||
{"Eina_List *", eolian_type::complex_, true, "efl::eina::ptr_list", {"eina-cxx/eina_ptrlist.hh"}},
|
||||
//{"Eina_List *", eolian_type::complex_, false, "efl::eina::ptr_list", {"eina-cxx/eina_ptrlist.hh"}},
|
||||
{"Eo *", eolian_type::simple_, true, "efl::eo::base", {"eo_base.hh"}},
|
||||
{"Evas_Object *", eolian_type::simple_, false, "evas_object", {"canvas/evas_object.eo.hh"}},
|
||||
//{"Evas_Object *", eolian_type::simple_, false, "evas::object", {"canvas/evas_object.eo.hh"}},
|
||||
{"char *", eolian_type::simple_, true, "std::unique_ptr<char*>", {"memory"}},
|
||||
{"const Eina_Inlist *", eolian_type::complex_, false, "efl::eina::range_inlist", {"eina-cxx/eina_inlist.hh"}},
|
||||
{"const Eina_List *", eolian_type::complex_, false, "efl::eina::range_ptr_list", {"eina-cxx/eina_ptrlist.hh"}},
|
||||
|
|
|
@ -76,7 +76,7 @@ operator<<(std::ostream& out, to_cxx const& x)
|
|||
<< ", " << type_ownership(x._type) << ");";
|
||||
}
|
||||
else
|
||||
out << "_ret";
|
||||
out << "_tmp_ret";
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue