q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f230dc9dbc08b52a26a8d547cc107fb1818ba5d1

commit f230dc9dbc08b52a26a8d547cc107fb1818ba5d1
Author: Felipe Magno de Almeida <[email protected]>
Date:   Fri Jul 26 13:02:21 2019 +0200

    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
---
 src/lib/eolian_cxx/grammar/type_impl.hpp | 24 ++++++++++++++++++++++++
 src/tests/eolian_cxx/generic.c           | 15 +++++++++++++++
 src/tests/eolian_cxx/generic.eo          | 20 ++++++++++++++++++++
 3 files changed, 59 insertions(+)

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;

-- 


Reply via email to