eolian-cxx: Fix compilation break with Eo rename to EFL

devs/vitorsousa/strict_events
Felipe Magno de Almeida 7 years ago
parent ef8a66a41d
commit f8a6568d5c
  1. 2
      src/bindings/cxx/eina_cxx/eina_accessor.hh
  2. 4
      src/bindings/cxx/eina_cxx/eina_clone_allocators.hh
  3. 12
      src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
  4. 12
      src/bindings/cxx/eo_cxx/eo_event.hh
  5. 16
      src/bindings/cxx/eo_cxx/eo_ops.hh
  6. 16
      src/tests/eina_cxx/eina_cxx_test_accessor.cc
  7. 48
      src/tests/eina_cxx/eina_cxx_test_ptrarray.cc
  8. 44
      src/tests/eina_cxx/eina_cxx_test_ptrlist.cc

@ -359,7 +359,7 @@ struct accessor<T, typename std::enable_if<std::is_base_of<::efl::eo::concrete,
// TODO Do we need to ref this Eo* instance ?
return mapped_type(::eo_ref(static_cast<Eo*>(p)));
return mapped_type(::efl_ref(static_cast<Eo*>(p)));
}
using _base_type::native_handle;

@ -68,12 +68,12 @@ struct eo_clone_allocator
{
static Eo* allocate_clone(Eo const& v)
{
return ::eo_ref(&v);
return ::efl_ref(&v);
}
static void deallocate_clone(Eo const* p)
{
::eo_unref(const_cast<Eo*>(p));
::efl_unref(const_cast<Eo*>(p));
}
};

