summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2012-03-05 15:03:12 +0000
committerDaniel Juyung Seo <seojuyung2@gmail.com>2012-03-05 15:03:12 +0000
commit8977312e43b8fbb16e482251ce1859f0ede9e3f6 (patch)
tree5657ee2f0316453e9464babf898c2db291498258
parentd2ae40cf9cfad748a2c478553d44569047eea640 (diff)
elm genlist: Added elm_genlist_item_flip_get/set APIs. Patch by
Hyoyoung Chang <hyoyoung@gmail.com> On Wed, Feb 29, 2012 at 9:17 PM, Hyoyoung Chang <hyoyoung@gmail.com> wrote: > Dear all. > > I made a patch to introduce new genlist item mode. > Two public apis are added. > +EAPI void elm_genlist_item_flip_set(Elm_Object_Item *it, Eina_Bool flip); > +EAPI Eina_Bool elm_genlist_item_flip_get(Elm_Object_Item *it); > > It provides on-the-flying item change. It works like that a new item > added on existed item. > In elementary test, you can test it. > It's useful at adding widgets or show buttons in genlist item. > > Thanks. On Mon, Mar 5, 2012 at 5:56 PM, Hyoyoung Chang <hyoyoung@gmail.com> wrote: > Hello, I modifed fliP_set api to use ecore_job. > It resolved version of mouse_{move, up} bugs. > SVN revision: 68727
-rw-r--r--legacy/elementary/data/themes/widgets/genlist.edc86
-rw-r--r--legacy/elementary/src/bin/test.c2
-rw-r--r--legacy/elementary/src/bin/test_genlist.c104
-rw-r--r--legacy/elementary/src/lib/elm_gen_common.h1
-rw-r--r--legacy/elementary/src/lib/elm_genlist.c91
-rw-r--r--legacy/elementary/src/lib/elm_genlist.h33
6 files changed, 313 insertions, 4 deletions
diff --git a/legacy/elementary/data/themes/widgets/genlist.edc b/legacy/elementary/data/themes/widgets/genlist.edc
index 5d0766c24b..b2acb977cf 100644
--- a/legacy/elementary/data/themes/widgets/genlist.edc
+++ b/legacy/elementary/data/themes/widgets/genlist.edc
@@ -3,6 +3,7 @@ group { name: "elm/genlist/item/default/default";
3 data.item: "texts" "elm.text"; 3 data.item: "texts" "elm.text";
4 data.item: "contents" "elm.swallow.icon elm.swallow.end"; 4 data.item: "contents" "elm.swallow.icon elm.swallow.end";
5 data.item: "treesize" "20"; 5 data.item: "treesize" "20";
6 data.item: "flips" "elm.text.flip";
6 // data.item: "states" ""; 7 // data.item: "states" "";
7 images { 8 images {
8 image: "bt_sm_base1.png" COMP; 9 image: "bt_sm_base1.png" COMP;
@@ -165,6 +166,10 @@ group { name: "elm/genlist/item/default/default";
165 offset: -1 -5; 166 offset: -1 -5;
166 } 167 }
167 } 168 }
169 description { state: "flip_enabled" 0.0;
170 inherit: "default" 0.0;
171 visible: 0;
172 }
168 } 173 }
169 part { name: "elm.swallow.end"; 174 part { name: "elm.swallow.end";
170 clip_to: "disclip"; 175 clip_to: "disclip";
@@ -183,6 +188,10 @@ group { name: "elm/genlist/item/default/default";
183 offset: -5 -5; 188 offset: -5 -5;
184 } 189 }
185 } 190 }
191 description { state: "flip_enabled" 0.0;
192 inherit: "default" 0.0;
193 visible: 0;
194 }
186 } 195 }
187 part { name: "elm.text"; 196 part { name: "elm.text";
188 clip_to: "disclip"; 197 clip_to: "disclip";
@@ -219,6 +228,24 @@ group { name: "elm/genlist/item/default/default";
219 color: 224 224 224 255; 228 color: 224 224 224 255;
220 color3: 0 0 0 64; 229 color3: 0 0 0 64;
221 } 230 }
231 description { state: "flip_enabled" 0.0;
232 inherit: "default" 0.0;
233 visible: 0;
234 }
235 }
236 part { name: "elm.text.flip";
237 clip_to: "disclip";
238 type: SWALLOW;
239 scale: 1;
240 description { state: "default" 0.0;
241 visible: 0;
242 rel1.to_y: "elm.text";
243 rel2.to_y: "elm.text";
244 }
245 description { state: "flip_enabled" 0.0;
246 inherit: "default" 0.0;
247 visible: 1;
248 }
222 } 249 }
223 part { name: "fg1"; 250 part { name: "fg1";
224 clip_to: "disclip"; 251 clip_to: "disclip";
@@ -363,6 +390,24 @@ group { name: "elm/genlist/item/default/default";
363 target: "reorder_bg"; 390 target: "reorder_bg";
364 transition: DECELERATE 0.5; 391 transition: DECELERATE 0.5;
365 } 392 }
393 program { name: "flip_enabled";
394 signal: "elm,state,flip,enabled";
395 source: "elm";
396 action: STATE_SET "flip_enabled" 0.0;
397 target: "elm.text";
398 target: "elm.text.flip";
399 target: "elm.swallow.icon";
400 target: "elm.swallow.end";
401 }
402 program { name: "flip_disabled";
403 signal: "elm,state,flip,disabled";
404 source: "elm";
405 action: STATE_SET "default" 0.0;
406 target: "elm.text";
407 target: "elm.text.flip";
408 target: "elm.swallow.icon";
409 target: "elm.swallow.end";
410 }
366 } 411 }
367} 412}
368group { name: "elm/genlist/item/group_index/default"; 413group { name: "elm/genlist/item/group_index/default";
@@ -9302,6 +9347,10 @@ group { name: "elm/genlist/item/edit/default";
9302 inherit: "default" 0.0; 9347 inherit: "default" 0.0;
9303 align: 0.0 0.5; 9348 align: 0.0 0.5;
9304 } 9349 }
9350 description { state: "disabled" 0.0;
9351 inherit: "default" 0.0;
9352 visible: 0;
9353 }
9305 } 9354 }
9306 part { name: "elm.padding.icon1.right"; 9355 part { name: "elm.padding.icon1.right";
9307 type: RECT; 9356 type: RECT;
@@ -9333,6 +9382,14 @@ group { name: "elm/genlist/item/edit/default";
9333 to_x: "elm.padding.icon2.left"; 9382 to_x: "elm.padding.icon2.left";
9334 } 9383 }
9335 } 9384 }
9385 description { state: "flipped" 0.0;
9386 inherit: "default" 0.0;
9387 rel1.to_x: "elm.padding.left";
9388 rel2 {
9389 relative: 1.3 1.0;
9390 to_x: "elm.padding.right";
9391 }
9392 }
9336 } 9393 }
9337 part { name: "elm.padding.icon2.left"; 9394 part { name: "elm.padding.icon2.left";
9338 type: RECT; 9395 type: RECT;
@@ -9374,6 +9431,10 @@ group { name: "elm/genlist/item/edit/default";
9374 inherit: "default" 0.0; 9431 inherit: "default" 0.0;
9375 align: 1.0 0.5; 9432 align: 1.0 0.5;
9376 } 9433 }
9434 description { state: "disabled" 0.0;
9435 inherit: "default" 0.0;
9436 visible: 0;
9437 }
9377 } 9438 }
9378 part { name: "disclip"; 9439 part { name: "disclip";
9379 type: RECT; 9440 type: RECT;
@@ -9473,5 +9534,30 @@ group { name: "elm/genlist/item/edit/default";
9473 target: "elm.edit.icon.1"; 9534 target: "elm.edit.icon.1";
9474 target: "elm.edit.icon.2"; 9535 target: "elm.edit.icon.2";
9475 } 9536 }
9537 program {
9538 name: "enable_flip_mode";
9539 signal: "elm,state,flip,enabled";
9540 source: "elm";
9541 action: STATE_SET "disabled" 0.0;
9542 target: "elm.edit.icon.1";
9543 target: "elm.edit.icon.2";
9544 after: "enable_flip_mode_next";
9545 }
9546 program {
9547 name: "enable_flip_mode_next";
9548 action: STATE_SET "flipped" 0.0;
9549 transition: DECELERATE 0.5;
9550 target: "elm.swallow.edit.content";
9551 }
9552 program {
9553 name: "disable_flip_mode";
9554 signal: "elm,state,flip,disabled";
9555 source: "elm";
9556 action: STATE_SET "default" 0.0;
9557 transition: DECELERATE 0.5;
9558 target: "elm.swallow.edit.content";
9559 target: "elm.edit.icon.1";
9560 target: "elm.edit.icon.2";
9561 }
9476 } 9562 }
9477} 9563}
diff --git a/legacy/elementary/src/bin/test.c b/legacy/elementary/src/bin/test.c
index 709b597b28..7cf3c38db3 100644
--- a/legacy/elementary/src/bin/test.c
+++ b/legacy/elementary/src/bin/test.c
@@ -86,6 +86,7 @@ void test_genlist12(void *data, Evas_Object *obj, void *event_info);
86void test_genlist13(void *data, Evas_Object *obj, void *event_info); 86void test_genlist13(void *data, Evas_Object *obj, void *event_info);
87void test_genlist14(void *data, Evas_Object *obj, void *event_info); 87void test_genlist14(void *data, Evas_Object *obj, void *event_info);
88void test_genlist15(void *data, Evas_Object *obj, void *event_info); 88void test_genlist15(void *data, Evas_Object *obj, void *event_info);
89void test_genlist16(void *data, Evas_Object *obj, void *event_info);
89void test_gesture_layer(void *data, Evas_Object *obj, void *event_info); 90void test_gesture_layer(void *data, Evas_Object *obj, void *event_info);
90void test_gesture_layer2(void *data, Evas_Object *obj, void *event_info); 91void test_gesture_layer2(void *data, Evas_Object *obj, void *event_info);
91void test_gesture_layer3(void *data, Evas_Object *obj, void *event_info); 92void test_gesture_layer3(void *data, Evas_Object *obj, void *event_info);
@@ -431,6 +432,7 @@ add_tests:
431 ADD_TEST(NULL, "Lists", "Genlist Tree, Insert Sorted", test_genlist13); 432 ADD_TEST(NULL, "Lists", "Genlist Tree, Insert Sorted", test_genlist13);
432 ADD_TEST(NULL, "Lists", "Genlist Tree, Insert Relative", test_genlist14); 433 ADD_TEST(NULL, "Lists", "Genlist Tree, Insert Relative", test_genlist14);
433 ADD_TEST(NULL, "Lists", "Genlist Edit Mode", test_genlist15); 434 ADD_TEST(NULL, "Lists", "Genlist Edit Mode", test_genlist15);
435 ADD_TEST(NULL, "Lists", "Genlist Flip Mode", test_genlist16);
434 ADD_TEST(NULL, "Lists", "GenGrid", test_gengrid); 436 ADD_TEST(NULL, "Lists", "GenGrid", test_gengrid);
435 ADD_TEST(NULL, "Lists", "GenGrid 2", test_gengrid2); 437 ADD_TEST(NULL, "Lists", "GenGrid 2", test_gengrid2);
436 ADD_TEST(NULL, "Lists", "GenGrid Group", test_gengrid3); 438 ADD_TEST(NULL, "Lists", "GenGrid Group", test_gengrid3);
diff --git a/legacy/elementary/src/bin/test_genlist.c b/legacy/elementary/src/bin/test_genlist.c
index 2980af4341..0f67ec5cdb 100644
--- a/legacy/elementary/src/bin/test_genlist.c
+++ b/legacy/elementary/src/bin/test_genlist.c
@@ -2485,4 +2485,108 @@ test_genlist15(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
2485 evas_object_resize(win, 520, 520); 2485 evas_object_resize(win, 520, 520);
2486 evas_object_show(win); 2486 evas_object_show(win);
2487} 2487}
2488
2489static void _flip_icon_clicked_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
2490{
2491 const Testitem *tit = data;
2492
2493 if (elm_genlist_item_flip_get(tit->item))
2494 elm_genlist_item_flip_set(tit->item, EINA_FALSE);
2495 else
2496 elm_genlist_item_flip_set(tit->item, EINA_TRUE);
2497}
2498
2499char *gl16_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__)
2500{
2501 const Testitem *tit = data;
2502 char buf[256];
2503 snprintf(buf, sizeof(buf), "Item #%i", tit->mode);
2504 return strdup(buf);
2505}
2506
2507Evas_Object *gl16_content_get(void *data, Evas_Object *obj, const char *part)
2508{
2509 Testitem *tit = data;
2510 char buf[PATH_MAX];
2511
2512 if (!strcmp(part, "elm.text.flip"))
2513 {
2514 Evas_Object *btn = elm_button_add(obj);
2515 elm_object_text_set(btn, "flipped content placement");
2516 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
2517 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0.0);
2518 evas_object_smart_callback_add(btn, "clicked", _flip_icon_clicked_cb, (void *)tit);
2519 evas_object_show(btn);
2520 return btn;
2521 }
2522 else if (!strcmp(part, "elm.edit.icon.1"))
2523 {
2524 Evas_Object *icn = elm_icon_add(obj);
2525 snprintf(buf, sizeof(buf), "%s/images/icon_04.png", PACKAGE_DATA_DIR);
2526 elm_icon_file_set(icn, buf, NULL);
2527 evas_object_propagate_events_set(icn, EINA_FALSE);
2528 evas_object_size_hint_aspect_set(icn, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
2529 return icn;
2530 }
2531 else if (!strcmp(part, "elm.edit.icon.2"))
2532 {
2533 Evas_Object *icn = elm_icon_add(obj);
2534 snprintf(buf, sizeof(buf), "%s/images/icon_09.png", PACKAGE_DATA_DIR);
2535 elm_icon_file_set(icn, buf, NULL);
2536 evas_object_propagate_events_set(icn, EINA_FALSE);
2537 evas_object_size_hint_aspect_set(icn, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
2538 evas_object_smart_callback_add(icn, "clicked", _flip_icon_clicked_cb, (void *)tit);
2539 return icn;
2540 }
2541 else return NULL;
2542}
2543
2544void
2545test_genlist16(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
2546{
2547 Evas_Object *win, *bx, *gl;
2548 int i;
2549 static Testitem tit[100];
2550
2551 win = elm_win_util_standard_add("genlist-flip-mode", "Genlist Flip Mode");
2552 elm_win_autodel_set(win, EINA_TRUE);
2553
2554 bx = elm_box_add(win);
2555 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2556 elm_win_resize_object_add(win, bx);
2557 evas_object_show(bx);
2558
2559 gl = elm_genlist_add(win);
2560 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
2561 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2562 evas_object_show(gl);
2563
2564 elm_genlist_edit_mode_set(gl, EINA_TRUE);
2565 elm_genlist_always_select_mode_set(gl, EINA_TRUE);
2566
2567 itc15 = elm_genlist_item_class_new();
2568 itc15->item_style = "default";
2569 itc15->func.text_get = gl16_text_get;
2570 itc15->func.content_get = gl16_content_get;
2571 itc15->func.state_get = gl_state_get;
2572 itc15->func.del = NULL;
2573 itc15->edit_item_style = "edit";
2574
2575 for (i = 0; i < 100; i++)
2576 {
2577 tit[i].mode = i;
2578 tit[i].item = elm_genlist_item_append(gl, itc15,
2579 &(tit[i])/* item data */,
2580 NULL/* parent */,
2581 ELM_GENLIST_ITEM_NONE/* flags */,
2582 gl_sel/* func */,
2583 (void *)(long)&(tit[i])/* func data */);
2584 }
2585 elm_genlist_item_class_free(itc15);
2586 elm_box_pack_end(bx, gl);
2587 evas_object_show(bx);
2588
2589 evas_object_resize(win, 520, 520);
2590 evas_object_show(win);
2591}
2488#endif 2592#endif
diff --git a/legacy/elementary/src/lib/elm_gen_common.h b/legacy/elementary/src/lib/elm_gen_common.h
index e01925e9da..185522d137 100644
--- a/legacy/elementary/src/lib/elm_gen_common.h
+++ b/legacy/elementary/src/lib/elm_gen_common.h
@@ -71,6 +71,7 @@ struct Elm_Gen_Item
71 Eina_Bool group : 1; 71 Eina_Bool group : 1;
72 Eina_Bool reorder : 1; 72 Eina_Bool reorder : 1;
73 Eina_Bool mode_set : 1; /* item uses style mode for highlight/select */ 73 Eina_Bool mode_set : 1; /* item uses style mode for highlight/select */
74 Eina_Bool flipped : 1; /* a flag that shows the flip status of the item. */
74}; 75};
75 76
76typedef struct _Pan Pan; 77typedef struct _Pan Pan;
diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c
index 2c97995638..b691e159e0 100644
--- a/legacy/elementary/src/lib/elm_genlist.c
+++ b/legacy/elementary/src/lib/elm_genlist.c
@@ -896,7 +896,7 @@ _mouse_move(void *data,
896 if (!it->wd->on_hold) 896 if (!it->wd->on_hold)
897 { 897 {
898 it->wd->on_hold = EINA_TRUE; 898 it->wd->on_hold = EINA_TRUE;
899 if (!it->wd->wasselected) 899 if ((!it->wd->wasselected) && (!it->flipped))
900 { 900 {
901 _item_unhighlight(it); 901 _item_unhighlight(it);
902 _item_unselect(it); 902 _item_unselect(it);
@@ -1367,7 +1367,7 @@ _mouse_up(void *data,
1367 if (it->wd->longpressed) 1367 if (it->wd->longpressed)
1368 { 1368 {
1369 it->wd->longpressed = EINA_FALSE; 1369 it->wd->longpressed = EINA_FALSE;
1370 if (!it->wd->wasselected) 1370 if ((!it->wd->wasselected) && (!it->flipped))
1371 { 1371 {
1372 _item_unhighlight(it); 1372 _item_unhighlight(it);
1373 _item_unselect(it); 1373 _item_unselect(it);
@@ -1625,7 +1625,7 @@ _item_cache_find(Elm_Gen_Item *it)
1625 if ((itc->tree == tree) && 1625 if ((itc->tree == tree) &&
1626 (itc->compress == it->wd->compress) && 1626 (itc->compress == it->wd->compress) &&
1627 (((!it->itc->item_style) && (!itc->item_style)) || 1627 (((!it->itc->item_style) && (!itc->item_style)) ||
1628 (it->itc->item_style && itc->item_style && 1628 (it->itc->item_style && itc->item_style &&
1629 (!strcmp(it->itc->item_style, itc->item_style))))) 1629 (!strcmp(it->itc->item_style, itc->item_style)))))
1630 { 1630 {
1631 it->wd->item_cache = eina_inlist_remove(it->wd->item_cache, 1631 it->wd->item_cache = eina_inlist_remove(it->wd->item_cache,
@@ -1891,6 +1891,41 @@ _item_state_realize(Elm_Gen_Item *it,
1891 } 1891 }
1892} 1892}
1893 1893
1894static Eina_List *
1895_item_flips_realize(Elm_Gen_Item *it,
1896 Evas_Object *target,
1897 Eina_List **source)
1898{
1899 Eina_List *res = NULL;
1900
1901 if (it->itc->func.content_get)
1902 {
1903 const Eina_List *l;
1904 const char *key;
1905 Evas_Object *ic = NULL;
1906
1907 *source = elm_widget_stringlist_get(edje_object_data_get(target, "flips"));
1908
1909 EINA_LIST_FOREACH(*source, l, key)
1910 {
1911 if (it->itc->func.content_get)
1912 ic = it->itc->func.content_get
1913 ((void *)it->base.data, WIDGET(it), key);
1914 if (ic)
1915 {
1916 res = eina_list_append(res, ic);
1917 edje_object_part_swallow(target, key, ic);
1918 evas_object_show(ic);
1919 elm_widget_sub_object_add(WIDGET(it), ic);
1920 if (elm_widget_item_disabled_get(it))
1921 elm_widget_disabled_set(ic, EINA_TRUE);
1922 }
1923 }
1924 }
1925
1926 return res;
1927}
1928
1894static void 1929static void
1895_item_realize(Elm_Gen_Item *it, 1930_item_realize(Elm_Gen_Item *it,
1896 int in, 1931 int in,
@@ -2031,6 +2066,11 @@ _item_realize(Elm_Gen_Item *it,
2031 _item_text_realize(it, VIEW(it), &it->texts, NULL); 2066 _item_text_realize(it, VIEW(it), &it->texts, NULL);
2032 it->content_objs = _item_content_realize(it, VIEW(it), &it->contents, NULL); 2067 it->content_objs = _item_content_realize(it, VIEW(it), &it->contents, NULL);
2033 _item_state_realize(it, VIEW(it), &it->states, NULL); 2068 _item_state_realize(it, VIEW(it), &it->states, NULL);
2069 if (it->flipped)
2070 {
2071 edje_object_signal_emit(VIEW(it), "elm,state,flip,enabled", "elm");
2072 it->content_objs = _item_flips_realize(it, VIEW(it), &it->contents);
2073 }
2034 2074
2035 if (!it->item->mincalcd) 2075 if (!it->item->mincalcd)
2036 { 2076 {
@@ -3253,6 +3293,7 @@ _edit_mode_item_realize(Elm_Gen_Item *it, Eina_Bool effect_on)
3253 _multi_move, it); 3293 _multi_move, it);
3254 3294
3255 _item_text_realize(it, it->edit_obj, &it->item->edit_texts, NULL); 3295 _item_text_realize(it, it->edit_obj, &it->item->edit_texts, NULL);
3296 if (it->flipped) edje_object_signal_emit(it->edit_obj, "elm,state,flip,enabled", "elm");
3256 it->item->edit_content_objs = 3297 it->item->edit_content_objs =
3257 _item_content_realize(it, it->edit_obj, &it->item->edit_contents, NULL); 3298 _item_content_realize(it, it->edit_obj, &it->item->edit_contents, NULL);
3258 _item_state_realize(it, it->edit_obj, &it->item->edit_states, NULL); 3299 _item_state_realize(it, it->edit_obj, &it->item->edit_states, NULL);
@@ -3286,7 +3327,7 @@ _edit_mode_item_unrealize(Elm_Gen_Item *it)
3286 elm_widget_stringlist_free(it->item->edit_states); 3327 elm_widget_stringlist_free(it->item->edit_states);
3287 it->item->edit_states = NULL; 3328 it->item->edit_states = NULL;
3288 EINA_LIST_FREE(it->item->edit_content_objs, icon) 3329 EINA_LIST_FREE(it->item->edit_content_objs, icon)
3289 evas_object_del(icon); 3330 evas_object_del(icon);
3290 edje_object_message_signal_process(it->edit_obj); 3331 edje_object_message_signal_process(it->edit_obj);
3291 3332
3292 evas_object_event_callback_del_full(it->edit_obj, EVAS_CALLBACK_MOUSE_DOWN, 3333 evas_object_event_callback_del_full(it->edit_obj, EVAS_CALLBACK_MOUSE_DOWN,
@@ -5653,6 +5694,48 @@ elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc)
5653 } 5694 }
5654} 5695}
5655 5696
5697void _flip_job(void *data)
5698{
5699 Elm_Gen_Item *it = (Elm_Gen_Item *) data;
5700 _elm_genlist_item_unrealize(it, EINA_FALSE);
5701 if (it->selected) _item_unselect(it);
5702 it->flipped = EINA_TRUE;
5703 it->item->nocache = EINA_TRUE;
5704}
5705
5706EAPI void
5707elm_genlist_item_flip_set(Elm_Object_Item *it,
5708 Eina_Bool flip)
5709{
5710 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
5711 Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
5712
5713 flip = !!flip;
5714 if (_it->flipped == flip) return;
5715
5716 if (flip)
5717 {
5718 ecore_job_add(_flip_job, _it);
5719 if (_it->wd->calc_job) ecore_job_del(_it->wd->calc_job);
5720 _it->wd->calc_job = ecore_job_add(_calc_job, _it->wd);
5721 }
5722 else
5723 {
5724 _it->flipped = flip;
5725 _it->item->nocache = EINA_TRUE;
5726 _item_cache_zero(_it->wd);
5727 elm_genlist_item_update(it);
5728 }
5729}
5730
5731EAPI Eina_Bool
5732elm_genlist_item_flip_get(const Elm_Object_Item *it)
5733{
5734 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
5735 Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
5736 return _it->flipped;
5737}
5738
5656/* for gengrid as of now */ 5739/* for gengrid as of now */
5657void 5740void
5658_elm_genlist_page_relative_set(Evas_Object *obj, 5741_elm_genlist_page_relative_set(Evas_Object *obj,
diff --git a/legacy/elementary/src/lib/elm_genlist.h b/legacy/elementary/src/lib/elm_genlist.h
index b941c6bde8..39cecc9119 100644
--- a/legacy/elementary/src/lib/elm_genlist.h
+++ b/legacy/elementary/src/lib/elm_genlist.h
@@ -1948,5 +1948,38 @@ EAPI void elm_genlist_edit_mode_set(Evas_Object *obj, Eina_Bool ed
1948EAPI Eina_Bool elm_genlist_edit_mode_get(const Evas_Object *obj); 1948EAPI Eina_Bool elm_genlist_edit_mode_get(const Evas_Object *obj);
1949 1949
1950/** 1950/**
1951 * Set the flip state of a given genlist item.
1952 *
1953 * @param it The genlist item object
1954 * @param flip The flip mode
1955 * (EINA_TRUE = on, EINA_FALSE = off)
1956 *
1957 * This function sets the flip state of a given genlist item.
1958 * Flip mode overrides current item object.
1959 * It can be used for on-the-fly item replace.
1960 *
1961 * @see elm_genlist_item_flip_get()
1962 *
1963 * @ingroup Genlist
1964 */
1965
1966EAPI void elm_genlist_item_flip_set(Elm_Object_Item *it, Eina_Bool flip);
1967
1968/**
1969 * Get the flip state of a given genlist item.
1970 *
1971 * @param it The genlist item object
1972 *
1973 * This function returns the flip state of a given genlist item.
1974 * If the parameter is invalid, it returns EINA_FALSE.
1975 *
1976 * @see elm_genlist_item_flip_set()
1977 *
1978 * @ingroup Genlist
1979 */
1980
1981EAPI Eina_Bool elm_genlist_item_flip_get(const Elm_Object_Item *it);
1982
1983/**
1951 * @} 1984 * @}
1952 */ 1985 */