eolian: add builtin binbuf and event types
authorDaniel Kolesa <d.kolesa@samsung.com>
Wed, 17 Jul 2019 13:50:38 +0000 (15:50 +0200)
committerSangHyeon Jade Lee <sh10233.lee@samsung.com>
Tue, 23 Jul 2019 05:02:34 +0000 (14:02 +0900)
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
src/lib/eo/Eo.h
src/lib/eo/efl_object.eo
src/lib/eolian/Eolian.h
src/lib/eolian/eo_lexer.c
src/lib/eolian/eo_lexer.h

index 2be1b6a..085f614 100644 (file)
@@ -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 = {
index 5390e61..ddbad15 100644 (file)
@@ -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. */
index bea9a0e..85cb664 100644 (file)
@@ -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.
index 0816812..4d74308 100644 (file)
@@ -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,
index aad79d8..20b71a0 100644 (file)
@@ -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 *",
index 0e79217..e2ce990 100644 (file)
@@ -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), \