Summary: This patch adds 'eolian_cxx' -- a C++ bindings generator -- to the EFL tree. Eolian Cxx uses Eolian API to read .eo files and generate .eo.hh. It relies/depends on Eo Cxx and Eina Cxx (both non-generated bindings). src/bin/eolian_cxx: The eolian_cxx program. src/lib/eolian_cxx: A header-only library that implements the C++ code generation that binds the .eo classes. =Examples= src/examples/eolian_cxx/eolian_cxx_simple_01.cc: The simplest example, it just uses some "dummy" generated C++ classes. src/examples/eolian_cxx/eolian_cxx_inherit_01.cc: Illustrates how pure C++ classes inherit from .eo generated classes. src/examples/evas/evas_cxx_rectangle.cc: More realistic example using the generated bindings Evas Cxx. Still a bit shallow because we don't have full fledged .eo descriptions yet, but will be improved. =Important= The generated code is not supported and not a stable API/ABI. It is here to gather people interest and get review before we set things in stone for release 1.11. @feature Reviewers: cedric, smohanty, raster, stefan_schmidt CC: felipealmeida, JackDanielZ, cedric, stefan Differential Revision: https://phab.enlightenment.org/D805 Signed-off-by: Cedric Bail <cedric.bail@free.fr>efl-1.10
parent
64c6c63725
commit
46b6e8a563
70 changed files with 4757 additions and 12 deletions
@ -0,0 +1,66 @@ |
||||
# - Try to find ecore_cxx |
||||
# Once done this will define |
||||
# |
||||
# ECORE_CXX_FOUND - System has ecore_cxx |
||||
# ECORE_CXX_INCLUDE_DIRS - The ecore_cxx include directories |
||||
# ECORE_CXX_LIBRARIES - The libraries needed to use ecore_cxx |
||||
# ECORE_CXX_DEFINITIONS - Compiler switches required for using ecore_cxx |
||||
# |
||||
# When the COMPONENTS keyword was passed to find_package(), |
||||
# the following variables are defined for additional Ecore_Cxx modules |
||||
# such as Evas, X, Imf, Imf_Evas. |
||||
# |
||||
# ECORE_CXX_*_FOUND - System has ecore_cxx * |
||||
# ECORE_CXX_*_INCLUDE_DIRS - The ecore_cxx include directories |
||||
# ECORE_CXX_*_LIBRARIES - The libraries needed to use ecore_cxx |
||||
# ECORE_CXX_*_DEFINITIONS - Compiler switches required for using ecore_cxx * module. |
||||
|
||||
set(MY_PKG ecore_cxx) |
||||
|
||||
find_package(PkgConfig) |
||||
if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER "2.8.1") |
||||
# "QUIET" was introduced in 2.8.2 |
||||
set(_QUIET QUIET) |
||||
endif () |
||||
pkg_check_modules(PC_LIBECORE_CXX ${_QUIET} ${MY_PKG}) |
||||
|
||||
find_library(ECORE_CXX_LIBRARY |
||||
NAMES ${PC_LIBECORE_CXX_LIBRARIES} |
||||
HINTS ${PC_LIBECORE_CXX_LIBDIR} ${PC_LIBECORE_CXX_LIBRARY_DIRS} ) |
||||
|
||||
set(ECORE_CXX_DEFINITIONS ${PC_LIBECORE_CXX_CFLAGS_OTHER}) |
||||
set(ECORE_CXX_LIBRARIES ${ECORE_CXX_LIBRARY}) |
||||
set(ECORE_CXX_INCLUDE_DIRS ${PC_LIBECORE_CXX_INCLUDE_DIRS}) |
||||
|
||||
include(FindPackageHandleStandardArgs) |
||||
# handle the QUIETLY and REQUIRED arguments and set ECORE_CXX_FOUND to TRUE |
||||
# if all listed variables are TRUE |
||||
find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG |
||||
ECORE_CXX_LIBRARIES ECORE_CXX_INCLUDE_DIRS) |
||||
|
||||
mark_as_advanced(ECORE_CXX_INCLUDE_DIRS ECORE_CXX_LIBRARY ECORE_CXX_LIBRARIES ECORE_CXX_DEFINITIONS) |
||||
|
||||
if (Ecore_Cxx_FIND_COMPONENTS) |
||||
foreach(_component ${Ecore_Cxx_FIND_COMPONENTS}) |
||||
string(TOUPPER ${_component} _COMPONENT) |
||||
string(TOLOWER ${_component} _component) |
||||
string(REGEX REPLACE "_" "-" _MODULE_PKGNAME "ecore_cxx-${_component}") |
||||
|
||||
pkg_check_modules(PC_LIBECORE_CXX_${_COMPONENT} ${_QUIET} ${_MODULE_PKGNAME}) |
||||
|
||||
find_library(ECORE_CXX_${_COMPONENT}_LIBRARY |
||||
NAMES ${PC_LIBECORE_CXX_${_COMPONENT}_LIBRARIES} |
||||
HINTS ${PC_LIBECORE_CXX_${_COMPONENT}_LIBDIR} |
||||
${PC_LIBECORE_CXX_${_COMPONENT}_LIBRARY_DIRS}) |
||||
|
||||
set(ECORE_CXX_${_COMPONENT}_DEFINITIONS ${PC_LIBECORE_CXX_${_COMPONENT}_CFLAGS_OTHER}) |
||||
set(ECORE_CXX_${_COMPONENT}_LIBRARIES ${ECORE_CXX_${_COMPONENT}_LIBRARY}) |
||||
set(ECORE_CXX_${_COMPONENT}_INCLUDE_DIRS ${PC_LIBECORE_CXX_${_COMPONENT}_INCLUDE_DIRS}) |
||||
|
||||
include(FindPackageHandleStandardArgs) |
||||
# handle the QUIETLY and REQUIRED arguments and set ECORE_CXX_*_FOUND to TRUE |
||||
# if all listed variables are TRUE |
||||
find_package_handle_standard_args(ecore_cxx_${_component} DEFAULT_MSG |
||||
ECORE_CXX_${_COMPONENT}_LIBRARIES ECORE_CXX_${_COMPONENT}_INCLUDE_DIRS) |
||||
endforeach(_component) |
||||
endif(Ecore_Cxx_FIND_COMPONENTS) |
@ -0,0 +1,30 @@ |
||||
# - Try to find eet |
||||
# Once done this will define |
||||
# EET_CXX_FOUND - System has eet |
||||
# EET_CXX_INCLUDE_DIRS - The eet include directories |
||||
# EET_CXX_LIBRARIES - The libraries needed to use eet |
||||
# EET_CXX_DEFINITIONS - Compiler switches required for using eet |
||||
|
||||
set(MY_PKG eet_cxx) |
||||
|
||||
find_package(PkgConfig) |
||||
if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER "2.8.1") |
||||
# "QUIET" was introduced in 2.8.2 |
||||
set(_QUIET QUIET) |
||||
endif () |
||||
pkg_check_modules(PC_EET_CXX ${_QUIET} ${MY_PKG}) |
||||
find_library(EET_CXX_LIBRARY |
||||
NAMES ${PC_EET_CXX_LIBRARIES} |
||||
HINTS ${PC_EET_CXX_LIBDIR} ${PC_EET_CXX_LIBRARY_DIRS} ) |
||||
|
||||
set(EET_CXX_DEFINITIONS ${PC_EET_CXX_CFLAGS_OTHER}) |
||||
set(EET_CXX_LIBRARIES ${EET_CXX_LIBRARY}) |
||||
set(EET_CXX_INCLUDE_DIRS ${PC_EET_CXX_INCLUDE_DIRS}) |
||||
|
||||
include(FindPackageHandleStandardArgs) |
||||
# handle the QUIETLY and REQUIRED arguments and set EET_CXX_FOUND to TRUE |
||||
# if all listed variables are TRUE |
||||
find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG |
||||
EET_CXX_LIBRARIES EET_CXX_INCLUDE_DIRS) |
||||
|
||||
mark_as_advanced(EET_CXX_INCLUDE_DIRS EET_CXX_LIBRARY EET_CXX_LIBRARIES EET_CXX_DEFINITIONS) |
@ -0,0 +1,30 @@ |
||||
# - Try to find eina |
||||
# Once done this will define |
||||
# EINA_CXX_FOUND - System has eina |
||||
# EINA_CXX_INCLUDE_DIRS - The eina include directories |
||||
# EINA_CXX_LIBRARIES - The libraries needed to use eina |
||||
# EINA_CXX_DEFINITIONS - Compiler switches required for using eina |
||||
|
||||
set(MY_PKG eina_cxx) |
||||
|
||||
find_package(PkgConfig) |
||||
if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER "2.8.1") |
||||
# "QUIET" was introduced in 2.8.2 |
||||
set(_QUIET QUIET) |
||||
endif () |
||||
pkg_check_modules(PC_EINA_CXX ${_QUIET} ${MY_PKG}) |
||||
find_library(EINA_CXX_LIBRARY |
||||
NAMES ${PC_EINA_CXX_LIBRARIES} |
||||
HINTS ${PC_EINA_CXX_LIBDIR} ${PC_EINA_CXX_LIBRARY_DIRS} ) |
||||
|
||||
set(EINA_CXX_DEFINITIONS ${PC_EINA_CXX_CFLAGS_OTHER}) |
||||
set(EINA_CXX_LIBRARIES ${EINA_CXX_LIBRARY}) |
||||
set(EINA_CXX_INCLUDE_DIRS ${PC_EINA_CXX_INCLUDE_DIRS}) |
||||
|
||||
include(FindPackageHandleStandardArgs) |
||||
# handle the QUIETLY and REQUIRED arguments and set EINA_CXX_FOUND to TRUE |
||||
# if all listed variables are TRUE |
||||
find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG |
||||
EINA_CXX_LIBRARIES EINA_CXX_INCLUDE_DIRS) |
||||
|
||||
mark_as_advanced(EINA_CXX_INCLUDE_DIRS EINA_CXX_LIBRARY EINA_CXX_LIBRARIES EINA_CXX_DEFINITIONS) |
@ -0,0 +1,30 @@ |
||||
# - Try to find eo |
||||
# Once done this will define |
||||
# EO_CXX_FOUND - System has eo |
||||
# EO_CXX_INCLUDE_DIRS - The eo include directories |
||||
# EO_CXX_LIBRARIES - The libraries needed to use eo |
||||
# EO_CXX_DEFINITIONS - Compiler switches required for using eo |
||||
|
||||
set(MY_PKG eo_cxx) |
||||
|
||||
find_package(PkgConfig) |
||||
if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER "2.8.1") |
||||
# "QUIET" was introduced in 2.8.2 |
||||
set(_QUIET QUIET) |
||||
endif () |
||||
pkg_check_modules(PC_EO_CXX ${_QUIET} ${MY_PKG}) |
||||
find_library(EO_CXX_LIBRARY |
||||
NAMES ${PC_EO_CXX_LIBRARIES} |
||||
HINTS ${PC_EO_CXX_LIBDIR} ${PC_EO_CXX_LIBRARY_DIRS} ) |
||||
|
||||
set(EO_CXX_DEFINITIONS ${PC_EO_CXX_CFLAGS_OTHER}) |
||||
set(EO_CXX_LIBRARIES ${EO_CXX_LIBRARY}) |
||||
set(EO_CXX_INCLUDE_DIRS ${PC_EO_CXX_INCLUDE_DIRS}) |
||||
|
||||
include(FindPackageHandleStandardArgs) |
||||
# handle the QUIETLY and REQUIRED arguments and set EO_CXX_FOUND to TRUE |
||||
# if all listed variables are TRUE |
||||
find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG |
||||
EO_CXX_LIBRARIES EO_CXX_INCLUDE_DIRS) |
||||
|
||||
mark_as_advanced(EO_CXX_INCLUDE_DIRS EO_CXX_LIBRARY EO_CXX_LIBRARIES EO_CXX_DEFINITIONS) |
@ -0,0 +1,30 @@ |
||||
# - Try to find eolian |
||||
# Once done this will define |
||||
# EOLIAN_CXX_FOUND - System has eolian |
||||
# EOLIAN_CXX_INCLUDE_DIRS - The eolian include directories |
||||
# EOLIAN_CXX_LIBRARIES - The libraries needed to use eolian |
||||
# EOLIAN_CXX_DEFINITIONS - Compiler switches required for using eolian |
||||
|
||||
set(MY_PKG eolian_cxx) |
||||
|
||||
find_package(PkgConfig) |
||||
if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER "2.8.1") |
||||
# "QUIET" was introduced in 2.8.2 |
||||
set(_QUIET QUIET) |
||||
endif () |
||||
pkg_check_modules(PC_EOLIAN_CXX ${_QUIET} ${MY_PKG}) |
||||
find_library(EOLIAN_CXX_LIBRARY |
||||
NAMES ${PC_EOLIAN_CXX_LIBRARIES} |
||||
HINTS ${PC_EOLIAN_CXX_LIBDIR} ${PC_EOLIAN_CXX_LIBRARY_DIRS} ) |
||||
|
||||
set(EOLIAN_CXX_DEFINITIONS ${PC_EOLIAN_CXX_CFLAGS_OTHER}) |
||||
set(EOLIAN_CXX_LIBRARIES ${EOLIAN_CXX_LIBRARY}) |
||||
set(EOLIAN_CXX_INCLUDE_DIRS ${PC_EOLIAN_CXX_INCLUDE_DIRS}) |
||||
|
||||
include(FindPackageHandleStandardArgs) |
||||
# handle the QUIETLY and REQUIRED arguments and set EOLIAN_CXX_FOUND to TRUE |
||||
# if all listed variables are TRUE |
||||
find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG |
||||
EOLIAN_CXX_LIBRARIES EOLIAN_CXX_INCLUDE_DIRS) |
||||
|
||||
mark_as_advanced(EOLIAN_CXX_INCLUDE_DIRS EOLIAN_CXX_LIBRARY EOLIAN_CXX_LIBRARIES EOLIAN_CXX_DEFINITIONS) |
@ -0,0 +1,30 @@ |
||||
# - Try to find evas |
||||
# Once done this will define |
||||
# EVAS_CXX_FOUND - System has evas |
||||
# EVAS_CXX_INCLUDE_DIRS - The evas include directories |
||||
# EVAS_CXX_LIBRARIES - The libraries needed to use evas |
||||
# EVAS_CXX_DEFINITIONS - Compiler switches required for using evas |
||||
|
||||
set(MY_PKG evas_cxx) |
||||
|
||||
find_package(PkgConfig) |
||||
if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER "2.8.1") |
||||
# "QUIET" was introduced in 2.8.2 |
||||
set(_QUIET QUIET) |
||||
endif () |
||||
pkg_check_modules(PC_EVAS_CXX ${_QUIET} ${MY_PKG}) |
||||
find_library(EVAS_CXX_LIBRARY |
||||
NAMES ${PC_EVAS_CXX_LIBRARIES} |
||||
HINTS ${PC_EVAS_CXX_LIBDIR} ${PC_EVAS_CXX_LIBRARY_DIRS} ) |
||||
|
||||
set(EVAS_CXX_DEFINITIONS ${PC_EVAS_CXX_CFLAGS_OTHER}) |
||||
set(EVAS_CXX_LIBRARIES ${EVAS_CXX_LIBRARY}) |
||||
set(EVAS_CXX_INCLUDE_DIRS ${PC_EVAS_CXX_INCLUDE_DIRS}) |
||||
|
||||
include(FindPackageHandleStandardArgs) |
||||
# handle the QUIETLY and REQUIRED arguments and set EVAS_CXX_FOUND to TRUE |
||||
# if all listed variables are TRUE |
||||
find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG |
||||
EVAS_CXX_LIBRARIES EVAS_CXX_INCLUDE_DIRS) |
||||
|
||||
mark_as_advanced(EVAS_CXX_INCLUDE_DIRS EVAS_CXX_LIBRARY EVAS_CXX_LIBRARIES EVAS_CXX_DEFINITIONS) |
@ -0,0 +1,12 @@ |
||||
prefix=@prefix@ |
||||
exec_prefix=@exec_prefix@ |
||||
libdir=@libdir@ |
||||
includedir=@includedir@ |
||||
|
||||
Name: Eo C++ |
||||
Description: C++ bindings for EFL's generic object system. |
||||
Version: @PACKAGE_VERSION@ |
||||
Requires.private: @requirements_pc_eo@ |
||||
Libs.private: @requirements_libs_eo@ |
||||
Libs: -L${libdir} -leo |
||||
Cflags: -I${includedir}/efl-@VMAJ@ -I${includedir}/eo-@VMAJ@ -I${includedir}/eo-cxx-@VMAJ@ |
@ -0,0 +1,12 @@ |
||||
prefix=@prefix@ |
||||
exec_prefix=@exec_prefix@ |
||||
libdir=@libdir@ |
||||
includedir=@includedir@ |
||||
|
||||
Name: Eolian C++ |
||||
Description: EFL's C++ bindings generator. |
||||
Version: @VERSION@ |
||||
Require.private: @requirements_pc_eolian_cxx@ |
||||
Libs: -L${libdir} |
||||
Libs.private: @requirements_libs_eolian_cxx@ |
||||
Cflags: -I${includedir}/efl-@VMAJ@ -I${includedir}/eolian-cxx-@VMAJ@ |
@ -0,0 +1,15 @@ |
||||
prefix=@prefix@ |
||||
exec_prefix=@exec_prefix@ |
||||
libdir=@libdir@ |
||||
includedir=@includedir@ |
||||
eoincludedir=@datarootdir@/eolian/include |
||||
eolian_flags=-I${eoincludedir}/evas-cxx-@VMAJ@ |
||||
|
||||
Name: evas |
||||
Description: Evas C++ Bindings |
||||
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@ -I${includedir}/evas-cxx-@VMAJ@ |
||||
|
@ -0,0 +1,58 @@ |
||||
|
||||
if HAVE_CXX11 |
||||
|
||||
### Generated headers |
||||
|
||||
generated_ecore_audio_cxx_bindings = \ |
||||
lib/ecore_audio/ecore_audio.eo.hh \ |
||||
lib/ecore_audio/ecore_audio_in.eo.hh \ |
||||
lib/ecore_audio/ecore_audio_out.eo.hh \ |
||||
lib/ecore_audio/ecore_audio_in_sndfile.eo.hh \ |
||||
lib/ecore_audio/ecore_audio_out_sndfile.eo.hh \ |
||||
lib/ecore_audio/ecore_audio_out_pulse.eo.hh \ |
||||
lib/ecore_audio/ecore_audio_in_tone.eo.hh |
||||
|
||||
BUILT_SOURCES += \ |
||||
lib/ecore_audio/Ecore_Audio.hh \ |
||||
$(generated_ecore_audio_cxx_bindings) |
||||
|
||||
lib/ecore_audio/Ecore_Audio.hh: |
||||
@echo -e "#ifndef EFL_CXX_ECORE_AUDIO_HH\n#define EFL_CXX_ECORE_AUDIO_HH\n" > $(top_builddir)/src/lib/ecore_audio/Ecore_Audio.hh |
||||
@echo -e "#ifdef EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/ecore_audio/Ecore_Audio.hh |
||||
@for i in $(generated_ecore_audio_cxx_bindings); do echo "#include <$$(basename $$i)>" >> $(top_builddir)/src/lib/ecore_audio/Ecore_Audio.hh; done |
||||
@echo -e "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/ecore_audio/Ecore_Audio.hh |
||||
|
||||
installed_ecoreaudiocxxmainheadersdir = $(includedir)/ecore-audio-cxx-@VMAJ@ |
||||
dist_installed_ecoreaudiocxxmainheaders_DATA = \ |
||||
lib/ecore_audio/Ecore_Audio.hh \ |
||||
$(generated_ecore_audio_cxx_bindings) |
||||
|
||||
### Unit tests |
||||
|
||||
if EFL_ENABLE_TESTS |
||||
|
||||
check_PROGRAMS += tests/ecore_audio_cxx/cxx_compile_test |
||||
TESTS += tests/ecore_audio_cxx/cxx_compile_test |
||||
|
||||
tests_ecore_audio_cxx_cxx_compile_test_SOURCES = tests/ecore_audio_cxx/cxx_compile_test.cc |
||||
tests_ecore_audio_cxx_cxx_compile_test_CPPFLAGS = -I$(top_builddir)/src/lib/efl -I$(top_builddir)/src/lib/efl \ |
||||
-I$(top_srcdir)/src/lib/ecore_audio \ |
||||
-I$(top_builddir)/src/lib/ecore_audio \ |
||||
-I$(top_srcdir)/src/lib/ecore \ |
||||
-I$(top_builddir)/src/lib/ecore \ |
||||
-I$(top_srcdir)/src/lib/eo \ |
||||
-I$(top_builddir)/src/lib/eo \ |
||||
-I$(top_srcdir)/src/bindings/eo_cxx \ |
||||
-I$(top_builddir)/src/bindings/eo_cxx \ |
||||
-I$(top_srcdir)/src/bindings/ecore_cxx \ |
||||
-I$(top_builddir)/src/bindings/ecore_cxx \ |
||||
-I$(top_srcdir)/src/bindings/eina_cxx \ |
||||
-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/ecore_audio_cxx\" \ |
||||
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/ecore_audio_cxx\" \ |
||||
@CHECK_CFLAGS@ @ECORE_CFLAGS@ @EINA_CFLAGS@ |
||||
tests_ecore_audio_cxx_cxx_compile_test_LDADD = @CHECK_LIBS@ @USE_ECORE_LIBS@ |
||||
tests_ecore_audio_cxx_cxx_compile_test_DEPENDENCIES = @USE_ECORE_INTERNAL_LIBS@ |
||||
|
||||
endif |
||||
|
||||
endif |
@ -0,0 +1,62 @@ |
||||
|
||||
if HAVE_CXX11 |
||||
|
||||
### Generated headers |
||||
|
||||
generated_edje_cxx_bindings = \ |
||||
lib/edje/edje.eo.hh \ |
||||
lib/edje/edje_edit.eo.hh |
||||
|
||||
BUILT_SOURCES += \ |
||||
lib/edje/Edje.hh \ |
||||
$(generated_edje_cxx_bindings) |
||||
|
||||
EXTRA_DIST += \ |
||||
lib/edje/Edje.hh \ |
||||
$(edje_cxx_bindngs) |
||||
|
||||
installed_edjecxxmainheadersdir = $(includedir)/edje-cxx-@VMAJ@/ |
||||
|
||||
dist_installed_edjecxxmainheaders_DATA = \ |
||||
lib/edje/Edje.hh \ |
||||
$(generated_edje_cxx_bindings) |
||||
|
||||
lib/edje/Edje.hh: |
||||
@echo -e "#ifndef EFL_CXX_EDJE_HH\n#define EFL_CXX_EDJE_HH\n" > $(top_builddir)/src/lib/edje/Edje.hh |
||||
@echo -e "#ifdef EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/edje/Edje.hh |
||||
@for i in $(generated_edje_cxx_bindings); do echo "#include <$$(basename $$i)>" >> $(top_builddir)/src/lib/edje/Edje.hh; done |
||||
@echo -e "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/edje/Edje.hh |
||||
|
||||
### Unit tests |
||||
|
||||
if EFL_ENABLE_TESTS |
||||
|
||||
check_PROGRAMS += tests/edje_cxx/cxx_compile_test |
||||
TESTS += tests/edje_cxx/cxx_compile_test |
||||
|
||||
tests_edje_cxx_cxx_compile_test_SOURCES = tests/edje_cxx/cxx_compile_test.cc |
||||
tests_edje_cxx_cxx_compile_test_CPPFLAGS = -I$(top_builddir)/src/lib/efl -I$(top_builddir)/src/lib/efl \ |
||||
-I$(top_srcdir)/src/lib/edje \ |
||||
-I$(top_builddir)/src/lib/edje \ |
||||
-I$(top_srcdir)/src/lib/evas \ |
||||
-I$(top_builddir)/src/lib/evas \ |
||||
-I$(top_srcdir)/src/lib/evas/canvas \ |
||||
-I$(top_builddir)/src/lib/evas/canvas \ |
||||
-I$(top_srcdir)/src/lib/ecore \ |
||||
-I$(top_builddir)/src/lib/ecore \ |
||||
-I$(top_srcdir)/src/lib/eo \ |
||||
-I$(top_builddir)/src/lib/eo \ |
||||
-I$(top_srcdir)/src/bindings/eo_cxx \ |
||||
-I$(top_builddir)/src/bindings/eo_cxx \ |
||||
-I$(top_srcdir)/src/bindings/ecore_cxx \ |
||||
-I$(top_builddir)/src/bindings/ecore_cxx \ |
||||
-I$(top_srcdir)/src/bindings/eina_cxx \ |
||||
-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/edje_cxx\" \ |
||||
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/edje_cxx\" \ |
||||
@CHECK_CFLAGS@ @ECORE_CFLAGS@ @EINA_CFLAGS@ |
||||
tests_edje_cxx_cxx_compile_test_LDADD = @CHECK_LIBS@ @USE_ECORE_LIBS@ |
||||
tests_edje_cxx_cxx_compile_test_DEPENDENCIES = @USE_ECORE_INTERNAL_LIBS@ |
||||
|
||||
endif |
||||
|
||||
endif |
@ -0,0 +1,16 @@ |
||||
|
||||
### Library |
||||
|
||||
installed_eocxxmainheadersdir = $(includedir)/eo-cxx-@VMAJ@/ |
||||
dist_installed_eocxxmainheaders_DATA = \ |
||||
bindings/eo_cxx/Eo.hh |
||||
|
||||
installed_eocxxheadersdir = $(includedir)/eo-cxx-@VMAJ@/ |
||||
dist_installed_eocxxheaders_DATA = \ |
||||
bindings/eo_cxx/eo_base.hh \ |
||||
bindings/eo_cxx/eo_init.hh \ |
||||
bindings/eo_cxx/eo_wref.hh \ |
||||
bindings/eo_cxx/eo_inherit.hh \ |
||||
bindings/eo_cxx/eo_ops.hh \ |
||||
bindings/eo_cxx/eo_private.hh \ |
||||
bindings/eo_cxx/eo_inherit_bindings.hh |
@ -0,0 +1,46 @@ |
||||
|
||||
### Binary |
||||
|
||||
bin_PROGRAMS += \ |
||||
bin/eolian_cxx/eolian_cxx |
||||
|
||||
bin_eolian_cxx_eolian_cxx_SOURCES = \ |
||||
bin/eolian_cxx/comments.cc \ |
||||
bin/eolian_cxx/comments.hh \ |
||||
bin/eolian_cxx/convert.cc \ |
||||
bin/eolian_cxx/convert.hh \ |
||||
bin/eolian_cxx/eo_read.h \ |
||||
bin/eolian_cxx/safe_strings.hh \ |
||||
bin/eolian_cxx/eolian_cxx.cc |
||||
|
||||
bin_eolian_cxx_eolian_cxx_CFLAGS = \ |
||||
-I$(top_builddir)/src/lib/efl \ |
||||
-I$(top_builddir)/src/lib/eo \ |
||||
-I$(top_srcdir)/src/lib/eo \ |
||||
-I$(top_builddir)/src/lib/eina \ |
||||
-I$(top_srcdir)/src/lib/eina \ |
||||
-I$(top_builddir)/src/lib/eolian \ |
||||
-I$(top_srcdir)/src/lib/eolian |
||||
|
||||
bin_eolian_cxx_eolian_cxx_CXXFLAGS = \ |
||||
-I$(top_builddir)/src/lib/efl \ |
||||
-I$(top_builddir)/src/lib/eo \ |
||||
-I$(top_srcdir)/src/lib/eo \ |
||||
-I$(top_builddir)/src/lib/eina \ |
||||
-I$(top_srcdir)/src/lib/eina \ |
||||
-I$(top_builddir)/src/lib/eolian \ |
||||
-I$(top_srcdir)/src/lib/eolian \ |
||||
-I$(top_builddir)/src/bindings/eina_cxx \ |
||||
-I$(top_srcdir)/src/bindings/eina_cxx \ |
||||
-I$(top_builddir)/src/lib/eolian_cxx \ |
||||
-I$(top_srcdir)/src/lib/eolian_cxx |
||||
|
||||
bin_eolian_cxx_eolian_cxx_LDADD = \ |
||||
@USE_EOLIAN_LIBS@ |
||||
|
||||
bin_eolian_cxx_eolian_cxx_DEPENDENCIES = \ |
||||
@USE_EOLIAN_INTERNAL_LIBS@ |
||||
|
||||
include Makefile_Eolian_Cxx_Helper.am |
||||
|
||||
CLEANFILES += $(BUILT_SOURCES) |
@ -0,0 +1,19 @@ |
||||
|
||||
if HAVE_EOLIAN_CXX |
||||
EOLIAN_CXX = @eolian_cxx@ |
||||
_EOLIAN_CXX_DEP = @eolian_cxx@ |
||||
else |
||||
EOLIAN_CXX = EFL_RUN_IN_TREE=1 $(top_builddir)/src/bin/eolian_cxx/eolian_cxx${EXEEXT} |
||||
_EOLIAN_CXX_DEP = bin/eolian_cxx/eolian_cxx${EXEEXT} |
||||
endif |
||||
|
||||
AM_V_EOLCXX = $(am__v_EOLCXX_@AM_V@) |
||||
am__v_EOLCXX_ = $(am__v_EOLCXX_@AM_DEFAULT_V@) |
||||
am__v_EOLCXX_0 = @echo " EOLCXX " $@; |
||||
|
||||
SUFFIXES += .eo.hh |
||||
|
||||
%.eo.hh: %.eo $(_EOLIAN_CXX_DEP) |
||||
$(AM_V_EOLCXX)$(EOLIAN_CXX) $(EOLIAN_FLAGS) -I./$< -o $@ |
||||
|
||||
CLEANFILES += $(BUILT_SOURCES) |
@ -0,0 +1,76 @@ |
||||
|
||||
if HAVE_CXX11 |
||||
|
||||
### Generated headers |
||||
|
||||
generated_evas_canvas_cxx_bindings = \ |
||||
lib/evas/canvas/evas_line.eo.hh \ |
||||
lib/evas/canvas/evas_polygon.eo.hh \ |
||||
lib/evas/canvas/evas_rectangle.eo.hh \ |
||||
lib/evas/canvas/evas_text.eo.hh \ |
||||
lib/evas/canvas/evas_textblock.eo.hh \ |
||||
lib/evas/canvas/evas_textgrid.eo.hh \ |
||||
lib/evas/canvas/evas_signal_interface.eo.hh \ |
||||
lib/evas/canvas/evas_smart.eo.hh \ |
||||
lib/evas/canvas/evas_smart_clipped.eo.hh \ |
||||
lib/evas/canvas/evas_table.eo.hh \ |
||||
lib/evas/canvas/evas_common_interface.eo.hh \ |
||||
lib/evas/canvas/evas_object.eo.hh \ |
||||
lib/evas/canvas/evas.eo.hh \ |
||||
lib/evas/canvas/evas_grid.eo.hh \ |
||||
lib/evas/canvas/evas_image.eo.hh \ |
||||
lib/evas/canvas/evas_out.eo.hh \ |
||||
lib/evas/canvas/evas_draggable_interface.eo.hh \ |
||||
lib/evas/canvas/evas_clickable_interface.eo.hh \ |
||||
lib/evas/canvas/evas_scrollable_interface.eo.hh \ |
||||
lib/evas/canvas/evas_selectable_interface.eo.hh \ |
||||
lib/evas/canvas/evas_zoomable_interface.eo.hh \ |
||||
lib/evas/canvas/evas_box.eo.hh |
||||
|
||||
BUILT_SOURCES += lib/evas/Evas.hh $(generated_evas_canvas_cxx_bindings) |
||||
|
||||
installed_evascanvasmainheadersdir = $(includedir)/evas-cxx-@VMAJ@/ |
||||
dist_installed_evascanvasmainheaders_DATA = lib/evas/Evas.hh |
||||
|
||||
installed_evascanvasmainheadersdir = $(includedir)/evas-cxx-@VMAJ@/canvas |
||||
dist_installed_evascanvasmainheaders_DATA = $(generated_evas_canvas_cxx_bindings) |
||||
|
||||
lib/evas/Evas.hh: |
||||
@echo -e "#ifndef EFL_CXX_EVAS_HH\n#define EFL_CXX_EVAS_HH\n" > $(top_builddir)/src/lib/evas/Evas.hh |
||||
@echo -e "#ifdef EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/evas/Evas.hh |
||||
@for i in $(generated_evas_canvas_cxx_bindings); do echo "#include <canvas/$$(basename $$i)>" >> $(top_builddir)/src/lib/evas/Evas.hh; done |
||||
@echo -e "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/evas/Evas.hh |
||||
|
||||
### Unit tests |
||||
|
||||
if EFL_ENABLE_TESTS |
||||
|
||||
check_PROGRAMS += tests/evas_cxx/cxx_compile_test |
||||
TESTS += tests/evas_cxx/cxx_compile_test |
||||
|
||||
tests_evas_cxx_cxx_compile_test_SOURCES = tests/evas_cxx/cxx_compile_test.cc |
||||
tests_evas_cxx_cxx_compile_test_CPPFLAGS = -I$(top_builddir)/src/lib/efl -I$(top_builddir)/src/lib/efl \ |
||||
-I$(top_srcdir)/src/lib/edje \ |
||||
-I$(top_builddir)/src/lib/edje \ |
||||
-I$(top_srcdir)/src/lib/evas \ |
||||
-I$(top_builddir)/src/lib/evas \ |
||||
-I$(top_srcdir)/src/lib/evas/canvas \ |
||||
-I$(top_builddir)/src/lib/evas/canvas \ |
||||
-I$(top_srcdir)/src/lib/ecore \ |
||||
-I$(top_builddir)/src/lib/ecore \ |
||||
-I$(top_srcdir)/src/lib/eo \ |
||||
-I$(top_builddir)/src/lib/eo \ |
||||
-I$(top_srcdir)/src/bindings/eo_cxx \ |
||||
-I$(top_builddir)/src/bindings/eo_cxx \ |
||||
-I$(top_srcdir)/src/bindings/ecore_cxx \ |
||||
-I$(top_builddir)/src/bindings/ecore_cxx \ |
||||
-I$(top_srcdir)/src/bindings/eina_cxx \ |
||||
-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/evas_cxx\" \ |
||||
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/evas_cxx\" \ |
||||
@CHECK_CFLAGS@ @ECORE_CFLAGS@ @EINA_CFLAGS@ |
||||
tests_evas_cxx_cxx_compile_test_LDADD = @CHECK_LIBS@ @USE_ECORE_LIBS@ |
||||
tests_evas_cxx_cxx_compile_test_DEPENDENCIES = @USE_ECORE_INTERNAL_LIBS@ |
||||
|
||||
endif |
||||
|
||||
endif |
@ -0,0 +1 @@ |
||||
/eolian_cxx |
@ -0,0 +1,110 @@ |
||||
|
||||
#include "comments.hh" |
||||
#include "safe_strings.hh" |
||||
|
||||
static std::string |
||||
_comment_parameter(Eolian_Function_Parameter param) |
||||
{ |
||||
Eolian_Parameter_Dir direction; |
||||
Eina_Stringshare *description; |
||||
|
||||
eolian_parameter_information_get |
||||
(param, &direction, NULL, NULL, &description); |
||||
|
||||
std::string doc = "@param"; |
||||
if (direction == EOLIAN_IN_PARAM) doc += " "; |
||||
else if (direction == EOLIAN_OUT_PARAM) doc += "[out] "; |
||||
else if (direction == EOLIAN_INOUT_PARAM) doc += "[inout] "; |
||||
else assert(false); |
||||
|
||||
doc += safe_strshare(eolian_parameter_name_get(param)); |
||||
doc += " "; |
||||
doc += safe_str(description); |
||||
|
||||
return doc; |
||||
} |
||||
|
||||
static std::string |
||||
_comment_parameters_list(const Eina_List *params) |
||||
{ |
||||
std::string doc = ""; |
||||
const Eina_List *it; |
||||
void *curr; |
||||
EINA_LIST_FOREACH (params, it, curr) |
||||
{ |
||||
doc += _comment_parameter |
||||
(static_cast<Eolian_Function_Parameter>(curr)) + "\n"; |
||||
} |
||||
return doc; |
||||
} |
||||
|
||||
static std::string |
||||
_comment_brief_and_params(Eolian_Function function, |
||||
const char *key = EOLIAN_COMMENT) |
||||
{ |
||||
std::string doc = ""; |
||||
std::string func = safe_str(eolian_function_description_get(function, key)); |
||||
if (func != "") |
||||
{ |
||||
doc += "@brief " + func + "\n\n"; |
||||
} |
||||
std::string params = _comment_parameters_list(eolian_parameters_list_get(function)); |
||||
if (params != "") |
||||
{ |
||||
doc += params + "\n"; |
||||
} |
||||
return doc; |
||||
} |
||||
|
||||
static std::string |
||||
_comment_return(Eolian_Function function, |
||||
Eolian_Function_Type rettype) |
||||
{ |
||||
std::string doc = ""; |
||||
std::string ret = safe_str(eolian_function_return_type_get(function, rettype)); |
||||
std::string comment = safe_str(eolian_function_return_comment_get(function, rettype)); |
||||
if (ret != "void" && ret != "" && comment != "") |
||||
{ |
||||
doc = "@return " + comment; |
||||
} |
||||
return doc; |
||||
} |
||||
|
||||
namespace detail { |
||||
|
||||
std::string |
||||
eolian_class_comment(const char *classname) |
||||
{ |
||||
return safe_str(eolian_class_description_get(classname)); |
||||
} |
||||
|
||||
std::string |
||||
eolian_constructor_comment(Eolian_Function constructor) |
||||
{ |
||||
return _comment_brief_and_params(constructor); |
||||
} |
||||
|
||||
std::string eolian_function_comment(Eolian_Function function) |
||||
{ |
||||
std::string doc = _comment_brief_and_params(function); |
||||
doc += _comment_return(function, EOLIAN_METHOD); |
||||
return doc; |
||||
} |
||||
|
||||
std::string eolian_property_getter_comment(Eolian_Function property) |
||||
{ |
||||
std::string doc = _comment_brief_and_params |
||||
(property, EOLIAN_COMMENT_GET); |
||||
doc += _comment_return(property, EOLIAN_PROP_GET); |
||||
return doc; |
||||
} |
||||
|
||||
std::string eolian_property_setter_comment(Eolian_Function property) |
||||
{ |
||||
std::string doc = _comment_brief_and_params |
||||
(property, EOLIAN_COMMENT_SET); |
||||
doc += _comment_return(property, EOLIAN_PROP_SET); |
||||
return doc; |
||||
} |
||||
|
||||
} // namespace detail
|
@ -0,0 +1,29 @@ |
||||
|
||||
#ifndef EOLIAN_CXX_EOLIAN_CONVERT_COMMENTS_HH |
||||
#define EOLIAN_CXX_EOLIAN_CONVERT_COMMENTS_HH |
||||
|
||||
#include <string> |
||||
|
||||
extern "C" |
||||
{ |
||||
#include <Eina.h> |
||||
#include <Eolian.h> |
||||
} |
||||
|
||||
#include <Eolian_Cxx.hh> |
||||
|
||||
namespace detail { |
||||
|
||||
std::string eolian_class_comment(const char *classname); |
||||
|
||||
std::string eolian_constructor_comment(Eolian_Function constructor); |
||||
|
||||
std::string eolian_function_comment(Eolian_Function function); |
||||
|
||||
std::string eolian_property_getter_comment(Eolian_Function function); |
||||
|
||||
std::string eolian_property_setter_comment(Eolian_Function function); |
||||
|
||||
} |
||||
|
||||
#endif // EOLIAN_CXX_EOLIAN_CONVERT_COMMENTS_HH
|
@ -0,0 +1,304 @@ |
||||
#include <vector> |
||||
#include <algorithm> |
||||
#include <cassert> |
||||
|
||||
#ifdef HAVE_CONFIG_H |
||||
# include <config.h> |
||||
#endif |
||||
|
||||
#include <Eina.h> |
||||
#include <Eina.hh> |
||||
#include <Eo.h> |
||||
#include <Eolian.h> |
||||
|
||||
#include "eo_types.hh" |
||||
#include "safe_strings.hh" |
||||
#include "comments.hh" |
||||
|
||||
static std::string |
||||
_resolve_param_type(Eolian_Function_Parameter id, bool is_get) |
||||
{ |
||||
Eolian_Parameter_Dir dir; |
||||
const char *type; |
||||
bool is_const; |
||||
std::string res; |
||||
|
||||
eolian_parameter_information_get(id, &dir, &type, NULL, NULL); |
||||
is_const = eolian_parameter_const_attribute_get(id, is_get); |
||||
res = safe_str(type); |
||||
assert(res != ""); |
||||
if (is_const) res = std::string("const ") + res; |
||||
if (dir == EOLIAN_OUT_PARAM || dir == EOLIAN_INOUT_PARAM) res += "*"; |
||||
return res; |
||||
} |
||||
|
||||
static efl::eolian::parameters_container_type |
||||
_get_params(const Eina_List *eolian_params, bool is_get = false) |
||||
{ |
||||
const Eina_List *it; |
||||
void *curr; |
||||
if (eolian_params == NULL) |
||||
{ |
||||
return efl::eolian::parameters_container_type(); |
||||
} |
||||
efl::eolian::parameters_container_type list; |
||||
EINA_LIST_FOREACH (eolian_params, it, curr) |
||||
{ |
||||
Eolian_Function_Parameter id = |
||||
(static_cast<Eolian_Function_Parameter>(curr)); |
||||
list.push_back({ |
||||
_resolve_param_type(id, is_get), |
||||
safe_strshare(eolian_parameter_name_get(id)) |
||||
}); |
||||
} |
||||
return list; |
||||
} |
||||
|
||||
static efl::eolian::functions_container_type |
||||
_get_properties(const char *classname) |
||||
{ |
||||
efl::eolian::functions_container_type container; |
||||
|
||||
std::string cxx_classname = classname; |
||||
std::transform(cxx_classname.begin(), cxx_classname.end(), |
||||
cxx_classname.begin(), ::tolower); |
||||
|
||||
const Eina_List *properties; |
||||
properties = eolian_class_functions_list_get(classname, EOLIAN_PROPERTY); |
||||
|
||||
const Eina_List *it; |
||||
void *curr; |
||||
std::string prefix(safe_str(eolian_class_eo_prefix_get(classname))); |
||||
EINA_LIST_FOREACH (properties, it, curr) |
||||
{ |
||||
Eolian_Function property = static_cast<Eolian_Function>(curr); |
||||
Eolian_Function_Type type = eolian_function_type_get(property); |
||||
std::string name = safe_str(eolian_function_name_get(property)); |
||||
if (type == EOLIAN_PROP_GET || type == EOLIAN_PROPERTY) |
||||
{ |
||||
const Eina_List *keys_ = eolian_property_keys_list_get(property); |
||||
efl::eolian::parameters_container_type params = _get_params |
||||
(eolian_parameters_list_get(property), true); |
||||
efl::eolian::eo_function getter; |
||||
getter.type = efl::eolian::eo_function::regular_; |
||||
getter.name = name + "_get"; |
||||
getter.impl = (prefix != "" ? prefix : cxx_classname) + "_" + getter.name; |
||||
std::string ret = safe_str |
||||
(eolian_function_return_type_get(property, EOLIAN_PROP_GET)); |
||||
if (ret == "") ret = "void"; |
||||
|
||||
// if the getter has a single parameter and void return
|
||||
// we translate it to a getter with no parameters that
|
||||
// returns its type.
|
||||
if ((ret == "void") && params.size() == 1) |
||||
{ |
||||
getter.ret = params[0].type; |
||||
getter.params.clear(); |
||||
} |
||||
else // otherwise just create the described getter
|
||||
{ |
||||
getter.ret = ret; |
||||
getter.params = params; |
||||
std::transform |
||||
(params.begin(), params.end(), getter.params.begin(), |
||||
[](efl::eolian::eo_parameter const& param) |
||||
{ |
||||
return efl::eolian::eo_parameter |
||||
{ param.type + "*", param.name }; |
||||
}); |
||||
} |
||||
if (eina_list_count(keys_) > 0) |
||||
{ |
||||
efl::eolian::parameters_container_type keys = _get_params(keys_, true); |
||||
keys.reserve(keys.size() + getter.params.size()); |
||||
keys.insert(keys.end(), getter.params.begin(), getter.params.end()); |
||||
getter.params = keys; |
||||
} |
||||
getter.comment = detail::eolian_property_getter_comment(property); |
||||
container.push_back(getter); |
||||
} |
||||
if (type == EOLIAN_PROP_SET || type == EOLIAN_PROPERTY) |
||||
{ |
||||
const Eina_List *keys_ = eolian_property_keys_list_get(property); |
||||
const Eina_List *args_ = eolian_parameters_list_get(property); |
||||
Eina_List *params_ = eina_list_merge(eina_list_clone(keys_), eina_list_clone(args_)); |
||||
efl::eolian::parameters_container_type params = _get_params(params_); |
||||
eina_list_free(params_); |
||||
efl::eolian::eo_function setter; |
||||
setter.type = efl::eolian::eo_function::regular_; |
||||
setter.name = name + "_set"; |
||||
setter.impl = (prefix != "" ? prefix : cxx_classname) + "_" + setter.name; |
||||
setter.params = params; |
||||
setter.ret = safe_str(eolian_function_return_type_get |
||||
(property, EOLIAN_PROP_SET)); |
||||
if (setter.ret == "") setter.ret = "void"; |
||||
setter.comment = detail::eolian_property_setter_comment(property); |
||||
container.push_back(setter); |
||||
} |
||||
} |
||||
return container; |
||||
} |
||||
|
||||
namespace detail { |
||||
|
||||
void |
||||
convert_eolian_inheritances(efl::eolian::eo_class& cls, const char *classname) |
||||
{ |
||||
const Eina_List *inheritances = eolian_class_inherits_list_get(classname); |
||||
const Eina_List *it; |
||||
void *curr; |
||||
|
||||
if (eina_list_count(inheritances) == 0 |
||||
|| eina_list_data_get(inheritances) == NULL) |
||||
{ |
||||
cls.parent = "efl::eo::base"; |
||||
return; |
||||
} |
||||
else |
||||
{ |
||||
std::string parent = |
||||
static_cast<const char*>(eina_list_data_get(inheritances)); |
||||
std::transform(parent.begin(), parent.end(), parent.begin(), ::tolower); |
||||
// "eo_base" is the Eolian name for EO_BASE_CLASS.
|
||||
cls.parent = (parent == "eo_base" || parent == "") ? "efl::eo::base" : parent; |
||||
} |
||||
|
||||
inheritances = eina_list_next(inheritances); |
||||
EINA_LIST_FOREACH (inheritances, it, curr) |
||||
{ |
||||
std::string extension = static_cast<const char*>(curr); |
||||
std::transform |
||||
(extension.begin(), extension.end(), extension.begin(), ::tolower); |
||||
cls.extensions.push_back(extension); |
||||
} |
||||
} |
||||
|
||||
void |
||||
convert_eolian_implements(efl::eolian::eo_class& cls, const char *classname) |
||||
{ |
||||
const Eina_List *it; |
||||
void *curr; |
||||
std::string prefix(safe_str(eolian_class_eo_prefix_get(classname))); |
||||
const Eina_List *implements = eolian_class_implements_list_get(classname); |
||||
Eolian_Implement impl_desc; |
||||
void *impl_desc_; |
||||
EINA_LIST_FOREACH(eolian_class_implements_list_get(classname), it, impl_desc_) |
||||
{ |
||||
Eolian_Implement impl_desc = static_cast<Eolian_Implement>(impl_desc_); |
||||
Eolian_Function_Type func_type; |
||||
const char *func_name; |
||||
const char *impl_class; |
||||
eolian_implement_information_get |
||||
(impl_desc, &impl_class, &func_name, &func_type); |
||||
#if 1 // XXX only due to a bug in Eolian we have to double-check
|
||||
if(func_type == EOLIAN_UNRESOLVED && |
||||
eolian_class_function_find_by_name(impl_class, func_name, EOLIAN_CTOR) != NULL) |
||||
func_type = EOLIAN_CTOR; |
||||
#endif |
||||
if (func_type == EOLIAN_CTOR) |
||||
{ |
||||
efl::eolian::eo_constructor constructor; |
||||
Eolian_Function eolian_constructor = eolian_class_function_find_by_name |
||||
(impl_class, func_name, func_type); |
||||
assert(eolian_constructor != NULL); |
||||
std::string parent = safe_str(impl_class); |
||||
if(parent == "Eo_Base") parent = "eo"; |
||||
else std::transform(parent.begin(), parent.end(), parent.begin(), ::tolower); |
||||
constructor.name = parent + "_" + safe_str(func_name); |
||||
constructor.params = _get_params |
||||
(eolian_parameters_list_get(eolian_constructor)); |
||||
constructor.comment = detail::eolian_constructor_comment |
||||
(eolian_constructor); |
||||
cls.constructors.push_back(constructor); |
||||
} |
||||
} |
||||
} |
||||
|
||||
void |
||||
convert_eolian_constructors(efl::eolian::eo_class& cls, const char *classname) |
||||
{ |
||||
const Eina_List *it; |
||||
void *curr; |
||||
std::string prefix(safe_str(eolian_class_eo_prefix_get(classname))); |
||||
const Eina_List *constructors = |
||||
eolian_class_functions_list_get(classname, EOLIAN_CTOR); |
||||
EINA_LIST_FOREACH (constructors, it, curr) |
||||
{ |
||||
Eolian_Function eolian_constructor = static_cast<Eolian_Function>(curr); |
||||
efl::eolian::eo_constructor constructor; |
||||
constructor.name = (prefix != "" ? prefix : cls.name) + "_" + safe_str |
||||
(eolian_function_name_get(eolian_constructor)); |
||||
constructor.params = _get_params |
||||
(eolian_parameters_list_get(eolian_constructor)); |
||||
constructor.comment = detail::eolian_constructor_comment |
||||
(eolian_constructor); |
||||
cls.constructors.push_back(constructor); |
||||
} |
||||
} |
||||
|
||||
void |
||||
convert_eolian_functions(efl::eolian::eo_class& cls, const char *classname) |
||||
{ |
||||
const Eina_List *it; |
||||
void *curr; |
||||
|
||||
const Eina_List *eolian_functions = |
||||
|