summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-08-13 13:48:24 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-17 15:08:42 +0300
commiteb928d7c439371326e217f3f1e7ad79f24bdc063 (patch)
treee853c1ed740d45be0d9154de846ae6148a0756dd
parentbf7afd0469bb6eb4c58b032df85d6dee2b72e042 (diff)
Porting to Eo: Elm DiskSelector Item
-rw-r--r--src/lib/Makefile.am11
-rw-r--r--src/lib/elm_diskselector.c228
-rw-r--r--src/lib/elm_diskselector_common.h72
-rw-r--r--src/lib/elm_diskselector_item.eo105
-rw-r--r--src/lib/elm_widget_diskselector.h32
5 files changed, 258 insertions, 190 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index f8caed429..53f8e9fbb 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -875,7 +875,9 @@ BUILT_SOURCES = \
875 elm_list_item.eo.c \ 875 elm_list_item.eo.c \
876 elm_list_item.eo.h \ 876 elm_list_item.eo.h \
877 elm_toolbar_item.eo.c \ 877 elm_toolbar_item.eo.c \
878 elm_toolbar_item.eo.h 878 elm_toolbar_item.eo.h \
879 elm_diskselector_item.eo.c \
880 elm_diskselector_item.eo.h
879 881
880elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@ 882elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@
881elementaryeolianfiles_DATA = \ 883elementaryeolianfiles_DATA = \
@@ -985,7 +987,8 @@ elementaryeolianfiles_DATA = \
985 elm_genlist_item.eo \ 987 elm_genlist_item.eo \
986 elm_gengrid_item.eo \ 988 elm_gengrid_item.eo \
987 elm_list_item.eo \ 989 elm_list_item.eo \
988 elm_toolbar_item.eo 990 elm_toolbar_item.eo \
991 elm_diskselector_item.eo
989 992
990EXTRA_DIST += ${elementaryeolianfiles_DATA} 993EXTRA_DIST += ${elementaryeolianfiles_DATA}
991 994
@@ -1095,6 +1098,7 @@ nodist_includesunstable_HEADERS = \
1095 elm_gengrid_item.eo.h \ 1098 elm_gengrid_item.eo.h \
1096 elm_list_item.eo.h \ 1099 elm_list_item.eo.h \
1097 elm_toolbar_item.eo.h \ 1100 elm_toolbar_item.eo.h \
1101 elm_diskselector_item.eo.h \
1098 elm_ctxpopup_item.eo.h \ 1102 elm_ctxpopup_item.eo.h \
1099 elm_slideshow_item.eo.h \ 1103 elm_slideshow_item.eo.h \
1100 elm_layout.eo.legacy.h \ 1104 elm_layout.eo.legacy.h \
@@ -1175,7 +1179,8 @@ nodist_includesunstable_HEADERS = \
1175 elm_genlist_item.eo.legacy.h \ 1179 elm_genlist_item.eo.legacy.h \
1176 elm_gengrid_item.eo.legacy.h \ 1180 elm_gengrid_item.eo.legacy.h \
1177 elm_list_item.eo.legacy.h \ 1181 elm_list_item.eo.legacy.h \
1178 elm_toolbar_item.eo.legacy.h 1182 elm_toolbar_item.eo.legacy.h \
1183 elm_diskselector_item.eo.legacy.h
1179 1184
1180if HAVE_CXX11 1185if HAVE_CXX11
1181 1186
diff --git a/src/lib/elm_diskselector.c b/src/lib/elm_diskselector.c
index 8cd930448..16b75029e 100644
--- a/src/lib/elm_diskselector.c
+++ b/src/lib/elm_diskselector.c
@@ -2,10 +2,12 @@
2# include "elementary_config.h" 2# include "elementary_config.h"
3#endif 3#endif
4 4
5#define ELM_WIDGET_ITEM_PROTECTED
5#include <Elementary.h> 6#include <Elementary.h>
6#include "elm_priv.h" 7#include "elm_priv.h"
7#include "elm_widget_diskselector.h" 8#include "elm_widget_diskselector.h"
8#include "elm_interface_scrollable.h" 9#include "elm_interface_scrollable.h"
10#include "elm_diskselector_item.eo.h"
9 11
10#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED 12#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
11#include "elm_interface_atspi_accessible.h" 13#include "elm_interface_atspi_accessible.h"
@@ -53,20 +55,20 @@ static const Elm_Action key_actions[] = {
53EOLIAN static Eina_Bool 55EOLIAN static Eina_Bool
54_elm_diskselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd) 56_elm_diskselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
55{ 57{
56 Elm_Diskselector_Item *it; 58 Elm_Diskselector_Item_Data *it;
57 Eina_List *l; 59 Eina_List *l;
58 60
59 EINA_LIST_FOREACH(sd->items, l, it) 61 EINA_LIST_FOREACH(sd->items, l, it)
60 elm_widget_item_translate(it); 62 eo_do((Eo *)EO_OBJ(it), elm_wdg_item_translate());
61 63
62 return EINA_TRUE; 64 return EINA_TRUE;
63} 65}
64 66
65static void 67static void
66_selected_item_indicate(Elm_Diskselector_Item *item) 68_selected_item_indicate(Elm_Diskselector_Item_Data *item)
67{ 69{
68 Eina_List *l; 70 Eina_List *l;
69 Elm_Diskselector_Item *it; 71 Elm_Diskselector_Item_Data *it;
70 72
71 ELM_DISKSELECTOR_DATA_GET(WIDGET(item), sd); 73 ELM_DISKSELECTOR_DATA_GET(WIDGET(item), sd);
72 74
@@ -82,7 +84,7 @@ _selected_item_indicate(Elm_Diskselector_Item *item)
82} 84}
83 85
84static void 86static void
85_item_select(Elm_Diskselector_Item *it) 87_item_select(Elm_Diskselector_Item_Data *it)
86{ 88{
87 if (!it) return; 89 if (!it) return;
88 90
@@ -91,8 +93,8 @@ _item_select(Elm_Diskselector_Item *it)
91 sd->selected_item = it; 93 sd->selected_item = it;
92 _selected_item_indicate(sd->selected_item); 94 _selected_item_indicate(sd->selected_item);
93 95
94 if (it->func) it->func((void *)it->base.data, WIDGET(it), it); 96 if (it->func) it->func((void *)it->base->data, WIDGET(it), EO_OBJ(it));
95 evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, it); 97 evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, EO_OBJ(it));
96} 98}
97 99
98static int 100static int
@@ -127,7 +129,7 @@ _letters_check(const char *str,
127 return pos; 129 return pos;
128} 130}
129static void 131static void
130_item_signal_emit(Elm_Diskselector_Item *it) 132_item_signal_emit(Elm_Diskselector_Item_Data *it)
131{ 133{
132 if ((it->icon) && (!it->label)) 134 if ((it->icon) && (!it->label))
133 edje_object_signal_emit(VIEW(it), "elm,state,icon,only", "elm"); 135 edje_object_signal_emit(VIEW(it), "elm,state,icon,only", "elm");
@@ -144,7 +146,7 @@ _string_check_idle_enterer_cb(void *data)
144 ELM_DISKSELECTOR_DATA_GET(obj, sd); 146 ELM_DISKSELECTOR_DATA_GET(obj, sd);
145 147
146 int mid, steps, length, diff; 148 int mid, steps, length, diff;
147 Elm_Diskselector_Item *it; 149 Elm_Diskselector_Item_Data *it;
148 Eina_List *list, *l; 150 Eina_List *list, *l;
149 Evas_Coord ox, ow; 151 Evas_Coord ox, ow;
150 char buf[1024]; 152 char buf[1024];
@@ -241,7 +243,7 @@ static Eina_Bool
241_scroller_move(void *data) 243_scroller_move(void *data)
242{ 244{
243 Evas_Object *obj = data; 245 Evas_Object *obj = data;
244 Elm_Diskselector_Item *dit; 246 Elm_Diskselector_Item_Data *dit;
245 Eina_List *list, *l; 247 Eina_List *list, *l;
246 Evas_Coord y, w, h; 248 Evas_Coord y, w, h;
247 int i; 249 int i;
@@ -270,8 +272,7 @@ _scroller_move(void *data)
270 272
271 if (!dit) 273 if (!dit)
272 { 274 {
273 sd->selected_item = 275 sd->selected_item = eina_list_nth(sd->items, 0);
274 (Elm_Diskselector_Item *)eina_list_nth(sd->items, 0);
275 goto end; 276 goto end;
276 } 277 }
277 278
@@ -304,7 +305,7 @@ _resize_cb(void *data EINA_UNUSED,
304 (NULL, NULL, &vw, &vh)); 305 (NULL, NULL, &vw, &vh));
305 if (sd->items) 306 if (sd->items)
306 { 307 {
307 Elm_Diskselector_Item *it = sd->items->data; 308 Elm_Diskselector_Item_Data *it = sd->items->data;
308 evas_object_size_hint_min_get(VIEW(it), &mw, &mh); 309 evas_object_size_hint_min_get(VIEW(it), &mw, &mh);
309 } 310 }
310 if (sd->minh < mh) sd->minh = mh; 311 if (sd->minh < mh) sd->minh = mh;
@@ -332,7 +333,7 @@ _resize_cb(void *data EINA_UNUSED,
332} 333}
333 334
334static void 335static void
335_item_del(Elm_Diskselector_Item *item) 336_item_del(Elm_Diskselector_Item_Data *item)
336{ 337{
337 if (!item) return; 338 if (!item) return;
338 339
@@ -348,14 +349,13 @@ _sizing_eval(Evas_Object *obj)
348 _resize_cb(NULL, NULL, obj, NULL); 349 _resize_cb(NULL, NULL, obj, NULL);
349} 350}
350 351
351static Eina_Bool 352EOLIAN static Eina_Bool
352_item_del_pre_hook(Elm_Object_Item *item) 353_elm_diskselector_item_elm_widget_item_del_pre(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it)
353{ 354{
354 Elm_Diskselector_Item *it, *item2, *dit; 355 Elm_Diskselector_Item_Data *item2, *dit;
355 Eina_List *l; 356 Eina_List *l;
356 int i = 0; 357 int i = 0;
357 358
358 it = (Elm_Diskselector_Item *)item;
359 Evas_Object *obj = WIDGET(it); 359 Evas_Object *obj = WIDGET(it);
360 360
361 ELM_DISKSELECTOR_DATA_GET(obj, sd); 361 ELM_DISKSELECTOR_DATA_GET(obj, sd);
@@ -371,7 +371,7 @@ _item_del_pre_hook(Elm_Object_Item *item)
371 { 371 {
372 if (sd->items) 372 if (sd->items)
373 { 373 {
374 sd->selected_item = (Elm_Diskselector_Item *)eina_list_nth(sd->items, 0); 374 sd->selected_item = eina_list_nth(sd->items, 0);
375 _selected_item_indicate(sd->selected_item); 375 _selected_item_indicate(sd->selected_item);
376 } 376 }
377 else 377 else
@@ -458,17 +458,15 @@ _item_del_pre_hook(Elm_Object_Item *item)
458 return EINA_TRUE; 458 return EINA_TRUE;
459} 459}
460 460
461static void 461EOLIAN static void
462_item_text_set_hook(Elm_Object_Item *item, 462_elm_diskselector_item_elm_widget_item_part_text_set(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
463 const char *part, 463 const char *part,
464 const char *label) 464 const char *label)
465{ 465{
466 Elm_Diskselector_Item *it;
467 Evas_Coord mw, mh; 466 Evas_Coord mw, mh;
468 467
469 if (part && strcmp(part, "default")) return; 468 if (part && strcmp(part, "default")) return;
470 469
471 it = (Elm_Diskselector_Item *)item;
472 eina_stringshare_replace(&it->label, label); 470 eina_stringshare_replace(&it->label, label);
473 edje_object_part_text_escaped_set(VIEW(it), "elm.text", it->label); 471 edje_object_part_text_escaped_set(VIEW(it), "elm.text", it->label);
474 _item_signal_emit(it); 472 _item_signal_emit(it);
@@ -476,17 +474,17 @@ _item_text_set_hook(Elm_Object_Item *item,
476 evas_object_size_hint_min_set(VIEW(it), 0, mh); 474 evas_object_size_hint_min_set(VIEW(it), 0, mh);
477} 475}
478 476
479static const char * 477EOLIAN static const char *
480_item_text_get_hook(const Elm_Object_Item *it, 478_elm_diskselector_item_elm_widget_item_part_text_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
481 const char *part) 479 const char *part)
482{ 480{
483 if (part && strcmp(part, "default")) return NULL; 481 if (part && strcmp(part, "default")) return NULL;
484 482
485 return ((Elm_Diskselector_Item *)it)->label; 483 return it->label;
486} 484}
487 485
488static void 486static void
489_item_icon_set(Elm_Diskselector_Item *it, 487_item_icon_set(Elm_Diskselector_Item_Data *it,
490 Evas_Object *icon) 488 Evas_Object *icon)
491{ 489{
492 if (it->icon == icon) return; 490 if (it->icon == icon) return;
@@ -507,10 +505,10 @@ _item_icon_set(Elm_Diskselector_Item *it,
507} 505}
508 506
509static void 507static void
510_identical_item_check(Elm_Diskselector_Item *it, 508_identical_item_check(Elm_Diskselector_Item_Data *it,
511 Evas_Object *icon) 509 Evas_Object *icon)
512{ 510{
513 Elm_Diskselector_Item *dit; 511 Elm_Diskselector_Item_Data *dit;
514 Eina_List *l; 512 Eina_List *l;
515 int idx = 0; 513 int idx = 0;
516 int ic = 0; 514 int ic = 0;
@@ -556,24 +554,24 @@ _identical_item_check(Elm_Diskselector_Item *it,
556 } 554 }
557} 555}
558 556
559static void 557EOLIAN static void
560_item_content_set_hook(Elm_Object_Item *it, 558_elm_diskselector_item_elm_widget_item_part_content_set(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
561 const char *part, 559 const char *part,
562 Evas_Object *content) 560 Evas_Object *content)
563{ 561{
564 if (part && strcmp(part, "icon")) return; 562 if (part && strcmp(part, "icon")) return;
565 563
566 _item_icon_set((Elm_Diskselector_Item *)it, content); 564 _item_icon_set(it, content);
567 _identical_item_check((Elm_Diskselector_Item *)it, content); 565 _identical_item_check(it, content);
568} 566}
569 567
570static Evas_Object * 568EOLIAN static Evas_Object *
571_item_content_get_hook(const Elm_Object_Item *it, 569_elm_diskselector_item_elm_widget_item_part_content_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
572 const char *part) 570 const char *part)
573{ 571{
574 if (part && strcmp(part, "icon")) return NULL; 572 if (part && strcmp(part, "icon")) return NULL;
575 573
576 return ((Elm_Diskselector_Item *)it)->icon; 574 return it->icon;
577} 575}
578 576
579static void 577static void
@@ -582,7 +580,7 @@ _item_click_cb(void *data,
582 const char *emission EINA_UNUSED, 580 const char *emission EINA_UNUSED,
583 const char *source EINA_UNUSED) 581 const char *source EINA_UNUSED)
584{ 582{
585 Elm_Diskselector_Item *it = data; 583 Elm_Diskselector_Item_Data *it = data;
586 584
587 if (!it) return; 585 if (!it) return;
588 ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd); 586 ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd);
@@ -593,14 +591,14 @@ _item_click_cb(void *data,
593 _selected_item_indicate(sd->selected_item); 591 _selected_item_indicate(sd->selected_item);
594 } 592 }
595 593
596 if (it->func) it->func((void *)it->base.data, WIDGET(it), it); 594 if (it->func) it->func((void *)it->base->data, WIDGET(it), EO_OBJ(it));
597 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED, it); 595 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED, EO_OBJ(it));
598} 596}
599 597
600static char * 598static char *
601_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED) 599_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
602{ 600{
603 Elm_Diskselector_Item *it = (Elm_Diskselector_Item *)data; 601 Elm_Diskselector_Item_Data *it = (Elm_Diskselector_Item_Data *)data;
604 const char *txt = NULL; 602 const char *txt = NULL;
605 if (!it) return NULL; 603 if (!it) return NULL;
606 604
@@ -616,7 +614,7 @@ _access_on_highlight_cb(void *data)
616 Evas_Coord bx, by, bw, bh; 614 Evas_Coord bx, by, bw, bh;
617 Evas_Coord x, y, w, h; 615 Evas_Coord x, y, w, h;
618 616
619 Elm_Diskselector_Item *it = (Elm_Diskselector_Item *)data; 617 Elm_Diskselector_Item_Data *it = (Elm_Diskselector_Item_Data *)data;
620 618
621 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it); 619 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it);
622 ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd); 620 ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd);
@@ -631,27 +629,27 @@ _access_on_highlight_cb(void *data)
631 eo_do(WIDGET(it), elm_interface_scrollable_region_bring_in(x, y, w, h)); 629 eo_do(WIDGET(it), elm_interface_scrollable_region_bring_in(x, y, w, h));
632} 630}
633 631
634static Elm_Diskselector_Item * 632EOLIAN static void
633_elm_diskselector_item_eo_base_constructor(Eo *eo_it, Elm_Diskselector_Item_Data *it)
634{
635 eo_do_super(eo_it, ELM_DISKSELECTOR_ITEM_CLASS, eo_constructor());
636 it->base = eo_data_scope_get(eo_it, ELM_WIDGET_ITEM_CLASS);
637}
638
639static Elm_Diskselector_Item_Data *
635_item_new(Evas_Object *obj, 640_item_new(Evas_Object *obj,
636 Evas_Object *icon, 641 Evas_Object *icon,
637 const char *label, 642 const char *label,
638 Evas_Smart_Cb func, 643 Evas_Smart_Cb func,
639 const void *data) 644 const void *data)
640{ 645{
641 Elm_Diskselector_Item *it; 646 Eo *eo_it = eo_add(ELM_DISKSELECTOR_ITEM_CLASS, obj);
642 647 if (!eo_it) return NULL;
643 it = elm_widget_item_new(obj, Elm_Diskselector_Item); 648 ELM_DISKSELECTOR_ITEM_DATA_GET(eo_it, it);
644 if (!it) return NULL;
645
646 elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook);
647 elm_widget_item_text_set_hook_set(it, _item_text_set_hook);
648 elm_widget_item_text_get_hook_set(it, _item_text_get_hook);
649 elm_widget_item_content_set_hook_set(it, _item_content_set_hook);
650 elm_widget_item_content_get_hook_set(it, _item_content_get_hook);
651 649
652 it->label = eina_stringshare_add(label); 650 it->label = eina_stringshare_add(label);
653 it->func = func; 651 it->func = func;
654 it->base.data = data; 652 it->base->data = data;
655 VIEW(it) = edje_object_add(evas_object_evas_get(obj)); 653 VIEW(it) = edje_object_add(evas_object_evas_get(obj));
656 elm_widget_theme_object_set(obj, VIEW(it), "diskselector", "item", 654 elm_widget_theme_object_set(obj, VIEW(it), "diskselector", "item",
657 elm_widget_style_get(obj)); 655 elm_widget_style_get(obj));
@@ -662,11 +660,11 @@ _item_new(Evas_Object *obj,
662 evas_object_show(VIEW(it)); 660 evas_object_show(VIEW(it));
663 661
664 if (icon) 662 if (icon)
665 _item_content_set_hook((Elm_Object_Item *)it, "icon", icon); 663 eo_do(eo_it, elm_wdg_item_part_content_set("icon", icon));
666 664
667 if (it->label) 665 if (it->label)
668 { 666 {
669 _item_text_set_hook((Elm_Object_Item *)it, "default", it->label); 667 eo_do(eo_it, elm_wdg_item_part_text_set("default", it->label));
670 edje_object_signal_callback_add 668 edje_object_signal_callback_add
671 (VIEW(it), "elm,action,click", "*", _item_click_cb, it); 669 (VIEW(it), "elm,action,click", "*", _item_click_cb, it);
672 } 670 }
@@ -674,15 +672,15 @@ _item_new(Evas_Object *obj,
674 //XXX: ACCESS 672 //XXX: ACCESS
675 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON) 673 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
676 { 674 {
677 _elm_access_widget_item_register((Elm_Widget_Item_Data *)it); 675 _elm_access_widget_item_register(it->base);
678 676
679 _elm_access_text_set(_elm_access_info_get(it->base.access_obj), 677 _elm_access_text_set(_elm_access_info_get(it->base->access_obj),
680 ELM_ACCESS_TYPE, E_("diskselector item")); 678 ELM_ACCESS_TYPE, E_("diskselector item"));
681 _elm_access_callback_set(_elm_access_info_get(it->base.access_obj), 679 _elm_access_callback_set(_elm_access_info_get(it->base->access_obj),
682 ELM_ACCESS_INFO, 680 ELM_ACCESS_INFO,
683 _access_info_cb, it); 681 _access_info_cb, it);
684 _elm_access_on_highlight_hook_set( 682 _elm_access_on_highlight_hook_set(
685 _elm_access_info_get(it->base.access_obj), _access_on_highlight_cb, 683 _elm_access_info_get(it->base->access_obj), _access_on_highlight_cb,
686 it); 684 it);
687 } 685 }
688 686
@@ -794,7 +792,7 @@ EOLIAN static Eina_Bool
794_elm_diskselector_elm_widget_theme_apply(Eo *obj, Elm_Diskselector_Data *sd) 792_elm_diskselector_elm_widget_theme_apply(Eo *obj, Elm_Diskselector_Data *sd)
795{ 793{
796 Eina_List *l; 794 Eina_List *l;
797 Elm_Diskselector_Item *it; 795 Elm_Diskselector_Item_Data *it;
798 Evas_Object *blank; 796 Evas_Object *blank;
799 Eina_Bool int_ret = EINA_FALSE; 797 Eina_Bool int_ret = EINA_FALSE;
800 Evas *evas; 798 Evas *evas;
@@ -855,7 +853,7 @@ _elm_diskselector_elm_widget_sub_object_del(Eo *obj, Elm_Diskselector_Data *sd,
855{ 853{
856 Eina_Bool int_ret = EINA_FALSE; 854 Eina_Bool int_ret = EINA_FALSE;
857 855
858 Elm_Diskselector_Item *it; 856 Elm_Diskselector_Item_Data *it;
859 const Eina_List *l; 857 const Eina_List *l;
860 858
861 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_sub_object_del(sobj)); 859 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_sub_object_del(sobj));
@@ -913,10 +911,10 @@ _elm_diskselector_elm_widget_focus_next(Eo *obj, Elm_Diskselector_Data *sd, Elm_
913{ 911{
914 Eina_List *items = NULL; 912 Eina_List *items = NULL;
915 Eina_List *elist = NULL; 913 Eina_List *elist = NULL;
916 Elm_Diskselector_Item *it; 914 Elm_Diskselector_Item_Data *it;
917 915
918 EINA_LIST_FOREACH(sd->items, elist, it) 916 EINA_LIST_FOREACH(sd->items, elist, it)
919 items = eina_list_append(items, it->base.access_obj); 917 items = eina_list_append(items, it->base->access_obj);
920 918
921 if (!sd->round) 919 if (!sd->round)
922 { 920 {
@@ -938,7 +936,7 @@ static Eina_Bool
938_key_action_move(Evas_Object *obj, const char *params) 936_key_action_move(Evas_Object *obj, const char *params)
939{ 937{
940 ELM_DISKSELECTOR_DATA_GET(obj, sd); 938 ELM_DISKSELECTOR_DATA_GET(obj, sd);
941 Elm_Diskselector_Item *it = NULL; 939 Elm_Diskselector_Item_Data *it = NULL;
942 Eina_List *l = NULL; 940 Eina_List *l = NULL;
943 const char *dir = params; 941 const char *dir = params;
944 942
@@ -1056,7 +1054,7 @@ static void
1056_scroll_animate_stop_cb(Evas_Object *obj, 1054_scroll_animate_stop_cb(Evas_Object *obj,
1057 void *data EINA_UNUSED) 1055 void *data EINA_UNUSED)
1058{ 1056{
1059 Elm_Diskselector_Item *it; 1057 Elm_Diskselector_Item_Data *it;
1060 Evas_Coord x, w, ox, ow; 1058 Evas_Coord x, w, ox, ow;
1061 Eina_List *l, *list; 1059 Eina_List *l, *list;
1062 1060
@@ -1078,7 +1076,7 @@ _scroll_animate_stop_cb(Evas_Object *obj,
1078 1076
1079 if (!it) return; 1077 if (!it) return;
1080 _item_select(it); 1078 _item_select(it);
1081 evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_STOP, it); 1079 evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_STOP, EO_OBJ(it));
1082} 1080}
1083 1081
1084static void 1082static void
@@ -1107,21 +1105,21 @@ _scroll_drag_stop_cb(Evas_Object *obj,
1107 1105
1108static void 1106static void
1109_round_item_del(Elm_Diskselector_Data *sd, 1107_round_item_del(Elm_Diskselector_Data *sd,
1110 Elm_Diskselector_Item *it) 1108 Elm_Diskselector_Item_Data *it)
1111{ 1109{
1112 if (!it) return; 1110 if (!it) return;
1113 1111
1114 elm_box_unpack(sd->main_box, VIEW(it)); 1112 elm_box_unpack(sd->main_box, VIEW(it));
1115 sd->r_items = eina_list_remove(sd->r_items, it); 1113 sd->r_items = eina_list_remove(sd->r_items, it);
1116 eina_stringshare_del(it->label); 1114 eina_stringshare_del(it->label);
1117 elm_widget_item_free(it); 1115 eo_del((Eo *)EO_OBJ(it));
1118} 1116}
1119 1117
1120static void 1118static void
1121_round_items_del(Elm_Diskselector_Data *sd) 1119_round_items_del(Elm_Diskselector_Data *sd)
1122{ 1120{
1123 Eina_List *l; 1121 Eina_List *l;
1124 Elm_Diskselector_Item *it; 1122 Elm_Diskselector_Item_Data *it;
1125 1123
1126 _round_item_del(sd, sd->last); 1124 _round_item_del(sd, sd->last);
1127 sd->last = NULL; 1125 sd->last = NULL;
@@ -1165,9 +1163,9 @@ _icon_duplicate(Evas_Object *icon)
1165static void 1163static void
1166_round_items_add(Elm_Diskselector_Data *sd) 1164_round_items_add(Elm_Diskselector_Data *sd)
1167{ 1165{
1168 Elm_Diskselector_Item *temp_it; 1166 Elm_Diskselector_Item_Data *temp_it;
1169 Elm_Diskselector_Item *dit; 1167 Elm_Diskselector_Item_Data *dit;
1170 Elm_Diskselector_Item *it; 1168 Elm_Diskselector_Item_Data *it;
1171 int i = 0; 1169 int i = 0;
1172 1170
1173 dit = it = eina_list_nth(sd->items, 0); 1171 dit = it = eina_list_nth(sd->items, 0);
@@ -1177,7 +1175,7 @@ _round_items_add(Elm_Diskselector_Data *sd)
1177 { 1175 {
1178 sd->first = _item_new 1176 sd->first = _item_new
1179 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func, 1177 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func,
1180 it->base.data); 1178 it->base->data);
1181 sd->first->node = it->node; 1179 sd->first->node = it->node;
1182 sd->r_items = eina_list_append(sd->r_items, sd->first); 1180 sd->r_items = eina_list_append(sd->r_items, sd->first);
1183 } 1181 }
@@ -1190,7 +1188,7 @@ _round_items_add(Elm_Diskselector_Data *sd)
1190 { 1188 {
1191 sd->second = _item_new 1189 sd->second = _item_new
1192 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func, 1190 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func,
1193 it->base.data); 1191 it->base->data);
1194 sd->second->node = it->node; 1192 sd->second->node = it->node;
1195 sd->r_items = eina_list_append(sd->r_items, sd->second); 1193 sd->r_items = eina_list_append(sd->r_items, sd->second);
1196 } 1194 }
@@ -1203,7 +1201,7 @@ _round_items_add(Elm_Diskselector_Data *sd)
1203 if (!it) it = dit; 1201 if (!it) it = dit;
1204 temp_it = _item_new 1202 temp_it = _item_new
1205 (WIDGET(it), _icon_duplicate 1203 (WIDGET(it), _icon_duplicate
1206 (it->icon), it->label, it->func, it->base.data); 1204 (it->icon), it->label, it->func, it->base->data);
1207 sd->over_items = eina_list_append(sd->over_items, temp_it); 1205 sd->over_items = eina_list_append(sd->over_items, temp_it);
1208 sd->r_items = eina_list_append(sd->r_items, temp_it); 1206 sd->r_items = eina_list_append(sd->r_items, temp_it);
1209 } 1207 }
@@ -1215,7 +1213,7 @@ _round_items_add(Elm_Diskselector_Data *sd)
1215 { 1213 {
1216 sd->last = _item_new 1214 sd->last = _item_new
1217 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func, 1215 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func,
1218 it->base.data); 1216 it->base->data);
1219 sd->last->node = it->node; 1217 sd->last->node = it->node;
1220 sd->r_items = eina_list_prepend(sd->r_items, sd->last); 1218 sd->r_items = eina_list_prepend(sd->r_items, sd->last);
1221 } 1219 }
@@ -1227,7 +1225,7 @@ _round_items_add(Elm_Diskselector_Data *sd)
1227 { 1225 {
1228 sd->s_last = _item_new 1226 sd->s_last = _item_new
1229 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func, 1227 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func,
1230 it->base.data); 1228 it->base->data);
1231 sd->s_last->node = it->node; 1229 sd->s_last->node = it->node;
1232 sd->r_items = eina_list_prepend(sd->r_items, sd->s_last); 1230 sd->r_items = eina_list_prepend(sd->r_items, sd->s_last);
1233 } 1231 }
@@ -1239,7 +1237,7 @@ _round_items_add(Elm_Diskselector_Data *sd)
1239 if (!it) it = dit; 1237 if (!it) it = dit;
1240 temp_it = _item_new 1238 temp_it = _item_new
1241 (WIDGET(it), _icon_duplicate 1239 (WIDGET(it), _icon_duplicate
1242 (it->icon), it->label, it->func, it->base.data); 1240 (it->icon), it->label, it->func, it->base->data);
1243 sd->under_items = eina_list_append(sd->under_items, temp_it); 1241 sd->under_items = eina_list_append(sd->under_items, temp_it);
1244 sd->r_items = eina_list_prepend(sd->r_items, temp_it); 1242 sd->r_items = eina_list_prepend(sd->r_items, temp_it);
1245 } 1243 }
@@ -1325,7 +1323,7 @@ _elm_diskselector_evas_object_smart_add(Eo *obj, Elm_Diskselector_Data *priv)
1325EOLIAN static void 1323EOLIAN static void
1326_elm_diskselector_evas_object_smart_del(Eo *obj, Elm_Diskselector_Data *sd) 1324_elm_diskselector_evas_object_smart_del(Eo *obj, Elm_Diskselector_Data *sd)
1327{ 1325{
1328 Elm_Diskselector_Item *it; 1326 Elm_Diskselector_Item_Data *it;
1329 Eina_List *l; 1327 Eina_List *l;
1330 Evas_Object *blank; 1328 Evas_Object *blank;
1331 1329
@@ -1341,28 +1339,28 @@ _elm_diskselector_evas_object_smart_del(Eo *obj, Elm_Diskselector_Data *sd)
1341 { 1339 {
1342 eina_stringshare_del(sd->last->label); 1340 eina_stringshare_del(sd->last->label);
1343 evas_object_del(sd->VIEW(last)); 1341 evas_object_del(sd->VIEW(last));
1344 free(sd->last); 1342 eo_del((Eo *)EO_OBJ(sd->last));
1345 } 1343 }
1346 1344
1347 if (sd->s_last) 1345 if (sd->s_last)
1348 { 1346 {
1349 eina_stringshare_del(sd->s_last->label); 1347 eina_stringshare_del(sd->s_last->label);
1350 evas_object_del(sd->VIEW(s_last)); 1348 evas_object_del(sd->VIEW(s_last));
1351 free(sd->s_last); 1349 eo_del((Eo *)EO_OBJ(sd->s_last));
1352 } 1350 }
1353 1351
1354 if (sd->second) 1352 if (sd->second)
1355 { 1353 {
1356 eina_stringshare_del(sd->second->label); 1354 eina_stringshare_del(sd->second->label);
1357 evas_object_del(sd->VIEW(second)); 1355 evas_object_del(sd->VIEW(second));
1358 free(sd->second); 1356 eo_del((Eo *)EO_OBJ(sd->second));
1359 } 1357 }
1360 1358
1361 if (sd->first) 1359 if (sd->first)
1362 { 1360 {
1363 eina_stringshare_del(sd->first->label); 1361 eina_stringshare_del(sd->first->label);
1364 evas_object_del(sd->VIEW(first)); 1362 evas_object_del(sd->VIEW(first));
1365 free(sd->first); 1363 eo_del((Eo *)EO_OBJ(sd->first));
1366 } 1364 }
1367 1365
1368 EINA_LIST_FOREACH(sd->under_items, l, it) 1366 EINA_LIST_FOREACH(sd->under_items, l, it)
@@ -1371,7 +1369,7 @@ _elm_diskselector_evas_object_smart_del(Eo *obj, Elm_Diskselector_Data *sd)
1371 { 1369 {
1372 eina_stringshare_del(it->label); 1370 eina_stringshare_del(it->label);
1373 evas_object_del(VIEW(it)); 1371 evas_object_del(VIEW(it));
1374 free(it); 1372 eo_del((Eo *)EO_OBJ(it));
1375 } 1373 }
1376 } 1374 }
1377 1375
@@ -1381,14 +1379,14 @@ _elm_diskselector_evas_object_smart_del(Eo *obj, Elm_Diskselector_Data *sd)
1381 { 1379 {
1382 eina_stringshare_del(it->label); 1380 eina_stringshare_del(it->label);
1383 evas_object_del(VIEW(it)); 1381 evas_object_del(VIEW(it));
1384 free(it); 1382 eo_del((Eo *)EO_OBJ(it));
1385 } 1383 }
1386 } 1384 }
1387 1385
1388 EINA_LIST_FREE(sd->items, it) 1386 EINA_LIST_FREE(sd->items, it)
1389 { 1387 {
1390 _item_del(it); 1388 _item_del(it);
1391 elm_widget_item_free(it); 1389 eo_del((Eo *)EO_OBJ(it));
1392 } 1390 }
1393 sd->r_items = eina_list_free(sd->r_items); 1391 sd->r_items = eina_list_free(sd->r_items);
1394 1392
@@ -1458,7 +1456,7 @@ EOLIAN static void
1458_elm_diskselector_round_enabled_set(Eo *obj, Elm_Diskselector_Data *sd, Eina_Bool enabled) 1456_elm_diskselector_round_enabled_set(Eo *obj, Elm_Diskselector_Data *sd, Eina_Bool enabled)
1459{ 1457{
1460 Eina_List *elist; 1458 Eina_List *elist;
1461 Elm_Diskselector_Item *it; 1459 Elm_Diskselector_Item_Data *it;
1462 Evas_Object *blank; 1460 Evas_Object *blank;
1463 1461
1464 if (sd->round == enabled) 1462 if (sd->round == enabled)
@@ -1607,7 +1605,7 @@ _elm_diskselector_elm_interface_scrollable_policy_set(Eo *obj, Elm_Diskselector_
1607EOLIAN static void 1605EOLIAN static void
1608_elm_diskselector_clear(Eo *obj, Elm_Diskselector_Data *sd) 1606_elm_diskselector_clear(Eo *obj, Elm_Diskselector_Data *sd)
1609{ 1607{
1610 Elm_Diskselector_Item *it; 1608 Elm_Diskselector_Item_Data *it;
1611 1609
1612 if (!sd->items) return; 1610 if (!sd->items) return;
1613 1611
@@ -1615,7 +1613,7 @@ _elm_diskselector_clear(Eo *obj, Elm_Diskselector_Data *sd)
1615 EINA_LIST_FREE(sd->items, it) 1613 EINA_LIST_FREE(sd->items, it)
1616 { 1614 {
1617 _item_del(it); 1615 _item_del(it);
1618 elm_widget_item_free(it); 1616 eo_del((Eo *)EO_OBJ(it));
1619 } 1617 }
1620 1618
1621 _round_items_del(sd); 1619 _round_items_del(sd);
@@ -1632,7 +1630,7 @@ _elm_diskselector_items_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
1632EOLIAN static Elm_Object_Item* 1630EOLIAN static Elm_Object_Item*
1633_elm_diskselector_item_append(Eo *obj, Elm_Diskselector_Data *sd, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) 1631_elm_diskselector_item_append(Eo *obj, Elm_Diskselector_Data *sd, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
1634{ 1632{
1635 Elm_Diskselector_Item *it, *dit; 1633 Elm_Diskselector_Item_Data *it, *dit;
1636 Eina_List *elist; 1634 Eina_List *elist;
1637 1635
1638 Evas *evas; 1636 Evas *evas;
@@ -1688,21 +1686,26 @@ _elm_diskselector_item_append(Eo *obj, Elm_Diskselector_Data *sd, const char *la
1688 evas_event_thaw(evas); 1686 evas_event_thaw(evas);
1689 evas_event_thaw_eval(evas); 1687 evas_event_thaw_eval(evas);
1690 1688
1691 return (Elm_Object_Item *)it; 1689 return EO_OBJ(it);
1692} 1690}
1693 1691
1694EOLIAN static Elm_Object_Item* 1692EOLIAN static Elm_Object_Item*
1695_elm_diskselector_selected_item_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd) 1693_elm_diskselector_selected_item_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
1696{ 1694{
1697 return (Elm_Object_Item *)sd->selected_item; 1695 return sd->selected_item?EO_OBJ(sd->selected_item):NULL;
1698} 1696}
1699 1697
1700EAPI void 1698EAPI void
1701elm_diskselector_item_selected_set(Elm_Object_Item *item, 1699elm_diskselector_item_selected_set(Elm_Object_Item *item,
1702 Eina_Bool selected) 1700 Eina_Bool selected)
1703{ 1701{
1704 Elm_Diskselector_Item *it = (Elm_Diskselector_Item *)item; 1702 eo_do((Eo *)item, elm_obj_diskselector_item_selected_set(selected));
1703}
1705 1704
1705EOLIAN static void
1706_elm_diskselector_item_selected_set(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it,
1707 Eina_Bool selected)
1708{
1706 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it); 1709 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it);
1707 ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd); 1710 ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd);
1708 1711
@@ -1718,37 +1721,55 @@ elm_diskselector_item_selected_set(Elm_Object_Item *item,
1718 } 1721 }
1719 1722
1720 if (!sd->scroller_move_idle_enterer) 1723 if (!sd->scroller_move_idle_enterer)
1721 sd->scroller_move_idle_enterer = ecore_idle_enterer_before_add(_scroller_move, WIDGET(item)); 1724 sd->scroller_move_idle_enterer = ecore_idle_enterer_before_add(_scroller_move, WIDGET(it));
1722} 1725}
1723 1726
1724EAPI Eina_Bool 1727EAPI Eina_Bool
1725elm_diskselector_item_selected_get(const Elm_Object_Item *it) 1728elm_diskselector_item_selected_get(const Elm_Object_Item *it)
1726{ 1729{
1730 return eo_do((Eo *)it, elm_obj_diskselector_item_selected_get());
1731}
1732
1733EOLIAN static Eina_Bool
1734_elm_diskselector_item_selected_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it)
1735{
1727 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 1736 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
1728 ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd); 1737 ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd);
1729 1738
1730 return sd->selected_item == ((Elm_Diskselector_Item *)it); 1739 return sd->selected_item == it;
1731} 1740}
1732 1741
1733EAPI Elm_Object_Item * 1742EAPI Elm_Object_Item *
1734elm_diskselector_item_prev_get(const Elm_Object_Item *item) 1743elm_diskselector_item_prev_get(const Elm_Object_Item *item)
1735{ 1744{
1736 Elm_Diskselector_Item *it = (Elm_Diskselector_Item *)item; 1745 return eo_do((Eo *)item, elm_obj_diskselector_item_prev_get());
1746}
1737 1747
1748EOLIAN static Elm_Object_Item *
1749_elm_diskselector_item_prev_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it)
1750{
1738 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL); 1751 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL);
1752 Elm_Diskselector_Item_Data *prev_it = NULL;
1739 1753
1740 if (it->node->prev) return it->node->prev->data; 1754 if (it->node->prev) prev_it = it->node->prev->data;
1755 if (prev_it) return EO_OBJ(prev_it);
1741 else return NULL; 1756 else return NULL;
1742} 1757}
1743 1758
1744EAPI Elm_Object_Item * 1759EAPI Elm_Object_Item *
1745elm_diskselector_item_next_get(const Elm_Object_Item *item) 1760elm_diskselector_item_next_get(const Elm_Object_Item *item)
1746{ 1761{
1747 Elm_Diskselector_Item *it = (Elm_Diskselector_Item *)item; 1762 return eo_do((Eo *)item, elm_obj_diskselector_item_next_get());
1763}
1748 1764
1765EOLIAN static Elm_Object_Item *
1766_elm_diskselector_item_next_get(Eo *eo_it EINA_UNUSED, Elm_Diskselector_Item_Data *it)
1767{
1749 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL); 1768 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL);
1769 Elm_Diskselector_Item_Data *next_it = NULL;
1750 1770
1751 if (it->node->next) return it->node->next->data; 1771 if (it->node->next) next_it = it->node->next->data;
1772 if (next_it) return EO_OBJ(next_it);
1752 else return NULL; 1773 else return NULL;
1753} 1774}
1754 1775
@@ -1756,14 +1777,18 @@ EOLIAN static Elm_Object_Item*
1756_elm_diskselector_first_item_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd) 1777_elm_diskselector_first_item_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
1757{ 1778{
1758 if (!sd || !sd->items) return NULL; 1779 if (!sd || !sd->items) return NULL;
1759 else return eina_list_data_get(sd->items); 1780 Elm_Diskselector_Item_Data *it = eina_list_data_get(sd->items);
1781 if (it) return EO_OBJ(it);
1782 else return NULL;
1760} 1783}
1761 1784
1762EOLIAN static Elm_Object_Item* 1785EOLIAN static Elm_Object_Item*
1763_elm_diskselector_last_item_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd) 1786_elm_diskselector_last_item_get(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
1764{ 1787{
1765 if (!sd->items) return NULL; 1788 if (!sd->items) return NULL;
1766 else return eina_list_data_get(eina_list_last(sd->items)); 1789 Elm_Diskselector_Item_Data *it = eina_list_data_get(eina_list_last(sd->items));
1790 if (it) return EO_OBJ(it);
1791 else return NULL;
1767} 1792}
1768 1793
1769EOLIAN static void 1794EOLIAN static void
@@ -1805,3 +1830,4 @@ _elm_diskselector_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA
1805} 1830}
1806 1831
1807#include "elm_diskselector.eo.c" 1832#include "elm_diskselector.eo.c"
1833#include "elm_diskselector_item.eo.c"
diff --git a/src/lib/elm_diskselector_common.h b/src/lib/elm_diskselector_common.h
index 9467d012d..a280e4c3a 100644
--- a/src/lib/elm_diskselector_common.h
+++ b/src/lib/elm_diskselector_common.h
@@ -1,80 +1,8 @@
1/**
2 * Set the selected state of an item.
3 *
4 * @param it The diskselector item
5 * @param selected The selected state
6 *
7 * This sets the selected state of the given item @p it.
8 * @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
9 *
10 * If a new item is selected the previously selected will be unselected.
11 * Previously selected item can be get with function
12 * elm_diskselector_selected_item_get().
13 *
14 * If the item @p it is unselected, the first item of diskselector will
15 * be selected.
16 *
17 * Selected items will be visible on center position of diskselector.
18 * So if it was on another position before selected, or was invisible,
19 * diskselector will animate items until the selected item reaches center
20 * position.
21 *
22 * @see elm_diskselector_item_selected_get()
23 * @see elm_diskselector_selected_item_get()
24 *
25 * @ingroup Diskselector
26 */
27EAPI void elm_diskselector_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); 1EAPI void elm_diskselector_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
28 2
29/*
30 * Get whether the @p item is selected or not.
31 *
32 * @param it The diskselector item.
33 * @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates
34 * it's not. If @p obj is @c NULL, @c EINA_FALSE is returned.
35 *
36 * @see elm_diskselector_selected_item_set() for details.
37 * @see elm_diskselector_item_selected_get()
38 *
39 * @ingroup Diskselector
40 */
41EAPI Eina_Bool elm_diskselector_item_selected_get(const Elm_Object_Item *it); 3EAPI Eina_Bool elm_diskselector_item_selected_get(const Elm_Object_Item *it);
42 4
43/**
44 * Get the item before @p item in diskselector.
45 *
46 * @param it The diskselector item.
47 * @return The item before @p item, or @c NULL if none or on failure.
48 *
49 * The list of items follows append order. So it will return item appended
50 * just before @p item and that wasn't deleted.
51 *
52 * If it is the first item, @c NULL will be returned.
53 * First item can be get by elm_diskselector_first_item_get().
54 *
55 * @see elm_diskselector_item_append()
56 * @see elm_diskselector_items_get()
57 *
58 * @ingroup Diskselector
59 */
60EAPI Elm_Object_Item *elm_diskselector_item_prev_get(const Elm_Object_Item *it); 5EAPI Elm_Object_Item *elm_diskselector_item_prev_get(const Elm_Object_Item *it);
61 6
62/**
63 * Get the item after @p item in diskselector.
64 *
65 * @param it The diskselector item.
66 * @return The item after @p item, or @c NULL if none or on failure.
67 *
68 * The list of items follows append order. So it will return item appended
69 * just after @p item and that wasn't deleted.
70 *
71 * If it is the last item, @c NULL will be returned.
72 * Last item can be get by elm_diskselector_last_item_get().
73 *
74 * @see elm_diskselector_item_append()
75 * @see elm_diskselector_items_get()
76 *
77 * @ingroup Diskselector
78 */
79EAPI Elm_Object_Item *elm_diskselector_item_next_get(const Elm_Object_Item *it); 7EAPI Elm_Object_Item *elm_diskselector_item_next_get(const Elm_Object_Item *it);
80 8
diff --git a/src/lib/elm_diskselector_item.eo b/src/lib/elm_diskselector_item.eo
new file mode 100644
index 000000000..71173d3a0
--- /dev/null
+++ b/src/lib/elm_diskselector_item.eo
@@ -0,0 +1,105 @@
1class Elm_Diskselector_Item(Elm_Widget_Item)
2{
3 legacy_prefix: null;
4 eo_prefix: elm_obj_diskselector_item;
5 properties {
6 prev {
7 get {
8 /*@
9 Get the item before @p item in diskselector.
10
11 The list of items follows append order. So it will return item appended
12 just before @p item and that wasn't deleted.
13
14 If it is the first item, @c NULL will be returned.
15 First item can be get by elm_diskselector_first_item_get().
16
17 @see elm_diskselector_item_append()
18 @see elm_diskselector_items_get()
19
20 @ingroup Diskselector
21 */
22 }
23 values {
24 Elm_Object_Item *item; /*@ The item before @p item, or @c NULL if none or on failure. */
25 }
26 }
27 next {
28 get {
29 /*@
30 Get the item after @p item in diskselector.
31
32 The list of items follows append order. So it will return item appended
33 just after @p item and that wasn't deleted.
34
35 If it is the last item, @c NULL will be returned.
36 Last item can be get by elm_diskselector_last_item_get().
37
38 @see elm_diskselector_item_append()
39 @see elm_diskselector_items_get()
40
41 @ingroup Diskselector
42 */
43 }
44 values {
45 Elm_Object_Item *item; /*@ The item after @p item, or @c NULL if none or on failure. */
46 }
47 }
48 selected {
49 get {
50 /*@
51 Get whether the @p item is selected or not.
52
53 @see elm_diskselector_selected_item_set() for details.
54 @see elm_diskselector_item_selected_get()
55
56 @ingroup Diskselector
57 */
58 }
59 set {
60 /*@
61 Set the selected state of an item.
62
63 This sets the selected state of the given item @p it.
64 @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
65
66 If a new item is selected the previously selected will be unselected.
67 Previously selected item can be get with function
68 elm_diskselector_selected_item_get().
69
70 If the item @p it is unselected, the first item of diskselector will
71 be selected.
72
73 Selected items will be visible on center position of diskselector.
74 So if it was on another position before selected, or was invisible,
75 diskselector will animate items until the selected item reaches center
76 position.
77
78 @see elm_diskselector_item_selected_get()
79 @see elm_diskselector_selected_item_get()
80
81 @ingroup Diskselector
82 */
83 }
84 values {
85 Eina_Bool selected; /*@ The selected state */
86 }
87 }
88 }
89 methods {
90 /* init { FIXME
91 params {
92 Evas_Smart_Cb func;
93 const(void)* data;
94 }
95 }*/
96 }
97 implements {
98 Eo.Base.constructor;
99 Elm_Widget_Item.del_pre;
100 Elm_Widget_Item.part_text.get;
101 Elm_Widget_Item.part_text.set;
102 Elm_Widget_Item.part_content.get;
103 Elm_Widget_Item.part_content.set;
104 }
105}
diff --git a/src/lib/elm_widget_diskselector.h b/src/lib/elm_widget_diskselector.h
index 1f8f408ea..b2e816a72 100644
--- a/src/lib/elm_widget_diskselector.h
+++ b/src/lib/elm_widget_diskselector.h
@@ -9,6 +9,7 @@
9 * IT AT RUNTIME. 9 * IT AT RUNTIME.
10 */ 10 */
11 11
12#include "elm_object_item_migration_temp.h"
12/** 13/**
13 * @addtogroup Widget 14 * @addtogroup Widget
14 * @{ 15 * @{
@@ -24,18 +25,18 @@
24 * Base widget smart data extended with diskselector instance data. 25 * Base widget smart data extended with diskselector instance data.
25 */ 26 */
26typedef struct _Elm_Diskselector_Data Elm_Diskselector_Data; 27typedef struct _Elm_Diskselector_Data Elm_Diskselector_Data;
27typedef struct _Elm_Diskselector_Item Elm_Diskselector_Item; 28typedef struct _Elm_Diskselector_Item_Data Elm_Diskselector_Item_Data;
28 29
29struct _Elm_Diskselector_Data 30struct _Elm_Diskselector_Data
30{ 31{
31 Evas_Object *hit_rect; 32 Evas_Object *hit_rect;
32 33
33 Evas_Object *main_box; 34 Evas_Object *main_box;
34 Elm_Diskselector_Item *selected_item; 35 Elm_Diskselector_Item_Data *selected_item;
35 Elm_Diskselector_Item *first; 36 Elm_Diskselector_Item_Data *first;
36 Elm_Diskselector_Item *second; 37 Elm_Diskselector_Item_Data *second;
37 Elm_Diskselector_Item *s_last; 38 Elm_Diskselector_Item_Data *s_last;
38 Elm_Diskselector_Item *last; 39 Elm_Diskselector_Item_Data *last;
39 Eina_List *items; 40 Eina_List *items;
40 Eina_List *r_items; 41 Eina_List *r_items;
41 Eina_List *over_items; 42 Eina_List *over_items;
@@ -56,9 +57,9 @@ struct _Elm_Diskselector_Data
56 Eina_Bool right_boundary_reached:1; 57 Eina_Bool right_boundary_reached:1;
57}; 58};
58 59
59struct _Elm_Diskselector_Item 60struct _Elm_Diskselector_Item_Data
60{ 61{
61 ELM_WIDGET_ITEM; 62 Elm_Widget_Item_Data *base;
62 63
63 Eina_List *node; 64 Eina_List *node;
64 Evas_Object *icon; 65 Evas_Object *icon;
@@ -96,16 +97,19 @@ struct _Elm_Diskselector_Item
96 return 97 return
97 98
98#define ELM_DISKSELECTOR_ITEM_CHECK(it) \ 99#define ELM_DISKSELECTOR_ITEM_CHECK(it) \
99 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, ); \ 100 ELM_WIDGET_ITEM_CHECK_OR_RETURN(it->base, ); \
100 ELM_DISKSELECTOR_CHECK(it->base.widget); 101 ELM_DISKSELECTOR_CHECK(it->base->widget);
101 102
102#define ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, ...) \ 103#define ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, ...) \
103 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, __VA_ARGS__); \ 104 ELM_WIDGET_ITEM_CHECK_OR_RETURN(it->base, __VA_ARGS__); \
104 ELM_DISKSELECTOR_CHECK(it->base.widget) __VA_ARGS__; 105 ELM_DISKSELECTOR_CHECK(it->base->widget) __VA_ARGS__;
105 106
106#define ELM_DISKSELECTOR_ITEM_CHECK_OR_GOTO(it, label) \ 107#define ELM_DISKSELECTOR_ITEM_CHECK_OR_GOTO(it, label) \
107 ELM_WIDGET_ITEM_CHECK_OR_GOTO((Elm_Widget_Item_Data *)it, label); \ 108 ELM_WIDGET_ITEM_CHECK_OR_GOTO(it->base, label); \
108 if (!it->base.widget || !eo_isa((it->base.widget), ELM_DISKSELECTOR_CLASS)) \ 109 if (!it->base->widget || !eo_isa((it->base->widget), ELM_DISKSELECTOR_CLASS)) \
109 goto label; 110 goto label;
110 111
112#define ELM_DISKSELECTOR_ITEM_DATA_GET(o, sd) \
113 Elm_Diskselector_Item_Data* sd = eo_data_scope_get((Eo *)o, ELM_DISKSELECTOR_ITEM_CLASS)
114
111#endif 115#endif