tests/eolian_cxx/eolian_cxx_test_address_of.cc \
tests/eolian_cxx/eolian_cxx_test_wrapper.cc \
tests/eolian_cxx/simple.c \
+tests/eolian_cxx/name_name.c \
+tests/eolian_cxx/name_name_cxx.cc \
tests/eolian_cxx/generic.c \
tests/eolian_cxx/eolian_cxx_test_inheritance.cc \
tests/eolian_cxx/eolian_cxx_test_generate.cc \
tests/eolian_cxx/tests_eolian_cxx_eolian_cxx_suite-c.$(OBJEXT): tests/eolian_cxx/c.eo.c tests/eolian_cxx/c.eo.h
tests/eolian_cxx/tests_eolian_cxx_eolian_cxx_suite-d.$(OBJEXT): tests/eolian_cxx/d.eo.c tests/eolian_cxx/d.eo.h
+tests/eolian_cxx/tests_eolian_cxx_eolian_cxx_suite-name_name.$(OBJEXT): tests/eolian_cxx/name_name.eo.c tests/eolian_cxx/name_name.eo.h
+tests/eolian_cxx/tests_eolian_cxx_eolian_cxx_suite-name_name_cxx.$(OBJEXT): tests/eolian_cxx/name_name.eo.h tests/eolian_cxx/name_name.eo.hh
+
CLEANFILES += \
tests/eolian_cxx/callback.eo.hh \
tests/eolian_cxx/callback.eo.c \
return;
}
- ancestor.insert(class_format_cxx(safe_lower(klass_name)));
+ ancestor.insert(class_format_cxx(safe_str(klass_name)));
Eina_Iterator* inheritances = ::eolian_class_inherits_get(klass);
void* curr = 0;
EINA_ITERATOR_FOREACH(inheritances, curr)
{
const char* klass_name = static_cast<const char*>(curr);
- cls.parents.push_back(class_format_cxx(safe_lower(klass_name)));
+ cls.parents.push_back(class_format_cxx(safe_str(klass_name)));
add_ancestor_recursive(klass_name, ancestors);
}
eina_iterator_free(inheritances);
cls.type = class_type(klass);
cls.name = class_name(klass);
cls.name_space = class_namespace_full(klass);
+ if(cls.name_space.empty())
+ cls.name_space = "nonamespace";
cls.eo_name = class_eo_name(klass);
cls.comment = convert_comments_class(klass);
return cls;
inline std::string
class_name(Eolian_Class const& klass)
{
- return safe_lower(::eolian_class_name_get(&klass));
+ return ::eolian_class_name_get(&klass);
}
inline std::string
event.is_beta = (::eolian_event_is_beta(event_) != EINA_FALSE);
event.name = normalize_spaces(name_);
event.eo_name = safe_upper
- (find_replace(class_full_name(klass), ".", "_") + "_EVENT_" + event.name);
+ (find_replace(safe_lower(class_full_name(klass)), ".", "_") + "_EVENT_" + event.name);
/* FIXME: use doc api */
event.comment = safe_str("");
}
inline std::string
class_format_cxx(std::string const& fullname)
{
- std::string s = fullname;
- auto found = s.find(".");
- while (found != std::string::npos)
- {
- s.replace(found, 1, "::");
- found = s.find(".");
- }
- return s;
+ auto current = fullname.begin(), last = fullname.end();
+ auto found = std::find(current, last, '.');
+ std::string new_string;
+ if(found == last)
+ new_string = "nonamespace::" + fullname;
+ else
+ while (current != last)
+ {
+ if(found == last)
+ {
+ new_string.insert(new_string.end(), current, found);
+ current = found;
+ }
+ else
+ {
+ new_string += std::tolower(*current);
+ new_string.insert(new_string.end(), std::next(current), found);
+ new_string = safe_lower(new_string);
+ new_string += "::";
+ current = std::next(found);
+ found = std::find(current, last, '.');
+ }
+ }
+ return new_string;
}
inline bool
x.category = efl::eolian::eolian_type::simple_;
x.is_class = true;
x.binding_requires_optional = false;
- x.binding = "::" + class_format_cxx(safe_lower(safe_str(::eolian_class_full_name_get(klass))));
+ x.binding = "::" + class_format_cxx(safe_str(::eolian_class_full_name_get(klass)));
+ x.native = "::";
+ x.native += safe_str( ::eolian_class_full_name_get(klass));
+ std::replace(x.native.begin(), x.native.end(), '.', '_');
+
+ if( ::eolian_type_is_const(base_type))
+ x.native += " const";
+
+ x.native += '*';
+
Eina_Stringshare* klass_file = ::eolian_class_file_get(klass);
if (klass_file)
}
}
- x.native = normalize_spaces(safe_str(::eolian_type_c_type_get(&type)));
+ if(x.native.empty())
+ x.native = normalize_spaces(safe_str(::eolian_type_c_type_get(&type)));
x.is_own = ::eolian_type_is_own(&type);
x.is_const = ::eolian_type_is_const(&type);
return x;
#include "eo_ops.hh"
namespace eo {
-struct base;
+struct Base;
}
namespace efl { namespace eo { namespace detail {
}
template <typename T> struct operation_description_class_size;
-template <> struct operation_description_class_size< ::eo::base> : std::integral_constant<std::size_t, 0u> {};
+template <> struct operation_description_class_size< ::eo::Base> : std::integral_constant<std::size_t, 0u> {};
/// @internal
///
template <typename T> struct operations;
template <>
-struct operations< ::eo::base> { template <typename T> struct type {}; };
+struct operations< ::eo::Base> { template <typename T> struct type {}; };
/// @internal
///
namespace efl { namespace eo { namespace detail {
template <typename T>
-int initialize_operation_description(efl::eo::detail::tag< ::eo::base>
+int initialize_operation_description(efl::eo::detail::tag< ::eo::Base>
, Eo_Op_Description* ops)
{
(void)ops;
#endif
#include <Ecore_Audio.h>
+#include <ecore_audio.eo.h>
#include <Ecore_Audio.hh>
#include <iostream>
efl::eina::eina_init eina_init;
efl::eo::eo_init eo_init;
- efl::eina::list<simple> list;
+ efl::eina::list<nonamespace::Simple> list;
- simple const w1;
- simple const w2;
- simple const w3;
- simple const w4;
+ nonamespace::Simple const w1;
+ nonamespace::Simple const w2;
+ nonamespace::Simple const w3;
+ nonamespace::Simple const w4;
list.push_back(w1);
list.push_back(w2);
list.push_back(w3);
list.push_back(w4);
- efl::eina::iterator<simple> iterator = list.ibegin()
+ efl::eina::iterator<nonamespace::Simple> iterator = list.ibegin()
, last_iterator = list.iend();
- simple const result[] = {w1, w2, w3, w4};
+ nonamespace::Simple const result[] = {w1, w2, w3, w4};
ck_assert(std::equal(iterator, last_iterator, result));
}
# include <config.h>
#endif
+#include <Eo.hh>
+
#include <a.eo.hh>
#include <b.eo.hh>
#include <c.eo.hh>
{
efl::eo::eo_init init;
- d d_obj;
+ nonamespace::D d_obj;
- a* a_ptr = &d_obj;
- b* b_ptr = &d_obj;
- c* c_ptr = &d_obj;
- d* d_ptr = &d_obj;
+ nonamespace::A* a_ptr = &d_obj;
+ nonamespace::B* b_ptr = &d_obj;
+ nonamespace::C* c_ptr = &d_obj;
+ nonamespace::D* d_ptr = &d_obj;
fail_unless(a_ptr == (void*) b_ptr);
fail_unless(a_ptr == (void*) c_ptr);
bool called1 = false;
- generic g(
+ nonamespace::Generic g(
g.required_ctor_a(1),
g.required_ctor_b(std::bind([&called1] { called1 = true; }))
);
bool called1 = false;
bool called2 = false;
- generic g(
+ nonamespace::Generic g(
g.required_ctor_a(2),
g.required_ctor_b(std::bind([&called1] { called1 = true; })),
g.optional_ctor_a(3),
{
efl::eo::eo_init i;
- callback c;
+ nonamespace::Callback c;
bool called1 = false, called2 = false;
{
efl::eo::eo_init i;
- callback c;
+ nonamespace::Callback c;
bool called1 = false, called2 = false;
{
efl::eo::eo_init i;
- callback c;
+ nonamespace::Callback c;
int called1 = 0, called2 = 0, called3 = 0, called4 = 0;
bool called = false;
- callback::test_global_callbacks(std::bind([&called] { called = true; }));
+ nonamespace::Callback::test_global_callbacks(std::bind([&called] { called = true; }));
fail_if(!called);
}
START_TEST(eolian_cxx_test_disconnect_inside_callback)
{
efl::eo::eo_init i;
- callback c;
+ nonamespace::Callback c;
std::vector<long> capture_me;
int times_called = 0;
#include "eolian_cxx_suite.h"
struct bar
-: efl::eo::inherit<bar, simple>
+: efl::eo::inherit<bar, nonamespace::Simple>
{
bar()
: inherit_base(efl::eo::parent = nullptr)
}
};
-void foo(simple is)
+void foo(nonamespace::Simple is)
{
fail_if(is.simple_get());
}
efl::eo::eo_init init;
::efl::eo::concrete b(nullptr);
- ::callback c;
+ ::nonamespace::Callback c;
fail_if(sizeof(b) != sizeof(Eo*));
fail_if(sizeof(b) != sizeof(c));
--- /dev/null
+
+#include <Eo.h>
+
+struct Name_Name_Data {};
+typedef struct Name_Name_Data Name_Name_Data;
+
+#include "name_name.eo.h"
+#include "name_name.eo.c"
--- /dev/null
+class Name.Name {
+ legacy_prefix: null;
+}
+
--- /dev/null
+
+#include <Eo.h>
+
+#include "name_name.eo.h"
+#include "name_name.eo.hh"
+