summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-07-26 13:35:27 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-07-26 13:35:27 +0200
commit635a2df7e7e69d051a290f616c9e14528404f42b (patch)
treea8727b2a5e07b4af5c35108ccb8c43460ddc60ae
parentd964a04da1ee654d9829c1b92dbb1ebb1d5738d7 (diff)
eolian: ban void_ptr in stable APIs
This required some refactoring in eldbus and tests but otherwise seems good to go.
-rw-r--r--src/lib/eldbus/Eldbus.h20
-rw-r--r--src/lib/eldbus/eldbus_introspection.h104
-rw-r--r--src/lib/eldbus/eldbus_types.eot26
-rw-r--r--src/lib/eolian/database_validate.c11
-rw-r--r--src/lib/evas/include/evas_ector_buffer.eo2
-rw-r--r--src/tests/eolian_cxx/name1_name2_type_generation.eo2
6 files changed, 148 insertions, 17 deletions
diff --git a/src/lib/eldbus/Eldbus.h b/src/lib/eldbus/Eldbus.h
index c69c056..18c3de5 100644
--- a/src/lib/eldbus/Eldbus.h
+++ b/src/lib/eldbus/Eldbus.h
@@ -212,7 +212,25 @@ typedef void (*Eldbus_Signal_Cb)(void *data, const Eldbus_Message *msg);
212 * @} 212 * @}
213 */ 213 */
214 214
215#include "eldbus_types.eot.h" 215/* FIXME: these are duplicated as @extern in eldbus_types.eot */
216
217/** Represents a client object bound to an interface
218 *
219 * @ingroup Eldbus
220 */
221typedef struct _Eldbus_Proxy Eldbus_Proxy;
222
223/** Represents a connection of one the type of connection with the DBus daemon.
224 *
225 * @ingroup Eldbus
226 */
227typedef struct _Eldbus_Connection Eldbus_Connection;
228
229/** Represents an object path already attached with bus name or unique id
230 *
231 * @ingroup Eldbus
232 */
233typedef struct _Eldbus_Object Eldbus_Object;
216 234
217#include "eldbus_connection.h" 235#include "eldbus_connection.h"
218#include "eldbus_message.h" 236#include "eldbus_message.h"
diff --git a/src/lib/eldbus/eldbus_introspection.h b/src/lib/eldbus/eldbus_introspection.h
index 7c02498..665d38a 100644
--- a/src/lib/eldbus/eldbus_introspection.h
+++ b/src/lib/eldbus/eldbus_introspection.h
@@ -4,7 +4,109 @@
4#include <Eina.h> 4#include <Eina.h>
5#include <Eo.h> 5#include <Eo.h>
6 6
7#include "eldbus_types.eot.h" 7/* FIXME: these are duplicated as @extern in eldbus_types.eot */
8
9/** Argument direction
10 *
11 * @ingroup Eldbus_Introspection
12 */
13typedef enum
14{
15 ELDBUS_INTROSPECTION_ARGUMENT_DIRECTION_NONE = 0, /**< No direction */
16 ELDBUS_INTROSPECTION_ARGUMENT_DIRECTION_IN, /**< Incoming direction */
17 ELDBUS_INTROSPECTION_ARGUMENT_DIRECTION_OUT /**< Outgoing direction */
18} Eldbus_Introspection_Argument_Direction;
19
20/** Property access rights
21 *
22 * @ingroup Eldbus_Introspection
23 */
24typedef enum
25{
26 ELDBUS_INTROSPECTION_PROPERTY_ACCESS_READ = 0, /**< Property can be read */
27 ELDBUS_INTROSPECTION_PROPERTY_ACCESS_WRITE, /**< Property can be written */
28 ELDBUS_INTROSPECTION_PROPERTY_ACCESS_READWRITE /**< Property can be read and
29 * written */
30} Eldbus_Introspection_Property_Access;
31
32/** DBus Node
33 *
34 * @ingroup Eldbus_Introspection
35 */
36typedef struct _Eldbus_Introspection_Node
37{
38 Eina_Stringshare *name; /**< Node name (optional) */
39 Eina_List *nodes; /**< List with nodes */
40 Eina_List *interfaces; /**< List with interfaces */
41} Eldbus_Introspection_Node;
42
43/** DBus Interface
44 *
45 * @ingroup Eldbus_Introspection
46 */
47typedef struct _Eldbus_Introspection_Interface
48{
49 Eina_Stringshare *name; /**< Interface name */
50 Eina_List *methods; /**< List with interface methods */
51 Eina_List *signals; /**< List with interface signals */
52 Eina_List *properties; /**< List with interface properties */
53 Eina_List *annotations; /**< List with interface annotations */
54} Eldbus_Introspection_Interface;
55
56/** DBus Method
57 *
58 * @ingroup Eldbus_Introspection
59 */
60typedef struct _Eldbus_Introspection_Method
61{
62 Eina_Stringshare *name; /**< Method name */
63 Eina_List *arguments; /**< List with method arguments */
64 Eina_List *annotations; /**< List with method annotations */
65} Eldbus_Introspection_Method;
66
67/** DBus Property
68 *
69 * @ingroup Eldbus_Introspection
70 */
71typedef struct _Eldbus_Introspection_Property
72{
73 Eina_Stringshare *name; /**< Property name */
74 Eina_Stringshare *type; /**< Property type */
75 Eldbus_Introspection_Property_Access access; /**< Property access rights */
76 Eina_List *annotations; /**< List with property annotations */
77} Eldbus_Introspection_Property;
78
79/** DBus Annotation
80 *
81 * @ingroup Eldbus_Introspection
82 */
83typedef struct _Eldbus_Introspection_Annotation
84{
85 Eina_Stringshare *name; /**< Annotation name */
86 Eina_Stringshare *value; /**< Annotation value */
87} Eldbus_Introspection_Annotation;
88
89/** DBus Argument
90 *
91 * @ingroup Eldbus_Introspection
92 */
93typedef struct _Eldbus_Introspection_Argument
94{
95 Eina_Stringshare *name; /**< Argument name (optional) */
96 Eina_Stringshare *type; /**< Argument type */
97 Eldbus_Introspection_Argument_Direction direction; /**< Argument direction */
98} Eldbus_Introspection_Argument;
99
100/** DBus Signal
101 *
102 * @ingroup Eldbus_Introspection
103 */
104typedef struct _Eldbus_Introspection_Signal
105{
106 Eina_Stringshare *name; /**< Signal name */
107 Eina_List *arguments; /**< List with signal arguments */
108 Eina_List *annotations; /**< List with signal annotations */
109} Eldbus_Introspection_Signal;
8 110
9/** 111/**
10 * @brief Parses the introspection xml abstracting it to an object tree 112 * @brief Parses the introspection xml abstracting it to an object tree
diff --git a/src/lib/eldbus/eldbus_types.eot b/src/lib/eldbus/eldbus_types.eot
index ebd3130..a4a5bab 100644
--- a/src/lib/eldbus/eldbus_types.eot
+++ b/src/lib/eldbus/eldbus_types.eot
@@ -1,8 +1,8 @@
1struct Eldbus.Proxy; [[Represents a client object bound to an interface]] 1struct @beta @extern Eldbus.Proxy; [[Represents a client object bound to an interface]]
2struct Eldbus.Connection; [[Represents a connection of one the type of connection with the DBus daemon.]] 2struct @beta @extern Eldbus.Connection; [[Represents a connection of one the type of connection with the DBus daemon.]]
3struct Eldbus.Object; [[Represents an object path already attached with bus name or unique id]] 3struct @beta @extern Eldbus.Object; [[Represents an object path already attached with bus name or unique id]]
4 4
5enum @extern Eldbus.Connection.Type 5enum @beta @extern Eldbus.Connection.Type
6{ 6{
7 [[Eldbus connection type]] 7 [[Eldbus connection type]]
8 unknown = 0, [[Sentinel, not a real type]] 8 unknown = 0, [[Sentinel, not a real type]]
@@ -13,7 +13,7 @@ enum @extern Eldbus.Connection.Type
13 last, [[Sentinel, not a real type]] 13 last, [[Sentinel, not a real type]]
14} 14}
15 15
16enum Eldbus.Introspection.Argument_Direction 16enum @beta @extern Eldbus.Introspection.Argument_Direction
17{ 17{
18 [[Argument direction]] 18 [[Argument direction]]
19 none = 0, [[No direction]] 19 none = 0, [[No direction]]
@@ -23,7 +23,7 @@ enum Eldbus.Introspection.Argument_Direction
23 23
24/* DTD conversion form: http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd */ 24/* DTD conversion form: http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd */
25 25
26enum Eldbus.Introspection.Property_Access 26enum @beta @extern Eldbus.Introspection.Property_Access
27{ 27{
28 [[Property access rights]] 28 [[Property access rights]]
29 read, [[Property can be read]] 29 read, [[Property can be read]]
@@ -32,7 +32,7 @@ enum Eldbus.Introspection.Property_Access
32} 32}
33 33
34/* FIXME: Properly type all of these lists. */ 34/* FIXME: Properly type all of these lists. */
35struct Eldbus.Introspection.Node 35struct @beta @extern Eldbus.Introspection.Node
36{ 36{
37 [[DBus Node]] 37 [[DBus Node]]
38 name: stringshare; [[Node name (optional)]] 38 name: stringshare; [[Node name (optional)]]
@@ -40,7 +40,7 @@ struct Eldbus.Introspection.Node
40 interfaces: list<void_ptr>; [[List with interfaces]] 40 interfaces: list<void_ptr>; [[List with interfaces]]
41} 41}
42 42
43struct Eldbus.Introspection.Interface 43struct @beta @extern Eldbus.Introspection.Interface
44{ 44{
45 [[DBus Interface]] 45 [[DBus Interface]]
46 name: stringshare; [[Interface name]] 46 name: stringshare; [[Interface name]]
@@ -50,7 +50,7 @@ struct Eldbus.Introspection.Interface
50 annotations: list<void_ptr>; [[List with interface annotations]] 50 annotations: list<void_ptr>; [[List with interface annotations]]
51} 51}
52 52
53struct Eldbus.Introspection.Method 53struct @beta @extern Eldbus.Introspection.Method
54{ 54{
55 [[DBus Method]] 55 [[DBus Method]]
56 name: stringshare; [[Method name]] 56 name: stringshare; [[Method name]]
@@ -58,7 +58,7 @@ struct Eldbus.Introspection.Method
58 annotations: list<void_ptr>; [[List with method annotations]] 58 annotations: list<void_ptr>; [[List with method annotations]]
59} 59}
60 60
61struct Eldbus.Introspection.Property 61struct @beta @extern Eldbus.Introspection.Property
62{ 62{
63 [[DBus Property]] 63 [[DBus Property]]
64 name: stringshare; [[Property name]] 64 name: stringshare; [[Property name]]
@@ -67,14 +67,14 @@ struct Eldbus.Introspection.Property
67 annotations: list<void_ptr>; [[List with property annotations]] 67 annotations: list<void_ptr>; [[List with property annotations]]
68} 68}
69 69
70struct Eldbus.Introspection.Annotation 70struct @beta @extern Eldbus.Introspection.Annotation
71{ 71{
72 [[DBus Annotation]] 72 [[DBus Annotation]]
73 name: stringshare; [[Annotation name]] 73 name: stringshare; [[Annotation name]]
74 value: stringshare; [[Annotation value]] 74 value: stringshare; [[Annotation value]]
75} 75}
76 76
77struct Eldbus.Introspection.Argument 77struct @beta @extern Eldbus.Introspection.Argument
78{ 78{
79 [[DBus Argument]] 79 [[DBus Argument]]
80 name: stringshare; [[Argument name (optional)]] 80 name: stringshare; [[Argument name (optional)]]
@@ -82,7 +82,7 @@ struct Eldbus.Introspection.Argument
82 direction: Eldbus.Introspection.Argument_Direction; [[Argument direction]] 82 direction: Eldbus.Introspection.Argument_Direction; [[Argument direction]]
83} 83}
84 84
85struct Eldbus.Introspection.Signal 85struct @beta @extern Eldbus.Introspection.Signal
86{ 86{
87 [[DBus Signal]] 87 [[DBus Signal]]
88 name: stringshare; [[Signal name]] 88 name: stringshare; [[Signal name]]
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index 8e14a95..95dc4a5 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -289,6 +289,17 @@ _validate_type(Validate_State *vals, Eolian_Type *tp)
289 default: 289 default:
290 break; 290 break;
291 } 291 }
292 switch (id)
293 {
294 case KW_void_ptr:
295 if (vals->stable)
296 {
297 _eo_parser_log(&tp->base,
298 "deprecated builtin type '%s' not allowed in stable context",
299 tp->base.name);
300 return EINA_FALSE;
301 }
302 }
292 return _validate_ownable(tp); 303 return _validate_ownable(tp);
293 } 304 }
294 /* user defined */ 305 /* user defined */
diff --git a/src/lib/evas/include/evas_ector_buffer.eo b/src/lib/evas/include/evas_ector_buffer.eo
index 8801c5a..5c09745 100644
--- a/src/lib/evas/include/evas_ector_buffer.eo
+++ b/src/lib/evas/include/evas_ector_buffer.eo
@@ -1,4 +1,4 @@
1interface Evas.Ector.Buffer 1interface @beta Evas.Ector.Buffer
2{ 2{
3 [[Binding layer between ector buffers and evas images. 3 [[Binding layer between ector buffers and evas images.
4 4
diff --git a/src/tests/eolian_cxx/name1_name2_type_generation.eo b/src/tests/eolian_cxx/name1_name2_type_generation.eo
index dce2ff2..8f3ca8e 100644
--- a/src/tests/eolian_cxx/name1_name2_type_generation.eo
+++ b/src/tests/eolian_cxx/name1_name2_type_generation.eo
@@ -1,4 +1,4 @@
1class Name1.Name2.Type_Generation extends Efl.Object 1class @beta Name1.Name2.Type_Generation extends Efl.Object
2{ 2{
3 data: Type_Generation_Data; 3 data: Type_Generation_Data;
4 methods { 4 methods {