efl-js: JavaScript Eolian binding

To configure efl sources with bindings to use in nodejs add ––with-js=nodejs in configure flags to generate node files

$ configure --with-js=nodejs

and compile normally with:

$ make
$ make install

To use, you have to require efl:

efl = require('efl')

The bindings is divided in two parts: generated and manually
written. The generation uses the Eolian library for parsing Eo files
and generate C++ code that is compiled against V8 interpreter library
to create a efl.node file that can be required in a node.js instance.

@feature
devs/felipealmeida/js
Felipe Magno de Almeida 9 years ago
parent 1a3cb45f1c
commit a3db1dddd3
  1. 1
      .gitignore
  2. 8
      Makefile.am
  3. 275
      configure.ac
  4. 3
      pc/.gitignore
  5. 15
      pc/efl-js.pc.in
  6. 14
      pc/eina-js.pc.in
  7. 15
      pc/eo-js.pc.in
  8. 14
      pc/eolian-js.pc.in
  9. 2
      pc/evas.pc.in
  10. 16
      src/Makefile.am
  11. 10
      src/Makefile_Ecore.am
  12. 11
      src/Makefile_Ecore_Audio.am
  13. 10
      src/Makefile_Ecore_Con.am
  14. 19
      src/Makefile_Ecore_Js.am
  15. 12
      src/Makefile_Edje.am
  16. 10
      src/Makefile_Efl.am
  17. 333
      src/Makefile_Efl_Js.am
  18. 4
      src/Makefile_Eina_Cxx.am
  19. 11
      src/Makefile_Emotion.am
  20. 10
      src/Makefile_Eo.am
  21. 123
      src/Makefile_Eolian_Js.am
  22. 18
      src/Makefile_Eolian_Js_Helper.am
  23. 10
      src/Makefile_Evas.am
  24. 139
      src/bin/efl_js/efljslaunch
  25. 7
      src/bin/efl_js/efljslaunch.desktop
  26. 7
      src/bin/efl_js/efljslaunch.xml
  27. 251
      src/bin/efl_js/efljspack
  28. 156
      src/bin/efl_js/launcher_main.cc
  29. 1
      src/bin/eolian_js/.gitignore
  30. 139
      src/bin/eolian_js/eolian/class.hh
  31. 8
      src/bin/eolian_js/eolian/js/domain.hh
  32. 44
      src/bin/eolian_js/eolian/js/format.hh
  33. 1090
      src/bin/eolian_js/main.cc
  34. 1
      src/bindings/eina_cxx/Eina.hh
  35. 5
      src/bindings/eina_cxx/eina_accessor.hh
  36. 250
      src/bindings/eina_cxx/eina_array.hh
  37. 3
      src/bindings/eina_cxx/eina_clone_allocators.hh
  38. 26
      src/bindings/eina_cxx/eina_function.hh
  39. 2
      src/bindings/eina_cxx/eina_integer_sequence.hh
  40. 14
      src/bindings/eina_cxx/eina_list.hh
  41. 34
      src/bindings/eina_cxx/eina_logical.hh
  42. 8
      src/bindings/eina_cxx/eina_pp.hh
  43. 16
      src/bindings/eina_cxx/eina_ptrarray.hh
  44. 79
      src/bindings/eina_cxx/eina_ptrlist.hh
  45. 58
      src/bindings/eina_cxx/eina_range_types.hh
  46. 60
      src/bindings/eina_cxx/eina_tuple.hh
  47. 24
      src/bindings/eina_cxx/eina_tuple_c.hh
  48. 16
      src/bindings/eina_cxx/eina_type_traits.hh
  49. 1
      src/bindings/eldbus_cxx/eldbus_freedesktop.hh
  50. 7
      src/bindings/eo_cxx/eo_concrete.hh
  51. 58
      src/bindings/js/ecore_js/Ecore_Js.hh
  52. 608
      src/bindings/js/ecore_js/ecore_js_animator.cc
  53. 772
      src/bindings/js/ecore_js/ecore_js_event.cc
  54. 294
      src/bindings/js/ecore_js/ecore_js_idle.cc
  55. 76
      src/bindings/js/ecore_js/ecore_js_init.cc
  56. 83
      src/bindings/js/ecore_js/ecore_js_job.cc
  57. 207
      src/bindings/js/ecore_js/ecore_js_mainloop.cc
  58. 190
      src/bindings/js/ecore_js/ecore_js_poller.cc
  59. 63
      src/bindings/js/ecore_js/ecore_js_throttle.cc
  60. 232
      src/bindings/js/ecore_js/ecore_js_timer.cc
  61. 38
      src/bindings/js/ecore_js/ecore_js_timer.hh
  62. 30
      src/bindings/js/efl_js/Efl_Js.hh
  63. 241
      src/bindings/js/efl_js/efl_js.cc
  64. 50
      src/bindings/js/eina_js/Eina_Js.hh
  65. 34
      src/bindings/js/eina_js/eina_js_accessor.cc
  66. 87
      src/bindings/js/eina_js/eina_js_accessor.hh
  67. 119
      src/bindings/js/eina_js/eina_js_array.hh
  68. 12
      src/bindings/js/eina_js/eina_js_compatibility.cc
  69. 918
      src/bindings/js/eina_js/eina_js_compatibility.hh
  70. 495
      src/bindings/js/eina_js/eina_js_container.cc
  71. 351
      src/bindings/js/eina_js/eina_js_container.hh
  72. 24
      src/bindings/js/eina_js/eina_js_error.cc
  73. 25
      src/bindings/js/eina_js/eina_js_error.hh
  74. 449
      src/bindings/js/eina_js/eina_js_get_value.hh
  75. 261
      src/bindings/js/eina_js/eina_js_get_value_from_c.hh
  76. 32
      src/bindings/js/eina_js/eina_js_iterator.cc
  77. 81
      src/bindings/js/eina_js/eina_js_iterator.hh
  78. 132
      src/bindings/js/eina_js/eina_js_list.hh
  79. 742
      src/bindings/js/eina_js/eina_js_log.cc
  80. 133
      src/bindings/js/eina_js/eina_js_log.hh
  81. 14
      src/bindings/js/eina_js/eina_js_node.hh
  82. 132
      src/bindings/js/eina_js/eina_js_value.cc
  83. 142
      src/bindings/js/eina_js/eina_js_value.hh
  84. 44
      src/bindings/js/eio_js/Eio_Js.hh
  85. 1756
      src/bindings/js/eio_js/eio_js.cc
  86. 48
      src/bindings/js/eldbus_js/Eldbus_Js.hh
  87. 543
      src/bindings/js/eldbus_js/eldbus_js_connection.cc
  88. 183
      src/bindings/js/eldbus_js/eldbus_js_core.cc
  89. 103
      src/bindings/js/eldbus_js/eldbus_js_message.cc
  90. 100
      src/bindings/js/eldbus_js/eldbus_js_object_mapper.cc
  91. 836
      src/bindings/js/eldbus_js/eldbus_js_util.hh
  92. 15
      src/bindings/js/eo_js/Eo_Js.hh
  93. 288
      src/bindings/js/eo_js/eo_js_call_function.hh
  94. 39
      src/bindings/js/eo_js/eo_js_construct_from_eo.hh
  95. 136
      src/bindings/js/eo_js/eo_js_constructor.hh
  96. 12
      src/bindings/js/eo_js/eo_js_direction.hh
  97. 126
      src/bindings/js/eo_js/eo_js_event.hh
  98. 24
      src/bindings/js/eo_js/eo_js_namespace.hh
  99. 106
      src/bindings/js/eo_js/eo_js_struct.hh
  100. 48
      src/bindings/js/ethumb_js/Ethumb_Js.hh
  101. Some files were not shown because too many files have changed in this diff Show More

1
.gitignore vendored

@ -35,6 +35,7 @@ tags
*.eo.legacy.h
*.eo.hh
*.eo.impl.hh
*.eo.js.cc
*.eo.lua
*.luac
.dir-locals.el

@ -172,6 +172,14 @@ if HAVE_ELUA
pkgconfig_DATA += pc/elua.pc
endif
if HAVE_JS
pkgconfig_DATA += \
pc/eolian-js.pc \
pc/efl-js.pc \
pc/eo-js.pc \
pc/eina-js.pc
endif
if BUILD_ENGINE_SOFTWARE_X11
pkgconfig_DATA += pc/evas-software-x11.pc
endif

