export efl_future_then() for Eina_Future syntax sugar.
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Sat, 26 Aug 2017 22:39:23 +0000 (19:39 -0300)
committerGuilherme Iscaro <iscaro@profusion.mobi>
Mon, 4 Sep 2017 13:24:00 +0000 (10:24 -0300)
This is actually written as efl_future_Eina_FutureXXX_then() as the
old API clashes, after removing the old code we'll "sed" to fix those.

src/lib/eo/Eo.h

index f548381..8699102 100644 (file)
@@ -535,10 +535,22 @@ EOAPI Eina_Future_Desc efl_future_cb_from_desc(Eo *obj, const Efl_Future_Cb_Desc
  * @endcode
  *
  * @see efl_future_cb_from_desc()
+ * @see efl_future_Eina_FutureXXX_then()
  */
 #define efl_future_cb(_eo, ...) efl_future_cb_from_desc(_eo, (Efl_Future_Cb_Desc){__VA_ARGS__})
 
 /**
+ * Syntax sugar over eina_future_then_from_desc() and efl_future_cb().
+ *
+ * Usage:
+ * @code
+ * efl_future_Eina_FutureXXX_then(o, future, .success = success, .success_type = EINA_VALUE_TYPE_INT);
+ * @endcode
+ *
+ */
+#define efl_future_Eina_FutureXXX_then(_eo, _future, ...) eina_future_then_from_desc(_future, efl_future_cb(_eo, ## __VA_ARGS__))
+
+/**
  * Creates an Future chain based on #Efl_Future_Cb_Desc
  *
  * This function is an wrapper around efl_future_cb_from_desc() and eina_future_then_from_desc()