diff --git a/src/bin/eolian_cxx/type_lookup.hh b/src/bin/eolian_cxx/type_lookup.hh index d366f5d87a..006201c122 100644 --- a/src/bin/eolian_cxx/type_lookup.hh +++ b/src/bin/eolian_cxx/type_lookup.hh @@ -56,15 +56,16 @@ 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 + // assert(type != NULL); std::vector types; types.push_back(type); - if (type_is_complex(*type)) + if (::eolian_type_type_get(type) == EOLIAN_TYPE_POINTER && type_is_complex(*eolian_type_base_type_get(type))) { efl::eina::iterator end; efl::eina::iterator it - (::eolian_type_subtypes_get(type)); + (::eolian_type_subtypes_get(eolian_type_base_type_get(type))); while(it != end) { if(Eolian_Type const* t = &*it) diff --git a/src/bin/eolian_cxx/type_lookup_table.cc b/src/bin/eolian_cxx/type_lookup_table.cc index 7c58618fba..2702225dd0 100644 --- a/src/bin/eolian_cxx/type_lookup_table.cc +++ b/src/bin/eolian_cxx/type_lookup_table.cc @@ -21,11 +21,12 @@ type_lookup_table {"Eina_List *", eolian_type::complex_, false, "efl::eina::range_list", {"eina-cxx/eina_list.hh"}}, {"Eina_List *", eolian_type::complex_, true, "efl::eina::list", {"eina-cxx/eina_list.hh"}}, {"Eo *", eolian_type::simple_, true, "efl::eo::base", {"eo_base.hh"}}, + {"Eo *", eolian_type::simple_, false, "efl::eo::base", {"eo_base.hh"}}, //{"Evas_Object_Box_Layout", eolian_type::callback_, {"Evas.h"}}, {"Evas_Object *", eolian_type::simple_, false, "evas::object", {"canvas/evas_object.eo.hh"}}, {"char *", eolian_type::simple_, true, "std::unique_ptr", {"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_list", {"eina-cxx/eina_ptrlist.hh"}}, + {"const Eina_List *", eolian_type::complex_, false, "efl::eina::crange_list", {"eina-cxx/eina_ptrlist.hh"}}, {"const char *", eolian_type::simple_, false, "std::string", {"string"}} }; diff --git a/src/bindings/eina_cxx/eina_list.hh b/src/bindings/eina_cxx/eina_list.hh index 1a7aafbc07..b2b6745dc8 100644 --- a/src/bindings/eina_cxx/eina_list.hh +++ b/src/bindings/eina_cxx/eina_list.hh @@ -191,6 +191,8 @@ public: typedef typename _base_type::const_reverse_iterator const_reverse_iterator; list& operator=(list&& other) = default; + list(list&& other) = default; + list() = default; using _base_type::_base_type; using _base_type::clear; @@ -437,25 +439,13 @@ public: typedef typename _base_type::const_pointer const_pointer; typedef typename _base_type::size_type size_type; typedef typename _base_type::difference_type difference_type; - typedef typename _base_type::clone_allocator_type clone_allocator_type; typedef typename _base_type::reverse_iterator reverse_iterator; typedef typename _base_type::const_reverse_iterator const_reverse_iterator; - range_list& operator=(range_list&& other) = default; - using _base_type::_base_type; - using _base_type::clear; using _base_type::size; using _base_type::empty; - using _base_type::get_clone_allocator; - using _base_type::push_back; - using _base_type::push_front; - using _base_type::pop_back; - using _base_type::pop_front; - using _base_type::insert; - using _base_type::erase; - using _base_type::assign; using _base_type::back; using _base_type::front; using _base_type::begin; @@ -466,21 +456,15 @@ public: using _base_type::cend; using _base_type::crbegin; using _base_type::crend; - using _base_type::ibegin; - using _base_type::iend; - using _base_type::cibegin; - using _base_type::ciend; using _base_type::swap; - using _base_type::max_size; using _base_type::native_handle; - using _base_type::accessor; }; template class range_list::value>::type> - : range_ptr_list + : range_ptr_list::value, Eo const, Eo>::type> { - typedef range_ptr_list _base_type; + typedef range_ptr_list::value, Eo const, Eo>::type> _base_type; typedef range_list _self_type; public: typedef T value_type; @@ -496,7 +480,9 @@ public: typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; - explicit range_list(Eina_List* handle) + typedef typename _base_type::native_handle_type native_handle_type; + + explicit range_list(native_handle_type handle) : _base_type(handle) {} range_list() {} range_list(range_list const& other) @@ -580,6 +566,9 @@ public: return rhs.size() == lhs.size() && std::equal(rhs.begin(), rhs.end(), lhs.begin()); } }; + +template +using crange_list = range_list::type>; } } diff --git a/src/bindings/eo_cxx/eo_cxx_interop.hh b/src/bindings/eo_cxx/eo_cxx_interop.hh index e7a7a3ee4f..3e1d88ba55 100644 --- a/src/bindings/eo_cxx/eo_cxx_interop.hh +++ b/src/bindings/eo_cxx/eo_cxx_interop.hh @@ -128,10 +128,10 @@ struct traits }; template -inline efl::eina::range_list +inline efl::eina::range_list to_cxx(const Eina_List* x, std::tuple, tag< efl::eina::range_list >) { - return efl::eina::list {x}; + return efl::eina::range_list {x}; } template diff --git a/src/lib/eolian_cxx/eo_types.hh b/src/lib/eolian_cxx/eo_types.hh index 58d9fb4dbe..3ce3e0914a 100644 --- a/src/lib/eolian_cxx/eo_types.hh +++ b/src/lib/eolian_cxx/eo_types.hh @@ -59,27 +59,6 @@ struct eolian_type assert(category == callback_); } - ~eolian_type() {} - - eolian_type(eolian_type const& other) - : native(other.native) - , category(other.category) - , is_own(other.is_own) - , binding(other.binding) - , includes(other.includes) - {} - - eolian_type& - operator=(eolian_type const& rhs) - { - native = rhs.native; - category = rhs.category; - is_own = rhs.is_own; - binding = rhs.binding; - includes = rhs.includes; - return *this; - } - std::string native; category_type category; bool is_own; diff --git a/src/lib/eolian_cxx/eo_validate.hh b/src/lib/eolian_cxx/eo_validate.hh index bca15c6aff..027c8fced1 100644 --- a/src/lib/eolian_cxx/eo_validate.hh +++ b/src/lib/eolian_cxx/eo_validate.hh @@ -8,6 +8,8 @@ #include #include "eo_types.hh" +#include + namespace efl { namespace eolian { inline bool @@ -21,12 +23,16 @@ _is_valid(eolian_type_instance const& type) { // if (type.empty() || (*type.rbegin()).category == eolian_type::complex_) // return false; - for (auto rit = ++type.rbegin(), last = type.rend(); rit != last; ++rit) + for (auto rit = type.rbegin(), last = type.rend(); rit != last; ++rit) { - if ((*rit).binding.empty() || (*rit).category != eolian_type::complex_) - return false; - else if (rit != type.rbegin() && (*rit).category != eolian_type::complex_) - return false; + if ((*rit).binding.empty() && (*rit).category == eolian_type::complex_) + return false; + // else if (rit != type.rbegin() && (*rit).category != eolian_type::complex_) + // { + // std::cout << "begin " << (rit != type.rbegin()) << std::endl; + // std::cout << "category " << rit->category << std::endl; + // return false; + // } } return true; }