forked from enlightenment/efl
Revert "cxx: Migrate C++ binding to the new eo_add syntax"
This reverts commit 48f62ad686
.
This commit is contained in:
parent
be8605dc44
commit
72c6236038
|
@ -83,10 +83,9 @@ struct inherit
|
||||||
///
|
///
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
inherit(efl::eo::parent_type _p, Args&& ... args)
|
inherit(efl::eo::parent_type _p, Args&& ... args)
|
||||||
: _eo_cls(nullptr), _eo_raw(nullptr)
|
|
||||||
{
|
{
|
||||||
_eo_cls = detail::create_class<D, E...> (eina::make_index_sequence<sizeof...(E)>());
|
_eo_cls = detail::create_class<D, E...> (eina::make_index_sequence<sizeof...(E)>());
|
||||||
eo_add_ref(&_eo_raw, _eo_cls, _p._eo_raw, detail::inherit_constructor(_eo_raw, this), ::efl::eolian::call_ctors(_eo_raw, args...));
|
_eo_raw = eo_add_ref(_eo_cls, _p._eo_raw, detail::inherit_constructor(eoid, this), ::efl::eolian::call_ctors(eoid, args...));
|
||||||
::efl::eolian::register_ev_del_free_callback(_eo_raw, args...);
|
::efl::eolian::register_ev_del_free_callback(_eo_raw, args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,7 @@ isa(const Eo *obj, const Eo_Class *klass)
|
||||||
inline Eo*
|
inline Eo*
|
||||||
add(const Eo_Class *klass, Eo *parent = NULL)
|
add(const Eo_Class *klass, Eo *parent = NULL)
|
||||||
{
|
{
|
||||||
Eo *eo = nullptr;
|
Eo *eo = eo_add_ref(klass, parent);
|
||||||
eo_add_ref(&eo, klass, parent);
|
|
||||||
return eo;
|
return eo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -577,14 +577,13 @@ operator<<(std::ostream& out, function_call_constructor_methods const& x)
|
||||||
|
|
||||||
out << ")" << endl
|
out << ")" << endl
|
||||||
<< tab(1) << "{" << endl
|
<< tab(1) << "{" << endl
|
||||||
<< tab(2) << "Eo* _ret_eo = nullptr;" << endl
|
<< tab(2) << "Eo* _ret_eo = eo_add_ref(" << x._cls.eo_name << ", _p._eo_raw";
|
||||||
<< tab(2) << "eo_add_ref(&_ret_eo, " << x._cls.eo_name << ", _p._eo_raw";
|
|
||||||
for (it = first; it != last; ++it)
|
for (it = first; it != last; ++it)
|
||||||
{
|
{
|
||||||
out << ", _c" << (it-first) << "(_ret_eo)";
|
out << ", _c" << (it-first) << "(eoid)";
|
||||||
}
|
}
|
||||||
if (!x._cls.optional_constructors.empty())
|
if (!x._cls.optional_constructors.empty())
|
||||||
out << ", ::efl::eolian::call_ctors(_ret_eo, _opts...)";
|
out << ", ::efl::eolian::call_ctors(eoid, _opts...)";
|
||||||
out << ");" << endl << endl;
|
out << ");" << endl << endl;
|
||||||
|
|
||||||
for (it = first; it != last; ++it)
|
for (it = first; it != last; ++it)
|
||||||
|
|
|
@ -43,11 +43,10 @@ START_TEST(eina_cxx_eo_accessor_indexing)
|
||||||
|
|
||||||
efl::eina::list<wrapper> list;
|
efl::eina::list<wrapper> list;
|
||||||
|
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
list.push_back(w1);
|
list.push_back(w1);
|
||||||
list.push_back(w2);
|
list.push_back(w2);
|
||||||
|
@ -98,11 +97,10 @@ START_TEST(eina_cxx_eo_accessor_iterator)
|
||||||
|
|
||||||
efl::eina::list<wrapper> list;
|
efl::eina::list<wrapper> list;
|
||||||
|
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
list.push_back(w1);
|
list.push_back(w1);
|
||||||
list.push_back(w2);
|
list.push_back(w2);
|
||||||
|
|
|
@ -26,10 +26,9 @@ START_TEST(eina_cxx_ptrarray_push_back)
|
||||||
int result[] = {5, 10, 15};
|
int result[] = {5, 10, 15};
|
||||||
int rresult[] = {15, 10, 5};
|
int rresult[] = {15, 10, 5};
|
||||||
|
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
{
|
{
|
||||||
efl::eina::ptr_array<int> array;
|
efl::eina::ptr_array<int> array;
|
||||||
|
@ -103,10 +102,9 @@ START_TEST(eina_cxx_ptrarray_pop_back)
|
||||||
ck_assert(std::equal(array.rbegin(), array.rend(), rresult));
|
ck_assert(std::equal(array.rbegin(), array.rend(), rresult));
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
efl::eina::array<wrapper> array;
|
efl::eina::array<wrapper> array;
|
||||||
|
|
||||||
|
@ -199,12 +197,11 @@ START_TEST(eina_cxx_ptrarray_insert)
|
||||||
ck_assert(std::equal(array.begin(), array.end(), array4.begin()));
|
ck_assert(std::equal(array.begin(), array.end(), array4.begin()));
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w0(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w0(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
efl::eina::array<wrapper> array;
|
efl::eina::array<wrapper> array;
|
||||||
ck_assert(std::distance(array.begin(), array.end()) == 0u);
|
ck_assert(std::distance(array.begin(), array.end()) == 0u);
|
||||||
|
@ -280,8 +277,7 @@ START_TEST(eina_cxx_ptrarray_constructors)
|
||||||
efl::eina::eina_init eina_init;
|
efl::eina::eina_init eina_init;
|
||||||
efl::eo::eo_init eo_init;
|
efl::eo::eo_init eo_init;
|
||||||
|
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
{
|
{
|
||||||
efl::eina::ptr_array<int> array1;
|
efl::eina::ptr_array<int> array1;
|
||||||
|
@ -360,13 +356,12 @@ START_TEST(eina_cxx_ptrarray_erase)
|
||||||
ck_assert(array1.back() == 25);
|
ck_assert(array1.back() == 25);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w5(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w5(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w6(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w6(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
efl::eina::array<wrapper> array1;
|
efl::eina::array<wrapper> array1;
|
||||||
|
|
||||||
|
@ -442,13 +437,12 @@ START_TEST(eina_cxx_ptrarray_range)
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w5(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w5(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w6(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w6(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
efl::eina::array<wrapper> array;
|
efl::eina::array<wrapper> array;
|
||||||
array.push_back(w1);
|
array.push_back(w1);
|
||||||
|
|
|
@ -28,10 +28,9 @@ START_TEST(eina_cxx_ptrlist_push_back)
|
||||||
int result[] = {5, 10, 15};
|
int result[] = {5, 10, 15};
|
||||||
int rresult[] = {15, 10, 5};
|
int rresult[] = {15, 10, 5};
|
||||||
|
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
{
|
{
|
||||||
efl::eina::ptr_list<int> list;
|
efl::eina::ptr_list<int> list;
|
||||||
|
@ -78,10 +77,9 @@ START_TEST(eina_cxx_ptrlist_pop_back)
|
||||||
int result[] = {5, 10};
|
int result[] = {5, 10};
|
||||||
int rresult[] = {10, 5};
|
int rresult[] = {10, 5};
|
||||||
|
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
{
|
{
|
||||||
efl::eina::ptr_list<int> list;
|
efl::eina::ptr_list<int> list;
|
||||||
|
@ -145,10 +143,9 @@ START_TEST(eina_cxx_ptrlist_push_front)
|
||||||
ck_assert(std::equal(list.rbegin(), list.rend(), rresult));
|
ck_assert(std::equal(list.rbegin(), list.rend(), rresult));
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
efl::eina::list<wrapper> list;
|
efl::eina::list<wrapper> list;
|
||||||
|
|
||||||
|
@ -174,10 +171,9 @@ START_TEST(eina_cxx_ptrlist_pop_front)
|
||||||
int result[] = {10, 5};
|
int result[] = {10, 5};
|
||||||
int rresult[] = {5, 10};
|
int rresult[] = {5, 10};
|
||||||
|
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
{
|
{
|
||||||
efl::eina::ptr_list<int> list;
|
efl::eina::ptr_list<int> list;
|
||||||
|
@ -277,12 +273,11 @@ START_TEST(eina_cxx_ptrlist_insert)
|
||||||
ck_assert(std::equal(list.begin(), list.end(), list4.begin()));
|
ck_assert(std::equal(list.begin(), list.end(), list4.begin()));
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w0(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w0(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
efl::eina::list<wrapper> list;
|
efl::eina::list<wrapper> list;
|
||||||
|
|
||||||
|
@ -371,12 +366,11 @@ START_TEST(eina_cxx_ptrlist_constructors)
|
||||||
ck_assert(list2 == list4);
|
ck_assert(list2 == list4);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Eo* eoptr = nullptr;
|
wrapper const w0(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w0(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
|
||||||
wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
|
|
||||||
|
|
||||||
efl::eina::list<wrapper> list1;
|
efl::eina::list<wrapper> list1;
|
||||||
ck_assert(list1.empty());
|
ck_assert(list1.empty());
|
||||||
|
|
Loading…
Reference in New Issue