summaryrefslogtreecommitdiff
path: root/src/lib/eldbus/eldbus_service.h
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2014-07-15 08:01:14 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-07-15 08:01:14 +0900
commit835b8756ece4327df90fe03060c61482de6ec5d4 (patch)
tree27c4bd26d8256d83375240d29c37a522b563462d /src/lib/eldbus/eldbus_service.h
parent831ade54fa69ac6bf1bac2aa611c0942281ca225 (diff)
Fixes ABI breakage in Eldbus for use with C++ Eldbus
Summary: This fixes the breakage when Eldbus_Service_Interface_Desc added a wrongfully methods2 field to a class that is allocated by the user. This patch adds the respective eldbus_service_interface_register2 and eldbus_service_interface_fallback_register2 for registration of Eldbus_Service_Interface_Desc2 which is now versioned. So future the functions can be backwards compatible and the struct be forward compatible and leaves the Eldbus_Service_Interface_Desc and eldbus_service_interface_register and eldbus_service_interface_fallback_register intact as it was in EFL 1.10. This fixes T1408 Reviewers: cedric, stefan_schmidt, raster Reviewed By: raster Subscribers: cedric Maniphest Tasks: T1408 Differential Revision: https://phab.enlightenment.org/D1188
Diffstat (limited to 'src/lib/eldbus/eldbus_service.h')
-rw-r--r--src/lib/eldbus/eldbus_service.h46
1 files changed, 45 insertions, 1 deletions
diff --git a/src/lib/eldbus/eldbus_service.h b/src/lib/eldbus/eldbus_service.h
index 11eff8b..ba5a9a3 100644
--- a/src/lib/eldbus/eldbus_service.h
+++ b/src/lib/eldbus/eldbus_service.h
@@ -15,6 +15,8 @@
15 15
16#define ELDBUS_PROPERTY_FLAG_DEPRECATED 1 16#define ELDBUS_PROPERTY_FLAG_DEPRECATED 1
17 17
18#define ELDBUS_INTERFACE_DESCRIPTOR_VERSION 2
19
18typedef struct _Eldbus_Arg_Info 20typedef struct _Eldbus_Arg_Info
19{ 21{
20 const char *signature; 22 const char *signature;
@@ -105,9 +107,15 @@ typedef struct _Eldbus_Service_Interface_Desc
105 const Eldbus_Property *properties; /**< array of property that this interface have, the last item of array should be filled with NULL */ 107 const Eldbus_Property *properties; /**< array of property that this interface have, the last item of array should be filled with NULL */
106 const Eldbus_Property_Get_Cb default_get; /**< default get function, if a property don't have a get function this will be used */ 108 const Eldbus_Property_Get_Cb default_get; /**< default get function, if a property don't have a get function this will be used */
107 const Eldbus_Property_Set_Cb default_set; /**< default set function, if a property don't have a set function this will be used */ 109 const Eldbus_Property_Set_Cb default_set; /**< default set function, if a property don't have a set function this will be used */
108 const Eldbus_Method2 *methods2; /**< array of the methods that should be registered in this interface, the last item of array should be filled with NULL @since 1.11 */
109} Eldbus_Service_Interface_Desc; 110} Eldbus_Service_Interface_Desc;
110 111
112typedef struct _Eldbus_Service_Interface_Desc2
113{
114 Eldbus_Service_Interface_Desc description;
115 int version; /**< version of the interface descriptor. Must be initialized with ELDBUS_INTERFACE_DESCRIPTOR_VERSION @since 1.11 >*/
116 const Eldbus_Method2 *methods2; /**< array of the methods that should be registered in this interface, the last item of array should be filled with NULL @since 1.11 */
117} Eldbus_Service_Interface_Desc2;
118
111/** 119/**
112 * @brief Register an interface in the given path and connection. 120 * @brief Register an interface in the given path and connection.
113 * 121 *
@@ -135,6 +143,42 @@ EAPI Eldbus_Service_Interface *
135eldbus_service_interface_fallback_register(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc *desc) EINA_ARG_NONNULL(1, 2, 3); 143eldbus_service_interface_fallback_register(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc *desc) EINA_ARG_NONNULL(1, 2, 3);
136 144
137/** 145/**
146 * @brief Register an interface in the given path and connection. This
147 * extended register function allows the registration of stateful methods, with void* data.
148 *
149 * Note: Use eldbus_service_interface_unregister() to unregister a interface.
150 *
151 * @param conn where the interface should listen
152 * @param path object path
153 * @param desc description of interface
154 *
155 * @since 1.11
156 *
157 * @return Interface
158 */
159EAPI Eldbus_Service_Interface *eldbus_service_interface_register2(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc2 *desc) EINA_ARG_NONNULL(1, 2, 3);
160
161/**
162 * @brief Register a fallback interface handler for a given subsection
163 * of the object hierarchy. This extended register function allows
164 * the registration of stateful methods, with void* data.
165 *
166 * Note: Use eldbus_service_interface_unregister() to unregister a interface.
167 *
168 * @param conn where the interface should listen
169 * @param path a '/' delimited string of path elements
170 * @param desc description of interface
171 * @see eldbus_service_interface_unregister()
172 *
173 * @since 1.11
174 *
175 * @return Interface
176 */
177EAPI Eldbus_Service_Interface *
178eldbus_service_interface_fallback_register2(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc2 *desc) EINA_ARG_NONNULL(1, 2, 3);
179
180
181/**
138 * @brief Unregister a interface. 182 * @brief Unregister a interface.
139 * Note: This doesn't unregister the object path if interface count reaches 0. 183 * Note: This doesn't unregister the object path if interface count reaches 0.
140 * Use eldbus_service_object_unregister() to unregister the object. 184 * Use eldbus_service_object_unregister() to unregister the object.