@ -333,7 +333,7 @@ template <typename T>
Eo* convert_to_c_impl(T v, tag<Eo*, T, true>
, typename std::enable_if<eo::is_eolian_object<T>::value>::type* = 0)
{
return ::eo_ref(v._eo_ptr());
return ::efl_ref(v._eo_ptr());
}
template <typename T>
Eo const* convert_to_c_impl(T v, tag<Eo const*, T>
@ -556,7 +556,7 @@ struct is_container<efl::eina::array<T>> : std::true_type {};
template <typename T>
T convert_to_event(void* value, typename std::enable_if< eo::is_eolian_object<T>::value>::type* = 0)
{
return T{::eo_ref(static_cast<Eo*>(value))};
return T{::efl_ref(static_cast<Eo*>(value))};
}
template <typename T>
T convert_to_event(void* value, typename std::enable_if< is_container<T>::value
@ -748,15 +748,15 @@ struct is_callable<T, decltype(std::declval<T>() ())> : std::true_type {};
inline void do_eo_add(Eo*& object, efl::eo::concrete const& parent
, Efl_Class const* klass)
{
object = ::_eo_add_internal_start(__FILE__, __LINE__, klass, parent._eo_ptr(), EINA_TRUE, EINA_FALSE);
object = ::_eo_add_end(object, EINA_FALSE, EINA_FALSE);
object = ::_efl_add_internal_start(__FILE__, __LINE__, klass, parent._eo_ptr(), EINA_TRUE, EINA_FALSE);
object = ::_efl_add_end(object, EINA_FALSE, EINA_FALSE);
}
template <typename F>
void do_eo_add(Eo*& object, efl::eo::concrete const& parent, Efl_Class const* klass, F f)
{
object = ::_eo_add_internal_start(__FILE__, __LINE__, klass, parent._eo_ptr(), EINA_TRUE, EINA_FALSE);
object = ::_efl_add_internal_start(__FILE__, __LINE__, klass, parent._eo_ptr(), EINA_TRUE, EINA_FALSE);
f();
object = ::_eo_add_end(object, EINA_FALSE, EINA_FALSE);
object = ::_efl_add_end(object, EINA_FALSE, EINA_FALSE);
}
template <typename D, typename T>

@ -75,21 +75,21 @@ template <typename F>
struct _event_deleter
{
_event_deleter(F* data, Eo* eo, ::Efl_Event_Cb cb, Efl_Event_Description const* description)
: _data(data), _eo( ::eo_ref(eo)), _cb(cb), _description(description)
: _data(data), _eo( ::efl_ref(eo)), _cb(cb), _description(description)
{
}
~_event_deleter()
{
::eo_unref(_eo);
::efl_unref(_eo);
}
_event_deleter(_event_deleter const& other)
: _data(other._data), _eo( ::eo_ref(other._eo)), _cb(other._cb), _description(other._description)
: _data(other._data), _eo( ::efl_ref(other._eo)), _cb(other._cb), _description(other._description)
{}
_event_deleter& operator=(_event_deleter const& other)
{
::eo_unref( _eo);
::efl_unref( _eo);
_data = other._data;
_eo = ::eo_ref(other._eo);
_eo = ::efl_ref(other._eo);
_cb = other._cb;
_description = other._description;
return *this;
@ -137,7 +137,7 @@ void really_call_event(T& wrapper, F& f, void *info, std::false_type)
template <typename T, typename P, typename F>
void event_callback(void *data, ::Eo_Event const* event)
{
T wrapper(::eo_ref(event->object));
T wrapper(::efl_ref(event->object));
F *f = static_cast<F*>(data);
_detail::really_call_event<T, P>
(wrapper, *f, event->info, std::is_void<P>{});

@ -12,49 +12,49 @@ namespace efl { namespace eo { namespace detail {
inline void
init()
{
::eo_init();
::efl_object_init();
}
inline void
shutdown()
{
::eo_shutdown();
::efl_object_shutdown();
}
inline Eo*
ref(Eo *obj)
{
return ::eo_ref(obj);
return ::efl_ref(obj);
}
inline const Eo*
ref(const Eo *obj)
{
return ::eo_ref(obj);
return ::efl_ref(obj);
}
inline void
unref(const Eo *obj)
{
::eo_unref(obj);
::efl_unref(obj);
}
inline int
ref_get(const Eo *obj)
{
return ::eo_ref_get(obj);
return ::efl_ref_get(obj);
}
inline Eina_Bool
isa(const Eo *obj, const Efl_Class *klass)
{
return eo_isa(obj, klass);
return efl_isa(obj, klass);
}
inline Eo*
add(const Efl_Class *klass, Eo *parent = NULL)
{
Eo *eo = eo_add_ref(klass, parent);
Eo *eo = efl_add_ref(klass, parent);
return eo;
}

@ -43,10 +43,10 @@ START_TEST(eina_cxx_eo_accessor_indexing)
efl::eina::list<wrapper> list;
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
wrapper const w2(efl_add(SIMPLE_CLASS, NULL));
wrapper const w3(efl_add(SIMPLE_CLASS, NULL));
wrapper const w4(efl_add(SIMPLE_CLASS, NULL));
list.push_back(w1);
list.push_back(w2);
@ -97,10 +97,10 @@ START_TEST(eina_cxx_eo_accessor_iterator)
efl::eina::list<wrapper> list;
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
wrapper const w2(efl_add(SIMPLE_CLASS, NULL));
wrapper const w3(efl_add(SIMPLE_CLASS, NULL));
wrapper const w4(efl_add(SIMPLE_CLASS, NULL));
list.push_back(w1);
list.push_back(w2);

@ -26,9 +26,9 @@ START_TEST(eina_cxx_ptrarray_push_back)
int result[] = {5, 10, 15};
int rresult[] = {15, 10, 5};
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
wrapper const w2(efl_add(SIMPLE_CLASS, NULL));
wrapper const w3(efl_add(SIMPLE_CLASS, NULL));
{
efl::eina::ptr_array<int> array;
@ -102,9 +102,9 @@ START_TEST(eina_cxx_ptrarray_pop_back)
ck_assert(std::equal(array.rbegin(), array.rend(), rresult));
}
{
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
wrapper const w2(efl_add(SIMPLE_CLASS, NULL));
wrapper const w3(efl_add(SIMPLE_CLASS, NULL));
efl::eina::array<wrapper> array;
@ -197,11 +197,11 @@ START_TEST(eina_cxx_ptrarray_insert)
ck_assert(std::equal(array.begin(), array.end(), array4.begin()));
}
{
wrapper const w0(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
wrapper const w0(efl_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
wrapper const w2(efl_add(SIMPLE_CLASS, NULL));
wrapper const w3(efl_add(SIMPLE_CLASS, NULL));
wrapper const w4(efl_add(SIMPLE_CLASS, NULL));
efl::eina::array<wrapper> array;
ck_assert(std::distance(array.begin(), array.end()) == 0u);
@ -277,7 +277,7 @@ START_TEST(eina_cxx_ptrarray_constructors)
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
{
efl::eina::ptr_array<int> array1;
@ -356,12 +356,12 @@ START_TEST(eina_cxx_ptrarray_erase)
ck_assert(array1.back() == 25);
}
{
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
wrapper const w5(eo_add(SIMPLE_CLASS, NULL));
wrapper const w6(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
wrapper const w2(efl_add(SIMPLE_CLASS, NULL));
wrapper const w3(efl_add(SIMPLE_CLASS, NULL));
wrapper const w4(efl_add(SIMPLE_CLASS, NULL));
wrapper const w5(efl_add(SIMPLE_CLASS, NULL));
wrapper const w6(efl_add(SIMPLE_CLASS, NULL));
efl::eina::array<wrapper> array1;
@ -437,12 +437,12 @@ START_TEST(eina_cxx_ptrarray_range)
}
{
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
wrapper const w5(eo_add(SIMPLE_CLASS, NULL));
wrapper const w6(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
wrapper const w2(efl_add(SIMPLE_CLASS, NULL));
wrapper const w3(efl_add(SIMPLE_CLASS, NULL));
wrapper const w4(efl_add(SIMPLE_CLASS, NULL));
wrapper const w5(efl_add(SIMPLE_CLASS, NULL));
wrapper const w6(efl_add(SIMPLE_CLASS, NULL));
efl::eina::array<wrapper> array;
array.push_back(w1);

@ -28,9 +28,9 @@ START_TEST(eina_cxx_ptrlist_push_back)
int result[] = {5, 10, 15};
int rresult[] = {15, 10, 5};
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
wrapper const w2(efl_add(SIMPLE_CLASS, NULL));
wrapper const w3(efl_add(SIMPLE_CLASS, NULL));
{
efl::eina::ptr_list<int> list;
@ -77,9 +77,9 @@ START_TEST(eina_cxx_ptrlist_pop_back)
int result[] = {5, 10};
int rresult[] = {10, 5};
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
wrapper const w2(efl_add(SIMPLE_CLASS, NULL));
wrapper const w3(efl_add(SIMPLE_CLASS, NULL));
{
efl::eina::ptr_list<int> list;
@ -143,9 +143,9 @@ START_TEST(eina_cxx_ptrlist_push_front)
ck_assert(std::equal(list.rbegin(), list.rend(), rresult));
}
{
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
wrapper const w2(efl_add(SIMPLE_CLASS, NULL));
wrapper const w3(efl_add(SIMPLE_CLASS, NULL));
efl::eina::list<wrapper> list;
@ -171,9 +171,9 @@ START_TEST(eina_cxx_ptrlist_pop_front)
int result[] = {10, 5};
int rresult[] = {5, 10};
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
wrapper const w2(efl_add(SIMPLE_CLASS, NULL));
wrapper const w3(efl_add(SIMPLE_CLASS, NULL));
{
efl::eina::ptr_list<int> list;
@ -273,11 +273,11 @@ START_TEST(eina_cxx_ptrlist_insert)
ck_assert(std::equal(list.begin(), list.end(), list4.begin()));
}
{
wrapper const w0(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
wrapper const w0(efl_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
wrapper const w2(efl_add(SIMPLE_CLASS, NULL));
wrapper const w3(efl_add(SIMPLE_CLASS, NULL));
wrapper const w4(efl_add(SIMPLE_CLASS, NULL));
efl::eina::list<wrapper> list;
@ -366,11 +366,11 @@ START_TEST(eina_cxx_ptrlist_constructors)
ck_assert(list2 == list4);
}
{
wrapper const w0(eo_add(SIMPLE_CLASS, NULL));
wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
wrapper const w0(efl_add(SIMPLE_CLASS, NULL));
wrapper const w1(efl_add(SIMPLE_CLASS, NULL));
wrapper const w2(efl_add(SIMPLE_CLASS, NULL));
wrapper const w3(efl_add(SIMPLE_CLASS, NULL));
wrapper const w4(efl_add(SIMPLE_CLASS, NULL));
efl::eina::list<wrapper> list1;
ck_assert(list1.empty());

Loading…
Cancel
Save