summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-07-17 15:50:38 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-07-17 15:52:39 +0200
commitfbdbf6b132153503f056ac10e55d76422fc64dc0 (patch)
treed41fdedcb042dc0cd2897689776ea31d9b6a7685
parentbaf1fcdb916d0142e1d0652549d658751486a534 (diff)
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.
-rw-r--r--src/bindings/luajit/eolian.lua20
-rw-r--r--src/lib/eo/Eo.h28
-rw-r--r--src/lib/eo/efl_object.eo2
-rw-r--r--src/lib/eolian/Eolian.h3
-rw-r--r--src/lib/eolian/eo_lexer.c2
-rw-r--r--src/lib/eolian/eo_lexer.h2
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 [[
162 162
163 EOLIAN_TYPE_BUILTIN_ANY_VALUE, 163 EOLIAN_TYPE_BUILTIN_ANY_VALUE,
164 EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR, 164 EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR,
165 165 EOLIAN_TYPE_BUILTIN_BINBUF,
166 EOLIAN_TYPE_BUILTIN_EVENT,
166 EOLIAN_TYPE_BUILTIN_MSTRING, 167 EOLIAN_TYPE_BUILTIN_MSTRING,
167 EOLIAN_TYPE_BUILTIN_STRING, 168 EOLIAN_TYPE_BUILTIN_STRING,
168 EOLIAN_TYPE_BUILTIN_STRINGSHARE, 169 EOLIAN_TYPE_BUILTIN_STRINGSHARE,
@@ -965,14 +966,15 @@ M.type_builtin_type = {
965 966
966 ANY_VALUE = 40, 967 ANY_VALUE = 40,
967 ANY_VALUE_PTR = 41, 968 ANY_VALUE_PTR = 41,
968 969 BINBUF = 42,
969 MSTRING = 42, 970 EVENT = 43,
970 STRING = 43, 971 MSTRING = 44,
971 STRINGSHARE = 44, 972 STRING = 45,
972 STRBUF = 45, 973 STRINGSHARE = 46,
973 974 STRBUF = 47,
974 VOID_PTR = 46, 975
975 FREE_CB = 47 976 VOID_PTR = 48,
977 FREE_CB = 49
976} 978}
977 979
978M.typedecl_type = { 980M.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);
214 214
215#include "efl_object_override.eo.h" 215#include "efl_object_override.eo.h"
216#include "efl_object.eo.h" 216#include "efl_object.eo.h"
217
218/**
219 * @brief A parameter passed in event callbacks holding extra event parameters.
220 *
221 * This is the full event information passed to callbacks in C.
222 *
223 * @since 1.22
224 *
225 * @ingroup Efl
226 */
227typedef struct _Efl_Event
228{
229 Efl_Object *object; /**< The object the callback was called on.
230 *
231 * @since 1.22 */
232 const Efl_Event_Description *desc; /**< The event description.
233 *
234 * @since 1.22 */
235 void *info; /**< Extra event information passed by the event caller. Must be
236 * cast to the event type declared in the EO file. Keep in mind
237 * that: 1) Objects are passed as a normal Eo*. Event subscribers
238 * can call functions on these objects. 2) Structs, built-in
239 * types and containers are passed as const pointers, with one
240 * level of indirection.
241 *
242 * @since 1.22 */
243} Efl_Event;
244
217#define EO_CLASS EFL_OBJECT_CLASS 245#define EO_CLASS EFL_OBJECT_CLASS
218 246
219/** An event callback prototype. */ 247/** 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
422 } 422 }
423} 423}
424 424
425struct Efl.Event { 425struct @extern Efl.Event {
426 [[A parameter passed in event callbacks holding extra event parameters. 426 [[A parameter passed in event callbacks holding extra event parameters.
427 427
428 This is the full event information passed to callbacks in C. 428 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
341 341
342 EOLIAN_TYPE_BUILTIN_ANY_VALUE, 342 EOLIAN_TYPE_BUILTIN_ANY_VALUE,
343 EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR, 343 EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR,
344 344 EOLIAN_TYPE_BUILTIN_BINBUF,
345 EOLIAN_TYPE_BUILTIN_EVENT,
345 EOLIAN_TYPE_BUILTIN_MSTRING, 346 EOLIAN_TYPE_BUILTIN_MSTRING,
346 EOLIAN_TYPE_BUILTIN_STRING, 347 EOLIAN_TYPE_BUILTIN_STRING,
347 EOLIAN_TYPE_BUILTIN_STRINGSHARE, 348 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[] =
77 77
78 "Eina_Accessor *", "Eina_Array *", "Eina_Future *", "Eina_Iterator *", 78 "Eina_Accessor *", "Eina_Array *", "Eina_Future *", "Eina_Iterator *",
79 "Eina_Hash *", "Eina_List *", 79 "Eina_Hash *", "Eina_List *",
80 "Eina_Value", "Eina_Value *", 80 "Eina_Value", "Eina_Value *", "Eina_Binbuf *", "Efl_Event *",
81 "char *", "const char *", "Eina_Stringshare *", "Eina_Strbuf *", 81 "char *", "const char *", "Eina_Stringshare *", "Eina_Strbuf *",
82 82
83 "void *", 83 "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
60 KW(void), \ 60 KW(void), \
61 \ 61 \
62 KW(accessor), KW(array), KW(future), KW(iterator), KW(hash), KW(list), \ 62 KW(accessor), KW(array), KW(future), KW(iterator), KW(hash), KW(list), \
63 KW(any_value), KW(any_value_ptr), \ 63 KW(any_value), KW(any_value_ptr), KW(binbuf), KW(event), \
64 KW(mstring), KW(string), KW(stringshare), KW(strbuf), \ 64 KW(mstring), KW(string), KW(stringshare), KW(strbuf), \
65 \ 65 \
66 KW(void_ptr), \ 66 KW(void_ptr), \