diff options
author | Felipe Magno de Almeida <felipe@expertisesolutions.com.br> | 2019-07-26 13:02:21 +0200 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@samsung.com> | 2019-07-26 13:02:28 +0200 |
commit | f230dc9dbc08b52a26a8d547cc107fb1818ba5d1 (patch) | |
tree | 369cbaaf8ba9f26cf4bafac8185aaae168acbc17 | |
parent | d19e435ff9a4716e890d2653af6a1231d8961e37 (diff) | |
download | efl-f230dc9dbc08b52a26a8d547cc107fb1818ba5d1.tar.gz |
eolian-cxx: Add binbuf and event keywords handling
n
Summary:
Add support in Eolian-Cxx for binbuf and event keywords and tests. It
will generate the C type while the manual binding in C++ for the types
do not exist.
Reviewers: q66, lauromoura
Reviewed By: q66
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9412
-rw-r--r-- | src/lib/eolian_cxx/grammar/type_impl.hpp | 24 | ||||
-rw-r--r-- | src/tests/eolian_cxx/generic.c | 15 | ||||
-rw-r--r-- | src/tests/eolian_cxx/generic.eo | 20 |
3 files changed, 59 insertions, 0 deletions
diff --git a/src/lib/eolian_cxx/grammar/type_impl.hpp b/src/lib/eolian_cxx/grammar/type_impl.hpp index c5bd4d8363..b8cb7342b6 100644 --- a/src/lib/eolian_cxx/grammar/type_impl.hpp +++ b/src/lib/eolian_cxx/grammar/type_impl.hpp @@ -140,6 +140,30 @@ struct visitor_generate r.base_qualifier.qualifier ^= qualifier_info::is_ref; return replace_base_type(r, " ::efl::eina::strbuf"); }} + , {"event", nullptr, nullptr, nullptr, [&] + { + regular_type_def r = regular; + r.base_qualifier.qualifier ^= qualifier_info::is_ref; + if (r.base_qualifier.qualifier & qualifier_info::is_const) + { + r.base_qualifier.qualifier ^= qualifier_info::is_const; + return replace_base_type(r, " Efl_Event*"); + } + else + return replace_base_type(r, " Efl_Event const*"); + }} + , {"binbuf", nullptr, nullptr, nullptr, [&] + { + regular_type_def r = regular; + r.base_qualifier.qualifier ^= qualifier_info::is_ref; + if (r.base_qualifier.qualifier & qualifier_info::is_const) + { + r.base_qualifier.qualifier ^= qualifier_info::is_const; + return replace_base_type(r, " Eina_Binbuf*"); + } + else + return replace_base_type(r, " Eina_Binbuf const*"); + }} /* FIXME: handle any_value_ptr */ , {"any_value", true, nullptr, nullptr, [&] { diff --git a/src/tests/eolian_cxx/generic.c b/src/tests/eolian_cxx/generic.c index ebc33aca25..0bbf894457 100644 --- a/src/tests/eolian_cxx/generic.c +++ b/src/tests/eolian_cxx/generic.c @@ -138,5 +138,20 @@ static void _generic_protected_beta_method1(Eo *obj EINA_UNUSED, Generic_Data* p static void _generic_beta_method1(Eo *obj EINA_UNUSED, Generic_Data* pd EINA_UNUSED) { } +void _generic_event_param(Eo *obj EINA_UNUSED, Generic_Data *pd EINA_UNUSED, Efl_Event *value EINA_UNUSED) +{ +} +void _generic_const_event_param(Eo *obj EINA_UNUSED, Generic_Data *pd EINA_UNUSED, const Efl_Event *value EINA_UNUSED) +{ +} +void _generic_binbuf_param(Eo *obj EINA_UNUSED, Generic_Data *pd EINA_UNUSED, Eina_Binbuf *value EINA_UNUSED) +{ +} +void _generic_const_binbuf_param(Eo *obj EINA_UNUSED, Generic_Data *pd EINA_UNUSED, const Eina_Binbuf *value EINA_UNUSED) +{ +} + + + #include "generic.eo.c" #include "generic_interface.eo.c" diff --git a/src/tests/eolian_cxx/generic.eo b/src/tests/eolian_cxx/generic.eo index 5bc284fc4a..cf7aa3b31e 100644 --- a/src/tests/eolian_cxx/generic.eo +++ b/src/tests/eolian_cxx/generic.eo @@ -94,6 +94,26 @@ class Generic extends Efl.Object implements Generic_Interface } protected_beta_method1 @protected @beta { } + event_param { + params { + value: event; + } + } + const_event_param { + params { + value: const(event); + } + } + binbuf_param { + params { + value: binbuf; + } + } + const_binbuf_param { + params { + value: const(binbuf); + } + } } constructors { .required_ctor_a; |