felipealmeida pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e807421f602c1adab47c3fcadbc508155d0d1136
commit e807421f602c1adab47c3fcadbc508155d0d1136 Author: Savio Sena <savio.s...@acm.org> Date: Thu Jul 17 04:14:22 2014 -0300 eolian-cxx: Fixed complex-types. --- src/bin/eolian_cxx/type_lookup.hh | 33 +++++++++++++++++++++++----- src/bin/eolian_cxx/type_lookup_table.cc | 2 +- src/lib/eolian_cxx/grammar/type_generator.hh | 2 +- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/bin/eolian_cxx/type_lookup.hh b/src/bin/eolian_cxx/type_lookup.hh index 8465ef9..b26fff9 100644 --- a/src/bin/eolian_cxx/type_lookup.hh +++ b/src/bin/eolian_cxx/type_lookup.hh @@ -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; } diff --git a/src/bin/eolian_cxx/type_lookup_table.cc b/src/bin/eolian_cxx/type_lookup_table.cc index 072ef22..19c84f4 100644 --- a/src/bin/eolian_cxx/type_lookup_table.cc +++ b/src/bin/eolian_cxx/type_lookup_table.cc @@ -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"}}, diff --git a/src/lib/eolian_cxx/grammar/type_generator.hh b/src/lib/eolian_cxx/grammar/type_generator.hh index 1ca5a66..acc7aa9 100644 --- a/src/lib/eolian_cxx/grammar/type_generator.hh +++ b/src/lib/eolian_cxx/grammar/type_generator.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; } --