summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-12-07 16:03:49 -0800
committerCedric BAIL <cedric@osg.samsung.com>2018-12-20 10:44:45 -0800
commite74578c7d3b7e95eb489925efbf860c9b87e938e (patch)
tree3be93a35a182b099c40772497e23a8c960f781b5 /src
parent50d675d6c1052258edece2e9748e5aff6797ad3c (diff)
elementary: switch to the new efl_future_then syntax.
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D7448
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_layout.c20
-rw-r--r--src/lib/elementary/efl_ui_list_view.c18
2 files changed, 16 insertions, 22 deletions
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index ea40224af3..deba292ce5 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -2047,14 +2047,13 @@ typedef struct _Efl_Ui_Layout_Factory_Request Efl_Ui_Layout_Factory_Request;
2047struct _Efl_Ui_Layout_Factory_Request 2047struct _Efl_Ui_Layout_Factory_Request
2048{ 2048{
2049 Efl_Ui_Layout_Factory_Tracking *tracking; 2049 Efl_Ui_Layout_Factory_Tracking *tracking;
2050 Efl_Ui_Layout *obj;
2051 Efl_Ui_Layout_Data *pd; 2050 Efl_Ui_Layout_Data *pd;
2052 Efl_Ui_Factory *factory; 2051 Efl_Ui_Factory *factory;
2053 const char *name; 2052 const char *name;
2054}; 2053};
2055 2054
2056static Eina_Value 2055static Eina_Value
2057_content_created(void *data, const Eina_Value value) 2056_content_created(Eo *obj, void *data, const Eina_Value value)
2058{ 2057{
2059 Efl_Ui_Layout_Factory_Request *request = data; 2058 Efl_Ui_Layout_Factory_Request *request = data;
2060 Efl_Gfx_Entity *content = NULL; 2059 Efl_Gfx_Entity *content = NULL;
@@ -2063,17 +2062,17 @@ _content_created(void *data, const Eina_Value value)
2063 eina_value_get(&value, &content); 2062 eina_value_get(&value, &content);
2064 2063
2065 // Recycle old content 2064 // Recycle old content
2066 old_content = elm_layout_content_get(request->obj, request->name); 2065 old_content = elm_layout_content_get(obj, request->name);
2067 if (old_content) efl_ui_factory_release(request->factory, old_content); 2066 if (old_content) efl_ui_factory_release(request->factory, old_content);
2068 2067
2069 // Set new content 2068 // Set new content
2070 elm_layout_content_set(request->obj, request->name, content); 2069 elm_layout_content_set(obj, request->name, content);
2071 2070
2072 return value; 2071 return value;
2073} 2072}
2074 2073
2075static void 2074static void
2076_clean_request(void *data, const Eina_Future *dead_future EINA_UNUSED) 2075_clean_request(Eo *obj EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
2077{ 2076{
2078 Efl_Ui_Layout_Factory_Request *request = data; 2077 Efl_Ui_Layout_Factory_Request *request = data;
2079 2078
@@ -2095,16 +2094,15 @@ _efl_ui_layout_view_model_content_update(Efl_Ui_Layout_Data *pd, Efl_Ui_Layout_F
2095 2094
2096 request->name = eina_stringshare_ref(name); 2095 request->name = eina_stringshare_ref(name);
2097 request->pd = pd; 2096 request->pd = pd;
2098 request->obj = pd->obj;
2099 request->factory = efl_ref(tracking->factory); 2097 request->factory = efl_ref(tracking->factory);
2100 request->tracking = tracking; 2098 request->tracking = tracking;
2101 2099
2102 f = efl_ui_view_factory_create_with_event(tracking->factory, pd->connect.model, pd->obj); 2100 f = efl_ui_view_factory_create_with_event(tracking->factory, pd->connect.model, pd->obj);
2103 f = eina_future_then_from_desc(efl_future_then(pd->obj, f), 2101 f = efl_future_then(pd->obj, f,
2104 eina_future_cb_easy(.success = _content_created, 2102 .success = _content_created,
2105 .success_type = EINA_VALUE_TYPE_OBJECT, 2103 .success_type = EINA_VALUE_TYPE_OBJECT,
2106 .data = request, 2104 .data = request,
2107 .free = _clean_request)); 2105 .free = _clean_request);
2108} 2106}
2109 2107
2110static void 2108static void
diff --git a/src/lib/elementary/efl_ui_list_view.c b/src/lib/elementary/efl_ui_list_view.c
index 34c90dd7aa..fc85818fc0 100644
--- a/src/lib/elementary/efl_ui_list_view.c
+++ b/src/lib/elementary/efl_ui_list_view.c
@@ -916,16 +916,14 @@ typedef struct _Efl_Ui_List_Vuew_Layout_Item_Tracking Efl_Ui_List_View_Layout_It
916struct _Efl_Ui_List_Vuew_Layout_Item_Tracking 916struct _Efl_Ui_List_Vuew_Layout_Item_Tracking
917{ 917{
918 Efl_Ui_List_View_Layout_Item *item; 918 Efl_Ui_List_View_Layout_Item *item;
919 Eo *obj;
920 Efl_Ui_List_View_Data *pd; 919 Efl_Ui_List_View_Data *pd;
921}; 920};
922 921
923static Eina_Value 922static Eina_Value
924_content_created(void *data, const Eina_Value value) 923_content_created(Eo *obj, void *data, const Eina_Value value)
925{ 924{
926 Efl_Ui_List_View_Layout_Item_Tracking *tracking = data; 925 Efl_Ui_List_View_Layout_Item_Tracking *tracking = data;
927 Efl_Ui_List_View_Layout_Item *item = tracking->item; 926 Efl_Ui_List_View_Layout_Item *item = tracking->item;
928 Eo *obj = tracking->obj;
929 Efl_Ui_List_View_Item_Event evt; 927 Efl_Ui_List_View_Item_Event evt;
930 928
931 eina_value_pget(&value, &item->layout); 929 eina_value_pget(&value, &item->layout);
@@ -951,7 +949,7 @@ _content_created(void *data, const Eina_Value value)
951} 949}
952 950
953static void 951static void
954_clean_request(void *data, const Eina_Future *dead_future EINA_UNUSED) 952_clean_request(Eo *obj EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
955{ 953{
956 Efl_Ui_List_View_Layout_Item_Tracking *tracking = data; 954 Efl_Ui_List_View_Layout_Item_Tracking *tracking = data;
957 955
@@ -973,16 +971,14 @@ _efl_ui_list_view_efl_ui_list_view_model_realize(Eo *obj, Efl_Ui_List_View_Data
973 if (!tracking) return item; 971 if (!tracking) return item;
974 972
975 tracking->item = item; 973 tracking->item = item;
976 tracking->obj = obj;
977 tracking->pd = pd; 974 tracking->pd = pd;
978 975
979 item->layout_request = efl_ui_view_factory_create_with_event(pd->factory, item->children, obj); 976 item->layout_request = efl_ui_view_factory_create_with_event(pd->factory, item->children, obj);
980 item->layout_request = efl_future_then(obj, item->layout_request); 977 item->layout_request = efl_future_then(obj, item->layout_request,
981 item->layout_request = eina_future_then_from_desc(item->layout_request, 978 .success = _content_created,
982 eina_future_cb_easy(.success = _content_created, 979 .success_type = EINA_VALUE_TYPE_OBJECT,
983 .success_type = EINA_VALUE_TYPE_OBJECT, 980 .data = tracking,
984 .data = tracking, 981 .free = _clean_request);
985 .free = _clean_request));
986 982
987 return item; 983 return item;
988} 984}