summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-02-02 14:08:24 -0800
committerCedric BAIL <cedric@osg.samsung.com>2018-05-01 10:39:01 -0700
commit2c2df5b18be45c18c27269bcab357fd9e002b0df (patch)
tree259cc006080f267c86e4f95ef5978bc2ee797962
parent90e0190161cbceae20b9693848b788f16e6d7104 (diff)
elementary: migrate elm_view_list to use the new Efl.Model API.
-rw-r--r--src/lib/elementary/elm_view_list.c312
-rw-r--r--src/lib/elementary/elm_view_list.eo25
2 files changed, 144 insertions, 193 deletions
diff --git a/src/lib/elementary/elm_view_list.c b/src/lib/elementary/elm_view_list.c
index fdcf8baa07..cb448af999 100644
--- a/src/lib/elementary/elm_view_list.c
+++ b/src/lib/elementary/elm_view_list.c
@@ -13,13 +13,8 @@
13#define MY_CLASS ELM_VIEW_LIST_CLASS 13#define MY_CLASS ELM_VIEW_LIST_CLASS
14#define MY_CLASS_NAME "View List" 14#define MY_CLASS_NAME "View List"
15 15
16struct _Elm_View_List_Data;
17typedef struct _Elm_View_List_Data Elm_View_List_Data; 16typedef struct _Elm_View_List_Data Elm_View_List_Data;
18
19struct _View_List_ItemData;
20typedef struct _View_List_ItemData View_List_ItemData; 17typedef struct _View_List_ItemData View_List_ItemData;
21
22struct _View_List_ValueItem;
23typedef struct _View_List_ValueItem View_List_ValueItem; 18typedef struct _View_List_ValueItem View_List_ValueItem;
24 19
25struct _Elm_View_List_Data 20struct _Elm_View_List_Data
@@ -29,8 +24,11 @@ struct _Elm_View_List_Data
29 View_List_ItemData *rootdata; 24 View_List_ItemData *rootdata;
30 Elm_Genlist_Item_Class *itc; 25 Elm_Genlist_Item_Class *itc;
31 Elm_Genlist_Item_Type itype; 26 Elm_Genlist_Item_Type itype;
32 Eina_Hash *prop_con; 27
33 Eo *model; 28 struct {
29 Eina_Hash *properties;
30 Eo *model;
31 } connect;
34}; 32};
35 33
36struct _View_List_ItemData 34struct _View_List_ItemData
@@ -50,7 +48,8 @@ struct _View_List_ValueItem
50}; 48};
51 49
52static void _efl_model_load_children(View_List_ItemData *); 50static void _efl_model_load_children(View_List_ItemData *);
53static void _efl_model_children_count_change_cb(void *, const Efl_Event *event); 51static void _efl_model_children_added_cb(void *, const Efl_Event *event);
52static void _efl_model_children_removed_cb(void *, const Efl_Event *event);
54static void _efl_model_properties_change_cb(void *, const Efl_Event *event); 53static void _efl_model_properties_change_cb(void *, const Efl_Event *event);
55 54
56static void _expand_request_cb(void *data EINA_UNUSED, const Efl_Event *event); 55static void _expand_request_cb(void *data EINA_UNUSED, const Efl_Event *event);
@@ -59,7 +58,8 @@ static void _contracted_cb(void *data EINA_UNUSED, const Efl_Event *event);
59 58
60/* --- Genlist Callbacks --- */ 59/* --- Genlist Callbacks --- */
61EFL_CALLBACKS_ARRAY_DEFINE(model_callbacks, 60EFL_CALLBACKS_ARRAY_DEFINE(model_callbacks,
62 { EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _efl_model_children_count_change_cb }); 61 { EFL_MODEL_EVENT_CHILD_ADDED, _efl_model_children_added_cb },
62 { EFL_MODEL_EVENT_CHILD_REMOVED, _efl_model_children_removed_cb });
63EFL_CALLBACKS_ARRAY_DEFINE(genlist_callbacks, 63EFL_CALLBACKS_ARRAY_DEFINE(genlist_callbacks,
64 { ELM_GENLIST_EVENT_EXPAND_REQUEST, _expand_request_cb }, 64 { ELM_GENLIST_EVENT_EXPAND_REQUEST, _expand_request_cb },
65 { ELM_GENLIST_EVENT_CONTRACT_REQUEST, _contract_request_cb }, 65 { ELM_GENLIST_EVENT_CONTRACT_REQUEST, _contract_request_cb },
@@ -79,8 +79,8 @@ static void
79_item_del(void *data, Evas_Object *obj EINA_UNUSED) 79_item_del(void *data, Evas_Object *obj EINA_UNUSED)
80{ 80{
81 View_List_ItemData *idata = data; 81 View_List_ItemData *idata = data;
82 if (!idata) 82
83 return; 83 if (!idata) return;
84 84
85 efl_event_callback_array_del(idata->model, model_callbacks(), idata); 85 efl_event_callback_array_del(idata->model, model_callbacks(), idata);
86 efl_event_callback_del(idata->model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_model_properties_change_cb, idata); 86 efl_event_callback_del(idata->model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_model_properties_change_cb, idata);
@@ -94,107 +94,57 @@ _item_del(void *data, Evas_Object *obj EINA_UNUSED)
94 free(idata); 94 free(idata);
95} 95}
96 96
97static void
98_property_get_cb(void* data, Efl_Event const* event)
99{
100 View_List_ValueItem *vitem = data;
101 Eina_Value *value = (Eina_Value*)((Efl_Future_Event_Success*)event->info)->value;
102 vitem->value = eina_value_new(eina_value_type_get(value));
103 eina_value_copy(value, vitem->value);
104
105 if (vitem->item)
106 elm_genlist_item_update(vitem->item);
107}
108
109static void
110_property_get_error_cb(void* data, Efl_Event const* event EINA_UNUSED)
111{
112 View_List_ValueItem *vitem = data;
113 eina_stringshare_del(vitem->part);
114}
115
116static Eina_Value *
117_item_get_value(View_List_ItemData *idata, const char *part)
118{
119 View_List_ValueItem *vitem = NULL;
120 Eina_Value *value = NULL;
121 Eina_List *l, *ln;
122
123 EINA_LIST_FOREACH_SAFE(idata->values, l, ln, vitem)
124 {
125 if (vitem->part == NULL)
126 {
127 unsigned i = eina_list_count(idata->values);
128 if (i == 1)
129 {
130 idata->values = eina_list_remove(idata->values, vitem);
131 free(vitem);
132 break;
133 }
134 idata->values = eina_list_remove_list(idata->values, l);
135 free(vitem);
136 continue;
137 }
138
139 if (strcmp(vitem->part, part) == 0)
140 {
141 value = vitem->value;
142 break;
143 }
144 }
145
146 if (value == NULL)
147 {
148 Efl_Future *future;
149 vitem = calloc(1, sizeof(View_List_ValueItem));
150 const char *prop = eina_hash_find(idata->priv->prop_con, part);
151
152 if (prop == NULL) prop = part;
153
154 vitem->part = eina_stringshare_add(part);
155 vitem->item = idata->item;
156 idata->values = eina_list_append(idata->values, vitem);
157 future = efl_model_property_get(idata->model, prop);
158 efl_future_then(future, &_property_get_cb,
159 &_property_get_error_cb, NULL, vitem);
160 }
161 else
162 {
163 unsigned i = eina_list_count(idata->values);
164 idata->values = eina_list_remove(idata->values, vitem);
165 if (i == 1) idata->values = NULL;
166
167 eina_stringshare_del(vitem->part);
168 free(vitem);
169 }
170
171 return value;
172}
173
174static Evas_Object * 97static Evas_Object *
175_item_content_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part) 98_item_content_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
176{ 99{
177 const Eina_Value_Type *vtype; 100 const Eina_Value_Type *vtype;
101 const char *prop;
102 Eina_Value *value = NULL;
178 Evas_Object *content = NULL; 103 Evas_Object *content = NULL;
179 View_List_ItemData *idata = data; 104 View_List_ItemData *idata = data;
180 EINA_SAFETY_ON_NULL_RETURN_VAL(data, NULL); 105 EINA_SAFETY_ON_NULL_RETURN_VAL(data, NULL);
181 EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); 106 EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
182 107
183 if (!idata->item) 108 if (!idata->item) return NULL;
184 return NULL;
185 109
186 Eina_Value *value = _item_get_value(idata, part); 110 prop = eina_hash_find(idata->priv->connect.properties, part);
111 if (!prop) prop = part;
187 112
188 if (value == NULL) 113 value = efl_model_property_get(idata->model, prop);
189 return NULL; 114 if (value == NULL) return NULL;
190 115
191 vtype = eina_value_type_get(value); 116 vtype = eina_value_type_get(value);
192 if (vtype == EINA_VALUE_TYPE_STRING || vtype == EINA_VALUE_TYPE_STRINGSHARE) 117 if (vtype == EINA_VALUE_TYPE_BLOB)
118 {
119 Eina_Value_Blob out;
120
121 eina_value_get(value, &out);
122 if (out.memory != NULL)
123 {
124 content = elm_image_add(obj);
125 //XXX: need copy memory??
126 elm_image_memfile_set(content, out.memory, out.size, NULL, NULL);
127 }
128 }
129 else if (vtype == EINA_VALUE_TYPE_FILE)
130 {
131 Eina_File *f = NULL;
132
133 eina_value_get(value, &f);
134
135 content = elm_image_add(obj);
136 elm_image_mmap_set(content, f, NULL);
137 }
138 else if (vtype == EINA_VALUE_TYPE_OBJECT)
193 { 139 {
194 char *content_s = NULL; 140 eina_value_get(value, &content);
195 content_s = eina_value_to_string(value); 141 }
142 else
143 {
144 char *str = NULL;
145 str = eina_value_to_string(value);
196 content = elm_icon_add(obj); 146 content = elm_icon_add(obj);
197 if (elm_icon_standard_set(content, content_s)) 147 if (elm_icon_standard_set(content, str))
198 { 148 {
199 evas_object_size_hint_aspect_set(content, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); 149 evas_object_size_hint_aspect_set(content, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
200 } 150 }
@@ -203,20 +153,9 @@ _item_content_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
203 evas_object_del(content); 153 evas_object_del(content);
204 content = NULL; 154 content = NULL;
205 } 155 }
206 free(content_s); 156 free(str);
207 }
208 else if (vtype == EINA_VALUE_TYPE_BLOB)
209 {
210 Eina_Value_Blob out;
211 eina_value_get(value, &out);
212 if (out.memory != NULL)
213 {
214 content = elm_image_add(obj);
215 //XXX: need copy memory??
216 elm_image_memfile_set(content, out.memory, out.size, NULL, NULL);
217 }
218 } 157 }
219 eina_value_flush(value); 158 eina_value_free(value);
220 159
221 return content; 160 return content;
222} 161}
@@ -224,21 +163,24 @@ _item_content_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
224static char * 163static char *
225_item_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part) 164_item_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
226{ 165{
166 Eina_Value *value = NULL;
167 const char *prop;
227 char *text = NULL; 168 char *text = NULL;
228 View_List_ItemData *idata = data; 169 View_List_ItemData *idata = data;
229 170
230 EINA_SAFETY_ON_NULL_RETURN_VAL(data, NULL); 171 EINA_SAFETY_ON_NULL_RETURN_VAL(data, NULL);
231 EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); 172 EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
232 if (!idata->item) 173 if (!idata->item) return NULL;
233 return text;
234 174
235 Eina_Value *value = _item_get_value(idata, part); 175 prop = eina_hash_find(idata->priv->connect.properties, part);
176 if (!prop) prop = part;
236 177
237 if (value) 178 value = efl_model_property_get(idata->model, prop);
238 { 179 if (value == NULL) return NULL;
239 text = eina_value_to_string(value); 180
240 eina_value_flush(value); 181 text = eina_value_to_string(value);
241 } 182
183 eina_value_free(value);
242 184
243 return text; 185 return text;
244} 186}
@@ -300,75 +242,101 @@ _efl_model_properties_change_cb(void *data, const Efl_Event *event)
300 elm_genlist_item_update(idata->item); 242 elm_genlist_item_update(idata->item);
301} 243}
302 244
303static void 245static Eina_Value
304_efl_model_load_children_then(void * data, Efl_Event const* event) 246_efl_model_load_children_then(void *data, const Eina_Value v,
247 const Eina_Future *ev EINA_UNUSED)
305{ 248{
306 View_List_ItemData *pdata = data; 249 View_List_ItemData *pdata = data;
307 Eina_Accessor *accessor = (Eina_Accessor*)((Efl_Future_Event_Success*)event->info)->value;
308 Eo *child;
309 unsigned i = 0;
310 EINA_SAFETY_ON_NULL_RETURN(pdata);
311 EINA_SAFETY_ON_NULL_RETURN(pdata->priv);
312 EINA_SAFETY_ON_NULL_RETURN(accessor);
313
314 Elm_View_List_Data *priv = pdata->priv; 250 Elm_View_List_Data *priv = pdata->priv;
251 unsigned int i, len;
252 Efl_Model *child = NULL;
253
254 if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR)
255 goto end;
315 256
316 EINA_ACCESSOR_FOREACH(accessor, i, child) 257 EINA_VALUE_ARRAY_FOREACH(&v, len, i, child)
317 { 258 {
318 View_List_ItemData *idata = calloc(1, sizeof(View_List_ItemData)); 259 View_List_ItemData *idata = calloc(1, sizeof(View_List_ItemData));
319 EINA_SAFETY_ON_NULL_RETURN(idata); 260 if (!idata) continue ;
261
320 idata->priv = priv; 262 idata->priv = priv;
321 idata->parent = pdata; 263 idata->parent = pdata;
322 idata->model = child; 264 idata->model = efl_ref(child);
323 efl_ref(child); 265
324 efl_event_callback_add(child, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _efl_model_properties_change_cb, idata); 266 efl_event_callback_add(idata->model, EFL_MODEL_EVENT_PROPERTIES_CHANGED,
267 _efl_model_properties_change_cb, idata);
268
325 idata->item = elm_genlist_item_append(priv->genlist, priv->itc, idata, pdata->item, 269 idata->item = elm_genlist_item_append(priv->genlist, priv->itc, idata, pdata->item,
326 priv->itype, _item_sel_cb, idata); 270 priv->itype, _item_sel_cb, idata);
327 } 271 }
328 272
329 if (i > 0 && pdata->item) 273 if (i > 0 && pdata->item)
330 elm_genlist_item_expanded_set(pdata->item, EINA_TRUE); 274 elm_genlist_item_expanded_set(pdata->item, EINA_TRUE);
275
276 end:
277 return v;
331} 278}
332 279
333static void 280static void
334_efl_model_load_children(View_List_ItemData *pdata) 281_efl_model_load_children(View_List_ItemData *pdata)
335{ 282{
336 efl_future_then(efl_model_children_slice_get(pdata->model, 0, 0), 283 Eina_Future *f;
337 &_efl_model_load_children_then, NULL, NULL, pdata); 284
285 f = efl_model_children_slice_get(pdata->priv->connect.model, 0,
286 efl_model_children_count_get(pdata->priv->connect.model));
287 f = eina_future_then(f, _efl_model_load_children_then, pdata);
288 efl_future_Eina_FutureXXX_then(pdata->priv->genlist, f);
338} 289}
339 290
340static void 291static void
341_efl_model_children_count_change_cb(void *data, const Efl_Event *event EINA_UNUSED) 292_efl_model_children_removed_cb(void *data, const Efl_Event *event)
342{ 293{
294 Efl_Model_Children_Event* evt = event->info;
343 View_List_ItemData *idata = data; 295 View_List_ItemData *idata = data;
344 EINA_SAFETY_ON_NULL_RETURN(idata); 296 Elm_Object_Item *item;
345 EINA_SAFETY_ON_NULL_RETURN(idata->priv); 297 const Eina_List *subitems, *l;
346 EINA_SAFETY_ON_NULL_RETURN(idata->priv->genlist); 298 unsigned int i = 0;
347 299
348 elm_genlist_item_subitems_clear(idata->item); 300 subitems = elm_genlist_item_subitems_get(idata->item);
349 301
350 _efl_model_load_children(idata); 302 EINA_LIST_FOREACH(subitems, l, item)
303 {
304 if (i == evt->index) break ;
305 i++;
306 }
307
308 if (i != evt->index) return ;
309 elm_object_item_del(item);
310}
311
312static void
313_efl_model_children_added_cb(void *data, const Efl_Event *event)
314{
315 Efl_Model_Children_Event* evt = event->info;
316 View_List_ItemData *idata = data;
317 Eina_Future *f;
318
319 f = efl_model_children_slice_get(idata->priv->connect.model, evt->index, 1);
320 f = eina_future_then(f, _efl_model_load_children_then, idata);
321 efl_future_Eina_FutureXXX_then(idata->priv->genlist, f);
351} 322}
352 323
353static void 324static void
354_priv_model_set(Elm_View_List_Data *priv, Eo *model) 325_priv_model_set(Elm_View_List_Data *priv, Eo *model)
355{ 326{
356 if (priv->model != NULL) 327 if (priv->connect.model)
357 { 328 {
358 efl_event_callback_array_del(priv->model, model_callbacks(), priv->rootdata); 329 efl_event_callback_array_del(priv->connect.model, model_callbacks(), priv->rootdata);
359 elm_obj_genlist_clear(priv->genlist); 330 elm_obj_genlist_clear(priv->genlist);
360 efl_unref(priv->model);
361 priv->model = NULL;
362 } 331 }
363 332
364 if (model == NULL) 333 efl_replace(&priv->connect.model, model);
365 return;
366 334
367 priv->model = model; 335 if (model == NULL) return;
368 priv->rootdata->model = priv->model;
369 efl_ref(priv->model);
370 336
371 efl_event_callback_array_add(priv->model, model_callbacks(), priv->rootdata); 337 priv->rootdata->model = priv->connect.model;
338
339 efl_event_callback_array_add(priv->connect.model, model_callbacks(), priv->rootdata);
372 _efl_model_load_children(priv->rootdata); 340 _efl_model_load_children(priv->rootdata);
373} 341}
374 342
@@ -377,7 +345,7 @@ _priv_model_set(Elm_View_List_Data *priv, Eo *model)
377 */ 345 */
378static void 346static void
379_elm_view_list_genlist_set(Eo *obj, Elm_View_List_Data *priv, Evas_Object *genlist, 347_elm_view_list_genlist_set(Eo *obj, Elm_View_List_Data *priv, Evas_Object *genlist,
380 Elm_Genlist_Item_Type itype, const char *istyle) 348 Elm_Genlist_Item_Type itype, const char *istyle)
381{ 349{
382 priv->view = obj; 350 priv->view = obj;
383 priv->genlist = genlist; 351 priv->genlist = genlist;
@@ -395,7 +363,7 @@ _elm_view_list_genlist_set(Eo *obj, Elm_View_List_Data *priv, Evas_Object *genli
395 priv->itc->func.content_get = _item_content_get; 363 priv->itc->func.content_get = _item_content_get;
396 priv->itc->func.state_get = NULL; 364 priv->itc->func.state_get = NULL;
397 priv->itc->func.del = _item_del; 365 priv->itc->func.del = _item_del;
398 priv->prop_con = eina_hash_string_superfast_new(free); 366 priv->connect.properties = eina_hash_string_superfast_new(free);
399 367
400 efl_event_callback_array_add(priv->genlist, genlist_callbacks(), priv); 368 efl_event_callback_array_add(priv->genlist, genlist_callbacks(), priv);
401 evas_object_event_callback_add(priv->genlist, EVAS_CALLBACK_DEL, _genlist_deleted, priv); 369 evas_object_event_callback_add(priv->genlist, EVAS_CALLBACK_DEL, _genlist_deleted, priv);
@@ -408,23 +376,24 @@ _elm_view_list_efl_object_destructor(Eo *obj, Elm_View_List_Data *priv)
408 EINA_SAFETY_ON_NULL_RETURN(priv); 376 EINA_SAFETY_ON_NULL_RETURN(priv);
409 EINA_SAFETY_ON_NULL_RETURN(obj); 377 EINA_SAFETY_ON_NULL_RETURN(obj);
410 378
411 efl_event_callback_array_del(priv->model, model_callbacks(), priv->rootdata); 379 efl_event_callback_array_del(priv->connect.model, model_callbacks(), priv->rootdata);
412 380
413 elm_obj_genlist_clear(priv->genlist); 381 elm_obj_genlist_clear(priv->genlist);
414 free((void *)priv->itc->item_style); 382 free((void *)priv->itc->item_style);
415 elm_genlist_item_class_free(priv->itc); 383 elm_genlist_item_class_free(priv->itc);
416 384
417 eina_hash_free(priv->prop_con); 385 eina_hash_free(priv->connect.properties);
418 free(priv->rootdata); 386 free(priv->rootdata);
419 priv->rootdata = NULL; 387 priv->rootdata = NULL;
388
420 if (priv->genlist) 389 if (priv->genlist)
421 { 390 {
422 evas_object_event_callback_del(priv->genlist, EVAS_CALLBACK_DEL, _genlist_deleted); 391 evas_object_event_callback_del(priv->genlist, EVAS_CALLBACK_DEL, _genlist_deleted);
423 efl_event_callback_array_del(priv->genlist, genlist_callbacks(), priv); 392 efl_event_callback_array_del(priv->genlist, genlist_callbacks(), priv);
424 efl_unref(priv->genlist); 393 efl_unref(priv->genlist);
425 } 394 }
426 395
427 efl_unref(priv->model); 396 efl_unref(priv->connect.model);
428 397
429 efl_destructor(efl_super(obj, MY_CLASS)); 398 efl_destructor(efl_super(obj, MY_CLASS));
430} 399}
@@ -441,37 +410,26 @@ _elm_view_list_evas_object_get(Eo *obj, Elm_View_List_Data *priv, Evas_Object **
441 410
442static void 411static void
443_elm_view_list_property_connect(Eo *obj EINA_UNUSED, Elm_View_List_Data *priv, 412_elm_view_list_property_connect(Eo *obj EINA_UNUSED, Elm_View_List_Data *priv,
444 const char *property, const char *part) 413 const char *property, const char *part)
445{ 414{
446 EINA_SAFETY_ON_NULL_RETURN(priv); 415 EINA_SAFETY_ON_NULL_RETURN(priv);
447 416
448 EINA_SAFETY_ON_NULL_RETURN(priv->prop_con); 417 EINA_SAFETY_ON_NULL_RETURN(priv->connect.properties);
449 EINA_SAFETY_ON_NULL_RETURN(property); 418 EINA_SAFETY_ON_NULL_RETURN(property);
450 EINA_SAFETY_ON_NULL_RETURN(part); 419 EINA_SAFETY_ON_NULL_RETURN(part);
451 420
452 free(eina_hash_set(priv->prop_con, part, strdup(property))); 421 free(eina_hash_set(priv->connect.properties, part, strdup(property)));
453} 422}
454 423
455static void 424static void
456_elm_view_list_model_set(Eo *obj EINA_UNUSED, Elm_View_List_Data *priv, Efl_Model *model) 425_elm_view_list_model_set(Eo *obj EINA_UNUSED, Elm_View_List_Data *priv, Efl_Model *model)
457{ 426{
458 EINA_SAFETY_ON_NULL_RETURN(priv);
459 EINA_SAFETY_ON_NULL_RETURN(model);
460 _priv_model_set(priv, model); 427 _priv_model_set(priv, model);
461} 428}
462 429
463static void 430static Efl_Model *
464_elm_view_list_model_unset(Eo *obj EINA_UNUSED, Elm_View_List_Data *priv) 431_elm_view_list_model_get(Eo *obj EINA_UNUSED, Elm_View_List_Data *priv)
465{
466 EINA_SAFETY_ON_NULL_RETURN(priv);
467 _priv_model_set(priv, NULL);
468}
469
470static void
471_elm_view_list_model_get(Eo *obj EINA_UNUSED, Elm_View_List_Data *priv, Eo **model)
472{ 432{
473 EINA_SAFETY_ON_NULL_RETURN(priv); 433 return priv->connect.model;
474 EINA_SAFETY_ON_NULL_RETURN(model);
475 *model = priv->model;
476} 434}
477#include "elm_view_list.eo.c" 435#include "elm_view_list.eo.c"
diff --git a/src/lib/elementary/elm_view_list.eo b/src/lib/elementary/elm_view_list.eo
index 967be21594..91fb080fd7 100644
--- a/src/lib/elementary/elm_view_list.eo
+++ b/src/lib/elementary/elm_view_list.eo
@@ -34,28 +34,21 @@ class Elm.View.List (Efl.Object)
34 @in part: string; [[Edje's theme part]] 34 @in part: string; [[Edje's theme part]]
35 } 35 }
36 } 36 }
37 model_set { 37 @property model {
38 [[Set model 38 set {
39 [[Set model
39 40
40 @since 1.11 41 @since 1.11
41 ]] 42 ]]
42 params {
43 @in model: Efl.Model; [[New Emodel to set]]
44 } 43 }
45 } 44 get {
46 model_unset {
47 [[Unset model
48
49 @since 1.11
50 ]]
51 }
52 model_get {
53 [[Get model 45 [[Get model
54 46
55 @since 1.11 47 @since 1.11
56 ]] 48 ]]
57 params { 49 }
58 @out model: Efl.Model; [[Returned Emodel]] 50 values {
51 model: Efl.Model; [[Efl.Model to set]]
59 } 52 }
60 } 53 }
61 } 54 }