diff options
25 files changed, 331 insertions, 124 deletions
diff --git a/src/Makefile_Cxx.am b/src/Makefile_Cxx.am index febc123dff..72d5713d46 100644 --- a/src/Makefile_Cxx.am +++ b/src/Makefile_Cxx.am | |||
@@ -21,63 +21,46 @@ bindings/cxx/eo_cxx/eo_private.hh | |||
21 | ### Elementary C++ | 21 | ### Elementary C++ |
22 | installed_elementarycxxmainheadersdir = $(includedir)/elementary-cxx-@VMAJ@/ | 22 | installed_elementarycxxmainheadersdir = $(includedir)/elementary-cxx-@VMAJ@/ |
23 | nodist_installed_elementarycxxmainheaders_DATA = $(elementary_eolian_cxx_hh) $(elementary_eolian_cxx_impl_hh) \ | 23 | nodist_installed_elementarycxxmainheaders_DATA = $(elementary_eolian_cxx_hh) $(elementary_eolian_cxx_impl_hh) \ |
24 | lib/elementary/Elementary.hh | 24 | lib/elementary/Elementary.eo.hh |
25 | 25 | dist_installed_elementarycxxmainheaders_DATA = lib/elementary/Elementary.hh | |
26 | lib/elementary/Elementary.hh: $(elementary_eolian_cxx_hh) | 26 | |
27 | @echo @ECHO_E@ "#ifndef EFL_CXX_ELEMENTARY_HH\n#define EFL_CXX_ELEMENTARY_HH\n" > $(top_builddir)/src/lib/elementary/Elementary.hh | 27 | lib/elementary/Elementary.eo.hh: $(elm_public_eolian_files) $(_EOLIAN_CXX_DEP) |
28 | @echo @ECHO_E@ "#if defined(ELEMENTARY_H) || defined(ELM_WIDGET_H)" >> $(top_builddir)/src/lib/elementary/Elementary.hh | 28 | $(AM_V_EOLCXX) \ |
29 | @echo @ECHO_E@ "#error Do not include Elm C API headers before including Elementary.hh" >> $(top_builddir)/src/lib/elementary/Elementary.hh | 29 | $(MKDIR_P) $(dir $@); \ |
30 | @echo @ECHO_E@ "#endif" >> $(top_builddir)/src/lib/elementary/Elementary.hh | 30 | $(EOLIAN_CXX) $(EOLIAN_FLAGS) -m -o $@ $(filter %.eo, $^) |
31 | @echo @ECHO_E@ "" >> $(top_builddir)/src/lib/elementary/Elementary.hh | 31 | |
32 | @echo @ECHO_E@ "#ifndef EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/elementary/Elementary.hh | 32 | CLEANFILES += $(elementary_eolian_cxx_hh) $(elementary_eolian_cxx_impl_hh) lib/elementary/Elementary.eo.hh |
33 | @echo @ECHO_E@ "#define EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
34 | @echo @ECHO_E@ "#endif\n" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
35 | @echo @ECHO_E@ "#ifndef EFL_EO_API_SUPPORT" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
36 | @echo @ECHO_E@ "#define EFL_EO_API_SUPPORT" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
37 | @echo @ECHO_E@ "#endif\n" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
38 | @echo @ECHO_E@ "#ifndef ELM_INTERNAL_API_ARGESFSDFEFC" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
39 | @echo @ECHO_E@ "#define ELM_INTERNAL_API_ARGESFSDFEFC" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
40 | @echo @ECHO_E@ "#endif\n" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
41 | @echo @ECHO_E@ "extern \"C\" {" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
42 | @echo @ECHO_E@ "#include \"Elementary.h\"" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
43 | @echo @ECHO_E@ "#include \"elm_widget.h\"" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
44 | @echo @ECHO_E@ "}" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
45 | @echo @ECHO_E@ "" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
46 | @for i in $(elementary_eolian_cxx_hh); do echo "#include <$$(basename $$i)>" >> $(top_builddir)/src/lib/elementary/Elementary.hh; done | ||
47 | @echo @ECHO_E@ "#endif\n" >> $(top_builddir)/src/lib/elementary/Elementary.hh | ||
48 | |||
49 | CLEANFILES += $(elementary_eolian_cxx_hh) $(elementary_eolian_cxx_impl_hh) lib/elementary/Elementary.hh | ||
50 | 33 | ||
51 | ### Efl C++ | 34 | ### Efl C++ |
52 | installed_eflcxxmainheadersdir = $(includedir)/efl-cxx-@VMAJ@/ | 35 | installed_eflcxxmainheadersdir = $(includedir)/efl-cxx-@VMAJ@/ |
53 | nodist_installed_eflcxxmainheaders_DATA = $(efl_eolian_cxx_hh) $(efl_eolian_cxx_impl_hh) lib/efl/Efl.hh | 36 | nodist_installed_eflcxxmainheaders_DATA = $(efl_eolian_cxx_hh) $(efl_eolian_cxx_impl_hh) lib/efl/Efl.eo.hh |
37 | dist_installed_eflcxxmainheaders_DATA = lib/efl/Efl.hh | ||
54 | 38 | ||
55 | lib/efl/Efl.hh: $(efl_eolian_cxx_hh) | 39 | lib/efl/Efl.eo.hh: $(efl_eolian_files) $(_EOLIAN_CXX_DEP) |
56 | @echo @ECHO_E@ "#ifndef EFL_CXX_HH\n#define EFL_CXX_HH\n" > $(top_builddir)/src/lib/efl/Efl.hh | 40 | $(AM_V_EOLCXX) \ |
57 | @echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/efl/Efl.hh | 41 | $(MKDIR_P) $(dir $@); \ |
58 | @for i in $(efl_eolian_cxx_hh); do echo "#include <$$(basename $$i)>" >> $(top_builddir)/src/lib/efl/Efl.hh; done | 42 | $(EOLIAN_CXX) $(EOLIAN_FLAGS) -m -o $@ $(filter %.eo, $^) |
59 | @echo @ECHO_E@ "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/efl/Efl.hh | ||
60 | 43 | ||
61 | CLEANFILES += $(efl_eolian_cxx_hh) $(efl_eolian_cxx_impl_hh) lib/efl/Efl.hh | 44 | CLEANFILES += $(efl_eolian_cxx_hh) $(efl_eolian_cxx_impl_hh) lib/efl/Efl.hh |
62 | 45 | ||
63 | ### Evas C++ | 46 | ### Evas C++ |
64 | installed_evascxxmainheadersdir = $(includedir)/evas-cxx-@VMAJ@/ | 47 | installed_evascxxmainheadersdir = $(includedir)/evas-cxx-@VMAJ@/ |
65 | nodist_installed_evascxxmainheaders_DATA = lib/evas/Evas.hh | 48 | dist_installed_evascxxmainheaders_DATA = lib/evas/Evas.hh |
49 | nodist_installed_evascxxmainheaders_DATA = lib/evas/Evas.eo.hh | ||
66 | 50 | ||
67 | installed_evascxxcanvasheadersdir = $(includedir)/evas-cxx-@VMAJ@/canvas | 51 | installed_evascxxcanvasheadersdir = $(includedir)/evas-cxx-@VMAJ@/canvas |
68 | nodist_installed_evascxxcanvasheaders_DATA = $(evas_eolian_cxx_hh) $(evas_eolian_cxx_impl_hh) | 52 | nodist_installed_evascxxcanvasheaders_DATA = $(evas_eolian_cxx_hh) $(evas_eolian_cxx_impl_hh) |
69 | 53 | ||
70 | lib/evas/Evas.hh: $(evas_eolian_cxx_hh) | 54 | lib/evas/Evas.eo.hh: $(evas_eolian_pub_files) $(_EOLIAN_CXX_DEP) |
71 | @echo @ECHO_E@ "#ifndef EFL_CXX_EVAS_HH\n#define EFL_CXX_EVAS_HH\n" > $(top_builddir)/src/lib/evas/Evas.hh | 55 | $(AM_V_EOLCXX) \ |
72 | @echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/evas/Evas.hh | 56 | $(MKDIR_P) $(dir $@); \ |
73 | @for i in $(evas_eolian_cxx_hh); do echo "#include <canvas/$$(basename $$i)>" >> $(top_builddir)/src/lib/evas/Evas.hh; done | 57 | $(EOLIAN_CXX) $(EOLIAN_FLAGS) -m -o $@ $(filter %.eo, $^) |
74 | @echo @ECHO_E@ "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/evas/Evas.hh | ||
75 | 58 | ||
76 | CLEANFILES += $(evas_eolian_cxx_hh) $(evas_eolian_cxx_impl_hh) lib/evas/Evas.hh | 59 | CLEANFILES += $(evas_eolian_cxx_hh) $(evas_eolian_cxx_impl_hh) lib/evas/Evas.eo.hh |
77 | 60 | ||
78 | ### Eldbus C++ | 61 | ### Eldbus C++ |
79 | installed_eldbuscxxmainheadersdir = $(includedir)/eldbus_cxx-@VMAJ@ | 62 | installed_eldbuscxxmainheadersdir = $(includedir)/eldbus_cxx-@VMAJ@ |
80 | nodist_installed_eldbuscxxmainheaders_DATA = $(eldbus_eolian_cxx_hh) $(eldbus_eolian_cxx_impl_hh) lib/eldbus/Eldbus_Model.hh | 63 | nodist_installed_eldbuscxxmainheaders_DATA = $(eldbus_eolian_cxx_hh) $(eldbus_eolian_cxx_impl_hh) lib/eldbus/Eldbus_Model.eo.hh |
81 | dist_installed_eldbuscxxmainheaders_DATA = \ | 64 | dist_installed_eldbuscxxmainheaders_DATA = \ |
82 | bindings/cxx/eldbus_cxx/eldbus_basic.hh \ | 65 | bindings/cxx/eldbus_cxx/eldbus_basic.hh \ |
83 | bindings/cxx/eldbus_cxx/eldbus_error.hh \ | 66 | bindings/cxx/eldbus_cxx/eldbus_error.hh \ |
@@ -89,16 +72,15 @@ bindings/cxx/eldbus_cxx/eldbus_message.hh \ | |||
89 | bindings/cxx/eldbus_cxx/eldbus_proxy_call.hh \ | 72 | bindings/cxx/eldbus_cxx/eldbus_proxy_call.hh \ |
90 | bindings/cxx/eldbus_cxx/eldbus_raw_tuple.hh \ | 73 | bindings/cxx/eldbus_cxx/eldbus_raw_tuple.hh \ |
91 | bindings/cxx/eldbus_cxx/eldbus_service.hh \ | 74 | bindings/cxx/eldbus_cxx/eldbus_service.hh \ |
92 | bindings/cxx/eldbus_cxx/eldbus_signature_traits.hh | 75 | bindings/cxx/eldbus_cxx/eldbus_signature_traits.hh \ |
76 | bindings/cxx/eldbus_cxx/Eldbus_Model.hh | ||
93 | 77 | ||
94 | lib/eldbus/Eldbus_Model.hh: $(eldbus_eolian_cxx_hh) | 78 | lib/eldbus/Eldbus_Model.eo.hh: $(eldbus_eolian_files) $(_EOLIAN_CXX_DEP) |
95 | @echo @ECHO_E@ "#ifndef EFL_CXX_ELDBUS_MODEL_HH\n#define EFL_CXX_ELDBUS_MODEL_HH\n" > $(top_builddir)/src/lib/eldbus/Eldbus_Model.hh | 79 | $(AM_V_EOLCXX) \ |
96 | @echo @ECHO_E@ "#include <Eldbus_Model.h>" >> $(top_builddir)/src/lib/eldbus/Eldbus_Model.hh | 80 | $(MKDIR_P) $(dir $@); \ |
97 | @echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/eldbus/Eldbus_Model.hh | 81 | $(EOLIAN_CXX) $(EOLIAN_FLAGS) -m -o $@ $(filter %.eo, $^) |
98 | @for i in $(eldbus_eolian_cxx_hh); do echo "#include <$$(basename $$i)>" >> $(top_builddir)/src/lib/eldbus/Eldbus_Model.hh; done | ||
99 | @echo @ECHO_E@ "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/eldbus/Eldbus_Model.hh | ||
100 | 82 | ||
101 | CLEANFILES += $(eldbus_eolian_cxx_hh) $(eldbus_eolian_cxx_impl_hh) lib/eldbus/Eldbus_Model.hh | 83 | CLEANFILES += $(eldbus_eolian_cxx_hh) $(eldbus_eolian_cxx_impl_hh) lib/eldbus/Eldbus_Model.eo.hh |
102 | 84 | ||
103 | ### Eet C++ | 85 | ### Eet C++ |
104 | installed_eetcxxheadersdir = $(includedir)/eet-cxx-@VMAJ@ | 86 | installed_eetcxxheadersdir = $(includedir)/eet-cxx-@VMAJ@ |
@@ -110,15 +92,15 @@ bindings/cxx/eet_cxx/Eet.hh | |||
110 | 92 | ||
111 | ### Generated headers src/lib/edje | 93 | ### Generated headers src/lib/edje |
112 | installed_edjecxxmainheadersdir = $(includedir)/edje-cxx-@VMAJ@/ | 94 | installed_edjecxxmainheadersdir = $(includedir)/edje-cxx-@VMAJ@/ |
113 | nodist_installed_edjecxxmainheaders_DATA = $(edje_eolian_cxx_hh) $(edje_eolian_cxx_impl_hh) lib/edje/Edje.hh | 95 | dist_installed_edjecxxmainheaders_DATA = lib/edje/Edje.hh |
96 | nodist_installed_edjecxxmainheaders_DATA = $(edje_eolian_cxx_hh) $(edje_eolian_cxx_impl_hh) lib/edje/Edje.eo.hh | ||
114 | 97 | ||
115 | lib/edje/Edje.hh: $(edje_eolian_cxx_hh) | 98 | lib/edje/Edje.eo.hh: $(edje_eolian_files) $(_EOLIAN_CXX_DEP) |
116 | @echo @ECHO_E@ "#ifndef EFL_CXX_EDJE_HH\n#define EFL_CXX_EDJE_HH\n" > $(top_builddir)/src/lib/edje/Edje.hh | 99 | $(AM_V_EOLCXX) \ |
117 | @echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/edje/Edje.hh | 100 | $(MKDIR_P) $(dir $@); \ |
118 | @for i in $(edje_eolian_cxx_hh); do echo "#include <$$(basename $$i)>" >> $(top_builddir)/src/lib/edje/Edje.hh; done | 101 | $(EOLIAN_CXX) $(EOLIAN_FLAGS) -m -o $@ $(filter %.eo, $^) |
119 | @echo @ECHO_E@ "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/edje/Edje.hh | ||
120 | 102 | ||
121 | CLEANFILES += $(edje_eolian_cxx_hh) $(edje_eolian_cxx_impl_hh) lib/edje/Edje.hh | 103 | CLEANFILES += $(edje_eolian_cxx_hh) $(edje_eolian_cxx_impl_hh) lib/edje/Edje.eo.hh |
122 | 104 | ||
123 | ### Ecore src/lib/ecore | 105 | ### Ecore src/lib/ecore |
124 | installed_ecorecxxheadersdir = $(includedir)/ecore-cxx-@VMAJ@ | 106 | installed_ecorecxxheadersdir = $(includedir)/ecore-cxx-@VMAJ@ |
@@ -129,11 +111,10 @@ bindings/cxx/ecore_cxx/Ecore_Manual.hh | |||
129 | nodist_installed_ecorecxxheaders_DATA = $(ecore_eolian_cxx_hh) $(ecore_eolian_cxx_impl_hh) \ | 111 | nodist_installed_ecorecxxheaders_DATA = $(ecore_eolian_cxx_hh) $(ecore_eolian_cxx_impl_hh) \ |
130 | lib/ecore/Ecore.eo.hh | 112 | lib/ecore/Ecore.eo.hh |
131 | 113 | ||
132 | lib/ecore/Ecore.eo.hh: $(ecore_eolian_cxx_hh) $(eo_eolian_cxx_hh) $(efl_eolian_cxx_hh) | 114 | lib/ecore/Ecore.eo.hh: $(ecore_eolian_files_public) $(_EOLIAN_CXX_DEP) |
133 | @echo @ECHO_E@ "#ifndef EFL_CXX_ECORE_HH\n#define EFL_CXX_ECORE_HH\n" > $(top_builddir)/src/lib/ecore/Ecore.eo.hh | 115 | $(AM_V_EOLCXX) \ |
134 | @echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/ecore/Ecore.eo.hh | 116 | $(MKDIR_P) $(dir $@); \ |
135 | @for i in $(ecore_eolian_cxx_hh); do echo "#include <$$(basename $$i)>" >> $(top_builddir)/src/lib/ecore/Ecore.eo.hh; done | 117 | $(EOLIAN_CXX) $(EOLIAN_FLAGS) -m -o $@ $(filter %.eo, $^) |
136 | @echo @ECHO_E@ "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/ecore/Ecore.eo.hh | ||
137 | 118 | ||
138 | CLEANFILES += $(ecore_eolian_cxx_hh) $(ecore_eolian_cxx_impl_hh) lib/ecore/Ecore.eo.hh | 119 | CLEANFILES += $(ecore_eolian_cxx_hh) $(ecore_eolian_cxx_impl_hh) lib/ecore/Ecore.eo.hh |
139 | 120 | ||
@@ -180,15 +161,15 @@ bindings/cxx/eina_cxx/Eina.hh | |||
180 | 161 | ||
181 | ### Eio | 162 | ### Eio |
182 | installed_eiocxxmainheadersdir = $(includedir)/eio-cxx-@VMAJ@/ | 163 | installed_eiocxxmainheadersdir = $(includedir)/eio-cxx-@VMAJ@/ |
183 | nodist_installed_eiocxxmainheaders_DATA = $(eio_eolian_cxx_hh) $(eio_eolian_cxx_impl_hh) lib/eio/Eio.hh | 164 | nodist_installed_eiocxxmainheaders_DATA = $(eio_eolian_cxx_hh) $(eio_eolian_cxx_impl_hh) lib/eio/Eio.eo.hh |
165 | dist_installed_eiocxxmainheaders_DATA = lib/eio/Eio.hh | ||
184 | 166 | ||
185 | lib/eio/Eio.hh: $(eio_eolian_cxx_hh) | 167 | lib/eio/Eio.eo.hh: $(eio_eolian_files) $(_EOLIAN_CXX_DEP) |
186 | @echo @ECHO_E@ "#ifndef EFL_CXX_EIO_HH\n#define EFL_CXX_EIO_HH\n" > $(top_builddir)/src/lib/eio/Eio.hh | 168 | $(AM_V_EOLCXX) \ |
187 | @echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/eio/Eio.hh | 169 | $(MKDIR_P) $(dir $@); \ |
188 | @for i in $(eio_eolian_cxx_hh); do echo "#include <$$(basename $$i)>" >> $(top_builddir)/src/lib/eio/Eio.hh; done | 170 | $(EOLIAN_CXX) $(EOLIAN_FLAGS) -m -o $@ $(filter %.eo, $^) |
189 | @echo @ECHO_E@ "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/eio/Eio.hh | ||
190 | 171 | ||
191 | CLEANFILES += $(eio_eolian_cxx_hh) $(eio_eolian_cxx_impl_hh) lib/eio/Eio.hh | 172 | CLEANFILES += $(eio_eolian_cxx_hh) $(eio_eolian_cxx_impl_hh) lib/eio/Eio.eo.hh |
192 | 173 | ||
193 | ### Tests | 174 | ### Tests |
194 | 175 | ||
diff --git a/src/Makefile_Eolian_Cxx.am b/src/Makefile_Eolian_Cxx.am index 6d0ae1d73e..6abb3d6a40 100644 --- a/src/Makefile_Eolian_Cxx.am +++ b/src/Makefile_Eolian_Cxx.am | |||
@@ -145,8 +145,15 @@ tests/eolian_cxx/complex.eo.impl.hh \ | |||
145 | tests/eolian_cxx/name1_name2_type_generation.eo.hh \ | 145 | tests/eolian_cxx/name1_name2_type_generation.eo.hh \ |
146 | tests/eolian_cxx/name1_name2_type_generation.eo.impl.hh \ | 146 | tests/eolian_cxx/name1_name2_type_generation.eo.impl.hh \ |
147 | tests/eolian_cxx/name1_name2_type_generation.eo.h \ | 147 | tests/eolian_cxx/name1_name2_type_generation.eo.h \ |
148 | tests/eolian_cxx/name1_name2_type_generation.eo.c | 148 | tests/eolian_cxx/name1_name2_type_generation.eo.c \ |
149 | 149 | tests/eolian_cxx/cyclic1.eo.c \ | |
150 | tests/eolian_cxx/cyclic1.eo.h \ | ||
151 | tests/eolian_cxx/cyclic1.eo.hh \ | ||
152 | tests/eolian_cxx/cyclic1.eo.impl.hh \ | ||
153 | tests/eolian_cxx/cyclic2.eo.c \ | ||
154 | tests/eolian_cxx/cyclic2.eo.h \ | ||
155 | tests/eolian_cxx/cyclic2.eo.hh \ | ||
156 | tests/eolian_cxx/cyclic2.eo.impl.hh | ||
150 | 157 | ||
151 | tests_eolian_cxx_eolian_cxx_suite_CXXFLAGS = \ | 158 | tests_eolian_cxx_eolian_cxx_suite_CXXFLAGS = \ |
152 | -I$(top_builddir)/src/lib/efl \ | 159 | -I$(top_builddir)/src/lib/efl \ |
@@ -181,7 +188,9 @@ tests/eolian_cxx/name_name.eo \ | |||
181 | tests/eolian_cxx/ns_name.eo \ | 188 | tests/eolian_cxx/ns_name.eo \ |
182 | tests/eolian_cxx/ns_name_other.eo \ | 189 | tests/eolian_cxx/ns_name_other.eo \ |
183 | tests/eolian_cxx/name1_name2_type_generation.eo \ | 190 | tests/eolian_cxx/name1_name2_type_generation.eo \ |
184 | tests/eolian_cxx/complex.eo | 191 | tests/eolian_cxx/complex.eo \ |
192 | tests/eolian_cxx/cyclic1.eo \ | ||
193 | tests/eolian_cxx/cyclic2.eo | ||
185 | 194 | ||
186 | include Makefile_Eolian_Cxx_Helper.am | 195 | include Makefile_Eolian_Cxx_Helper.am |
187 | 196 | ||
diff --git a/src/bin/eolian_cxx/eolian_cxx.cc b/src/bin/eolian_cxx/eolian_cxx.cc index 24a9dd62a1..18978a3fe9 100644 --- a/src/bin/eolian_cxx/eolian_cxx.cc +++ b/src/bin/eolian_cxx/eolian_cxx.cc | |||
@@ -32,8 +32,11 @@ namespace eolian_cxx { | |||
32 | struct options_type | 32 | struct options_type |
33 | { | 33 | { |
34 | std::vector<std::string> include_dirs; | 34 | std::vector<std::string> include_dirs; |
35 | std::string in_file; | 35 | std::vector<std::string> in_files; |
36 | std::string out_file; | 36 | std::string out_file; |
37 | bool main_header; | ||
38 | |||
39 | options_type() : main_header(false) {} | ||
37 | }; | 40 | }; |
38 | 41 | ||
39 | efl::eina::log_domain domain("eolian_cxx"); | 42 | efl::eina::log_domain domain("eolian_cxx"); |
@@ -41,7 +44,7 @@ efl::eina::log_domain domain("eolian_cxx"); | |||
41 | static bool | 44 | static bool |
42 | opts_check(eolian_cxx::options_type const& opts) | 45 | opts_check(eolian_cxx::options_type const& opts) |
43 | { | 46 | { |
44 | if (opts.in_file.empty()) | 47 | if (opts.in_files.empty()) |
45 | { | 48 | { |
46 | EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) | 49 | EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) |
47 | << "Nothing to generate?" << std::endl; | 50 | << "Nothing to generate?" << std::endl; |
@@ -68,6 +71,7 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts) | |||
68 | 71 | ||
69 | efl::eolian::grammar::attributes::klass_def klass_def(klass); | 72 | efl::eolian::grammar::attributes::klass_def klass_def(klass); |
70 | std::vector<efl::eolian::grammar::attributes::klass_def> klasses{klass_def}; | 73 | std::vector<efl::eolian::grammar::attributes::klass_def> klasses{klass_def}; |
74 | std::vector<efl::eolian::grammar::attributes::klass_def> forward_klasses{klass_def}; | ||
71 | 75 | ||
72 | std::set<std::string> c_headers; | 76 | std::set<std::string> c_headers; |
73 | std::set<std::string> cpp_headers; | 77 | std::set<std::string> cpp_headers; |
@@ -82,6 +86,9 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts) | |||
82 | assert(klass); | 86 | assert(klass); |
83 | c_headers.insert(eolian_class_file_get(klass) + std::string(".h")); | 87 | c_headers.insert(eolian_class_file_get(klass) + std::string(".h")); |
84 | cpp_headers.insert(eolian_class_file_get(klass) + std::string(".hh")); | 88 | cpp_headers.insert(eolian_class_file_get(klass) + std::string(".hh")); |
89 | efl::eolian::grammar::attributes::klass_def cls{klass}; | ||
90 | if(std::find(forward_klasses.begin(), forward_klasses.end(), cls) == forward_klasses.end()) | ||
91 | forward_klasses.push_back(cls); | ||
85 | }; | 92 | }; |
86 | auto complex_function | 93 | auto complex_function |
87 | = [&] (efl::eolian::grammar::attributes::complex_type_def const& complex) | 94 | = [&] (efl::eolian::grammar::attributes::complex_type_def const& complex) |
@@ -112,6 +119,9 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts) | |||
112 | Eolian_Class const* inherit = ::eolian_class_get_by_name(&*inherit_iterator); | 119 | Eolian_Class const* inherit = ::eolian_class_get_by_name(&*inherit_iterator); |
113 | c_headers.insert(eolian_class_file_get(inherit) + std::string(".h")); | 120 | c_headers.insert(eolian_class_file_get(inherit) + std::string(".h")); |
114 | cpp_headers.insert(eolian_class_file_get(inherit) + std::string(".hh")); | 121 | cpp_headers.insert(eolian_class_file_get(inherit) + std::string(".hh")); |
122 | efl::eolian::grammar::attributes::klass_def klass{inherit}; | ||
123 | if(std::find(forward_klasses.begin(), forward_klasses.end(), klass) == forward_klasses.end()) | ||
124 | forward_klasses.push_back(klass); | ||
115 | 125 | ||
116 | klass_function(inherit); | 126 | klass_function(inherit); |
117 | } | 127 | } |
@@ -147,7 +157,7 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts) | |||
147 | , std::vector<efl::eolian::grammar::attributes::klass_def>& | 157 | , std::vector<efl::eolian::grammar::attributes::klass_def>& |
148 | , std::vector<efl::eolian::grammar::attributes::klass_def>& | 158 | , std::vector<efl::eolian::grammar::attributes::klass_def>& |
149 | > attributes | 159 | > attributes |
150 | {guard_name, c_headers, cpp_headers, klasses, klasses, klasses, klasses}; | 160 | {guard_name, c_headers, cpp_headers, klasses, forward_klasses, klasses, klasses}; |
151 | 161 | ||
152 | if(opts.out_file == "-") | 162 | if(opts.out_file == "-") |
153 | { | 163 | { |
@@ -182,15 +192,11 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts) | |||
182 | return false; | 192 | return false; |
183 | } | 193 | } |
184 | 194 | ||
185 | #if 1 | ||
186 | efl::eolian::grammar::class_header.generate | 195 | efl::eolian::grammar::class_header.generate |
187 | (std::ostream_iterator<char>(header_decl), attributes, efl::eolian::grammar::context_null()); | 196 | (std::ostream_iterator<char>(header_decl), attributes, efl::eolian::grammar::context_null()); |
188 | 197 | ||
189 | efl::eolian::grammar::impl_header.generate | 198 | efl::eolian::grammar::impl_header.generate |
190 | (std::ostream_iterator<char>(header_impl), klasses, efl::eolian::grammar::context_null()); | 199 | (std::ostream_iterator<char>(header_impl), klasses, efl::eolian::grammar::context_null()); |
191 | #else | ||
192 | efl::eolian::generate(header_decl, header_impl, cls, gen_opts); | ||
193 | #endif | ||
194 | 200 | ||
195 | header_impl.close(); | 201 | header_impl.close(); |
196 | header_decl.close(); | 202 | header_decl.close(); |
@@ -201,26 +207,75 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts) | |||
201 | static void | 207 | static void |
202 | run(options_type const& opts) | 208 | run(options_type const& opts) |
203 | { | 209 | { |
204 | const Eolian_Class *klass = NULL; | 210 | if(!opts.main_header) |
205 | char* dup = strdup(opts.in_file.c_str()); | ||
206 | char* base = basename(dup); | ||
207 | klass = ::eolian_class_get_by_file(base); | ||
208 | free(dup); | ||
209 | if (klass) | ||
210 | { | 211 | { |
211 | if (!generate(klass, opts)) | 212 | const Eolian_Class *klass = NULL; |
212 | goto err; | 213 | char* dup = strdup(opts.in_files[0].c_str()); |
214 | char* base = basename(dup); | ||
215 | klass = ::eolian_class_get_by_file(base); | ||
216 | free(dup); | ||
217 | if (klass) | ||
218 | { | ||
219 | if (!generate(klass, opts)) | ||
220 | { | ||
221 | EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) | ||
222 | << "Error generating: " << ::eolian_class_name_get(klass) | ||
223 | << std::endl; | ||
224 | assert(false && "error generating class"); | ||
225 | } | ||
226 | } | ||
227 | else | ||
228 | { | ||
229 | std::abort(); | ||
230 | } | ||
213 | } | 231 | } |
214 | else | 232 | else |
215 | { | 233 | { |
216 | std::abort(); | 234 | std::set<std::string> headers; |
217 | } | 235 | std::set<std::string> eo_files; |
218 | return; | 236 | |
219 | err: | 237 | for(auto&& name : opts.in_files) |
220 | EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) | 238 | { |
221 | << "Error generating: " << ::eolian_class_name_get(klass) | 239 | bool b = ::eolian_file_parse(name.c_str()); |
222 | << std::endl; | 240 | if(!b) |
223 | assert(false && "error generating class"); | 241 | { |
242 | EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) | ||
243 | << "Failed parsing: " << name << "."; | ||
244 | } | ||
245 | char* dup = strdup(name.c_str()); | ||
246 | char* base = basename(dup); | ||
247 | Eolian_Class const* klass = ::eolian_class_get_by_file(base); | ||
248 | free(dup); | ||
249 | if (klass) | ||
250 | { | ||
251 | std::string filename = eolian_class_file_get(klass); | ||
252 | headers.insert(filename + std::string(".hh")); | ||
253 | eo_files.insert(filename); | ||
254 | } | ||
255 | } | ||
256 | |||
257 | using efl::eolian::grammar::header_include_directive; | ||
258 | using efl::eolian::grammar::implementation_include_directive; | ||
259 | |||
260 | auto main_header_grammar = | ||
261 | *header_include_directive // sequence<string> | ||
262 | << *implementation_include_directive // sequence<string> | ||
263 | ; | ||
264 | |||
265 | std::tuple<std::set<std::string>&, std::set<std::string>&> attributes{headers, eo_files}; | ||
266 | |||
267 | std::ofstream main_header; | ||
268 | main_header.open(opts.out_file); | ||
269 | if (!main_header.good()) | ||
270 | { | ||
271 | EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) | ||
272 | << "Can't open output file: " << opts.out_file << std::endl; | ||
273 | return; | ||
274 | } | ||
275 | |||
276 | main_header_grammar.generate(std::ostream_iterator<char>(main_header) | ||
277 | , attributes, efl::eolian::grammar::context_null()); | ||
278 | } | ||
224 | } | 279 | } |
225 | 280 | ||
226 | static void | 281 | static void |
@@ -240,16 +295,16 @@ database_load(options_type const& opts) | |||
240 | << "Eolian failed parsing eot files"; | 295 | << "Eolian failed parsing eot files"; |
241 | assert(false && "Error parsing eot files"); | 296 | assert(false && "Error parsing eot files"); |
242 | } | 297 | } |
243 | if (opts.in_file.empty()) | 298 | if (opts.in_files.empty()) |
244 | { | 299 | { |
245 | EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) | 300 | EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) |
246 | << "No input file."; | 301 | << "No input file."; |
247 | assert(false && "Error parsing input file"); | 302 | assert(false && "Error parsing input file"); |
248 | } | 303 | } |
249 | if (!::eolian_file_parse(opts.in_file.c_str())) | 304 | if (!opts.main_header && !::eolian_file_parse(opts.in_files[0].c_str())) |
250 | { | 305 | { |
251 | EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) | 306 | EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) |
252 | << "Failed parsing: " << opts.in_file << "."; | 307 | << "Failed parsing: " << opts.in_files[0] << "."; |
253 | assert(false && "Error parsing input file"); | 308 | assert(false && "Error parsing input file"); |
254 | } | 309 | } |
255 | if (!::eolian_database_validate()) | 310 | if (!::eolian_database_validate()) |
@@ -307,13 +362,14 @@ opts_get(int argc, char **argv) | |||
307 | 362 | ||
308 | const struct option long_options[] = | 363 | const struct option long_options[] = |
309 | { | 364 | { |
310 | { "in", required_argument, 0, 'I' }, | 365 | { "in", required_argument, 0, 'I' }, |
311 | { "out-file", required_argument, 0, 'o' }, | 366 | { "out-file", required_argument, 0, 'o' }, |
312 | { "version", no_argument, 0, 'v' }, | 367 | { "version", no_argument, 0, 'v' }, |
313 | { "help", no_argument, 0, 'h' }, | 368 | { "help", no_argument, 0, 'h' }, |
314 | { 0, 0, 0, 0 } | 369 | { "main-header", no_argument, 0, 'm' }, |
370 | { 0, 0, 0, 0 } | ||
315 | }; | 371 | }; |
316 | const char* options = "I:D:o:c:arvh"; | 372 | const char* options = "I:D:o:c::marvh"; |
317 | 373 | ||
318 | int c, idx; | 374 | int c, idx; |
319 | while ( (c = getopt_long(argc, argv, options, long_options, &idx)) != -1) | 375 | while ( (c = getopt_long(argc, argv, options, long_options, &idx)) != -1) |
@@ -331,15 +387,20 @@ opts_get(int argc, char **argv) | |||
331 | { | 387 | { |
332 | _usage(argv[0]); | 388 | _usage(argv[0]); |
333 | } | 389 | } |
390 | else if(c == 'm') | ||
391 | { | ||
392 | opts.main_header = true; | ||
393 | } | ||
334 | else if (c == 'v') | 394 | else if (c == 'v') |
335 | { | 395 | { |
336 | _print_version(); | 396 | _print_version(); |
337 | if (argc == 2) exit(EXIT_SUCCESS); | 397 | if (argc == 2) exit(EXIT_SUCCESS); |
338 | } | 398 | } |
339 | } | 399 | } |
340 | if (optind == argc-1) | 400 | if (optind != argc) |
341 | { | 401 | { |
342 | opts.in_file = argv[optind]; | 402 | for(int i = optind; i != argc; ++i) |
403 | opts.in_files.push_back(argv[i]); | ||
343 | } | 404 | } |
344 | 405 | ||
345 | if (!eolian_cxx::opts_check(opts)) | 406 | if (!eolian_cxx::opts_check(opts)) |
diff --git a/src/bindings/cxx/eldbus_cxx/Eldbus_Model.hh b/src/bindings/cxx/eldbus_cxx/Eldbus_Model.hh new file mode 100644 index 0000000000..f2aa9e1a2c --- /dev/null +++ b/src/bindings/cxx/eldbus_cxx/Eldbus_Model.hh | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef EFL_CXX_ELDBUS_MODEL_HH | ||
2 | #define EFL_CXX_ELDBUS_MODEL_HH | ||
3 | |||
4 | #include <Eldbus_Model.h> | ||
5 | |||
6 | #ifdef EFL_BETA_API_SUPPORT | ||
7 | |||
8 | #include <Eldbus_Model.eo.hh> | ||
9 | |||
10 | #endif | ||
11 | #endif | ||
12 | |||
diff --git a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh index 524863e418..7a2f8fb765 100644 --- a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh +++ b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh | |||
@@ -279,11 +279,11 @@ T convert_to_c(V&& object); | |||
279 | 279 | ||
280 | namespace impl { | 280 | namespace impl { |
281 | 281 | ||
282 | template <typename U, typename T> | 282 | template <typename U, typename T, typename V> |
283 | auto convert_to_c_impl | 283 | auto convert_to_c_impl |
284 | (T&& v, tag<U, U>, typename std::enable_if<std::is_same<typename std::remove_reference<T>::type, U>::value>::type* =0) -> decltype(std::forward<T>(v)) | 284 | (V&& v, tag<U, T>, typename std::enable_if<std::is_same<typename std::remove_reference<T>::type, U>::value>::type* =0) -> decltype(std::forward<V>(v)) |
285 | { | 285 | { |
286 | return std::forward<T>(v); | 286 | return std::forward<V>(v); |
287 | } | 287 | } |
288 | 288 | ||
289 | template <typename T> | 289 | template <typename T> |
diff --git a/src/examples/elementary/button_cxx_example_00.cc b/src/examples/elementary/button_cxx_example_00.cc index 99901d2aa2..9239f74734 100644 --- a/src/examples/elementary/button_cxx_example_00.cc +++ b/src/examples/elementary/button_cxx_example_00.cc | |||
@@ -24,7 +24,7 @@ elm_main (int argc, char *argv[]) | |||
24 | win.autohide_set(true); | 24 | win.autohide_set(true); |
25 | 25 | ||
26 | ::elm::Button btn(win); | 26 | ::elm::Button btn(win); |
27 | btn.eo_cxx::efl::Text::text_set("Good-Bye, World!"); | 27 | btn.eo_cxx::elm::Layout::text_set(nullptr,"Good-Bye, World!"); |
28 | btn.eo_cxx::efl::Gfx::size_set(120, 30); | 28 | btn.eo_cxx::efl::Gfx::size_set(120, 30); |
29 | btn.eo_cxx::efl::Gfx::position_set(60, 15); | 29 | btn.eo_cxx::efl::Gfx::position_set(60, 15); |
30 | btn.visible_set(true); | 30 | btn.visible_set(true); |
diff --git a/src/examples/elementary/calendar_cxx_example_02.cc b/src/examples/elementary/calendar_cxx_example_02.cc index 7061e57c4a..02a1edea3e 100644 --- a/src/examples/elementary/calendar_cxx_example_02.cc +++ b/src/examples/elementary/calendar_cxx_example_02.cc | |||
@@ -3,6 +3,7 @@ | |||
3 | #include "elementary_config.h" | 3 | #include "elementary_config.h" |
4 | #endif | 4 | #endif |
5 | 5 | ||
6 | #include <Efl.hh> | ||
6 | #include <Elementary.hh> | 7 | #include <Elementary.hh> |
7 | 8 | ||
8 | static char * | 9 | static char * |
diff --git a/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc b/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc index 2fedf12748..5cd6b20596 100644 --- a/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc +++ b/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc | |||
@@ -8,6 +8,8 @@ | |||
8 | 8 | ||
9 | #include "ns_colourable.eo.hh" | 9 | #include "ns_colourable.eo.hh" |
10 | #include "ns_colourablesquare.eo.hh" | 10 | #include "ns_colourablesquare.eo.hh" |
11 | #include "ns_colourable.eo.impl.hh" | ||
12 | #include "ns_colourablesquare.eo.impl.hh" | ||
11 | 13 | ||
12 | #include <eo_inherit.hh> | 14 | #include <eo_inherit.hh> |
13 | 15 | ||
diff --git a/src/examples/eolian_cxx/eolian_cxx_simple_01.cc b/src/examples/eolian_cxx/eolian_cxx_simple_01.cc index eb093d904b..028a429039 100644 --- a/src/examples/eolian_cxx/eolian_cxx_simple_01.cc +++ b/src/examples/eolian_cxx/eolian_cxx_simple_01.cc | |||
@@ -9,6 +9,8 @@ | |||
9 | 9 | ||
10 | #include "ns_colourable.eo.hh" | 10 | #include "ns_colourable.eo.hh" |
11 | #include "ns_colourablesquare.eo.hh" | 11 | #include "ns_colourablesquare.eo.hh" |
12 | #include "ns_colourable.eo.impl.hh" | ||
13 | #include "ns_colourablesquare.eo.impl.hh" | ||
12 | 14 | ||
13 | int | 15 | int |
14 | main() | 16 | main() |
diff --git a/src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc b/src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc index 11209783bc..2ca0e975de 100644 --- a/src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc +++ b/src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc | |||
@@ -9,6 +9,8 @@ | |||
9 | 9 | ||
10 | #include "colourable.eo.hh" | 10 | #include "colourable.eo.hh" |
11 | #include "colourablesquare.eo.hh" | 11 | #include "colourablesquare.eo.hh" |
12 | #include "ns_colourable.eo.impl.hh" | ||
13 | #include "ns_colourablesquare.eo.impl.hh" | ||
12 | 14 | ||
13 | int | 15 | int |
14 | main() | 16 | main() |
diff --git a/src/lib/.gitignore b/src/lib/.gitignore index 190a85e1d6..aaec4c069e 100644 --- a/src/lib/.gitignore +++ b/src/lib/.gitignore | |||
@@ -1,11 +1,12 @@ | |||
1 | /ecore_x/ecore_x_version.h | 1 | /ecore_x/ecore_x_version.h |
2 | /efl/Efl_Config.h | 2 | /efl/Efl_Config.h |
3 | /efl/Efl.hh | ||
4 | /eina/eina_config.h | 3 | /eina/eina_config.h |
5 | /ecore_audio/Ecore_Audio.hh | ||
6 | /ecore/Ecore.eo.hh | 4 | /ecore/Ecore.eo.hh |
7 | /evas/Evas.hh | ||
8 | /edje/Edje.hh | ||
9 | /edje/Edje.eo.hh | 5 | /edje/Edje.eo.hh |
10 | /eio/Eio.hh | 6 | /eio/Eio.eo.hh |
11 | /eldbus/Eldbus_Model.hh | 7 | /elementary/Elementary.eo.hh |
8 | /evas/Evas.eo.hh | ||
9 | /efl/Efl.eo.hh | ||
10 | /eldbus/Eldbus_Model.eo.hh | ||
11 | |||
12 | |||
diff --git a/src/lib/edje/Edje.hh b/src/lib/edje/Edje.hh new file mode 100644 index 0000000000..4550181ac8 --- /dev/null +++ b/src/lib/edje/Edje.hh | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef EFL_CXX_EDJE_HH | ||
2 | #define EFL_CXX_EDJE_HH | ||
3 | |||
4 | #ifdef EFL_BETA_API_SUPPORT | ||
5 | |||
6 | #include <Edje.eo.hh> | ||
7 | |||
8 | #endif | ||
9 | #endif | ||
diff --git a/src/lib/efl/.gitignore b/src/lib/efl/.gitignore index 3732c0ce33..e69de29bb2 100644 --- a/src/lib/efl/.gitignore +++ b/src/lib/efl/.gitignore | |||
@@ -1 +0,0 @@ | |||
1 | Efl.hh | ||
diff --git a/src/lib/efl/Efl.hh b/src/lib/efl/Efl.hh new file mode 100644 index 0000000000..20dfc1a90d --- /dev/null +++ b/src/lib/efl/Efl.hh | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef EFL_EFL_HH | ||
2 | #define EFL_EFL_HH | ||
3 | |||
4 | #ifdef EFL_BETA_API_SUPPORT | ||
5 | |||
6 | #include <Efl.eo.hh> | ||
7 | |||
8 | #endif | ||
9 | #endif | ||
10 | |||
11 | |||
diff --git a/src/lib/eio/Eio.hh b/src/lib/eio/Eio.hh new file mode 100644 index 0000000000..78c0f391d8 --- /dev/null +++ b/src/lib/eio/Eio.hh | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef EFL_CXX_EIO_HH | ||
2 | #define EFL_CXX_EIO_HH | ||
3 | #ifdef EFL_BETA_API_SUPPORT | ||
4 | |||
5 | #include "Eio.eo.hh" | ||
6 | |||
7 | #endif | ||
8 | #endif | ||
9 | |||
diff --git a/src/lib/elementary/.gitignore b/src/lib/elementary/.gitignore index 089c32dd72..9076648525 100644 --- a/src/lib/elementary/.gitignore +++ b/src/lib/elementary/.gitignore | |||
@@ -1,4 +1,3 @@ | |||
1 | /Elementary.hh | ||
2 | /Elementary_Options.h | 1 | /Elementary_Options.h |
3 | /elm_intro.h | 2 | /elm_intro.h |
4 | /*.eo.c | 3 | /*.eo.c |
diff --git a/src/lib/elementary/Elementary.hh b/src/lib/elementary/Elementary.hh new file mode 100644 index 0000000000..215632bb10 --- /dev/null +++ b/src/lib/elementary/Elementary.hh | |||
@@ -0,0 +1,26 @@ | |||
1 | #ifndef EFL_CXX_ELEMENTARY_HH | ||
2 | #define EFL_CXX_ELEMENTARY_HH | ||
3 | #if defined(ELEMENTARY_H) || defined(ELM_WIDGET_H) | ||
4 | #error "Do not include Elm C API headers before including Elementary.hh" | ||
5 | #endif | ||
6 | |||
7 | #ifndef EFL_BETA_API_SUPPORT | ||
8 | #define EFL_BETA_API_SUPPORT | ||
9 | #endif | ||
10 | #ifndef EFL_EO_API_SUPPORT | ||
11 | #define EFL_EO_API_SUPPORT | ||
12 | #endif | ||
13 | #ifndef ELM_INTERNAL_API_ARGESFSDFEFC | ||
14 | #define ELM_INTERNAL_API_ARGESFSDFEFC | ||
15 | #endif | ||
16 | |||
17 | #include <Efl.hh> | ||
18 | |||
19 | extern "C" { | ||
20 | #include "Elementary.h" | ||
21 | #include "elm_widget.h" | ||
22 | } | ||
23 | |||
24 | #include "Elementary.eo.hh" | ||
25 | |||
26 | #endif | ||
diff --git a/src/lib/eolian_cxx/grammar/class_declaration.hpp b/src/lib/eolian_cxx/grammar/class_declaration.hpp index 6f23641e4d..bed1a5696f 100644 --- a/src/lib/eolian_cxx/grammar/class_declaration.hpp +++ b/src/lib/eolian_cxx/grammar/class_declaration.hpp | |||
@@ -15,6 +15,8 @@ namespace efl { namespace eolian { namespace grammar { | |||
15 | 15 | ||
16 | struct class_declaration_generator | 16 | struct class_declaration_generator |
17 | { | 17 | { |
18 | bool type_traits; | ||
19 | |||
18 | template <typename OutputIterator, typename Context> | 20 | template <typename OutputIterator, typename Context> |
19 | bool generate(OutputIterator sink, attributes::klass_def const& cls, Context const& context) const | 21 | bool generate(OutputIterator sink, attributes::klass_def const& cls, Context const& context) const |
20 | { | 22 | { |
@@ -30,11 +32,12 @@ struct class_declaration_generator | |||
30 | auto close_namespace = *(lit("} ")) << "\n"; | 32 | auto close_namespace = *(lit("} ")) << "\n"; |
31 | if(!as_generator(close_namespace).generate(sink, cpp_namespaces, context)) return false; | 33 | if(!as_generator(close_namespace).generate(sink, cpp_namespaces, context)) return false; |
32 | 34 | ||
33 | if(!as_generator | 35 | if(type_traits) |
34 | ( | 36 | if(!as_generator |
35 | "namespace efl { namespace eo { template<> struct is_eolian_object< " | 37 | ( |
36 | "::" << *(lower_case[string] << "::") << string << "> : ::std::true_type {}; } }\n" | 38 | "namespace efl { namespace eo { template<> struct is_eolian_object< " |
37 | ).generate(sink, std::make_tuple(cpp_namespaces, cls.cxx_name), context)) return false; | 39 | "::" << *(lower_case[string] << "::") << string << "> : ::std::true_type {}; } }\n" |
40 | ).generate(sink, std::make_tuple(cpp_namespaces, cls.cxx_name), context)) return false; | ||
38 | 41 | ||
39 | 42 | ||
40 | return true; | 43 | return true; |
@@ -49,7 +52,8 @@ template <> | |||
49 | struct attributes_needed<class_declaration_generator> : std::integral_constant<int, 1> {}; | 52 | struct attributes_needed<class_declaration_generator> : std::integral_constant<int, 1> {}; |
50 | } | 53 | } |
51 | 54 | ||
52 | class_declaration_generator const class_declaration = {}; | 55 | class_declaration_generator const class_declaration = {true}; |
56 | class_declaration_generator const class_forward_declaration = {false}; | ||
53 | 57 | ||
54 | } } } | 58 | } } } |
55 | 59 | ||
diff --git a/src/lib/eolian_cxx/grammar/header.hpp b/src/lib/eolian_cxx/grammar/header.hpp index 96e123593c..63a6095949 100644 --- a/src/lib/eolian_cxx/grammar/header.hpp +++ b/src/lib/eolian_cxx/grammar/header.hpp | |||
@@ -25,11 +25,12 @@ auto class_header = | |||
25 | "#include <Eo.hh>\n" | 25 | "#include <Eo.hh>\n" |
26 | << *header_include_directive // sequence<string> | 26 | << *header_include_directive // sequence<string> |
27 | << *class_declaration // sequence<class> | class | 27 | << *class_declaration // sequence<class> | class |
28 | << *class_forward_declaration // sequence<class> | class | ||
28 | << "\nnamespace eo_cxx {\n" | 29 | << "\nnamespace eo_cxx {\n" |
29 | << *base_class_definition // sequence<class> | class | 30 | << *base_class_definition // sequence<class> | class |
30 | << "}\n" | 31 | << "}\n" |
31 | << *class_definition // sequence<class> | class | 32 | << *class_definition // sequence<class> | class |
32 | << *implementation_include_directive | 33 | // << *implementation_include_directive |
33 | ] | 34 | ] |
34 | ; | 35 | ; |
35 | 36 | ||
diff --git a/src/lib/eolian_cxx/grammar/implementation_include_directive.hpp b/src/lib/eolian_cxx/grammar/implementation_include_directive.hpp index dab1e0a7e9..6c2631ab80 100644 --- a/src/lib/eolian_cxx/grammar/implementation_include_directive.hpp +++ b/src/lib/eolian_cxx/grammar/implementation_include_directive.hpp | |||
@@ -22,6 +22,12 @@ struct implementation_include_directive_generator | |||
22 | return as_generator("#include \"" << string << ".impl.hh\"\n") | 22 | return as_generator("#include \"" << string << ".impl.hh\"\n") |
23 | .generate(sink, std::string(eolian_class_file_get(get_klass(get_klass_name(cls)))), add_lower_case_context(ctx)); | 23 | .generate(sink, std::string(eolian_class_file_get(get_klass(get_klass_name(cls)))), add_lower_case_context(ctx)); |
24 | } | 24 | } |
25 | template <typename OutputIterator, typename Context> | ||
26 | bool generate(OutputIterator sink, std::string const& cls, Context const& ctx) const | ||
27 | { | ||
28 | return as_generator("#include \"" << string << ".impl.hh\"\n") | ||
29 | .generate(sink, cls, add_lower_case_context(ctx)); | ||
30 | } | ||
25 | }; | 31 | }; |
26 | 32 | ||
27 | template <> | 33 | template <> |
diff --git a/src/lib/eolian_cxx/grammar/keyword.hpp b/src/lib/eolian_cxx/grammar/keyword.hpp index 9359892f9c..b64201eac3 100644 --- a/src/lib/eolian_cxx/grammar/keyword.hpp +++ b/src/lib/eolian_cxx/grammar/keyword.hpp | |||
@@ -5,7 +5,7 @@ namespace efl { namespace eolian { namespace grammar { | |||
5 | 5 | ||
6 | inline std::string escape_keyword(std::string const& name) | 6 | inline std::string escape_keyword(std::string const& name) |
7 | { | 7 | { |
8 | if(name == "delete" || name == "register") | 8 | if(name == "delete" || name == "register" || name == "do") |
9 | return "cxx_" + name; | 9 | return "cxx_" + name; |
10 | return name; | 10 | return name; |
11 | } | 11 | } |
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp index 4b9bc48205..c663f289b8 100644 --- a/src/lib/eolian_cxx/grammar/klass_def.hpp +++ b/src/lib/eolian_cxx/grammar/klass_def.hpp | |||
@@ -315,6 +315,18 @@ struct parameter_def | |||
315 | std::string param_name; | 315 | std::string param_name; |
316 | std::string c_type; | 316 | std::string c_type; |
317 | 317 | ||
318 | friend inline bool operator==(parameter_def const& lhs, parameter_def const& rhs) | ||
319 | { | ||
320 | return lhs.direction == rhs.direction | ||
321 | && lhs.type == rhs.type | ||
322 | && lhs.param_name == rhs.param_name | ||
323 | && lhs.c_type == rhs.c_type; | ||
324 | } | ||
325 | friend inline bool operator!=(parameter_def const& lhs, parameter_def const& rhs) | ||
326 | { | ||
327 | return !(lhs == rhs); | ||
328 | } | ||
329 | |||
318 | parameter_def(parameter_direction direction, type_def type, std::string param_name, std::string c_type) | 330 | parameter_def(parameter_direction direction, type_def type, std::string param_name, std::string c_type) |
319 | : direction(std::move(direction)), type(std::move(type)), param_name(std::move(param_name)), c_type(std::move(c_type)) {} | 331 | : direction(std::move(direction)), type(std::move(type)), param_name(std::move(param_name)), c_type(std::move(c_type)) {} |
320 | parameter_def(Eolian_Function_Parameter const* param) | 332 | parameter_def(Eolian_Function_Parameter const* param) |
@@ -384,6 +396,20 @@ struct function_def | |||
384 | bool is_beta; | 396 | bool is_beta; |
385 | bool is_protected; | 397 | bool is_protected; |
386 | 398 | ||
399 | friend inline bool operator==(function_def const& lhs, function_def const& rhs) | ||
400 | { | ||
401 | return lhs.return_type == rhs.return_type | ||
402 | && lhs.name == rhs.name | ||
403 | && lhs.parameters == rhs.parameters | ||
404 | && lhs.c_name == rhs.c_name | ||
405 | && lhs.is_beta == rhs.is_beta | ||
406 | && lhs.is_protected == rhs.is_protected; | ||
407 | } | ||
408 | friend inline bool operator!=(function_def const& lhs, function_def const& rhs) | ||
409 | { | ||
410 | return !(lhs == rhs); | ||
411 | } | ||
412 | |||
387 | function_def(type_def return_type, std::string name, std::vector<parameter_def> parameters | 413 | function_def(type_def return_type, std::string name, std::vector<parameter_def> parameters |
388 | , std::string c_name, bool is_beta) | 414 | , std::string c_name, bool is_beta) |
389 | : return_type(return_type), name(name), parameters(parameters), c_name(c_name), is_beta(is_beta) {} | 415 | : return_type(return_type), name(name), parameters(parameters), c_name(c_name), is_beta(is_beta) {} |
@@ -504,6 +530,19 @@ struct event_def | |||
504 | std::string name, c_name; | 530 | std::string name, c_name; |
505 | bool beta, protect; | 531 | bool beta, protect; |
506 | 532 | ||
533 | friend inline bool operator==(event_def const& lhs, event_def const& rhs) | ||
534 | { | ||
535 | return lhs.type == rhs.type | ||
536 | && lhs.name == rhs.name | ||
537 | && lhs.c_name == rhs.c_name | ||
538 | && lhs.beta == rhs.beta | ||
539 | && lhs.protect == rhs.protect; | ||
540 | } | ||
541 | friend inline bool operator!=(event_def const& lhs, event_def const& rhs) | ||
542 | { | ||
543 | return !(lhs == rhs); | ||
544 | } | ||
545 | |||
507 | event_def(type_def type, std::string name, std::string c_name, bool beta, bool protect) | 546 | event_def(type_def type, std::string name, std::string c_name, bool beta, bool protect) |
508 | : type(type), name(name), c_name(c_name), beta(beta), protect(protect) {} | 547 | : type(type), name(name), c_name(c_name), beta(beta), protect(protect) {} |
509 | event_def(Eolian_Event const* event) | 548 | event_def(Eolian_Event const* event) |
@@ -558,6 +597,21 @@ struct klass_def | |||
558 | class_type type; | 597 | class_type type; |
559 | std::vector<event_def> events; | 598 | std::vector<event_def> events; |
560 | 599 | ||
600 | friend inline bool operator==(klass_def const& lhs, klass_def const& rhs) | ||
601 | { | ||
602 | return lhs.eolian_name == rhs.eolian_name | ||
603 | && lhs.cxx_name == rhs.cxx_name | ||
604 | && lhs.namespaces == rhs.namespaces | ||
605 | && lhs.functions == rhs.functions | ||
606 | && lhs.inherits == rhs.inherits | ||
607 | && lhs.type == rhs.type | ||
608 | && lhs.events == rhs.events; | ||
609 | } | ||
610 | friend inline bool operator!=(klass_def const& lhs, klass_def const& rhs) | ||
611 | { | ||
612 | return !(lhs == rhs); | ||
613 | } | ||
614 | |||
561 | klass_def(std::string eolian_name, std::string cxx_name | 615 | klass_def(std::string eolian_name, std::string cxx_name |
562 | , std::vector<std::string> namespaces | 616 | , std::vector<std::string> namespaces |
563 | , std::vector<function_def> functions | 617 | , std::vector<function_def> functions |
diff --git a/src/lib/evas/Evas.hh b/src/lib/evas/Evas.hh new file mode 100644 index 0000000000..4bef41958f --- /dev/null +++ b/src/lib/evas/Evas.hh | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef EFL_EVAS_HH | ||
2 | #define EFL_EVAS_HH | ||
3 | #ifdef EFL_BETA_API_SUPPORT | ||
4 | |||
5 | #include "Evas.eo.hh" | ||
6 | |||
7 | #endif | ||
8 | #endif | ||
9 | |||
diff --git a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc index c9ee5c8e9b..0e46e84ff6 100644 --- a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc +++ b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc | |||
@@ -5,7 +5,9 @@ | |||
5 | #include <Ecore.h> | 5 | #include <Ecore.h> |
6 | 6 | ||
7 | #include <generic.eo.hh> | 7 | #include <generic.eo.hh> |
8 | #include <generic.eo.impl.hh> | ||
8 | #include <name1_name2_type_generation.eo.hh> | 9 | #include <name1_name2_type_generation.eo.hh> |
10 | #include <name1_name2_type_generation.eo.impl.hh> | ||
9 | 11 | ||
10 | #include "eolian_cxx_suite.h" | 12 | #include "eolian_cxx_suite.h" |
11 | 13 | ||
diff --git a/src/tests/eolian_cxx/eolian_cxx_test_cyclic.cc b/src/tests/eolian_cxx/eolian_cxx_test_cyclic.cc index f338133c45..dcd88ac151 100644 --- a/src/tests/eolian_cxx/eolian_cxx_test_cyclic.cc +++ b/src/tests/eolian_cxx/eolian_cxx_test_cyclic.cc | |||
@@ -4,6 +4,13 @@ | |||
4 | 4 | ||
5 | #include <Eo.hh> | 5 | #include <Eo.hh> |
6 | 6 | ||
7 | extern "C" { | ||
8 | typedef Eo Cyclic1; | ||
9 | typedef Eo Cyclic2; | ||
10 | } | ||
11 | |||
12 | #include <cyclic1.eo.h> | ||
13 | #include <cyclic2.eo.h> | ||
7 | #include <cyclic1.eo.hh> | 14 | #include <cyclic1.eo.hh> |
8 | #include <cyclic2.eo.hh> | 15 | #include <cyclic2.eo.hh> |
9 | 16 | ||