summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-11-29 16:42:37 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-11-29 16:43:09 -0200
commitb06d2510deab1884ea9c85cb7944102b3fb2078f (patch)
treee561e0c7475a5e22865265b82813901e2c647ac0
parent90b6468bbd2d9c14e24d5bfe9f655b3f074c39ce (diff)
downloadefl-b06d2510deab1884ea9c85cb7944102b3fb2078f.tar.gz
eolian-js: Fix compilation of JavaScript binding
-rw-r--r--src/Makefile_Cxx.am2
-rw-r--r--src/Makefile_Efl_Js.am1
-rw-r--r--src/Makefile_Eolian_Js.am3
-rw-r--r--src/bin/eolian_js/eolian/class.hh6
-rw-r--r--src/bin/eolian_js/main.cc90
-rw-r--r--src/bindings/js/eio_js/eio_js.cc1
6 files changed, 60 insertions, 43 deletions
diff --git a/src/Makefile_Cxx.am b/src/Makefile_Cxx.am
index c87a5597fb..febc123dff 100644
--- a/src/Makefile_Cxx.am
+++ b/src/Makefile_Cxx.am
@@ -129,7 +129,7 @@ bindings/cxx/ecore_cxx/Ecore_Manual.hh
nodist_installed_ecorecxxheaders_DATA = $(ecore_eolian_cxx_hh) $(ecore_eolian_cxx_impl_hh) \
lib/ecore/Ecore.eo.hh
-lib/ecore/Ecore.eo.hh: $(ecore_eolian_cxx_hh) $(eo_eolian_cxx_hh)
+lib/ecore/Ecore.eo.hh: $(ecore_eolian_cxx_hh) $(eo_eolian_cxx_hh) $(efl_eolian_cxx_hh)
@echo @ECHO_E@ "#ifndef EFL_CXX_ECORE_HH\n#define EFL_CXX_ECORE_HH\n" > $(top_builddir)/src/lib/ecore/Ecore.eo.hh
@echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/ecore/Ecore.eo.hh
@for i in $(ecore_eolian_cxx_hh); do echo "#include <$$(basename $$i)>" >> $(top_builddir)/src/lib/ecore/Ecore.eo.hh; done
diff --git a/src/Makefile_Efl_Js.am b/src/Makefile_Efl_Js.am
index 64c643acd7..085f05f3e5 100644
--- a/src/Makefile_Efl_Js.am
+++ b/src/Makefile_Efl_Js.am
@@ -204,6 +204,7 @@ SUITE_RUNNER_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/efl_js\" \
@CHECK_CFLAGS@ \
@EFL_JS_CFLAGS@ \
+@EFL_CFLAGS@ \
@EINA_CXX_CFLAGS@ \
@EO_CXX_CFLAGS@ \
@EO_CFLAGS@ \
diff --git a/src/Makefile_Eolian_Js.am b/src/Makefile_Eolian_Js.am
index 9752027a26..b0e64de6da 100644
--- a/src/Makefile_Eolian_Js.am
+++ b/src/Makefile_Eolian_Js.am
@@ -13,6 +13,9 @@ bin_eolian_js_eolian_js_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/bindings/js/eo_js \
@EOLIAN_JS_CFLAGS@ \
@EINA_CXX_CFLAGS@ \
+@EO_CXX_CFLAGS@ \
+@EFL_CFLAGS@ \
+@ECORE_CXX_CFLAGS@ \
@EOLIAN_CXX_CFLAGS@
bin_eolian_js_eolian_js_LDADD = @USE_EO_LIBS@ @USE_EOLIAN_LIBS@
diff --git a/src/bin/eolian_js/eolian/class.hh b/src/bin/eolian_js/eolian/class.hh
index 227798700a..633d6c4e72 100644
--- a/src/bin/eolian_js/eolian/class.hh
+++ b/src/bin/eolian_js/eolian/class.hh
@@ -1,6 +1,7 @@
#ifndef EOLIAN_KLASS_HH
#define EOLIAN_KLASS_HH
+#include <Eo.hh>
#include <Eina.hh>
#include <eolian/js/domain.hh>
@@ -38,11 +39,6 @@ inline std::string type_class_name(Eolian_Type const* tp)
if (tp)
{
Eolian_Type_Type tpt = ::eolian_type_type_get(tp);
- if (tpt == EOLIAN_TYPE_POINTER)
- {
- return type_class_name(::eolian_type_base_type_get(tp));
- }
- else
{
tp = ::eolian_type_aliased_base_get(tp);
tpt = ::eolian_type_type_get(tp);
diff --git a/src/bin/eolian_js/main.cc b/src/bin/eolian_js/main.cc
index 9f95c741fd..db5fa16546 100644
--- a/src/bin/eolian_js/main.cc
+++ b/src/bin/eolian_js/main.cc
@@ -83,18 +83,57 @@ _final_type_and_type_type_get(Eolian_Type const* tp_in, Eolian_Type const*& tp_o
}
std::string
-_eolian_type_cpp_type_named_get(const Eolian_Type *tp, std::string const& caller_class_prefix, std::set<std::string>& need_name_getter)
+_eolian_type_cpp_type_named_get(const Eolian_Type *tp, std::string const& caller_class_prefix, std::set<std::string>& need_name_getter, bool in_pointer = false)
{
const auto is_const = eolian_type_is_const(tp);
+ std::string result;
+
+ if(!in_pointer && (eolian_type_is_ptr(tp) || eolian_type_type_get(tp) == EOLIAN_TYPE_TERMINATED_ARRAY
+ || eolian_type_type_get(tp) == EOLIAN_TYPE_STATIC_ARRAY))
+ // else if (tpt == EOLIAN_TYPE_POINTER)
+ {
+ // auto btp = eolian_type_base_type_get(tp);
+ auto btp = eolian_type_type_get(tp) == EOLIAN_TYPE_TERMINATED_ARRAY
+ || eolian_type_type_get(tp) == EOLIAN_TYPE_STATIC_ARRAY
+ ? eolian_type_base_type_get(tp)
+ : tp;
+ result += _eolian_type_cpp_type_named_get(btp, caller_class_prefix, need_name_getter
+ , eolian_type_is_ptr(tp));
+ const auto base_is_const = eolian_type_is_const(btp);
+
+ Eolian_Type_Type btpt = EOLIAN_TYPE_UNKNOWN_TYPE;
+ _final_type_and_type_type_get(btp, btp, btpt);
+ auto btpd = eolian_type_typedecl_get(btp);
+
+ if (btpd && eolian_typedecl_type_get(btpd) == EOLIAN_TYPEDECL_STRUCT)
+ {
+ std::string f = "::make_struct_tag";
+ auto p = result.find(f);
+ if (p == std::string::npos)
+ throw std::runtime_error("missing struct type tag");
+ result.replace(p, f.size(), "::make_struct_ptr_tag");
+ result.pop_back();
+ result += " *";
+ if (is_const) result += " const";
+ result += ">";
+ }
+ else
+ {
+ // if (btpt != EOLIAN_TYPE_POINTER || base_is_const)
+ // result += ' ';
+ result += '*';
+ if (is_const) result += " const";
+ }
+ }
+ else
+ {
Eolian_Type_Type tpt = EOLIAN_TYPE_UNKNOWN_TYPE;
_final_type_and_type_type_get(tp, tp, tpt);
if (tpt == EOLIAN_TYPE_UNKNOWN_TYPE || tpt == EOLIAN_TYPE_UNDEFINED)
return "error";
- std::string result;
-
if ((tpt == EOLIAN_TYPE_VOID
|| tpt == EOLIAN_TYPE_REGULAR
|| tpt == EOLIAN_TYPE_COMPLEX
@@ -207,40 +246,19 @@ _eolian_type_cpp_type_named_get(const Eolian_Type *tp, std::string const& caller
}
else if (tpt == EOLIAN_TYPE_VOID)
result += "void";
- else if (tpt == EOLIAN_TYPE_POINTER)
- {
- auto btp = eolian_type_base_type_get(tp);
- result += _eolian_type_cpp_type_named_get(btp, caller_class_prefix, need_name_getter);
- const auto base_is_const = eolian_type_is_const(btp);
-
- Eolian_Type_Type btpt = EOLIAN_TYPE_UNKNOWN_TYPE;
- _final_type_and_type_type_get(btp, btp, btpt);
- auto btpd = eolian_type_typedecl_get(btp);
-
- if (btpd && eolian_typedecl_type_get(btpd) == EOLIAN_TYPEDECL_STRUCT)
- {
- std::string f = "::make_struct_tag";
- auto p = result.find(f);
- if (p == std::string::npos)
- throw std::runtime_error("missing struct type tag");
- result.replace(p, f.size(), "::make_struct_ptr_tag");
- result.pop_back();
- result += " *";
- if (is_const) result += " const";
- result += ">";
- }
- else
- {
- if (btpt != EOLIAN_TYPE_POINTER || base_is_const)
- result += ' ';
- result += '*';
- if (is_const) result += " const";
- }
- }
- else
- {
- throw std::runtime_error("unhandled Eolian_Type_Type value");
+ // else if(tpt == EOLIAN_TYPE_STATIC_ARRAY)
+ // {
+ // result += "void";
+ // }
+ // else if(tpt == EOLIAN_TYPE_TERMINATED_ARRAY)
+ // {
+ // result += "void";
+ // }
}
+ // else
+ // {
+ // throw std::runtime_error("unhandled Eolian_Type_Type value");
+ // }
/*if (!name.empty())
{
diff --git a/src/bindings/js/eio_js/eio_js.cc b/src/bindings/js/eio_js/eio_js.cc
index 7fafe8b181..99f41bc60a 100644
--- a/src/bindings/js/eio_js/eio_js.cc
+++ b/src/bindings/js/eio_js/eio_js.cc
@@ -79,7 +79,6 @@ static v8::Local<v8::Object> wrap_eina_file(Eina_File *file,
using v8::ObjectTemplate;
using v8::Object;
using v8::FunctionTemplate;
- using v8::WeakCallbackData;
auto obj_tpl = compatibility_new<ObjectTemplate>(isolate);
obj_tpl->SetInternalFieldCount(1);