q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fbdbf6b132153503f056ac10e55d76422fc64dc0
commit fbdbf6b132153503f056ac10e55d76422fc64dc0 Author: Daniel Kolesa <d.kol...@samsung.com> Date: Wed Jul 17 15:50:38 2019 +0200 eolian: add builtin binbuf and event types Binbuf is like strbuf and allows not using the Eina opaque wrapper now, which will remove some ptr(). And event translates to Efl.Event because otherwise there would be no way to get rid of void_ptr. --- src/bindings/luajit/eolian.lua | 20 +++++++++++--------- src/lib/eo/Eo.h | 28 ++++++++++++++++++++++++++++ src/lib/eo/efl_object.eo | 2 +- src/lib/eolian/Eolian.h | 3 ++- src/lib/eolian/eo_lexer.c | 2 +- src/lib/eolian/eo_lexer.h | 2 +- 6 files changed, 44 insertions(+), 13 deletions(-) diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua index 2be1b6a981..085f614d4e 100644 --- a/src/bindings/luajit/eolian.lua +++ b/src/bindings/luajit/eolian.lua @@ -162,7 +162,8 @@ ffi.cdef [[ EOLIAN_TYPE_BUILTIN_ANY_VALUE, EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR, - + EOLIAN_TYPE_BUILTIN_BINBUF, + EOLIAN_TYPE_BUILTIN_EVENT, EOLIAN_TYPE_BUILTIN_MSTRING, EOLIAN_TYPE_BUILTIN_STRING, EOLIAN_TYPE_BUILTIN_STRINGSHARE, @@ -965,14 +966,15 @@ M.type_builtin_type = { ANY_VALUE = 40, ANY_VALUE_PTR = 41, - - MSTRING = 42, - STRING = 43, - STRINGSHARE = 44, - STRBUF = 45, - - VOID_PTR = 46, - FREE_CB = 47 + BINBUF = 42, + EVENT = 43, + MSTRING = 44, + STRING = 45, + STRINGSHARE = 46, + STRBUF = 47, + + VOID_PTR = 48, + FREE_CB = 49 } M.typedecl_type = { diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index 5390e61c8e..ddbad15de2 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -214,6 +214,34 @@ typedef void (*Efl_Del_Intercept) (Eo *obj_id); #include "efl_object_override.eo.h" #include "efl_object.eo.h" + +/** + * @brief A parameter passed in event callbacks holding extra event parameters. + * + * This is the full event information passed to callbacks in C. + * + * @since 1.22 + * + * @ingroup Efl + */ +typedef struct _Efl_Event +{ + Efl_Object *object; /**< The object the callback was called on. + * + * @since 1.22 */ + const Efl_Event_Description *desc; /**< The event description. + * + * @since 1.22 */ + void *info; /**< Extra event information passed by the event caller. Must be + * cast to the event type declared in the EO file. Keep in mind + * that: 1) Objects are passed as a normal Eo*. Event subscribers + * can call functions on these objects. 2) Structs, built-in + * types and containers are passed as const pointers, with one + * level of indirection. + * + * @since 1.22 */ +} Efl_Event; + #define EO_CLASS EFL_OBJECT_CLASS /** An event callback prototype. */ diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo index bea9a0e0f5..85cb664958 100644 --- a/src/lib/eo/efl_object.eo +++ b/src/lib/eo/efl_object.eo @@ -422,7 +422,7 @@ abstract Efl.Object } } -struct Efl.Event { +struct @extern Efl.Event { [[A parameter passed in event callbacks holding extra event parameters. This is the full event information passed to callbacks in C. diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index 0816812c74..4d743087ed 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h @@ -341,7 +341,8 @@ typedef enum EOLIAN_TYPE_BUILTIN_ANY_VALUE, EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR, - + EOLIAN_TYPE_BUILTIN_BINBUF, + EOLIAN_TYPE_BUILTIN_EVENT, EOLIAN_TYPE_BUILTIN_MSTRING, EOLIAN_TYPE_BUILTIN_STRING, EOLIAN_TYPE_BUILTIN_STRINGSHARE, diff --git a/src/lib/eolian/eo_lexer.c b/src/lib/eolian/eo_lexer.c index aad79d8f71..20b71a0252 100644 --- a/src/lib/eolian/eo_lexer.c +++ b/src/lib/eolian/eo_lexer.c @@ -77,7 +77,7 @@ static const char * const ctypes[] = "Eina_Accessor *", "Eina_Array *", "Eina_Future *", "Eina_Iterator *", "Eina_Hash *", "Eina_List *", - "Eina_Value", "Eina_Value *", + "Eina_Value", "Eina_Value *", "Eina_Binbuf *", "Efl_Event *", "char *", "const char *", "Eina_Stringshare *", "Eina_Strbuf *", "void *", diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h index 0e7921726f..e2ce990304 100644 --- a/src/lib/eolian/eo_lexer.h +++ b/src/lib/eolian/eo_lexer.h @@ -60,7 +60,7 @@ enum Tokens KW(void), \ \ KW(accessor), KW(array), KW(future), KW(iterator), KW(hash), KW(list), \ - KW(any_value), KW(any_value_ptr), \ + KW(any_value), KW(any_value_ptr), KW(binbuf), KW(event), \ KW(mstring), KW(string), KW(stringshare), KW(strbuf), \ \ KW(void_ptr), \ --