summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-12-05 10:47:09 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-12-05 15:01:45 +0900
commit8cdb3184f8a1f3e5396d953b238ce2e217f0cb1c (patch)
treebbd99d8e8616588f69360281d8291fb34fffb7e6 /src/bin
parent2b0805ddce66903c73c82047772f695b70c3b810 (diff)
cxx: Fix compilation after merge
This resolves a few issues and brings back the experimental features. Also, disable some of the ugliest experiments: - manual function overrides, - define APIs only in eo_cxx namespace Some APIs are generated behind EFL_CXXPERIMENT (eg. event_name_cb_add or some weak pointer stuff). I believe they are useful but would like to make sure there are no serious drawbacks with generating those.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian_cxx/eolian_cxx.cc52
1 files changed, 3 insertions, 49 deletions
diff --git a/src/bin/eolian_cxx/eolian_cxx.cc b/src/bin/eolian_cxx/eolian_cxx.cc
index 3720aa9251..134700ae6c 100644
--- a/src/bin/eolian_cxx/eolian_cxx.cc
+++ b/src/bin/eolian_cxx/eolian_cxx.cc
@@ -241,55 +241,9 @@ types_generate(std::string const& fname, options_type const& opts,
241 const Eolian_Function *func = eolian_typedecl_function_pointer_get(tp); 241 const Eolian_Function *func = eolian_typedecl_function_pointer_get(tp);
242 if (!func) return false; 242 if (!func) return false;
243 243
244 Eina_Iterator *param_itr = eolian_function_parameters_get(func); 244 function_def def(func, EOLIAN_FUNCTION_POINTER, opts.unit);
245 std::vector<parameter_def> params; 245 def.c_name = eolian_typedecl_full_name_get(tp);
246 246 std::replace(def.c_name.begin(), def.c_name.end(), '.', '_');
247 /* const */ Eolian_Function_Parameter *param;
248 while (::eina_iterator_next(param_itr, reinterpret_cast<void **>(&param)))
249 {
250 parameter_direction param_dir;
251 switch (eolian_parameter_direction_get(param))
252 {
253 /* Note: Inverted on purpose, as the direction objects are
254 * passed is inverted (from C to C++ for function pointers).
255 * FIXME: This is probably not right in all cases. */
256 case EOLIAN_IN_PARAM: param_dir = parameter_direction::out; break;
257 case EOLIAN_INOUT_PARAM: param_dir = parameter_direction::inout; break;
258 case EOLIAN_OUT_PARAM: param_dir = parameter_direction::in; break;
259 default: return false;
260 }
261
262 const Eolian_Type *param_type_eolian = eolian_parameter_type_get(param);
263 type_def param_type(param_type_eolian, opts.unit, EOLIAN_C_TYPE_PARAM);
264 std::string param_name = eolian_parameter_name_get(param);
265 std::string param_c_type = eolian_type_c_type_get(param_type_eolian, EOLIAN_C_TYPE_PARAM);
266 parameter_def param_def(param_dir, param_type, param_name, param_c_type);
267 params.push_back(std::move(param_def));
268 }
269 ::eina_iterator_free(param_itr);
270
271 const Eolian_Type *ret_type_eolian = eolian_function_return_type_get(func, EOLIAN_FUNCTION_POINTER);
272
273 type_def ret_type = void_;
274 if (ret_type_eolian)
275 ret_type = type_def(ret_type_eolian, opts.unit, EOLIAN_C_TYPE_RETURN);
276
277 /*
278 // List namespaces. Not used as function_wrapper lives in efl::eolian.
279 std::vector<std::string> namespaces;
280 Eina_Iterator *ns_itr = eolian_typedecl_namespaces_get(tp);
281 char *ns;
282 while (::eina_iterator_next(ns_itr, reinterpret_cast<void**>(&ns)))
283 namespaces.push_back(std::string(ns));
284 ::eina_iterator_free(ns_itr);
285 */
286
287 std::string name = eolian_function_name_get(func);
288 std::string c_name = eolian_typedecl_full_name_get(tp);
289 std::replace(c_name.begin(), c_name.end(), '.', '_');
290 bool beta = eolian_function_is_beta(func);
291
292 function_def def(ret_type, name, params, c_name, beta, false, true);
293 functions.push_back(std::move(def)); 247 functions.push_back(std::move(def));
294 } 248 }
295 ::eina_iterator_free(itr); 249 ::eina_iterator_free(itr);