@ -1051,6 +1051,191 @@ EFL_EVAL_PKGS([EINA_CXX])
EFL_LIB_END([Eina_Cxx])
#### End of Eina CXX
AC_ARG_WITH([js],
[AS_HELP_STRING([--with-js=@<:@nodejs/libv8/libuv/none@:>@],[enable JavaScript bindings using nodejs or libv8/libuv as build dependencies. The libuv option implies libv8. @<:@default=none@:>@])],
[want_js="${withval}"], [want_js="none"])
EFLJS_CXXFLAGS=""
AC_LANG_PUSH([C++])
case "$want_js" in
nodejs)
AC_CHECK_HEADERS([node/v8.h nodejs/deps/v8/v8.h nodejs/deps/v8/include/v8.h nodejs/src/v8.h v8.h],
[
v8_header=AC_header
v8_header_define=AS_TR_CPP([HAVE_]AC_header)
EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -D$v8_header_define"
break
]
[AC_MSG_ERROR([Could not find v8 include headers from nodejs.])])
AC_CHECK_HEADERS([node/node.h nodejs/deps/node/node.h nodejs/deps/node/include/node.h nodejs/src/node.h node.h],
[
node_header_define=AS_TR_CPP([HAVE_]AC_header)
EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -D$node_header_define"
break
]
[AC_MSG_ERROR([Could not find node include headers from nodejs.])])
AC_CHECK_HEADERS([node/uv.h nodejs/deps/uv/uv.h nodejs/deps/uv/include/uv.h nodejs/src/uv.h uv.h],
[
uv_header_define=AS_TR_CPP([HAVE_]AC_header)
EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -D$uv_header_define"
break
]
[AC_MSG_ERROR([Could not find uv include headers from nodejs.])])
;;
libv8)
AC_CHECK_HEADERS([v8.h],
[
v8_header=AC_header
break
]
[AC_MSG_ERROR([Could not find v8 include headers from libv8.])])
;;
libuv)
AC_CHECK_HEADERS([v8.h],
[
v8_header=AC_header
break
]
[AC_MSG_ERROR([Could not find v8 include headers from libv8.])])
AC_CHECK_HEADERS([uv.h],
[break]
[AC_MSG_ERROR([Could not find uv include headers from libuv.])])
;;
none)
;;
*) AC_MSG_ERROR([Invalid javascript dependency (${want_js}): must be none, nodejs, libv8 or libuv]) ;;
esac
have_v8_global="no"
have_v8_create_params="no"
if test "$want_js" != "none" ; then
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include "$v8_header"
]],
[[
v8::Isolate::CreateParams create_params; create_params.array_buffer_allocator = nullptr;
]])
],
[
AC_DEFINE(HAVE_V8_CREATE_PARAMS, 1, [Define to 1 if you must pass create_params explicitly.])
have_v8_create_params="yes"
AC_MSG_NOTICE([checking for v8::Isolate::CreateParams... yes])
],
[
AC_MSG_NOTICE([checking for v8::Isolate::CreateParams... no])
])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include "$v8_header"
#include <type_traits>
]],
[[
static_assert((std::is_same< ::v8::Global<void>, ::v8::UniquePersistent<void>>::value), "");
]])
],
[
AC_DEFINE(HAVE_V8_GLOBAL, 1, [Define to 1 if you must pass create_params explicitly.])
have_v8_global="yes"
AC_MSG_NOTICE([checking for v8::Global<T> class... yes])
],
[
AC_MSG_NOTICE([checking for v8::Global<T> class... no])
])
fi
AM_CONDITIONAL([HAVE_V8_CREATE_PARAMS], [test "x${have_v8_create_params}" = "xyes"])
AM_CONDITIONAL([HAVE_V8_GLOBAL], [test "x${have_v8_global}" = "xyes"])
AC_SUBST([HAVE_V8_CREATE_PARAMS])
AC_SUBST([HAVE_V8_GLOBAL])
AC_LANG_POP([C++])
AM_CONDITIONAL([HAVE_NODEJS], [test "x${want_js}" = "xnodejs"])
AC_DEFINE_IF([HAVE_NODEJS], [test "x${want_js}" = "xnodejs"],
[1], [Using NodeJS])
AC_SUBST([want_js])
AC_SUBST([HAVE_NODEJS])
have_js="no"
if test "x${want_js}" != "xnone" ; then
have_js="yes"
fi
AM_CONDITIONAL([HAVE_JS], [test "x${have_js}" = "xyes"])
AC_DEFINE_IF([HAVE_JS], [test "x${have_js}" = "xyes"], [1], [Compiling bindings for JavaScript])
AC_SUBST([HAVE_JS])
AM_CONDITIONAL([HAVE_LIBUV], [test "x${want_js}" = "xnodejs" -o "x${want_js}" = "xlibuv"])
AC_DEFINE_IF([HAVE_LIBUV], [test "x${want_js}" = "xnodejs" -o "x${want_js}" = "xlibuv"],
[1], [Compiling libuv event loop integration])
AC_SUBST([HAVE_LIBUV])
# For efljspack mime handling
AM_CONDITIONAL([HAVE_XDG_DATA_HOME], [test "x${XDG_DATA_HOME}" != "x"])
AM_COND_IF([HAVE_XDG_DATA_HOME], [AC_SUBST([XDG_DATA_HOME])], [AC_SUBST([XDG_DATA_HOME], "$HOME/.local/share")])
#### Eina JS
EFL_LIB_START_OPTIONAL([Eina_Js], [test "x${have_js}" = "xyes"])
EFL_INTERNAL_DEPEND_PKG([EINA_JS], [Eina])
EFL_INTERNAL_DEPEND_PKG([EINA_JS], [Eo])
EFL_ADD_CFLAGS([EINA_JS], [${EFL_PTHREAD_CFLAGS}])
EFL_EVAL_PKGS([EINA_JS])
EFL_LIB_END_OPTIONAL([Eina_Js])
#### End of Eina JS
#### Ecore JS
EFL_LIB_START_OPTIONAL([Ecore_Js], [test "x${have_js}" = "xyes"])
EFL_INTERNAL_DEPEND_PKG([ECORE_JS], [ecore])
EFL_INTERNAL_DEPEND_PKG([ECORE_JS], [ecore_file])
EFL_ADD_CFLAGS([ECORE_JS], [${EFL_PTHREAD_CFLAGS}])
EFL_EVAL_PKGS([ECORE_JS])
EFL_LIB_END_OPTIONAL([Ecore_Js])
#### End of Ecore JS
#### Eio JS
EFL_LIB_START_OPTIONAL([Eio_Js], [test "x${have_js}" = "xyes"])
EFL_INTERNAL_DEPEND_PKG([EIO_JS], [eio])
EFL_ADD_CFLAGS([EIO_JS], [${EFL_PTHREAD_CFLAGS}])
EFL_EVAL_PKGS([EIO_JS])
EFL_LIB_END_OPTIONAL([Eio_Js])
#### End of Eio JS
#### Ethumb JS
EFL_LIB_START_OPTIONAL([Ethumb_Js], [test "x${have_js}" = "xyes"])
EFL_INTERNAL_DEPEND_PKG([ETHUMB_JS], [ethumb])
EFL_INTERNAL_DEPEND_PKG([ETHUMB_JS], [ethumb_client])
EFL_ADD_CFLAGS([ETHUMB_JS], [${EFL_PTHREAD_CFLAGS}])
EFL_EVAL_PKGS([ETHUMB_JS])
EFL_LIB_END_OPTIONAL([Ethumb_Js])
#### End of Ethumb JS
#### Eldbus JS
EFL_LIB_START_OPTIONAL([Eldbus_Js], [test "x${have_js}" = "xyes"])
EFL_INTERNAL_DEPEND_PKG([ELDBUS_JS], [eldbus])
EFL_ADD_CFLAGS([ELDBUS_JS], [${EFL_PTHREAD_CFLAGS}])
EFL_EVAL_PKGS([ELDBUS_JS])
EFL_LIB_END_OPTIONAL([Eldbus_Js])
#### End of Eldbus JS
#### Eo JS
EFL_LIB_START_OPTIONAL([Eo_Js], [test "x${have_js}" = "xyes"])
EFL_INTERNAL_DEPEND_PKG([EO_JS], [eina])
EFL_ADD_CFLAGS([EO_JS], [${EFL_PTHREAD_CFLAGS}])
EFL_EVAL_PKGS([EO_JS])
EFL_LIB_END_OPTIONAL([Eo_Js])
#### End of Eo JS
#### Eo
EFL_LIB_START([Eo])
@ -1244,6 +1429,15 @@ EFL_INTERNAL_DEPEND_PKG([EOLIAN], [eina])
EFL_LIB_END([Eolian])
#### End of Eolian
EFL_LIB_START_OPTIONAL([Eolian_Js], [test "${have_js}" = "yes"])
EFL_INTERNAL_DEPEND_PKG([EOLIAN_JS], [eina])
EFL_INTERNAL_DEPEND_PKG([EOLIAN_JS], [eolian])
EFL_LIB_END_OPTIONAL([Eolian_Js])
#### End of Eolian
EFL_LIB_START([Eolian_Cxx])
### Default values
@ -2322,6 +2516,17 @@ AC_ARG_ENABLE([g-main-loop],
fi
],
[want_g_main_loop="no"])
AC_ARG_ENABLE([libuv],
[AS_HELP_STRING([--enable-libuv],[enable ecore_main_loop based on libuv. @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_libuv="yes"
CFOPT_WARNING="xyes"
else
want_libuv="no"
fi
],
[want_libuv="no"])
AC_ARG_ENABLE([gstreamer],
[AS_HELP_STRING([--enable-gstreamer],[enable gstreamer 0.10 support. @<:@default=disabled@:>@])],
@ -2410,6 +2615,7 @@ EFL_OPTIONAL_DEPEND_PKG([ECORE], [${want_systemd}], [SYSTEMD], [libsystemd])
EFL_ADD_FEATURE([ECORE], [systemd-daemon], [${want_systemd}])
EFL_ADD_FEATURE([ECORE], [glib])
EFL_ADD_FEATURE([ECORE], [g-main-loop])
EFL_ADD_FEATURE([ECORE], [libuv])
want_glib_integration_always=no
if test "x${with_glib}" = "xalways" ; then
@ -2419,6 +2625,9 @@ fi
if test "x${want_g_main_loop}" = "xyes" ; then
AC_DEFINE([USE_G_MAIN_LOOP], [1], [Use g_main_loop in ecore])
if test "x${want_js}" = "xnodejs" -o "x${want_js}" = "xlibuv" ; then
AC_MSG_ERROR([Can't define glib and libuv integration together])
fi
fi
# not EFL_OPTIONAL_DEPEND_PKG() because it's only used for ecore examples
@ -4007,7 +4216,7 @@ EFL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [emile])
ECORE_EVAS_MODULE([extn], [${want_ecore_evas_extn}])
ECORE_EVAS_MODULE([ews], [yes])
ECORE_EVAS_MODULE([fb], [${want_fb}])
ECORE_EVAS_MODULE([drm], [${want_drm}],
ECORE_EVAS_MODULE([drm], [${want_drm}],
[EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_drm}], [ecore-drm])])
ECORE_EVAS_MODULE([gl-drm], [${want_gl_drm}],
[EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_gl_drm}], [ecore-drm])])
@ -4677,6 +4886,63 @@ EFL_ADD_LIBS([ELOCATION], [-lm])
EFL_LIB_END([Elocation])
#### End of Elocation
#### Efl_Js
EFL_LIB_START_OPTIONAL([Efl_Js], [test "x${have_js}" = "xyes"])
### Default values
### Additional options to configure
### Checks for programs
### Checks for libraries
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Eina])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Eo])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Ecore])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Eet])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Ecore_Evas])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Ecore_Con])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Ecore_Audio])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Efl])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Evas])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Edje])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Emotion])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Eldbus])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Emile])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Ethumb_Client])
EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Eio])
AM_COND_IF([HAVE_NODEJS], [], [ EFL_ADD_LIBS([EFL_JS], [-lv8]) ])
EFL_EVAL_PKGS([EFL_JS])
AM_COND_IF([HAVE_NODEJS], [EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -DHAVE_NODEJS"], [])
AM_COND_IF([HAVE_LIBUV], [EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -DHAVE_LIBUV"], [])
AM_COND_IF([HAVE_JS], [EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -DHAVE_JS"], [])
AM_COND_IF([HAVE_V8_CREATE_PARAMS], [EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -DHAVE_V8_CREATE_PARAMS"], [])
AM_COND_IF([HAVE_V8_GLOBAL], [EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -DHAVE_V8_GLOBAL"], [])
AC_SUBST([EFLJS_CXXFLAGS])
### Checks for header files
### Checks for types
### Checks for structures
### Checks for compiler characteristics
### Checks for linker characteristics
### Checks for library functions
### Check availability
EFL_LIB_END_OPTIONAL([Efl_Js])
#### End of Efl_Js
### Add Wayland server library if test is enabled
if test "x${want_tests}" = "xyes" -a "x${want_wayland}" = "xyes"; then
EFL_DEPEND_PKG([ECORE_WAYLAND_SRV], [WAYLAND], [wayland-server >= 1.8.0])
@ -4809,6 +5075,10 @@ pc/eo.pc
pc/eo-cxx.pc
pc/eolian.pc
pc/eolian-cxx.pc
pc/eina-js.pc
pc/efl-js.pc
pc/eolian-js.pc
pc/eo-js.pc
pc/efl.pc
pc/efl-cxx.pc
pc/evas-fb.pc
@ -4991,6 +5261,8 @@ echo " Cryptography..: ${build_crypto}"
echo " X11...........: ${with_x11}"
echo " OpenGL........: ${with_opengl}"
echo " C++11.........: ${have_cxx11}"
echo " JavaScript....: ${want_js}"
echo " JavaScript flg: $EINA_JS_LIBS"
echo "Eina............: yes (${features_eina} unwind=$have_unwind)"
echo "Eo..............: yes (${features_eo})"
echo "Eolian..........: yes (${features_eolian})"
@ -5052,6 +5324,7 @@ echo " CPPFLAGS......: $CPPFLAGS"
echo " CFLAGS........: $CFLAGS"
echo " CXXFLAGS......: $CXXFLAGS"
echo " LDFLAGS.......: $LDFLAGS"
echo " EFLJS_CXXFLAGS: $EFLJS_CXXFLAGS"
if test "x${with_binary_edje_cc}" != "x"; then
echo " edje_cc.......: ${with_binary_edje_cc}"

3
pc/.gitignore vendored

@ -28,6 +28,7 @@
/efreet.pc
/eina.pc
/eina-cxx.pc
/eina-js.pc
/eet-cxx.pc
/eio.pc
/eio-cxx.pc
@ -36,6 +37,7 @@
/embryo.pc
/emotion.pc
/eo.pc
/eo-js.pc
/ephysics.pc
/escape.pc
/ethumb.pc
@ -57,6 +59,7 @@
/evil.pc
/eolian.pc
/eolian-cxx.pc
/eolian-js.pc
/eo-cxx.pc
/evas-cxx.pc
/ecore-cxx.pc

@ -0,0 +1,15 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
want_js=@want_js@
Name: EFL JavaScript
Description: JavaScript C++ helpers for data structures
Version: @PACKAGE_VERSION@
Requires.private: @requirements_pc_eina@
Libs.private: @requirements_libs_eina@
Libs: -L${libdir} -lefl_js
Cflags: -I${includedir}/efl-js-@VMAJ@ @EFLJS_CXXFLAGS@

@ -0,0 +1,14 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
want_js=@want_js@
Name: Eina JavaScript
Description: JavaScript C++ helpers for data structures
Version: @PACKAGE_VERSION@
Requires.private: @requirements_pc_eina@
Libs.private: @requirements_libs_eina@
Cflags: -I${includedir}/efl-@VMAJ@ -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-js-@VMAJ@

@ -0,0 +1,15 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
eoincludedir=@datadir@/eolian/include
eolian_flags=-I${eoincludedir}/eo-@VMAJ@
Name: Eo JavaScript
Description: JavaScript C++ helpers for bindings for EFL's generic object system.
Version: @PACKAGE_VERSION@
Requires.private: @requirements_pc_eo@
Libs.private: @requirements_libs_eo@
Cflags: -I${includedir}/efl-@VMAJ@ -I${includedir}/eo-@VMAJ@ -I${includedir}/eo-js-@VMAJ@

@ -0,0 +1,14 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
Name: Eolian-JS
Description: EFL's JavaScript bindings generator.
Version: @VERSION@
Require.private: @requirements_pc_eolian@
Libs: -L${libdir}
Libs.private: @requirements_libs_eolian@
Cflags: -I${includedir}/efl-@VMAJ@ -I${includedir}/eolian-js-@VMAJ@

@ -13,4 +13,4 @@ Requires.private: @requirements_pc_evas@
Version: @VERSION@
Libs: -L${libdir} -levas
Libs.private: @requirements_libs_evas@
Cflags: -I${includedir}/efl-@VMAJ@ -I${includedir}/evas-@VMAJ@
Cflags: -I${includedir}/efl-@VMAJ@ -I${includedir}/evas-@VMAJ@ -I${includedir}/evas-@VMAJ@/canvas

@ -15,6 +15,7 @@ check_PROGRAMS =
TESTS =
EXTRA_DIST =
GENERATED_JS_BINDINGS =
EFL_INSTALL_EXEC_HOOK=
@ -76,6 +77,21 @@ include Makefile_Eio_Cxx.am
include Makefile_Elua.am
include Makefile_Elocation.am
if HAVE_JS
AM_V_CP = $(am__v_CP_@AM_V@)
am__v_CP_ = $(am__v_CP_@AM_DEFAULT_V@)
am__v_CP_0 = @echo " CP " $@;
CP = cp
if EFL_ENABLE_TESTS
if HAVE_NODEJS
AM_TESTS_ENVIRONMENT = NODE_PATH='$(abs_builddir)/lib/efl_js:$(abs_builddir)/tests/eolian_js:$(abs_builddir)/tests/efl_js'; export NODE_PATH;
endif
endif
endif
include Makefile_Eolian_Js.am
include Makefile_Efl_Js.am
.PHONY: benchmark examples
BENCHMARK_SUBDIRS = \

@ -271,3 +271,13 @@ installed_ecoreluadir = $(datadir)/elua/modules/ecore
nodist_installed_ecorelua_DATA = $(generated_ecore_lua_all)
endif
if HAVE_JS
generated_ecore_js_bindings = $(ecore_eolian_files:%.eo=%.eo.js.cc)
CLEANFILES += $(generated_ecore_js_bindings)
GENERATED_JS_BINDINGS += $(generated_ecore_js_bindings)
endif

@ -104,4 +104,15 @@ nodist_installed_ecoreaudiolua_DATA = $(generated_ecore_audio_lua_all)
endif
if HAVE_JS
generated_ecore_audio_js_bindings = $(ecore_audio_eolian_files:%.eo=%.eo.js.cc)
CLEANFILES += $(generated_ecore_audio_js_bindings)
GENERATED_JS_BINDINGS += $(generated_ecore_audio_js_bindings)
endif
endif

@ -143,3 +143,13 @@ installed_ecoreconluadir = $(datadir)/elua/modules/ecore_con
nodist_installed_ecoreconlua_DATA = $(generated_ecore_con_lua_all)
endif
if HAVE_JS
generated_ecore_con_js_bindings = $(ecore_con_eolian_files:%.eo=%.eo.js.cc)
CLEANFILES += $(generated_ecore_con_js_bindings)
GENERATED_JS_BINDINGS += $(generated_ecore_con_js_bindings)
endif

@ -0,0 +1,19 @@
### Library
if HAVE_JS
installed_ecorejsheadersdir = $(includedir)/ecore-js-@VMAJ@
dist_installed_ecorejsheaders_DATA = \
bindings/js/ecore_js/Ecore_Js.hh \
bindings/js/ecore_js/ecore_js_init.hh \
bindings/js/ecore_js/ecore_js_mainloop.hh \
bindings/js/ecore_js/ecore_js_timer.hh \
bindings/js/ecore_js/ecore_js_event.hh \
bindings/js/ecore_js/ecore_js_job.hh \
bindings/js/ecore_js/ecore_js_idle.hh \
bindings/js/ecore_js/ecore_js_animator.hh \
bindings/js/ecore_js/ecore_js_poller.hh \
bindings/js/ecore_js/ecore_js_throttle.hh \
bindings/js/ecore_js/ecore_js_file.hh
endif

@ -130,7 +130,7 @@ if HAVE_WIN32
USE_EDJE_BIN_LIBS = -L$(top_builddir)/src/lib/evil @USE_EDJE_LIBS@
else
USE_EDJE_BIN_LIBS = @USE_EDJE_LIBS@
endif
endif
bin_PROGRAMS += \
bin/edje/edje_cc \
@ -334,3 +334,13 @@ installed_edjeluadir = $(datadir)/elua/modules/edje
nodist_installed_edjelua_DATA = $(generated_edje_lua_all)
endif
if HAVE_JS
generated_edje_js_bindings = $(edje_eolian_files:%.eo=%.eo.js.cc)
CLEANFILES += $(generated_edje_js_bindings)
GENERATED_JS_BINDINGS += $(generated_edje_js_bindings)
endif

@ -80,6 +80,16 @@ nodist_installed_efllua_DATA = $(generated_efl_lua_all)
endif
if HAVE_JS
generated_efl_js_bindings = $(efl_eolian_files:%.eo=%.eo.js.cc)
CLEANFILES += $(generated_efl_js_bindings)
GENERATED_JS_BINDINGS += $(generated_efl_js_bindings)
endif
### Binary
bin_PROGRAMS += \

@ -0,0 +1,333 @@
if HAVE_JS
if HAVE_NODEJS
noinst_lib_LTLIBRARIES = lib/efl_js/libefl_node_js.la
noinst_libdir = $(libdir)/efl_js
$(top_builddir)/src/lib/efl_js/efl.node: lib/efl_js/libefl_node_js.la
$(AM_V_CP)$(CP) $(top_builddir)/src/lib/efl_js/.libs/libefl_node_js.so $(top_builddir)/src/lib/efl_js/efl.node
eflnodedir = $(libdir)/node_modules
eflnode_DATA = $(top_builddir)/src/lib/efl_js/efl.node
CLEANFILES += ${eflnodedir_DATA}
EXTRA_DIST += ${eflnodedir_DATA}
efljsmimedir = @XDG_DATA_HOME@/mime/packages
efljsmime_DATA = bin/efl_js/efljslaunch.xml
efljsdesktopdir = @XDG_DATA_HOME@/applications
efljsdesktop_DATA = bin/efl_js/efljslaunch.desktop
bin_SCRIPTS += \
bin/efl_js/efljslaunch \
bin/efl_js/efljspack
else
bin_PROGRAMS += bin/efl_js/eflv8js
bin_efl_js_eflv8js_SOURCES = \
bin/efl_js/launcher_main.cc
bin_efl_js_eflv8js_CPPFLAGS = \
-I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/bindings/js/efl_js \
-I$(top_srcdir)/src/bindings/js/eina_js \
-I$(top_srcdir)/src/bindings/js/eo_js \
@CHECK_CFLAGS@ \
@EINA_CXX_CFLAGS@ \
@EO_CXX_CFLAGS@ \
@EMILE_CFLAGS@ \
@ECORE_CFLAGS@ \
@EET_CFLAGS@ \
@EO_CFLAGS@ \
@EFL_JS_CFLAGS@ \
@EINA_JS_CFLAGS@ \
@EO_JS_CFLAGS@
bin_efl_js_eflv8js_LDFLAGS = \
-lv8 \
@USE_EFL_JS_INTERNAL_LIBS@
bin_efl_js_eflv8js_LDADD = \
@USE_EFL_JS_LIBS@
endif
bindings/js/efl_js/eolian_js_bindings.cc: $(GENERATED_JS_BINDINGS)
@echo @ECHO_E@ "#ifdef HAVE_CONFIG_H" > $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc
@echo @ECHO_E@ "#include \"config.h\"" >> $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc
@echo @ECHO_E@ "#endif\n" >> $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc
@echo @ECHO_E@ "#include <Efl.h>" >> $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc
@echo @ECHO_E@ "#include <Efl_Config.h>" >> $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc
@echo @ECHO_E@ "#include <Ecore.h>" >> $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc
@echo @ECHO_E@ "#include <Eo.h>" >> $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc
@echo @ECHO_E@ "#include <Ecore_Con.h>" >> $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc
@echo @ECHO_E@ "#include <Ecore_Audio.h>" >> $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc
@echo @ECHO_E@ "#include <Evas.h>" >> $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc
@echo @ECHO_E@ "#include <Edje.h>" >> $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc
@echo @ECHO_E@ "#include <Ecore_Con_Eet.h>" >> $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc
@echo @ECHO_E@ "#include <Emotion.h>\n" >> $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc
@for i in $(GENERATED_JS_BINDINGS); do echo "#include <$$i>" >> $(top_builddir)/src/bindings/js/efl_js/eolian_js_bindings.cc; done
CLEANFILES += bindings/js/efl_js/eolian_js_bindings.cc
## Install Ecore-JS headers
installed_ecorejsheadersdir = $(includedir)/ecore-js-@VMAJ@
dist_installed_ecorejsheaders_DATA = \
bindings/js/ecore_js/Ecore_Js.hh
## Install Eio-JS headers
installed_eiojsheadersdir = $(includedir)/eio-js-@VMAJ@
dist_installed_eiojsheaders_DATA = \
bindings/js/eio_js/Eio_Js.hh
## Install Ethumb-JS headers
installed_ethumbjsheadersdir = $(includedir)/ethumb-js-@VMAJ@
dist_installed_ethumbjsheaders_DATA = \
bindings/js/ethumb_js/Ethumb_Js.hh
## Install Eldbus-JS headers
installed_eldbusjsheadersdir = $(includedir)/eldbus-js-@VMAJ@
dist_installed_eldbusjsheaders_DATA = \
bindings/js/eldbus_js/Eldbus_Js.hh
## Install Eo-JS headers
installed_eojsmainheadersdir = $(includedir)/eo-js-@VMAJ@
dist_installed_eojsmainheaders_DATA = \
bindings/js/eo_js/eo_js_call_function.hh \
bindings/js/eo_js/eo_js_constructor.hh \
bindings/js/eo_js/eo_js_direction.hh \
bindings/js/eo_js/eo_js_event.hh \
bindings/js/eo_js/eo_js_namespace.hh \
bindings/js/eo_js/eo_js_struct.hh \
bindings/js/eo_js/eo_js_construct_from_eo.hh \
bindings/js/eo_js/Eo_Js.hh
## Install Eina-JS headers
installed_einajsheadersdir = $(includedir)/eina-js-@VMAJ@
dist_installed_einajsheaders_DATA = \
bindings/js/eina_js/Eina_Js.hh \
bindings/js/eina_js/eina_js_accessor.hh \
bindings/js/eina_js/eina_js_array.hh \
bindings/js/eina_js/eina_js_compatibility.hh \
bindings/js/eina_js/eina_js_container.hh \
bindings/js/eina_js/eina_js_error.hh \
bindings/js/eina_js/eina_js_get_value_from_c.hh \
bindings/js/eina_js/eina_js_get_value.hh \
bindings/js/eina_js/eina_js_iterator.hh \
bindings/js/eina_js/eina_js_list.hh \
bindings/js/eina_js/eina_js_log.hh \
bindings/js/eina_js/eina_js_node.hh \
bindings/js/eina_js/eina_js_value.hh
installed_efljsheadersdir = $(includedir)/efl-js-@VMAJ@
dist_installed_efljsheaders_DATA = \
bindings/js/efl_js/Efl_Js.hh
lib_LTLIBRARIES += lib/efl_js/libefl_js.la
lib_efl_js_libefl_js_la_SOURCES = \
bindings/js/eina_js/eina_js_container.cc \
bindings/js/eina_js/eina_js_value.cc \
bindings/js/eina_js/eina_js_error.cc \
bindings/js/eina_js/eina_js_accessor.cc \
bindings/js/eina_js/eina_js_log.cc \
bindings/js/eina_js/eina_js_iterator.cc \
bindings/js/eina_js/eina_js_compatibility.cc \
bindings/js/ecore_js/ecore_js_init.cc \
bindings/js/ecore_js/ecore_js_mainloop.cc \
bindings/js/ecore_js/ecore_js_timer.cc \
bindings/js/ecore_js/ecore_js_event.cc \
bindings/js/ecore_js/ecore_js_job.cc \
bindings/js/ecore_js/ecore_js_idle.cc \
bindings/js/ecore_js/ecore_js_animator.cc \
bindings/js/ecore_js/ecore_js_poller.cc \
bindings/js/ecore_js/ecore_js_throttle.cc \
bindings/js/eldbus_js/eldbus_js_core.cc \
bindings/js/eldbus_js/eldbus_js_connection.cc \
bindings/js/eldbus_js/eldbus_js_message.cc \
bindings/js/eldbus_js/eldbus_js_object_mapper.cc \
bindings/js/eio_js/eio_js.cc \
bindings/js/ethumb_js/ethumb_js_client.cc
nodist_lib_efl_js_libefl_js_la_SOURCES = \
bindings/js/efl_js/eolian_js_bindings.cc
bindings/js/efl_js/efl_js.cc $(lib_efl_js_libefl_js_la_SOURCES): $(generated_ecore_cxx_all) $(generated_eo_cxx_bindings) $(generated_efl_cxx_all)
lib_efl_js_libefl_js_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/lib/efl \
-I$(top_builddir)/src/lib/efl/interfaces/ \
-I$(top_builddir)/src/lib/evas/canvas/ \
-I$(top_srcdir)/src/bindings/js/eina_js \
-I$(top_srcdir)/src/bindings/js/ecore_js \
-I$(top_srcdir)/src/bindings/js/eo_js \
-I$(top_srcdir)/src/bindings/js/eldbus_js \
-I$(top_srcdir)/src/bindings/js/eio_js \
-I$(top_srcdir)/src/bindings/js/ethumb_js \
@EFL_JS_CFLAGS@ \
@EO_JS_CFLAGS@ \
@ECORE_CXX_CFLAGS@ \
@EO_CXX_CFLAGS@ \
@ECORE_JS_CFLAGS@ \
@EINA_JS_CFLAGS@ \
@ELDBUS_JS_CFLAGS@ \
@EIO_JS_CFLAGS@ \
@ETHUMB_JS_CFLAGS@ \
@EINA_CXX_CFLAGS@
lib_efl_js_libefl_js_la_LIBADD = @EFL_JS_LIBS@
lib_efl_js_libefl_js_la_DEPENDENCIES = @EFL_JS_INTERNAL_LIBS@
lib_efl_js_libefl_js_la_LIBTOOLFLAGS = --tag=disable-static
lib_efl_js_libefl_js_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
if HAVE_NODEJS
lib_efl_js_libefl_node_js_la_SOURCES = \
bindings/js/efl_js/efl_js.cc
lib_efl_js_libefl_node_js_la_CPPFLAGS = $(lib_efl_js_libefl_js_la_CPPFLAGS)
lib_efl_js_libefl_node_js_la_LIBADD = @USE_EFL_JS_LIBS@
lib_efl_js_libefl_node_js_la_DEPENDENCIES = @USE_EFL_JS_INTERNAL_LIBS@
lib_efl_js_libefl_node_js_la_LIBTOOLFLAGS = --tag=disable-static
lib_efl_js_libefl_node_js_la_LDFLAGS =
else
lib_efl_js_libefl_js_la_SOURCES += \
bindings/js/efl_js/efl_js.cc
endif
if EFL_ENABLE_TESTS
SUITE_RUNNER_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/bindings/js/eina_js \
-I$(top_srcdir)/src/bindings/js/eo_js \
-DTESTS_WD=\"`pwd`\" \
-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/efl_js\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/efl_js\" \
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/efl_js\" \
@CHECK_CFLAGS@ \
@EFL_JS_CFLAGS@ \
@EINA_CXX_CFLAGS@ \
@EO_CXX_CFLAGS@ \
@EO_CFLAGS@ \
@ECORE_CFLAGS@ \
@ECORE_CXX_CFLAGS@ \
@ECORE_JS_CFLAGS@ \
@EINA_JS_CFLAGS@
if HAVE_NODEJS
TESTS += tests/efl_js/eina_js_suite.js \
tests/efl_js/eina_js_containers_suite.js \
tests/efl_js/ecore_js_suite.js \
tests/efl_js/eldbus_js_suite.js \
tests/efl_js/ethumb_js_suite.js \
tests/efl_js/eio_js_suite.js \
tests/efl_js/benchmark_js_suite.js
check_LTLIBRARIES += tests/efl_js/libbenchmark_object.la
tests/efl_js/eina_js_suite.js tests/efl_js/eina_js_containers_suite.js tests/efl_js/ecore_js_suite.js tests/efl_js/eldbus_js_suite.js tests/efl_js/eio_js_suite.js tests/efl_js/ethumb_js_suite.js: $(top_builddir)/src/lib/efl_js/efl.node
tests/efl_js/benchmark_object.node: tests/efl_js/libbenchmark_object.la
$(AM_V_CP)$(CP) $(top_builddir)/src/tests/efl_js/.libs/libbenchmark_object.so $(top_builddir)/src/tests/efl_js/benchmark_object.node
tests/efl_js/benchmark_js_suite.js: $(top_builddir)/src/lib/efl_js/efl.node tests/efl_js/benchmark_object.node
tests_efl_js_libbenchmark_object_la_SOURCES = tests/efl_js/benchmark_object_impl.cc
tests_efl_js_libbenchmark_object_la_CPPFLAGS = \
-I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/bindings/js/efl_js \
-I$(top_builddir)/src/tests/efl_js \
-I$(top_srcdir)/src/bindings/js/eina_js \
-I$(top_srcdir)/src/bindings/js/eo_js \
-DTESTS_WD=\"`pwd`\" \
-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/efl_js\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/efl_js\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/efl_js\" \
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/efl_js\" \
@CHECK_CFLAGS@ @EOLIAN_CXX_CFLAGS@ @EINA_JS_CFLAGS@ @EO_JS_CFLAGS@ \
@EOLIAN_CFLAGS@ @EINA_CFLAGS@ @EO_CFLAGS@ @ECORE_CFLAGS@ @EINA_CXX_CFLAGS@ \
@EO_JS_CFLAGS@ @EO_CXX_CFLAGS@
tests_efl_js_libbenchmark_object_la_LIBADD = \
@CHECK_LIBS@ @USE_EO_LIBS@ @USE_EINA_LIBS@ @USE_EOLIAN_LIBS@ @USE_EFL_JS_LIBS@
tests_efl_js_libbenchmark_object_la_LDFLAGS = -rpath $(abs_top_builddir)/tests/efl_js @EFL_LTLIBRARY_FLAGS@
tests_efl_js_libbenchmark_object_la_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_EO_INTERNAL_LIBS@ @USE_EFL_JS_INTERNAL_LIBS@
tests_efl_js_libbenchmark_object_la_LIBTOOLFLAGS = --tag=disable-static
tests/efl_js/tests_efl_js_libbenchmark_object_la-benchmark_object_impl.l$(OBJEXT): tests/efl_js/benchmark_object.eo.js.cc tests/efl_js/benchmark_object.eo.c tests/efl_js/benchmark_object.eo.h
else
check_PROGRAMS += \
tests/efl_js/eina_js_suite \
tests/efl_js/eina_js_containers_suite \
tests/efl_js/ecore_js_suite \
tests/efl_js/eldbus_js_suite \
tests/efl_js/ethumb_js_suite \
tests/efl_js/eio_js_suite \
tests/efl_js/benchmark_js_suite
TESTS += tests/efl_js/eina_js_suite \
tests/efl_js/ecore_js_suite \
tests/efl_js/eldbus_js_suite \
tests/efl_js/ethumb_js_suite \
tests/efl_js/eio_js_suite \
tests/efl_js/benchmark_js_suite
tests_efl_js_eina_js_suite_SOURCES = \
tests/efl_js/eina_js_suite.cc
tests_efl_js_eina_js_suite_CPPFLAGS = $(SUITE_RUNNER_CPPFLAGS)
tests_efl_js_eina_js_suite_LDADD = \
@CHECK_LIBS@ @USE_EO_LIBS@ @USE_EINA_LIBS@ @USE_EOLIAN_LIBS@ @USE_EFL_JS_LIBS@
tests_efl_js_eina_js_suite_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_EO_INTERNAL_LIBS@ @USE_EFL_JS_INTERNAL_LIBS@
tests_efl_js_eina_js_containers_suite_SOURCES = \
tests/efl_js/eina_js_containers_suite.cc
tests_efl_js_eina_js_containers_suite_CPPFLAGS = $(SUITE_RUNNER_CPPFLAGS)
tests_efl_js_eina_js_containers_suite_LDADD = \
@CHECK_LIBS@ @USE_EO_LIBS@ @USE_EINA_LIBS@ @USE_EOLIAN_LIBS@ @USE_EFL_JS_LIBS@
tests_efl_js_eina_js_containers_suite_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_EO_INTERNAL_LIBS@ @USE_EFL_JS_INTERNAL_LIBS@
tests_efl_js_ecore_js_suite_SOURCES = \
tests/efl_js/ecore_js_suite.cc
tests_efl_js_ecore_js_suite_CPPFLAGS = $(SUITE_RUNNER_CPPFLAGS)
tests_efl_js_ecore_js_suite_LDADD = \
@CHECK_LIBS@ @USE_EO_LIBS@ @USE_EINA_LIBS@ @USE_EOLIAN_LIBS@ @USE_EFL_JS_LIBS@
tests_efl_js_ecore_js_suite_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_EO_INTERNAL_LIBS@ @USE_EFL_JS_INTERNAL_LIBS@
tests_efl_js_eldbus_js_suite_SOURCES = \
tests/efl_js/eldbus_js_suite.cc
tests_efl_js_eldbus_js_suite_CPPFLAGS = $(SUITE_RUNNER_CPPFLAGS)
tests_efl_js_eldbus_js_suite_LDADD = \
@CHECK_LIBS@ @USE_EO_LIBS@ @USE_EINA_LIBS@ @USE_EOLIAN_LIBS@ @USE_EFL_JS_LIBS@
tests_efl_js_eldbus_js_suite_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_EO_INTERNAL_LIBS@ @USE_EFL_JS_INTERNAL_LIBS@
tests_efl_js_ethumb_js_suite_SOURCES = \
tests/efl_js/ethumb_js_suite.cc
tests_efl_js_ethumb_js_suite_CPPFLAGS = $(SUITE_RUNNER_CPPFLAGS)
tests_efl_js_ethumb_js_suite_LDADD = \
@CHECK_LIBS@ @USE_EO_LIBS@ @USE_EINA_LIBS@ @USE_EOLIAN_LIBS@ @USE_EFL_JS_LIBS@
tests_efl_js_ethumb_js_suite_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_EO_INTERNAL_LIBS@ @USE_EFL_JS_INTERNAL_LIBS@
tests_efl_js_eio_js_suite_SOURCES = \
tests/efl_js/eio_js_suite.cc
tests_efl_js_eio_js_suite_CPPFLAGS = $(SUITE_RUNNER_CPPFLAGS)
tests_efl_js_eio_js_suite_LDADD = \
@CHECK_LIBS@ @USE_EO_LIBS@ @USE_EINA_LIBS@ @USE_EOLIAN_LIBS@ @USE_EFL_JS_LIBS@
tests_efl_js_eio_js_suite_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_EO_INTERNAL_LIBS@ @USE_EFL_JS_INTERNAL_LIBS@
tests_efl_js_benchmark_js_suite_SOURCES = \
tests/efl_js/benchmark_js_suite.cc
tests_efl_js_benchmark_js_suite_CPPFLAGS = $(SUITE_RUNNER_CPPFLAGS)
tests_efl_js_benchmark_js_suite_LDADD = \
@CHECK_LIBS@ @USE_EO_LIBS@ @USE_EINA_LIBS@ @USE_EOLIAN_LIBS@ @USE_EFL_JS_LIBS@
tests_efl_js_benchmark_js_suite_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_EO_INTERNAL_LIBS@ @USE_EFL_JS_INTERNAL_LIBS@
endif
endif
endif

@ -14,6 +14,7 @@ bindings/eina_cxx/eina_clone_allocators.hh \
bindings/eina_cxx/eina_error.hh \
bindings/eina_cxx/eina_eo_concrete_fwd.hh \
bindings/eina_cxx/eina_fold.hh \
bindings/eina_cxx/eina_function.hh \
bindings/eina_cxx/eina_inarray.hh \
bindings/eina_cxx/eina_inlist.hh \
bindings/eina_cxx/eina_integer_sequence.hh \
@ -21,7 +22,9 @@ bindings/eina_cxx/eina_iterator.hh \
bindings/eina_cxx/eina_lists_auxiliary.hh \
bindings/eina_cxx/eina_list.hh \
bindings/eina_cxx/eina_log.hh \
bindings/eina_cxx/eina_logical.hh \
bindings/eina_cxx/eina_optional.hh \
bindings/eina_cxx/eina_pp.hh \
bindings/eina_cxx/eina_ptrarray.hh \
bindings/eina_cxx/eina_ptrlist.hh \
bindings/eina_cxx/eina_range_types.hh \
@ -31,6 +34,7 @@ bindings/eina_cxx/eina_string_view.hh \
bindings/eina_cxx/eina_thread.hh \
bindings/eina_cxx/eina_throw.hh \
bindings/eina_cxx/eina_tuple.hh \
bindings/eina_cxx/eina_tuple_c.hh \
bindings/eina_cxx/eina_tuple_unwrap.hh \
bindings/eina_cxx/eina_type_traits.hh \
bindings/eina_cxx/eina_value.hh

@ -347,3 +347,14 @@ installed_emotionluadir = $(datadir)/elua/modules/emotion
nodist_installed_emotionlua_DATA = $(generated_emotion_lua_all)
endif
# TODO: gives undefined reference to emotion_object_class_get()
if HAVE_JS
generated_emotion_js_bindings = $(emotion_eolian_files:%.eo=%.eo.js.cc)
CLEANFILES += $(generated_emotion_js_bindings)
GENERATED_JS_BINDINGS += $(generated_emotion_js_bindings)
endif

@ -197,3 +197,13 @@ endif
EXTRA_DIST += tests/eo/eunit_tests.h lib/eo/eo_ptr_indirection.x
if HAVE_JS
generated_eo_js_bindings = $(eo_eolian_files:%.eo=%.eo.js.cc)
CLEANFILES += $(generated_eo_js_bindings)
GENERATED_JS_BINDINGS += $(generated_eo_js_bindings)
endif

@ -0,0 +1,123 @@
if HAVE_JS
### Binary
bin_PROGRAMS += bin/eolian_js/eolian_js
bin_eolian_js_eolian_js_SOURCES = \
bin/eolian_js/main.cc
bin_eolian_js_eolian_js_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/bin/eolian_js \
-I$(top_srcdir)/src/bindings/js/eina_js \
-I$(top_srcdir)/src/bindings/js/eo_js \
@EOLIAN_JS_CFLAGS@ \
@EINA_CXX_CFLAGS@ \
@EOLIAN_CXX_CFLAGS@
bin_eolian_js_eolian_js_LDADD = @USE_EO_LIBS@ @USE_EOLIAN_LIBS@
bin_eolian_js_eolian_js_DEPENDENCIES = @USE_EO_INTERNAL_LIBS@ @USE_EOLIAN_INTERNAL_LIBS@
include Makefile_Eolian_Js_Helper.am
### Unit tests
if EFL_ENABLE_TESTS
if HAVE_NODEJS
TESTS += tests/eolian_js/eolian_js_suite.js
check_LTLIBRARIES += tests/eolian_js/libeolian_js_suite.la
tests/eolian_js/eolian_js_suite.js: tests/eolian_js/eolian_js_suite_mod.node
tests/eolian_js/eolian_js_suite_mod.node: tests/eolian_js/libeolian_js_suite.la
$(AM_V_CP)$(CP) $(top_builddir)/src/tests/eolian_js/.libs/libeolian_js_suite.so $(top_builddir)/src/tests/eolian_js/eolian_js_suite_mod.node
tests_eolian_js_libeolian_js_suite_la_SOURCES = \
tests/eolian_js/eolian_js_suite.cc \
tests/eolian_js/eolian_js_test_eolian_js_binding.cc \
tests/eolian_js/eolian_js_test_constructor_method_impl.c \
tests/eolian_js/eolian_js_test_test_object_impl.c
tests_eolian_js_libeolian_js_suite_la_CPPFLAGS = \
-I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/bin/eolian_js \
-I$(top_srcdir)/src/bindings/js/eina_js \
-I$(top_srcdir)/src/bindings/js/eo_js \
-I$(top_builddir)/src/tests/eolian_js \
-DTESTS_WD=\"`pwd`\" \
-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/eolian_js\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/eolian_js\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/eolian_js\" \
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/eolian_js\" \
@CHECK_CFLAGS@ @EOLIAN_CXX_CFLAGS@ @EINA_JS_CFLAGS@ @EO_JS_CFLAGS@ \
@EOLIAN_CFLAGS@ @EINA_CFLAGS@ @EO_CFLAGS@ @ECORE_CFLAGS@ @EINA_CXX_CFLAGS@ \
@EO_JS_CFLAGS@ @EO_CXX_CFLAGS@
tests_eolian_js_libeolian_js_suite_la_LIBADD = \
@CHECK_LIBS@ @USE_EO_LIBS@ @USE_EINA_LIBS@ @USE_EOLIAN_LIBS@ @USE_EFL_JS_LIBS@
tests_eolian_js_libeolian_js_suite_la_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_EO_INTERNAL_LIBS@ @USE_EFL_JS_INTERNAL_LIBS@
tests_eolian_js_libeolian_js_suite_la_CFLAGS = $(tests_eolian_js_libeolian_js_suite_la_CXXFLAGS)
tests_eolian_js_libeolian_js_suite_la_LIBTOOLFLAGS = --tag=disable-static
tests_eolian_js_libeolian_js_suite_la_LDFLAGS = -rpath $(abs_top_builddir)/tests/eolian_js @EFL_LTLIBRARY_FLAGS@
# if compiler_o_lo == yes, lo, otherwise $(OBJEXT)
tests/eolian_js/tests_eolian_js_libeolian_js_suite_la-eolian_js_test_eolian_js_binding.l$(OBJEXT): tests/eolian_js/constructor_method_class.eo.js.cc tests/eolian_js/constructor_method_class.eo.h tests/eolian_js/test_object.eo.js.cc tests/eolian_js/test_object.eo.h
tests/eolian_js/tests_eolian_js_libeolian_js_suite_la-eolian_js_test_constructor_method_impl.l$(OBJEXT): tests/eolian_js/constructor_method_class.eo.c
tests/eolian_js/tests_eolian_js_libeolian_js_suite_la-eolian_js_test_test_object_impl.l$(OBJEXT): tests/eolian_js/test_object.eo.c
CLEANFILES += \
tests/eolian_js/constructor_method_class.eo.js.cc \
tests/eolian_js/constructor_method_class.eo.c \
tests/eolian_js/constructor_method_class.eo.h \
tests/eolian_js/test_object.eo.js.cc \
tests/eolian_js/test_object.eo.c \
tests/eolian_js/test_object.eo.h
else
check_PROGRAMS += tests/eolian_js/eolian_js_suite
TESTS += tests/eolian_js/eolian_js_suite
tests_eolian_js_eolian_js_suite_SOURCES = \
tests/eolian_js/eolian_js_suite.cc \
tests/eolian_js/eolian_js_test_eolian_js_binding.cc \
tests/eolian_js/eolian_js_test_constructor_method_impl.c \
tests/eolian_js/eolian_js_test_test_object_impl.c
tests/eolian_js/tests_eolian_js_eolian_js_suite-eolian_js_test_eolian_js_binding.$(OBJEXT): tests/eolian_js/constructor_method_class.eo.js.cc tests/eolian_js/constructor_method_class.eo.h tests/eolian_js/test_object.eo.js.cc tests/eolian_js/test_object.eo.h
tests/eolian_js/tests_eolian_js_eolian_js_suite-eolian_js_test_constructor_method_impl.$(OBJEXT): tests/eolian_js/constructor_method_class.eo.c
tests/eolian_js/tests_eolian_js_eolian_js_suite-eolian_js_test_test_object_impl.$(OBJEXT): tests/eolian_js/test_object.eo.c
CLEANFILES += \
tests/eolian_js/constructor_method_class.eo.js.cc \
tests/eolian_js/constructor_method_class.eo.c \
tests/eolian_js/constructor_method_class.eo.h \
tests/eolian_js/test_object.eo.js.cc \
tests/eolian_js/test_object.eo.c \
tests/eolian_js/test_object.eo.h
tests_eolian_js_eolian_js_suite_CPPFLAGS = \
-I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/bin/eolian_js \
-I$(top_srcdir)/src/bindings/js/eina_js \
-I$(top_srcdir)/src/bindings/js/eo_js \
-I$(top_builddir)/src/tests/eolian_js \
-I$(top_srcdir)/src/tests/efl_js \
-DTESTS_WD=\"`pwd`\" \
-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/eolian_js\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/eolian_js\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/eolian_js\" \
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/eolian_js\" \
@CHECK_CFLAGS@ @EOLIAN_CXX_CFLAGS@ @EINA_JS_CFLAGS@ @EO_JS_CFLAGS@ @EFL_JS_CFLAGS@ \
@EOLIAN_CFLAGS@ @EINA_CFLAGS@ @EO_CFLAGS@ @ECORE_CFLAGS@ @EINA_CXX_CFLAGS@ \
@EO_JS_CFLAGS@ @EO_CXX_CFLAGS@ @EFL_JS_CFLAGS@
tests_eolian_js_eolian_js_suite_LDADD = \
@CHECK_LIBS@ @USE_EO_LIBS@ @USE_EINA_LIBS@ @USE_EOLIAN_LIBS@ @USE_EFL_JS_LIBS@ @USE_EVAS_LIBS@ @USE_EFL_JS_LIBS@
tests_eolian_js_eolian_js_suite_DEPENDENCIES = @USE_EOLIAN_INTERNAL_LIBS@ @USE_EFL_JS_INTERNAL_LIBS@ @USE_EVAS_INTERNAL_LIBS@ @USE_EFL_JS_INTERNAL_LIBS@
endif
endif
endif

@ -0,0 +1,18 @@
#if HAVE_EOLIAN_JS
#EOLIAN_JS = @eolian_js@
#_EOLIAN_JS_DEP = @eolian_js@
#else
EOLIAN_JS = EFL_RUN_IN_TREE=1 $(top_builddir)/src/bin/eolian_js/eolian_js${EXEEXT}
_EOLIAN_JS_DEP = bin/eolian_js/eolian_js${EXEEXT}
#endif
AM_V_EOLJS = $(am__v_EOLJS_@AM_V@)
am__v_EOLJS_ = $(am__v_EOLJS_@AM_DEFAULT_V@)
am__v_EOLJS_0 = @echo " EOLJS " $@;
SUFFIXES += .eo.js.cc
%.eo.js.cc: %.eo $(_EOLIAN_JS_DEP)
$(AM_V_EOLJS)$(EOLIAN_JS) $(EOLIAN_FLAGS) -o $@ $<
CLEANFILES += $(BUILT_SOURCES)

@ -2221,3 +2221,13 @@ $(NULL)
installed_evasfiltersdir = $(datadir)/evas/filters/lua
dist_installed_evasfilters_DATA = $(evas_filters_lua)
if HAVE_JS
generated_evas_js_bindings = $(evas_eolian_files:%.eo=%.eo.js.cc)
CLEANFILES += $(generated_evas_js_bindings)
GENERATED_JS_BINDINGS += $(generated_evas_js_bindings)
endif

@ -0,0 +1,139 @@
#!/bin/sh
':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@"
// Core node modules
var path = require('path');
var os = require('os');
var zlib = require('zlib');
var child_process = require('child_process');
// 3rd party modules
var fs = require('fs-extra');
var getopt = require('node-getopt');
var tar = require('tar');
function make_error_cb(message)
{
return function(e) {
console.error("Error %s: %s", message, e);
process.exit(1);
};
}
function remove_files(options)
{
if (options.verbose)
console.log("Removing temporary files");
fs.remove(options.project_folder);
}
function run_project(options)
{
if (options.verbose)
console.log("Running the project");
var current_dir = process.cwd();
process.chdir(options.project_root);
var proc = child_process.fork(options.metadata.Entry);
proc.on('exit', function(code){
if (options.verbose)
console.log('Child exited with code %s', code);
process.chdir(current_dir);
if (!options.keep)
remove_files(options);
});
}
function unpack_project_data(options)
{
if (options.verbose)
console.log("Unpacking project sources and assets");
var datafile = path.join(options.project_folder, "data.tar.gz");
var project_root = path.join(options.project_folder, "root");
options.project_root = project_root;
var input = fs.createReadStream(datafile);
var unzipper = zlib.createGunzip();
var extractor = tar.Extract({path: project_root, strip: 0});
input.on('error', make_error_cb("reading package data file."));
extractor.on('error', make_error_cb("unpacking package data file."));
if (!("only-extract" in options))
extractor.on('end', function(){ run_project(options); });
input.pipe(unzipper)
unzipper.pipe(extractor);
}
function read_metadata(options)
{
if (options.verbose)
console.log("Reading project metadata");
var project_folder = options.project_folder;
var metadata = JSON.parse(fs.readFileSync(path.join(project_folder, "meta.json")));
if (options.verbose)
console.log("Project: %s\nVersion: %s\nEntry point: %s", metadata.Name, metadata.Version, metadata.Entry);
if ("only-dump" in options)
process.exit(0);
options.metadata = metadata;
unpack_project_data(options);
}
function extract(filename, options)
{
if (options.verbose)
console.log("Extracting ", filename, "with options ", options);
var project_id = path.basename(filename, ".epk");
var project_folder = path.join(options['temp-dir'], project_id);
options.project_folder = project_folder;
options.project_id = project_id;
var input = fs.createReadStream(filename);
var extractor = tar.Extract({path: options['temp-dir'], strip: 0});
input.on('error', make_error_cb("reading package file."));
extractor.on('error', make_error_cb("unpacking package file."));
extractor.on('end', function(){ read_metadata(options); });
input.pipe(extractor);
}
function main() {
var options = getopt.create([
['d', 'only-dump', 'Only dump information about the package'],
['e', 'only-extract', 'Only extract the package, do not run'],
['h', 'help', 'Display this help'],
['k', 'keep', 'Do not remove the files after exiting'],
['t', 'temp-dir=ARG', 'Temporary dir to extract files'],
['v', 'verbose', 'Print information messages'],
]).bindHelp().parseSystem();
var filename = options.argv[0];
if (filename === undefined)
{
console.error("Must provide a package file.");
process.exit(1);
}
if (!('temp-dir' in options.options))
{
options.options["temp-dir"] = path.join(os.tmpdir(), "efljs_apps");
if (options.verbose)
console.log("Defaulting temp dir to ", options.options["temp-dir"]);
}
extract(filename, options.options);
}
main();

@ -0,0 +1,7 @@
[Desktop Entry]
Name=EFL JS package launcher
Exec=efljslaunch %f
Type=Application
Categories=EFL
Terminal=true
MimeType=application/x-efljspackage;

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-efljspackage">
<comment xml:lang="en">EFL JS package</comment>
<glob pattern="*.epk"/>
</mime-type>
</mime-info>

@ -0,0 +1,251 @@
#!/bin/sh
':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@"
var zlib = require('zlib');
var path = require('path');
// external dependencies
var fs = require('fs-extra');
var tar = require('tar');
var fstream = require('fstream');
var getopt = require('node-getopt');
/*
* Packing a project.
* The efljs package has a similar format to debian packages. It is a
* tar package containing two files:
*
* meta.txt: Metadata information about this package.
* data.tar.gz: Gzipped data, with the project tree ready to be decompressed
* and run by the package launcher.
*
* During the build, a out/ directory is created in the project root to
* store the package and temporary files.
*/
// Creates a stub .project file and packs it.
function pack_single(sourcepath, options)
{
if (options.verbose)
console.log("Creating project file for single file app", sourcepath);
var dir_name = path.dirname(fs.realpathSync(sourcepath));
var filename = path.basename(sourcepath);
var projectRegex = /^(.*).js$/g;
var project_name = projectRegex.exec(filename)[1];
if (!validade_project_name(project_name))
{
console.error("Invalid project name. Must start with a letter.");
process.exit(0);
}
var project_filename = path.join(dir_name, project_name + ".project");
var fd = fs.openSync(project_filename, 'w');
var jsonData = {};
jsonData["Name"] = project_name;
jsonData["Entry"] = filename;
jsonData["Sources"] = [[filename, '.']];
jsonData["Version"] = "0.1";
fs.writeSync(fd, JSON.stringify(jsonData, null, 2));
fs.closeSync(fd);
pack_project(project_filename, options);
}
function generate_build_info(configuration, project_file, options)
{
build_info = {};
// project == project_dir
// /out == build_dir
// /data == data_dir
// /name-version == package_dir
build_info.package_id = configuration.Name + "-" + configuration.Version;
build_info.project_dir = path.dirname(project_file);
build_info.build_dir = path.join(build_info.project_dir, "out");
build_info.data_dir = path.join(build_info.build_dir, "data");
build_info.package_dir = path.join(build_info.build_dir, build_info.package_id);
build_info.data_file = path.join(build_info.package_dir, "data.tar.gz");
build_info.package_file = path.join(build_info.build_dir, build_info.package_id + ".epk")
build_info.metadata_file = path.join(build_info.package_dir, "meta.json");
if (options.verbose)
{
console.log("Project id: ", build_info.package_id);
console.log("Project source dir: ", build_info.project_dir);
console.log("Project build dir: ", build_info.build_dir);
console.log("Project data dir:", build_info.data_dir);
console.log("Project package dir:", build_info.package_dir);
}
return build_info;
}
// Project names must start with a letter and contain only
// letters, digits and underscores.
function validade_project_name(name)
{
return (/^[a-zA-Z][\w-]*$/).test(name)
}
function pack_project(project_file, options)
{
if (options.verbose)
console.log("Packing project from project file ", project_file);
var configuration = JSON.parse(fs.readFileSync(project_file));
if (!validade_project_name(configuration.Name))
{
console.error("Invalid project name. Must start with a letter.");
process.exit(0);
}
var build_info = generate_build_info(configuration, project_file, options);
try
{
fs.mkdirSync(build_info.build_dir);
fs.mkdirSync(build_info.data_dir);
fs.mkdirSync(build_info.package_dir);
}
catch (e)
{
console.warn("Warning: Project output directories not empty.");
}
create_metadata_file(configuration, build_info, options);
// If not explicitly named on configuration, add the entire directory
if (!('Sources' in configuration))
{
generate_source_list(configuration, build_info.project_dir, options);
}
create_project_tree(configuration.Sources, build_info, options);
pack_data_dir(build_info, options);
}
function create_project_tree(sources, build_info, options)
{
for (var i = sources.length - 1; i >= 0; i--) {
if (options.verbose)
console.log("Adding file ", sources[i], "to package.");
var source_file = path.join(build_info.project_dir, sources[i][0]);
var destination_dir = path.join(build_info.data_dir, sources[i][1]);
var destination_filename = path.basename(source_file);
var destination_file = path.join(destination_dir, destination_filename);
fs.copySync(source_file, destination_file);
};
}