summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYossi Kantor <yossi.kantor@samsung.com>2014-07-07 11:07:53 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-17 15:08:42 +0300
commit5c9f23b5c440d4893e6a2bf0afbcd9929ddd35cd (patch)
treedaf7032142cf51f7ef6ebaf4b7a7a603af4ec31a
parent32c20501438751b9a90d2cc09a77df8b16938d27 (diff)
Porting to Eo: Elm Multibuttonentry Item
-rw-r--r--src/lib/Makefile.am11
-rw-r--r--src/lib/elc_multibuttonentry.c259
-rw-r--r--src/lib/elc_multibuttonentry_legacy.h34
-rw-r--r--src/lib/elm_multibuttonentry_item.eo55
-rw-r--r--src/lib/elm_widget_multibuttonentry.h20
5 files changed, 228 insertions, 151 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index a2566cc78..179e20d07 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -863,7 +863,9 @@ BUILT_SOURCES = \
863 elm_ctxpopup_item.eo.c \ 863 elm_ctxpopup_item.eo.c \
864 elm_ctxpopup_item.eo.h \ 864 elm_ctxpopup_item.eo.h \
865 elm_index_item.eo.c \ 865 elm_index_item.eo.c \
866 elm_index_item.eo.h 866 elm_index_item.eo.h \
867 elm_multibuttonentry_item.eo.c \
868 elm_multibuttonentry_item.eo.h
867 869
868elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@ 870elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@
869elementaryeolianfiles_DATA = \ 871elementaryeolianfiles_DATA = \
@@ -967,7 +969,8 @@ elementaryeolianfiles_DATA = \
967 elm_flipselector_item.eo \ 969 elm_flipselector_item.eo \
968 elm_menu_item.eo \ 970 elm_menu_item.eo \
969 elm_ctxpopup_item.eo \ 971 elm_ctxpopup_item.eo \
970 elm_index_item.eo 972 elm_index_item.eo \
973 elm_multibuttonentry_item.eo
971 974
972EXTRA_DIST += ${elementaryeolianfiles_DATA} 975EXTRA_DIST += ${elementaryeolianfiles_DATA}
973 976
@@ -1071,6 +1074,7 @@ nodist_includesunstable_HEADERS = \
1071 elm_flipselector_item.eo.h \ 1074 elm_flipselector_item.eo.h \
1072 elm_menu_item.eo.h \ 1075 elm_menu_item.eo.h \
1073 elm_index_item.eo.h \ 1076 elm_index_item.eo.h \
1077 elm_multibuttonentry_item.eo.h \
1074 elm_ctxpopup_item.eo.h \ 1078 elm_ctxpopup_item.eo.h \
1075 elm_slideshow_item.eo.h \ 1079 elm_slideshow_item.eo.h \
1076 elm_layout.eo.legacy.h \ 1080 elm_layout.eo.legacy.h \
@@ -1145,7 +1149,8 @@ nodist_includesunstable_HEADERS = \
1145 elm_flipselector_item.eo.legacy.h \ 1149 elm_flipselector_item.eo.legacy.h \
1146 elm_menu_item.eo.legacy.h \ 1150 elm_menu_item.eo.legacy.h \
1147 elm_ctxpopup_item.eo.legacy.h \ 1151 elm_ctxpopup_item.eo.legacy.h \
1148 elm_index_item.eo.legacy.h 1152 elm_index_item.eo.legacy.h \
1153 elm_multibuttonentry_item.eo.legacy.h
1149 1154
1150if HAVE_CXX11 1155if HAVE_CXX11
1151 1156
diff --git a/src/lib/elc_multibuttonentry.c b/src/lib/elc_multibuttonentry.c
index 14f050ce2..ab46abeda 100644
--- a/src/lib/elc_multibuttonentry.c
+++ b/src/lib/elc_multibuttonentry.c
@@ -2,6 +2,7 @@
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_multibuttonentry.h" 8#include "elm_widget_multibuttonentry.h"
@@ -46,11 +47,11 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
46EOLIAN static Eina_Bool 47EOLIAN static Eina_Bool
47_elm_multibuttonentry_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd) 48_elm_multibuttonentry_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
48{ 49{
49 Elm_Multibuttonentry_Item *it; 50 Elm_Object_Item *it;
50 Eina_List *l; 51 Eina_List *l;
51 52
52 EINA_LIST_FOREACH(sd->items, l, it) 53 EINA_LIST_FOREACH(sd->items, l, it)
53 elm_widget_item_translate(it); 54 eo_do((Eo *)it, elm_wdg_item_translate());
54 55
55 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate()); 56 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate());
56 57
@@ -70,14 +71,15 @@ EOLIAN static Eina_Bool
70_elm_multibuttonentry_elm_widget_theme_apply(Eo *obj, Elm_Multibuttonentry_Data *sd) 71_elm_multibuttonentry_elm_widget_theme_apply(Eo *obj, Elm_Multibuttonentry_Data *sd)
71{ 72{
72 Eina_List *l; 73 Eina_List *l;
73 Elm_Multibuttonentry_Item *item; 74 Elm_Object_Item *eo_item;
74 75
75 Eina_Bool int_ret = EINA_FALSE; 76 Eina_Bool int_ret = EINA_FALSE;
76 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply()); 77 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply());
77 if (!int_ret) return EINA_FALSE; 78 if (!int_ret) return EINA_FALSE;
78 79
79 EINA_LIST_FOREACH(sd->items, l, item) 80 EINA_LIST_FOREACH(sd->items, l, eo_item)
80 { 81 {
82 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
81 if (item->button) 83 if (item->button)
82 elm_widget_theme_object_set 84 elm_widget_theme_object_set
83 (obj, item->button, "multibuttonentry", "btn", 85 (obj, item->button, "multibuttonentry", "btn",
@@ -135,7 +137,7 @@ _shrink_mode_set(Evas_Object *obj,
135{ 137{
136 int count; 138 int count;
137 Eina_List *l; 139 Eina_List *l;
138 Elm_Multibuttonentry_Item *item; 140 Elm_Object_Item *eo_item;
139 141
140 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd); 142 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
141 143
@@ -157,8 +159,9 @@ _shrink_mode_set(Evas_Object *obj,
157 elm_box_padding_get(sd->box, &box_inner_item_width_padding, NULL); 159 elm_box_padding_get(sd->box, &box_inner_item_width_padding, NULL);
158 // unpack all items and entry 160 // unpack all items and entry
159 elm_box_unpack_all(sd->box); 161 elm_box_unpack_all(sd->box);
160 EINA_LIST_FOREACH(sd->items, l, item) 162 EINA_LIST_FOREACH(sd->items, l, eo_item)
161 { 163 {
164 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
162 evas_object_hide(item->button); 165 evas_object_hide(item->button);
163 item->visible = EINA_FALSE; 166 item->visible = EINA_FALSE;
164 } 167 }
@@ -173,14 +176,15 @@ _shrink_mode_set(Evas_Object *obj,
173 w -= box_inner_item_width_padding; 176 w -= box_inner_item_width_padding;
174 } 177 }
175 178
176 item = NULL; 179 eo_item = NULL;
177 count = eina_list_count(sd->items); 180 count = eina_list_count(sd->items);
178 181
179 EINA_LIST_FOREACH(sd->items, l, item) 182 EINA_LIST_FOREACH(sd->items, l, eo_item)
180 { 183 {
181 Evas_Coord w_label_count = 0, h = 0; 184 Evas_Coord w_label_count = 0, h = 0;
182 char *buf; 185 char *buf;
183 186
187 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
184 elm_box_pack_end(sd->box, item->button); 188 elm_box_pack_end(sd->box, item->button);
185 evas_object_show(item->button); 189 evas_object_show(item->button);
186 item->visible = EINA_TRUE; 190 item->visible = EINA_TRUE;
@@ -236,8 +240,9 @@ _shrink_mode_set(Evas_Object *obj,
236 { 240 {
237 // unpack all items and entry 241 // unpack all items and entry
238 elm_box_unpack_all(sd->box); 242 elm_box_unpack_all(sd->box);
239 EINA_LIST_FOREACH(sd->items, l, item) 243 EINA_LIST_FOREACH(sd->items, l, eo_item)
240 { 244 {
245 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
241 evas_object_hide(item->button); 246 evas_object_hide(item->button);
242 item->visible = EINA_FALSE; 247 item->visible = EINA_FALSE;
243 } 248 }
@@ -248,9 +253,10 @@ _shrink_mode_set(Evas_Object *obj,
248 if (sd->label) elm_box_pack_end(sd->box, sd->label); 253 if (sd->label) elm_box_pack_end(sd->box, sd->label);
249 254
250 // pack remain btns 255 // pack remain btns
251 item = NULL; 256 eo_item = NULL;
252 EINA_LIST_FOREACH(sd->items, l, item) 257 EINA_LIST_FOREACH(sd->items, l, eo_item)
253 { 258 {
259 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
254 elm_box_pack_end(sd->box, item->button); 260 elm_box_pack_end(sd->box, item->button);
255 evas_object_show(item->button); 261 evas_object_show(item->button);
256 item->visible = EINA_TRUE; 262 item->visible = EINA_TRUE;
@@ -332,26 +338,27 @@ end:
332} 338}
333 339
334static void 340static void
335_button_item_del(Elm_Multibuttonentry_Item *item) 341_button_item_del(Elm_Multibuttonentry_Item_Data *item)
336{ 342{
337 Eina_List *l; 343 Eina_List *l;
338 Elm_Multibuttonentry_Item *it; 344 Elm_Object_Item *eo_it;
339 Evas_Object *obj = WIDGET(item); 345 Evas_Object *obj = WIDGET(item);
340 346
341 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd); 347 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
342 348
343 EINA_LIST_FOREACH(sd->items, l, it) 349 EINA_LIST_FOREACH(sd->items, l, eo_it)
344 { 350 {
351 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_it, it);
345 if (it == item) 352 if (it == item)
346 { 353 {
347 sd->items = eina_list_remove(sd->items, it); 354 sd->items = eina_list_remove(sd->items, eo_it);
348 elm_box_unpack(sd->box, it->button); 355 elm_box_unpack(sd->box, it->button);
349 356
350 evas_object_smart_callback_call(obj, SIG_ITEM_DELETED, it); 357 evas_object_smart_callback_call(obj, SIG_ITEM_DELETED, eo_it);
351 358
352 evas_object_del(it->button); 359 evas_object_del(it->button);
353 360
354 if (sd->selected_it == (Elm_Object_Item *)it) 361 if (sd->selected_it == it)
355 sd->selected_it = NULL; 362 sd->selected_it = NULL;
356 break; 363 break;
357 } 364 }
@@ -368,11 +375,11 @@ static void
368_current_button_state_change(Evas_Object *obj, 375_current_button_state_change(Evas_Object *obj,
369 Multibuttonentry_Button_State state) 376 Multibuttonentry_Button_State state)
370{ 377{
371 Elm_Multibuttonentry_Item *item; 378 Elm_Multibuttonentry_Item_Data *item;
372 379
373 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd); 380 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
374 381
375 item = (Elm_Multibuttonentry_Item *)sd->selected_it; 382 item = sd->selected_it;
376 383
377 if (!item || !item->button) return; 384 if (!item || !item->button) return;
378 385
@@ -380,7 +387,7 @@ _current_button_state_change(Evas_Object *obj,
380 { 387 {
381 case MULTIBUTTONENTRY_BUTTON_STATE_SELECTED: 388 case MULTIBUTTONENTRY_BUTTON_STATE_SELECTED:
382 edje_object_signal_emit(item->button, "elm,state,focused", "elm"); 389 edje_object_signal_emit(item->button, "elm,state,focused", "elm");
383 evas_object_smart_callback_call(obj, SIG_ITEM_SELECTED, item); 390 evas_object_smart_callback_call(obj, SIG_ITEM_SELECTED, EO_OBJ(item));
384 break; 391 break;
385 case MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT: 392 case MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT:
386 default: 393 default:
@@ -395,7 +402,7 @@ _current_button_change(Evas_Object *obj,
395 Evas_Object *btn) 402 Evas_Object *btn)
396{ 403{
397 Eina_List *l; 404 Eina_List *l;
398 Elm_Multibuttonentry_Item *item; 405 Elm_Object_Item *eo_item;
399 406
400 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd); 407 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
401 408
@@ -403,11 +410,12 @@ _current_button_change(Evas_Object *obj,
403 _current_button_state_change(obj, MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT); 410 _current_button_state_change(obj, MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT);
404 411
405 // change the current 412 // change the current
406 EINA_LIST_FOREACH(sd->items, l, item) 413 EINA_LIST_FOREACH(sd->items, l, eo_item)
407 { 414 {
415 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
408 if (item->button == btn) 416 if (item->button == btn)
409 { 417 {
410 sd->selected_it = (Elm_Object_Item *)item; 418 sd->selected_it = item;
411 break; 419 break;
412 } 420 }
413 } 421 }
@@ -467,7 +475,7 @@ _button_clicked_cb(void *data,
467 const char *emission EINA_UNUSED, 475 const char *emission EINA_UNUSED,
468 const char *source EINA_UNUSED) 476 const char *source EINA_UNUSED)
469{ 477{
470 Elm_Multibuttonentry_Item *item = NULL; 478 Elm_Multibuttonentry_Item_Data *item = NULL;
471 479
472 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); 480 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
473 481
@@ -477,9 +485,9 @@ _button_clicked_cb(void *data,
477 485
478 if (sd->selected_it) 486 if (sd->selected_it)
479 { 487 {
480 if ((item = (Elm_Multibuttonentry_Item *)sd->selected_it) != NULL) 488 if ((item = sd->selected_it) != NULL)
481 { 489 {
482 evas_object_smart_callback_call(data, SIG_ITEM_CLICKED, item); 490 evas_object_smart_callback_call(data, SIG_ITEM_CLICKED, EO_OBJ(item));
483 _button_select(data, item->button); 491 _button_select(data, item->button);
484 } 492 }
485 } 493 }
@@ -492,15 +500,16 @@ _button_deleted_cb(void *data,
492 const char *source EINA_UNUSED) 500 const char *source EINA_UNUSED)
493{ 501{
494 Eina_List *l; 502 Eina_List *l;
495 Elm_Multibuttonentry_Item *item = NULL; 503 Elm_Object_Item *eo_item = NULL;
496 504
497 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); 505 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
498 // change the current 506 // change the current
499 EINA_LIST_FOREACH(sd->items, l, item) 507 EINA_LIST_FOREACH(sd->items, l, eo_item)
500 { 508 {
509 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
501 if (item->button == obj) 510 if (item->button == obj)
502 { 511 {
503 elm_widget_item_del(item); 512 eo_do((Eo *)eo_item, elm_wdg_item_del());
504 break; 513 break;
505 } 514 }
506 } 515 }
@@ -538,22 +547,21 @@ _button_resize(Evas_Object *obj,
538 if (vieww) *vieww = vw; 547 if (vieww) *vieww = vw;
539} 548}
540 549
541static void 550EOLIAN static void
542_item_signal_emit_hook(Elm_Object_Item *it, 551_elm_multibuttonentry_item_elm_widget_item_signal_emit(Eo *eo_item EINA_UNUSED,
543 const char *emission, 552 Elm_Multibuttonentry_Item_Data *item,
544 const char *source) 553 const char *emission,
554 const char *source)
545{ 555{
546 Elm_Multibuttonentry_Item *item = (Elm_Multibuttonentry_Item *)it;
547
548 edje_object_signal_emit(item->button, emission, source); 556 edje_object_signal_emit(item->button, emission, source);
549} 557}
550 558
551static void 559EOLIAN static void
552_item_text_set_hook(Elm_Object_Item *it, 560_elm_multibuttonentry_item_elm_widget_item_part_text_set(Eo *eo_item EINA_UNUSED,
553 const char *part, 561 Elm_Multibuttonentry_Item_Data *item,
554 const char *label) 562 const char *part,
563 const char *label)
555{ 564{
556 Elm_Multibuttonentry_Item *item;
557 const char *dest_part = NULL; 565 const char *dest_part = NULL;
558 566
559 if (!part || !strcmp(part, "elm.text")) 567 if (!part || !strcmp(part, "elm.text"))
@@ -561,16 +569,15 @@ _item_text_set_hook(Elm_Object_Item *it,
561 else 569 else
562 dest_part = part; 570 dest_part = part;
563 571
564 item = (Elm_Multibuttonentry_Item *)it;
565 edje_object_part_text_escaped_set(item->button, dest_part, label); 572 edje_object_part_text_escaped_set(item->button, dest_part, label);
566 _button_resize(item->base.widget, item->button, &item->rw, &item->vw); 573 _button_resize(item->base->widget, item->button, &item->rw, &item->vw);
567} 574}
568 575
569static const char * 576EOLIAN static const char *
570_item_text_get_hook(const Elm_Object_Item *it, 577_elm_multibuttonentry_item_elm_widget_item_part_text_get(Eo *eo_item EINA_UNUSED,
571 const char *part) 578 Elm_Multibuttonentry_Item_Data *item,
579 const char *part)
572{ 580{
573 Elm_Multibuttonentry_Item *item;
574 const char *src_part = NULL; 581 const char *src_part = NULL;
575 582
576 if (!part || !strcmp(part, "elm.text")) 583 if (!part || !strcmp(part, "elm.text"))
@@ -578,14 +585,14 @@ _item_text_get_hook(const Elm_Object_Item *it,
578 else 585 else
579 src_part = part; 586 src_part = part;
580 587
581 item = (Elm_Multibuttonentry_Item *)it;
582 return edje_object_part_text_get(item->button, src_part); 588 return edje_object_part_text_get(item->button, src_part);
583} 589}
584 590
585static Eina_Bool 591EOLIAN static Eina_Bool
586_item_del_pre_hook(Elm_Object_Item *it) 592_elm_multibuttonentry_item_elm_widget_item_del_pre(Eo *eo_it EINA_UNUSED,
593 Elm_Multibuttonentry_Item_Data *it EINA_UNUSED)
587{ 594{
588 _button_item_del((Elm_Multibuttonentry_Item *)it); 595 _button_item_del(it);
589 596
590 return EINA_TRUE; 597 return EINA_TRUE;
591} 598}
@@ -615,9 +622,10 @@ _access_multibuttonentry_label_register(Evas_Object *obj, Eina_Bool is_access)
615 622
616static void 623static void
617_access_multibuttonentry_item_register(Evas_Object *obj, 624_access_multibuttonentry_item_register(Evas_Object *obj,
618 Elm_Multibuttonentry_Item *item, 625 Elm_Object_Item *eo_item,
619 Eina_Bool is_access) 626 Eina_Bool is_access)
620{ 627{
628 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
621 if (is_access) 629 if (is_access)
622 { 630 {
623 Evas_Object *ao; 631 Evas_Object *ao;
@@ -636,11 +644,18 @@ _access_multibuttonentry_item_register(Evas_Object *obj,
636 evas_object_propagate_events_set(item->button, !is_access); 644 evas_object_propagate_events_set(item->button, !is_access);
637} 645}
638 646
647EOLIAN static void
648_elm_multibuttonentry_item_eo_base_constructor(Eo *eo_item, Elm_Multibuttonentry_Item_Data *item)
649{
650 eo_do_super(eo_item, ELM_MULTIBUTTONENTRY_ITEM_CLASS, eo_constructor());
651 item->base = eo_data_scope_get(eo_item, ELM_WIDGET_ITEM_CLASS);
652}
653
639static Elm_Object_Item * 654static Elm_Object_Item *
640_button_item_add(Elm_Multibuttonentry_Data *sd, 655_button_item_add(Elm_Multibuttonentry_Data *sd,
641 const char *str, 656 const char *str,
642 Multibuttonentry_Pos pos, 657 Multibuttonentry_Pos pos,
643 const void *ref, 658 Elm_Object_Item *eo_reference,
644 Evas_Smart_Cb func, 659 Evas_Smart_Cb func,
645 void *data) 660 void *data)
646{ 661{
@@ -648,10 +663,12 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
648 Evas_Object *btn; 663 Evas_Object *btn;
649 Evas_Coord rw, vw; 664 Evas_Coord rw, vw;
650 char *str_utf8 = NULL; 665 char *str_utf8 = NULL;
651 Elm_Multibuttonentry_Item *item; 666 Eo *eo_item;
652 Evas_Coord width = -1, height = -1; 667 Evas_Coord width = -1, height = -1;
653 Elm_Multibuttonentry_Item_Filter *item_filter; 668 Elm_Multibuttonentry_Item_Filter *item_filter;
654 Elm_Multibuttonentry_Item *reference = (Elm_Multibuttonentry_Item *)ref; 669 Elm_Multibuttonentry_Item_Data *reference = eo_reference?
670 eo_data_scope_get((Eo *)eo_reference, ELM_MULTIBUTTONENTRY_ITEM_CLASS):
671 NULL;
655 Evas_Object *obj; 672 Evas_Object *obj;
656 673
657 obj = sd->parent; 674 obj = sd->parent;
@@ -686,15 +703,11 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
686 evas_object_show(btn); 703 evas_object_show(btn);
687 704
688 // append item list 705 // append item list
689 item = elm_widget_item_new(obj, Elm_Multibuttonentry_Item); 706 eo_item = eo_add(ELM_MULTIBUTTONENTRY_ITEM_CLASS, obj, elm_wdg_item_data_set(data));
690 if (!item) return NULL; 707 if (!eo_item) return NULL;
691 708
692 elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook); 709 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
693 elm_widget_item_text_set_hook_set(item, _item_text_set_hook);
694 elm_widget_item_text_get_hook_set(item, _item_text_get_hook);
695 elm_widget_item_signal_emit_hook_set(item, _item_signal_emit_hook);
696 710
697 elm_widget_item_data_set(item, data);
698 _button_resize(obj, btn, &rw, &vw); 711 _button_resize(obj, btn, &rw, &vw);
699 712
700 item->button = btn; 713 item->button = btn;
@@ -717,7 +730,7 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
717 _elm_access_say(text); 730 _elm_access_say(text);
718 eina_strbuf_free(buf); 731 eina_strbuf_free(buf);
719 732
720 _access_multibuttonentry_item_register(obj, item, EINA_TRUE); 733 _access_multibuttonentry_item_register(obj, (Elm_Object_Item *)eo_item, EINA_TRUE);
721 } 734 }
722 735
723 if (func) 736 if (func)
@@ -728,7 +741,7 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
728 switch (pos) 741 switch (pos)
729 { 742 {
730 case MULTIBUTTONENTRY_POS_START: 743 case MULTIBUTTONENTRY_POS_START:
731 sd->items = eina_list_prepend(sd->items, item); 744 sd->items = eina_list_prepend(sd->items, eo_item);
732 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK) 745 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK)
733 { 746 {
734 elm_widget_sub_object_add(obj, btn); 747 elm_widget_sub_object_add(obj, btn);
@@ -746,7 +759,7 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
746 break; 759 break;
747 760
748 case MULTIBUTTONENTRY_POS_END: 761 case MULTIBUTTONENTRY_POS_END:
749 sd->items = eina_list_append(sd->items, item); 762 sd->items = eina_list_append(sd->items, eo_item);
750 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK) 763 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK)
751 { 764 {
752 elm_widget_sub_object_add(obj, btn); 765 elm_widget_sub_object_add(obj, btn);
@@ -766,10 +779,10 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
766 break; 779 break;
767 780
768 case MULTIBUTTONENTRY_POS_BEFORE: 781 case MULTIBUTTONENTRY_POS_BEFORE:
769 if (reference) 782 if (eo_reference)
770 sd->items = eina_list_prepend_relative(sd->items, item, reference); 783 sd->items = eina_list_prepend_relative(sd->items, eo_item, eo_reference);
771 else 784 else
772 sd->items = eina_list_append(sd->items, item); 785 sd->items = eina_list_append(sd->items, eo_item);
773 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK) 786 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK)
774 { 787 {
775 elm_widget_sub_object_add(obj, btn); 788 elm_widget_sub_object_add(obj, btn);
@@ -778,7 +791,7 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
778 } 791 }
779 else 792 else
780 { 793 {
781 if (reference) 794 if (eo_reference)
782 elm_box_pack_before(sd->box, btn, reference->button); 795 elm_box_pack_before(sd->box, btn, reference->button);
783 else 796 else
784 { 797 {
@@ -795,10 +808,10 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
795 break; 808 break;
796 809
797 case MULTIBUTTONENTRY_POS_AFTER: 810 case MULTIBUTTONENTRY_POS_AFTER:
798 if (reference) 811 if (eo_reference)
799 sd->items = eina_list_append_relative(sd->items, item, reference); 812 sd->items = eina_list_append_relative(sd->items, eo_item, eo_reference);
800 else 813 else
801 sd->items = eina_list_append(sd->items, item); 814 sd->items = eina_list_append(sd->items, eo_item);
802 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK) 815 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK)
803 { 816 {
804 elm_widget_sub_object_add(obj, btn); 817 elm_widget_sub_object_add(obj, btn);
@@ -806,7 +819,7 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
806 } 819 }
807 else 820 else
808 { 821 {
809 if (reference) 822 if (eo_reference)
810 elm_box_pack_after(sd->box, btn, reference->button); 823 elm_box_pack_after(sd->box, btn, reference->button);
811 else 824 else
812 { 825 {
@@ -825,11 +838,11 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
825 default: 838 default:
826 break; 839 break;
827 } 840 }
828 evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, item); 841 evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, eo_item);
829 842
830 free(str_utf8); 843 free(str_utf8);
831 844
832 return (Elm_Object_Item *)item; 845 return (Elm_Object_Item *)eo_item;
833} 846}
834 847
835//FIXME: having an empty event handling function and reacting on Evas 848//FIXME: having an empty event handling function and reacting on Evas
@@ -941,12 +954,12 @@ _entry_focus_in_cb(void *data,
941 Evas_Object *obj EINA_UNUSED, 954 Evas_Object *obj EINA_UNUSED,
942 void *event_info EINA_UNUSED) 955 void *event_info EINA_UNUSED)
943{ 956{
944 Elm_Multibuttonentry_Item *item = NULL; 957 Elm_Multibuttonentry_Item_Data *item = NULL;
945 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); 958 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
946 959
947 if (sd->selected_it) 960 if (sd->selected_it)
948 { 961 {
949 item = (Elm_Multibuttonentry_Item *)sd->selected_it; 962 item = sd->selected_it;
950 elm_object_focus_set(sd->entry, EINA_FALSE); 963 elm_object_focus_set(sd->entry, EINA_FALSE);
951 evas_object_focus_set(item->button, EINA_TRUE); 964 evas_object_focus_set(item->button, EINA_TRUE);
952 } 965 }
@@ -982,7 +995,6 @@ _layout_key_down_cb(void *data,
982 Evas_Object *obj EINA_UNUSED, 995 Evas_Object *obj EINA_UNUSED,
983 void *event_info) 996 void *event_info)
984{ 997{
985 Elm_Multibuttonentry_Item *item = NULL;
986 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); 998 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
987 Evas_Event_Key_Up *ev = (Evas_Event_Key_Up *)event_info; 999 Evas_Event_Key_Up *ev = (Evas_Event_Key_Up *)event_info;
988 1000
@@ -994,10 +1006,10 @@ _layout_key_down_cb(void *data,
994 ((strcmp(ev->key, "BackSpace") == 0) || 1006 ((strcmp(ev->key, "BackSpace") == 0) ||
995 (strcmp(ev->key, "Delete") == 0))) 1007 (strcmp(ev->key, "Delete") == 0)))
996 { 1008 {
997 item = (Elm_Multibuttonentry_Item *)sd->selected_it; 1009 Elm_Multibuttonentry_Item_Data *item = sd->selected_it;
998 if (item && sd->editable) 1010 if (item && sd->editable)
999 { 1011 {
1000 elm_widget_item_del(item); 1012 eo_do((Eo *)EO_OBJ(item), elm_wdg_item_del());
1001 elm_object_focus_set(sd->entry, EINA_TRUE); 1013 elm_object_focus_set(sd->entry, EINA_TRUE);
1002 } 1014 }
1003 } 1015 }
@@ -1005,9 +1017,12 @@ _layout_key_down_cb(void *data,
1005 (strcmp(ev->key, "BackSpace") == 0)) || 1017 (strcmp(ev->key, "BackSpace") == 0)) ||
1006 (strcmp(ev->key, "Delete") == 0))) 1018 (strcmp(ev->key, "Delete") == 0)))
1007 { 1019 {
1008 item = eina_list_data_get(eina_list_last(sd->items)); 1020 Elm_Object_Item *eo_item = eina_list_data_get(eina_list_last(sd->items));
1009 if (item) 1021 if (eo_item)
1010 _button_select(sd->parent, item->button); 1022 {
1023 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
1024 _button_select(sd->parent, item->button);
1025 }
1011 } 1026 }
1012 } 1027 }
1013 else 1028 else
@@ -1432,7 +1447,7 @@ _access_info_cb(void *data EINA_UNUSED, Evas_Object *obj)
1432 char *ret; 1447 char *ret;
1433 Eina_Strbuf *buf; 1448 Eina_Strbuf *buf;
1434 Eina_List *l = NULL; 1449 Eina_List *l = NULL;
1435 Elm_Multibuttonentry_Item *it; 1450 Elm_Object_Item *eo_item;
1436 1451
1437 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, NULL); 1452 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
1438 1453
@@ -1447,8 +1462,9 @@ _access_info_cb(void *data EINA_UNUSED, Evas_Object *obj)
1447 if (sd->label_str) eina_strbuf_append(buf, sd->label_str); 1462 if (sd->label_str) eina_strbuf_append(buf, sd->label_str);
1448 1463
1449 int invisible_its = 0; 1464 int invisible_its = 0;
1450 EINA_LIST_FOREACH (sd->items, l, it) 1465 EINA_LIST_FOREACH (sd->items, l, eo_item)
1451 { 1466 {
1467 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, it);
1452 if (it->visible) 1468 if (it->visible)
1453 eina_strbuf_append_printf(buf, ", %s", 1469 eina_strbuf_append_printf(buf, ", %s",
1454 edje_object_part_text_get(it->button, "elm.btn.text")); 1470 edje_object_part_text_get(it->button, "elm.btn.text"));
@@ -1497,12 +1513,13 @@ _elm_multibuttonentry_evas_object_smart_add(Eo *obj, Elm_Multibuttonentry_Data *
1497EOLIAN static void 1513EOLIAN static void
1498_elm_multibuttonentry_evas_object_smart_del(Eo *obj, Elm_Multibuttonentry_Data *sd) 1514_elm_multibuttonentry_evas_object_smart_del(Eo *obj, Elm_Multibuttonentry_Data *sd)
1499{ 1515{
1500 Elm_Multibuttonentry_Item *item; 1516 Elm_Object_Item *eo_item;
1501 1517
1502 EINA_LIST_FREE(sd->items, item) 1518 EINA_LIST_FREE(sd->items, eo_item)
1503 { 1519 {
1520 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
1504 evas_object_del(item->button); 1521 evas_object_del(item->button);
1505 free(item); 1522 eo_del((Eo *)eo_item);
1506 } 1523 }
1507 sd->items = NULL; 1524 sd->items = NULL;
1508 1525
@@ -1539,7 +1556,7 @@ _elm_multibuttonentry_elm_widget_focus_next(Eo *obj, Elm_Multibuttonentry_Data *
1539 1556
1540 Eina_List *items = NULL; 1557 Eina_List *items = NULL;
1541 Eina_List *l = NULL; 1558 Eina_List *l = NULL;
1542 Elm_Multibuttonentry_Item *it; 1559 Elm_Object_Item *eo_item;
1543 Evas_Object *ao; 1560 Evas_Object *ao;
1544 Evas_Object *po; 1561 Evas_Object *po;
1545 1562
@@ -1557,8 +1574,9 @@ _elm_multibuttonentry_elm_widget_focus_next(Eo *obj, Elm_Multibuttonentry_Data *
1557 items = eina_list_append(items, ao); 1574 items = eina_list_append(items, ao);
1558 } 1575 }
1559 1576
1560 EINA_LIST_FOREACH (sd->items, l, it) 1577 EINA_LIST_FOREACH (sd->items, l, eo_item)
1561 { 1578 {
1579 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, it);
1562 po = (Evas_Object *)edje_object_part_object_get 1580 po = (Evas_Object *)edje_object_part_object_get
1563 (it->button, "elm.btn.text"); 1581 (it->button, "elm.btn.text");
1564 ao = evas_object_data_get(po, "_part_access_obj"); 1582 ao = evas_object_data_get(po, "_part_access_obj");
@@ -1586,7 +1604,7 @@ static void
1586_access_obj_process(Evas_Object *obj, Eina_Bool is_access) 1604_access_obj_process(Evas_Object *obj, Eina_Bool is_access)
1587{ 1605{
1588 Eina_List *l; 1606 Eina_List *l;
1589 Elm_Multibuttonentry_Item *it; 1607 Elm_Object_Item *it;
1590 1608
1591 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd); 1609 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
1592 1610
@@ -1727,17 +1745,21 @@ _elm_multibuttonentry_last_item_get(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Da
1727EOLIAN static Elm_Object_Item* 1745EOLIAN static Elm_Object_Item*
1728_elm_multibuttonentry_selected_item_get(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd) 1746_elm_multibuttonentry_selected_item_get(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
1729{ 1747{
1730 return sd->selected_it; 1748 return sd->selected_it?EO_OBJ(sd->selected_it):NULL;
1731} 1749}
1732 1750
1733EAPI void 1751EAPI void
1734elm_multibuttonentry_item_selected_set(Elm_Object_Item *it, 1752elm_multibuttonentry_item_selected_set(Elm_Object_Item *it,
1735 Eina_Bool selected) 1753 Eina_Bool selected)
1736{ 1754{
1737 Elm_Multibuttonentry_Item *item = (Elm_Multibuttonentry_Item *)it; 1755 eo_do((Eo *)it, elm_obj_multibuttonentry_item_selected_set(selected));
1738 1756}
1739 ELM_MULTIBUTTONENTRY_ITEM_CHECK_OR_RETURN(it);
1740 1757
1758EOLIAN static void
1759_elm_multibuttonentry_item_selected_set(Eo *eo_item EINA_UNUSED,
1760 Elm_Multibuttonentry_Item_Data *item,
1761 Eina_Bool selected)
1762{
1741 if (selected) _button_select(WIDGET(item), item->button); 1763 if (selected) _button_select(WIDGET(item), item->button);
1742 else _button_select(WIDGET(item), NULL); 1764 else _button_select(WIDGET(item), NULL);
1743} 1765}
@@ -1745,8 +1767,15 @@ elm_multibuttonentry_item_selected_set(Elm_Object_Item *it,
1745EAPI Eina_Bool 1767EAPI Eina_Bool
1746elm_multibuttonentry_item_selected_get(const Elm_Object_Item *it) 1768elm_multibuttonentry_item_selected_get(const Elm_Object_Item *it)
1747{ 1769{
1770 return eo_do((Eo *)it, elm_obj_multibuttonentry_item_selected_get());
1771}
1772
1773EOLIAN static Eina_Bool
1774_elm_multibuttonentry_item_selected_get(Eo *eo_item,
1775 Elm_Multibuttonentry_Item_Data *item EINA_UNUSED)
1776{
1748 //TODO : To be implemented. 1777 //TODO : To be implemented.
1749 if (!it) return EINA_FALSE; 1778 if (!eo_item) return EINA_FALSE;
1750 1779
1751 return EINA_TRUE; 1780 return EINA_TRUE;
1752} 1781}
@@ -1754,15 +1783,16 @@ elm_multibuttonentry_item_selected_get(const Elm_Object_Item *it)
1754EOLIAN static void 1783EOLIAN static void
1755_elm_multibuttonentry_clear(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd) 1784_elm_multibuttonentry_clear(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
1756{ 1785{
1757 Elm_Multibuttonentry_Item *item; 1786 Elm_Object_Item *eo_item;
1758 1787
1759 if (sd->items) 1788 if (sd->items)
1760 { 1789 {
1761 EINA_LIST_FREE(sd->items, item) 1790 EINA_LIST_FREE(sd->items, eo_item)
1762 { 1791 {
1792 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
1763 elm_box_unpack(sd->box, item->button); 1793 elm_box_unpack(sd->box, item->button);
1764 evas_object_del(item->button); 1794 evas_object_del(item->button);
1765 free(item); 1795 eo_del((Eo *)eo_item);
1766 } 1796 }
1767 sd->items = NULL; 1797 sd->items = NULL;
1768 } 1798 }
@@ -1773,15 +1803,21 @@ _elm_multibuttonentry_clear(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
1773EAPI Elm_Object_Item * 1803EAPI Elm_Object_Item *
1774elm_multibuttonentry_item_prev_get(const Elm_Object_Item *it) 1804elm_multibuttonentry_item_prev_get(const Elm_Object_Item *it)
1775{ 1805{
1806 return (Elm_Object_Item *)eo_do((Eo *)it, elm_obj_multibuttonentry_item_prev_get());
1807}
1808
1809EOLIAN static Elm_Object_Item *
1810_elm_multibuttonentry_item_prev_get(Eo *eo_it,
1811 Elm_Multibuttonentry_Item_Data *it)
1812{
1776 Eina_List *l; 1813 Eina_List *l;
1777 Elm_Multibuttonentry_Item *item; 1814 Elm_Object_Item *eo_item;
1778 1815
1779 ELM_MULTIBUTTONENTRY_ITEM_CHECK_OR_RETURN(it, NULL);
1780 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(it), sd, NULL); 1816 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(it), sd, NULL);
1781 1817
1782 EINA_LIST_FOREACH(sd->items, l, item) 1818 EINA_LIST_FOREACH(sd->items, l, eo_item)
1783 { 1819 {
1784 if (item == (Elm_Multibuttonentry_Item *)it) 1820 if (eo_item == (Elm_Object_Item *)eo_it)
1785 { 1821 {
1786 l = eina_list_prev(l); 1822 l = eina_list_prev(l);
1787 if (!l) return NULL; 1823 if (!l) return NULL;
@@ -1794,15 +1830,21 @@ elm_multibuttonentry_item_prev_get(const Elm_Object_Item *it)
1794EAPI Elm_Object_Item * 1830EAPI Elm_Object_Item *
1795elm_multibuttonentry_item_next_get(const Elm_Object_Item *it) 1831elm_multibuttonentry_item_next_get(const Elm_Object_Item *it)
1796{ 1832{
1833 return (Elm_Object_Item *)eo_do((Eo *)it, elm_obj_multibuttonentry_item_next_get());
1834}
1835
1836EOLIAN static Elm_Object_Item *
1837_elm_multibuttonentry_item_next_get(Eo *eo_it,
1838 Elm_Multibuttonentry_Item_Data *it)
1839{
1797 Eina_List *l; 1840 Eina_List *l;
1798 Elm_Multibuttonentry_Item *item; 1841 Elm_Object_Item *eo_item;
1799 1842
1800 ELM_MULTIBUTTONENTRY_ITEM_CHECK_OR_RETURN(it, NULL);
1801 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(it), sd, NULL); 1843 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(it), sd, NULL);
1802 1844
1803 EINA_LIST_FOREACH(sd->items, l, item) 1845 EINA_LIST_FOREACH(sd->items, l, eo_item)
1804 { 1846 {
1805 if (item == (Elm_Multibuttonentry_Item *)it) 1847 if (eo_item == (Elm_Object_Item *)eo_it)
1806 { 1848 {
1807 l = eina_list_next(l); 1849 l = eina_list_next(l);
1808 if (!l) return NULL; 1850 if (!l) return NULL;
@@ -1815,14 +1857,14 @@ elm_multibuttonentry_item_next_get(const Elm_Object_Item *it)
1815EINA_DEPRECATED EAPI void * 1857EINA_DEPRECATED EAPI void *
1816elm_multibuttonentry_item_data_get(const Elm_Object_Item *it) 1858elm_multibuttonentry_item_data_get(const Elm_Object_Item *it)
1817{ 1859{
1818 return elm_widget_item_data_get(it); 1860 return eo_do((Eo *)it, elm_wdg_item_data_get());
1819} 1861}
1820 1862
1821EINA_DEPRECATED EAPI void 1863EINA_DEPRECATED EAPI void
1822elm_multibuttonentry_item_data_set(Elm_Object_Item *it, 1864elm_multibuttonentry_item_data_set(Elm_Object_Item *it,
1823 void *data) 1865 void *data)
1824{ 1866{
1825 return elm_widget_item_data_set(it, data); 1867 eo_do((Eo *)it, elm_wdg_item_data_set(data));
1826} 1868}
1827 1869
1828EOLIAN static void 1870EOLIAN static void
@@ -1903,4 +1945,5 @@ _elm_multibuttonentry_class_constructor(Eo_Class *klass)
1903 _elm_multibuttonentry_smart_focus_next_enable = EINA_TRUE; 1945 _elm_multibuttonentry_smart_focus_next_enable = EINA_TRUE;
1904} 1946}
1905 1947
1948#include "elm_multibuttonentry_item.eo.c"
1906#include "elm_multibuttonentry.eo.c" 1949#include "elm_multibuttonentry.eo.c"
diff --git a/src/lib/elc_multibuttonentry_legacy.h b/src/lib/elc_multibuttonentry_legacy.h
index b1739be99..ec936b701 100644
--- a/src/lib/elc_multibuttonentry_legacy.h
+++ b/src/lib/elc_multibuttonentry_legacy.h
@@ -9,44 +9,12 @@
9 */ 9 */
10EAPI Evas_Object *elm_multibuttonentry_add(Evas_Object *parent); 10EAPI Evas_Object *elm_multibuttonentry_add(Evas_Object *parent);
11 11
12/**
13 * Set the selected state of an item
14 *
15 * @param it The item
16 * @param selected if it's @c EINA_TRUE, select the item otherwise, unselect the item
17 *
18 * @ingroup Multibuttonentry
19 */
20EAPI void elm_multibuttonentry_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); 12EAPI void elm_multibuttonentry_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
21 13
22/**
23 * Get the selected state of an item
24 *
25 * @param it The item
26 * @return @c EINA_TRUE if the item is selected, @c EINA_FALSE otherwise.
27 *
28 * @ingroup Multibuttonentry
29 */
30EAPI Eina_Bool elm_multibuttonentry_item_selected_get(const Elm_Object_Item *it); 14EAPI Eina_Bool elm_multibuttonentry_item_selected_get(const Elm_Object_Item *it);
31 15
32/**
33 * Get the previous item in the multibuttonentry
34 *
35 * @param it The item
36 * @return The item before the item @p it
37 *
38 * @ingroup Multibuttonentry
39 */
40EAPI Elm_Object_Item *elm_multibuttonentry_item_prev_get(const Elm_Object_Item *it); 16EAPI Elm_Object_Item *elm_multibuttonentry_item_prev_get(const Elm_Object_Item *it);
41 17
42/**
43 * Get the next item in the multibuttonentry
44 *
45 * @param it The item
46 * @return The item after the item @p it
47 *
48 * @ingroup Multibuttonentry
49 */
50EAPI Elm_Object_Item *elm_multibuttonentry_item_next_get(const Elm_Object_Item *it); 18EAPI Elm_Object_Item *elm_multibuttonentry_item_next_get(const Elm_Object_Item *it);
51 19
52#include "elm_multibuttonentry.eo.legacy.h" \ No newline at end of file 20#include "elm_multibuttonentry.eo.legacy.h"
diff --git a/src/lib/elm_multibuttonentry_item.eo b/src/lib/elm_multibuttonentry_item.eo
new file mode 100644
index 000000000..a4e2df1e0
--- /dev/null
+++ b/src/lib/elm_multibuttonentry_item.eo
@@ -0,0 +1,55 @@
1class Elm_Multibuttonentry_Item(Elm_Widget_Item)
2{
3 legacy_prefix: null;
4 eo_prefix: elm_obj_multibuttonentry_item;
5 properties {
6 selected {
7 get {
8 /*@
9 Get the selected state of an item
10
11 @ingroup Multibuttonentry
12 */
13 }
14 set {
15 /*@
16 Set the selected state of an item
17
18 @ingroup Multibuttonentry
19 */
20 }
21 values {
22 Eina_Bool selected; /*@ EINA_TRUE if selected EINA_FALSE otherwise */
23 }
24 }
25 }
26 methods {
27 prev_get @const {
28 /*@
29 Get the previous item in the multibuttonentry
30
31 @return The item before the item @p it
32
33 @ingroup Multibuttonentry
34 */
35 return: Elm_Object_Item *;
36 }
37 next_get @const {
38 /*@
39 Get the next item in the multibuttonentry
40
41 @return The item after the item @p it
42
43 @ingroup Multibuttonentry
44 */
45 return: Elm_Object_Item *;
46 }
47 }
48 implements {
49 Eo.Base.constructor;
50 Elm_Widget_Item.del_pre;
51 Elm_Widget_Item.signal_emit;
52 Elm_Widget_Item.part_text.get;
53 Elm_Widget_Item.part_text.set;
54 }
55}
diff --git a/src/lib/elm_widget_multibuttonentry.h b/src/lib/elm_widget_multibuttonentry.h
index 6a9b8d9b1..2216e0313 100644
--- a/src/lib/elm_widget_multibuttonentry.h
+++ b/src/lib/elm_widget_multibuttonentry.h
@@ -2,6 +2,9 @@
2#define ELM_WIDGET_MULTIBUTTONENTRY_H 2#define ELM_WIDGET_MULTIBUTTONENTRY_H
3 3
4#include "elm_widget_layout.h" 4#include "elm_widget_layout.h"
5#include "elm_object_item_migration_temp.h"
6
7#include "elm_multibuttonentry_item.eo.h"
5 8
6/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR 9/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
7 * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT 10 * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
@@ -53,11 +56,11 @@ typedef enum _Multibuttonentry_View_State
53 MULTIBUTTONENTRY_VIEW_SHRINK 56 MULTIBUTTONENTRY_VIEW_SHRINK
54} Multibuttonentry_View_State; 57} Multibuttonentry_View_State;
55 58
56typedef struct _Multibuttonentry_Item Elm_Multibuttonentry_Item; 59typedef struct _Multibuttonentry_Item Elm_Multibuttonentry_Item_Data;
57 60
58struct _Multibuttonentry_Item 61struct _Multibuttonentry_Item
59{ 62{
60 ELM_WIDGET_ITEM; 63 Elm_Widget_Item_Data *base;
61 64
62 Evas_Object *button; 65 Evas_Object *button;
63 Evas_Coord vw, rw; // vw: visual width, real width 66 Evas_Coord vw, rw; // vw: visual width, real width
@@ -86,7 +89,7 @@ struct _Elm_Multibuttonentry_Data
86 89
87 Eina_List *items; 90 Eina_List *items;
88 Eina_List *filter_list; 91 Eina_List *filter_list;
89 Elm_Object_Item *selected_it; /* selected item */ 92 Elm_Multibuttonentry_Item_Data *selected_it; /* selected item */
90 93
91 Elm_Multibuttonentry_Format_Cb format_func; 94 Elm_Multibuttonentry_Format_Cb format_func;
92 const void *format_func_data; 95 const void *format_func_data;
@@ -129,16 +132,19 @@ struct _Elm_Multibuttonentry_Data
129 return val; \ 132 return val; \
130 } 133 }
131 134
135#define ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(o, sd) \
136 Elm_Multibuttonentry_Item_Data *sd = eo_data_scope_get((Eo *)o, ELM_MULTIBUTTONENTRY_ITEM_CLASS)
137
132#define ELM_MULTIBUTTONENTRY_CHECK(obj) \ 138#define ELM_MULTIBUTTONENTRY_CHECK(obj) \
133 if (EINA_UNLIKELY(!eo_isa((obj), ELM_MULTIBUTTONENTRY_CLASS))) \ 139 if (EINA_UNLIKELY(!eo_isa((obj), ELM_MULTIBUTTONENTRY_CLASS))) \
134 return 140 return
135 141
136#define ELM_MULTIBUTTONENTRY_ITEM_CHECK(it) \ 142#define ELM_MULTIBUTTONENTRY_ITEM_CHECK(it) \
137 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, ); \ 143 if (EINA_UNLIKELY(!eo_isa((it->base->eo_obj), ELM_MULTIBUTTONENTRY_ITEM_CLASS))) \
138 ELM_MULTIBUTTONENTRY_CHECK(it->base.widget); 144 return
139 145
140#define ELM_MULTIBUTTONENTRY_ITEM_CHECK_OR_RETURN(it, ...) \ 146#define ELM_MULTIBUTTONENTRY_ITEM_CHECK_OR_RETURN(it, ...) \
141 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, __VA_ARGS__); \ 147 if (EINA_UNLIKELY(!eo_isa((it->base->eo_obj), ELM_MULTIBUTTONENTRY_ITEM_CLASS))) \
142 ELM_MULTIBUTTONENTRY_CHECK(it->base.widget) __VA_ARGS__; 148 return __VA_ARGS__;
143 149
144#endif 150#endif