summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYossi Kantor <yossi.kantor@samsung.com>2014-07-07 11:07:53 +0300
committerYossi Kantor <yossi.kantor@samsung.com>2014-08-03 14:50:41 +0300
commit1b12200eaf8942aecdf924d52b26159e7e0574c8 (patch)
tree0a294c25db16423db35ed8ea3444f4ffd42ffe5a
parent098799231c36a5452ccb747cb0434cd16b3fdc18 (diff)
Integration of Multibuttonentry Item
-rw-r--r--src/lib/Makefile.am7
-rw-r--r--src/lib/elc_multibuttonentry.c299
-rw-r--r--src/lib/elm_multibuttonentry_item.eo57
-rw-r--r--src/lib/elm_widget_multibuttonentry.h24
4 files changed, 255 insertions, 132 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 3025c151b..4440bf281 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -794,7 +794,9 @@ BUILT_SOURCES = \
794 elm_ctxpopup_item.eo.c \ 794 elm_ctxpopup_item.eo.c \
795 elm_ctxpopup_item.eo.h \ 795 elm_ctxpopup_item.eo.h \
796 elm_index_item.eo.c \ 796 elm_index_item.eo.c \
797 elm_index_item.eo.h 797 elm_index_item.eo.h \
798 elm_multibuttonentry_item.eo.c \
799 elm_multibuttonentry_item.eo.h
798 800
799elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@ 801elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@
800elementaryeolianfiles_DATA = \ 802elementaryeolianfiles_DATA = \
@@ -896,7 +898,8 @@ elementaryeolianfiles_DATA = \
896 elm_flipselector_item.eo \ 898 elm_flipselector_item.eo \
897 elm_menu_item.eo \ 899 elm_menu_item.eo \
898 elm_ctxpopup_item.eo \ 900 elm_ctxpopup_item.eo \
899 elm_index_item.eo 901 elm_index_item.eo \
902 elm_multibuttonentry_item.eo
900 903
901EXTRA_DIST += \ 904EXTRA_DIST += \
902 ${elementaryeolianfiles_DATA} 905 ${elementaryeolianfiles_DATA}
diff --git a/src/lib/elc_multibuttonentry.c b/src/lib/elc_multibuttonentry.c
index 8a139e500..d64b7ed98 100644
--- a/src/lib/elc_multibuttonentry.c
+++ b/src/lib/elc_multibuttonentry.c
@@ -42,11 +42,11 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
42EOLIAN static Eina_Bool 42EOLIAN static Eina_Bool
43_elm_multibuttonentry_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd) 43_elm_multibuttonentry_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
44{ 44{
45 Elm_Multibuttonentry_Item *it; 45 Elm_Widobj_Item *it;
46 Eina_List *l; 46 Eina_List *l;
47 47
48 EINA_LIST_FOREACH(sd->items, l, it) 48 EINA_LIST_FOREACH(sd->items, l, it)
49 elm_widget_item_translate(it); 49 eo_do(it, elm_wdg_item_translate());
50 50
51 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate()); 51 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate());
52 52
@@ -66,14 +66,15 @@ EOLIAN static Eina_Bool
66_elm_multibuttonentry_elm_widget_theme_apply(Eo *obj, Elm_Multibuttonentry_Data *sd) 66_elm_multibuttonentry_elm_widget_theme_apply(Eo *obj, Elm_Multibuttonentry_Data *sd)
67{ 67{
68 Eina_List *l; 68 Eina_List *l;
69 Elm_Multibuttonentry_Item *item; 69 Elm_Widobj_Item *eo_item;
70 70
71 Eina_Bool int_ret = EINA_FALSE; 71 Eina_Bool int_ret = EINA_FALSE;
72 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply()); 72 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply());
73 if (!int_ret) return EINA_FALSE; 73 if (!int_ret) return EINA_FALSE;
74 74
75 EINA_LIST_FOREACH(sd->items, l, item) 75 EINA_LIST_FOREACH(sd->items, l, eo_item)
76 { 76 {
77 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
77 if (item->button) 78 if (item->button)
78 elm_widget_theme_object_set 79 elm_widget_theme_object_set
79 (obj, item->button, "multibuttonentry", "btn", 80 (obj, item->button, "multibuttonentry", "btn",
@@ -131,7 +132,7 @@ _shrink_mode_set(Evas_Object *obj,
131{ 132{
132 int count; 133 int count;
133 Eina_List *l; 134 Eina_List *l;
134 Elm_Multibuttonentry_Item *item; 135 Elm_Widobj_Item *eo_item;
135 136
136 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd); 137 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
137 138
@@ -153,8 +154,9 @@ _shrink_mode_set(Evas_Object *obj,
153 elm_box_padding_get(sd->box, &box_inner_item_width_padding, NULL); 154 elm_box_padding_get(sd->box, &box_inner_item_width_padding, NULL);
154 // unpack all items and entry 155 // unpack all items and entry
155 elm_box_unpack_all(sd->box); 156 elm_box_unpack_all(sd->box);
156 EINA_LIST_FOREACH(sd->items, l, item) 157 EINA_LIST_FOREACH(sd->items, l, eo_item)
157 { 158 {
159 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
158 evas_object_hide(item->button); 160 evas_object_hide(item->button);
159 item->visible = EINA_FALSE; 161 item->visible = EINA_FALSE;
160 } 162 }
@@ -169,14 +171,15 @@ _shrink_mode_set(Evas_Object *obj,
169 w -= box_inner_item_width_padding; 171 w -= box_inner_item_width_padding;
170 } 172 }
171 173
172 item = NULL; 174 eo_item = NULL;
173 count = eina_list_count(sd->items); 175 count = eina_list_count(sd->items);
174 176
175 EINA_LIST_FOREACH(sd->items, l, item) 177 EINA_LIST_FOREACH(sd->items, l, eo_item)
176 { 178 {
177 Evas_Coord w_label_count = 0, h = 0; 179 Evas_Coord w_label_count = 0, h = 0;
178 char *buf; 180 char *buf;
179 181
182 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
180 elm_box_pack_end(sd->box, item->button); 183 elm_box_pack_end(sd->box, item->button);
181 evas_object_show(item->button); 184 evas_object_show(item->button);
182 item->visible = EINA_TRUE; 185 item->visible = EINA_TRUE;
@@ -232,8 +235,9 @@ _shrink_mode_set(Evas_Object *obj,
232 { 235 {
233 // unpack all items and entry 236 // unpack all items and entry
234 elm_box_unpack_all(sd->box); 237 elm_box_unpack_all(sd->box);
235 EINA_LIST_FOREACH(sd->items, l, item) 238 EINA_LIST_FOREACH(sd->items, l, eo_item)
236 { 239 {
240 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
237 evas_object_hide(item->button); 241 evas_object_hide(item->button);
238 item->visible = EINA_FALSE; 242 item->visible = EINA_FALSE;
239 } 243 }
@@ -244,9 +248,10 @@ _shrink_mode_set(Evas_Object *obj,
244 if (sd->label) elm_box_pack_end(sd->box, sd->label); 248 if (sd->label) elm_box_pack_end(sd->box, sd->label);
245 249
246 // pack remain btns 250 // pack remain btns
247 item = NULL; 251 eo_item = NULL;
248 EINA_LIST_FOREACH(sd->items, l, item) 252 EINA_LIST_FOREACH(sd->items, l, eo_item)
249 { 253 {
254 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
250 elm_box_pack_end(sd->box, item->button); 255 elm_box_pack_end(sd->box, item->button);
251 evas_object_show(item->button); 256 evas_object_show(item->button);
252 item->visible = EINA_TRUE; 257 item->visible = EINA_TRUE;
@@ -328,26 +333,29 @@ end:
328} 333}
329 334
330static void 335static void
331_button_item_del(Elm_Multibuttonentry_Item *item) 336_button_item_del(Elm_Widobj_Item *eo_item)
332{ 337{
333 Eina_List *l; 338 Eina_List *l;
334 Elm_Multibuttonentry_Item *it; 339 Elm_Widobj_Item *eo_it;
340
341 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
335 Evas_Object *obj = WIDGET(item); 342 Evas_Object *obj = WIDGET(item);
336 343
337 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd); 344 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
338 345
339 EINA_LIST_FOREACH(sd->items, l, it) 346 EINA_LIST_FOREACH(sd->items, l, eo_it)
340 { 347 {
341 if (it == item) 348 if (eo_it == eo_item)
342 { 349 {
343 sd->items = eina_list_remove(sd->items, it); 350 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_it, it);
351 sd->items = eina_list_remove(sd->items, eo_it);
344 elm_box_unpack(sd->box, it->button); 352 elm_box_unpack(sd->box, it->button);
345 353
346 evas_object_smart_callback_call(obj, SIG_ITEM_DELETED, it); 354 evas_object_smart_callback_call(obj, SIG_ITEM_DELETED, eo_it);
347 355
348 evas_object_del(it->button); 356 evas_object_del(it->button);
349 357
350 if (sd->selected_it == (Elm_Object_Item *)it) 358 if (sd->selected_it == (Elm_Object_Item *)eo_it)
351 sd->selected_it = NULL; 359 sd->selected_it = NULL;
352 break; 360 break;
353 } 361 }
@@ -364,19 +372,20 @@ static void
364_current_button_state_change(Evas_Object *obj, 372_current_button_state_change(Evas_Object *obj,
365 Multibuttonentry_Button_State state) 373 Multibuttonentry_Button_State state)
366{ 374{
367 Elm_Multibuttonentry_Item *item; 375 Elm_Widobj_Item *eo_item;
368 376
369 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd); 377 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
370 378
371 item = (Elm_Multibuttonentry_Item *)sd->selected_it; 379 eo_item = (Elm_Widobj_Item *)sd->selected_it;
372 380
373 if (!item || !item->button) return; 381 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
382 if (!eo_item || !item->button) return;
374 383
375 switch (state) 384 switch (state)
376 { 385 {
377 case MULTIBUTTONENTRY_BUTTON_STATE_SELECTED: 386 case MULTIBUTTONENTRY_BUTTON_STATE_SELECTED:
378 edje_object_signal_emit(item->button, "elm,state,focused", "elm"); 387 edje_object_signal_emit(item->button, "elm,state,focused", "elm");
379 evas_object_smart_callback_call(obj, SIG_ITEM_SELECTED, item); 388 evas_object_smart_callback_call(obj, SIG_ITEM_SELECTED, eo_item);
380 break; 389 break;
381 case MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT: 390 case MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT:
382 default: 391 default:
@@ -391,7 +400,7 @@ _current_button_change(Evas_Object *obj,
391 Evas_Object *btn) 400 Evas_Object *btn)
392{ 401{
393 Eina_List *l; 402 Eina_List *l;
394 Elm_Multibuttonentry_Item *item; 403 Elm_Widobj_Item *eo_item;
395 404
396 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd); 405 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
397 406
@@ -399,11 +408,12 @@ _current_button_change(Evas_Object *obj,
399 _current_button_state_change(obj, MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT); 408 _current_button_state_change(obj, MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT);
400 409
401 // change the current 410 // change the current
402 EINA_LIST_FOREACH(sd->items, l, item) 411 EINA_LIST_FOREACH(sd->items, l, eo_item)
403 { 412 {
413 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
404 if (item->button == btn) 414 if (item->button == btn)
405 { 415 {
406 sd->selected_it = (Elm_Object_Item *)item; 416 sd->selected_it = (Elm_Object_Item *)eo_item;
407 break; 417 break;
408 } 418 }
409 } 419 }
@@ -463,7 +473,7 @@ _button_clicked_cb(void *data,
463 const char *emission EINA_UNUSED, 473 const char *emission EINA_UNUSED,
464 const char *source EINA_UNUSED) 474 const char *source EINA_UNUSED)
465{ 475{
466 Elm_Multibuttonentry_Item *item = NULL; 476 Elm_Widobj_Item *eo_item = NULL;
467 477
468 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); 478 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
469 479
@@ -473,9 +483,10 @@ _button_clicked_cb(void *data,
473 483
474 if (sd->selected_it) 484 if (sd->selected_it)
475 { 485 {
476 if ((item = (Elm_Multibuttonentry_Item *)sd->selected_it) != NULL) 486 if ((eo_item = (Elm_Widobj_Item *)sd->selected_it) != NULL)
477 { 487 {
478 evas_object_smart_callback_call(data, SIG_ITEM_CLICKED, item); 488 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
489 evas_object_smart_callback_call(data, SIG_ITEM_CLICKED, eo_item);
479 _button_select(data, item->button); 490 _button_select(data, item->button);
480 } 491 }
481 } 492 }
@@ -488,15 +499,16 @@ _button_deleted_cb(void *data,
488 const char *source EINA_UNUSED) 499 const char *source EINA_UNUSED)
489{ 500{
490 Eina_List *l; 501 Eina_List *l;
491 Elm_Multibuttonentry_Item *item = NULL; 502 Elm_Widobj_Item *eo_item = NULL;
492 503
493 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); 504 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
494 // change the current 505 // change the current
495 EINA_LIST_FOREACH(sd->items, l, item) 506 EINA_LIST_FOREACH(sd->items, l, eo_item)
496 { 507 {
508 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
497 if (item->button == obj) 509 if (item->button == obj)
498 { 510 {
499 elm_widget_item_del(item); 511 eo_do(eo_item, elm_wdg_item_del());
500 break; 512 break;
501 } 513 }
502 } 514 }
@@ -534,22 +546,21 @@ _button_resize(Evas_Object *obj,
534 if (vieww) *vieww = vw; 546 if (vieww) *vieww = vw;
535} 547}
536 548
537static void 549EOLIAN static void
538_item_signal_emit_hook(Elm_Object_Item *it, 550_elm_multibuttonentry_item_elm_widget_item_signal_emit(Eo *eo_item EINA_UNUSED,
539 const char *emission, 551 Elm_Multibuttonentry_Item_Data *item,
540 const char *source) 552 const char *emission,
553 const char *source)
541{ 554{
542 Elm_Multibuttonentry_Item *item = (Elm_Multibuttonentry_Item *)it;
543
544 edje_object_signal_emit(item->button, emission, source); 555 edje_object_signal_emit(item->button, emission, source);
545} 556}
546 557
547static void 558EOLIAN static void
548_item_text_set_hook(Elm_Object_Item *it, 559_elm_multibuttonentry_item_elm_widget_item_part_text_set(Eo *eo_item EINA_UNUSED,
549 const char *part, 560 Elm_Multibuttonentry_Item_Data *item,
550 const char *label) 561 const char *part,
562 const char *label)
551{ 563{
552 Elm_Multibuttonentry_Item *item;
553 const char *dest_part = NULL; 564 const char *dest_part = NULL;
554 565
555 if (!part || !strcmp(part, "elm.text")) 566 if (!part || !strcmp(part, "elm.text"))
@@ -557,16 +568,15 @@ _item_text_set_hook(Elm_Object_Item *it,
557 else 568 else
558 dest_part = part; 569 dest_part = part;
559 570
560 item = (Elm_Multibuttonentry_Item *)it;
561 edje_object_part_text_escaped_set(item->button, dest_part, label); 571 edje_object_part_text_escaped_set(item->button, dest_part, label);
562 _button_resize(item->base.widget, item->button, &item->rw, &item->vw); 572 _button_resize(item->base->widget, item->button, &item->rw, &item->vw);
563} 573}
564 574
565static const char * 575EOLIAN static const char *
566_item_text_get_hook(const Elm_Object_Item *it, 576_elm_multibuttonentry_item_elm_widget_item_part_text_get(Eo *eo_item EINA_UNUSED,
567 const char *part) 577 Elm_Multibuttonentry_Item_Data *item,
578 const char *part)
568{ 579{
569 Elm_Multibuttonentry_Item *item;
570 const char *src_part = NULL; 580 const char *src_part = NULL;
571 581
572 if (!part || !strcmp(part, "elm.text")) 582 if (!part || !strcmp(part, "elm.text"))
@@ -574,14 +584,14 @@ _item_text_get_hook(const Elm_Object_Item *it,
574 else 584 else
575 src_part = part; 585 src_part = part;
576 586
577 item = (Elm_Multibuttonentry_Item *)it;
578 return edje_object_part_text_get(item->button, src_part); 587 return edje_object_part_text_get(item->button, src_part);
579} 588}
580 589
581static Eina_Bool 590EOLIAN static Eina_Bool
582_item_del_pre_hook(Elm_Object_Item *it) 591_elm_multibuttonentry_item_elm_widget_item_del_pre(Eo *it,
592 Elm_Multibuttonentry_Item_Data *item EINA_UNUSED)
583{ 593{
584 _button_item_del((Elm_Multibuttonentry_Item *)it); 594 _button_item_del(it);
585 595
586 return EINA_TRUE; 596 return EINA_TRUE;
587} 597}
@@ -611,9 +621,10 @@ _access_multibuttonentry_label_register(Evas_Object *obj, Eina_Bool is_access)
611 621
612static void 622static void
613_access_multibuttonentry_item_register(Evas_Object *obj, 623_access_multibuttonentry_item_register(Evas_Object *obj,
614 Elm_Multibuttonentry_Item *item, 624 Elm_Widobj_Item *eo_item,
615 Eina_Bool is_access) 625 Eina_Bool is_access)
616{ 626{
627 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
617 if (is_access) 628 if (is_access)
618 { 629 {
619 Evas_Object *ao; 630 Evas_Object *ao;
@@ -632,6 +643,13 @@ _access_multibuttonentry_item_register(Evas_Object *obj,
632 evas_object_propagate_events_set(item->button, !is_access); 643 evas_object_propagate_events_set(item->button, !is_access);
633} 644}
634 645
646EOLIAN static void
647_elm_multibuttonentry_item_eo_base_constructor(Eo *obj, Elm_Multibuttonentry_Item_Data *it)
648{
649 eo_do_super(obj, ELM_MULTIBUTTONENTRY_ITEM_CLASS, eo_constructor());
650 it->base = eo_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
651}
652
635static Elm_Object_Item * 653static Elm_Object_Item *
636_button_item_add(Elm_Multibuttonentry_Data *sd, 654_button_item_add(Elm_Multibuttonentry_Data *sd,
637 const char *str, 655 const char *str,
@@ -644,10 +662,10 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
644 Evas_Object *btn; 662 Evas_Object *btn;
645 Evas_Coord rw, vw; 663 Evas_Coord rw, vw;
646 char *str_utf8 = NULL; 664 char *str_utf8 = NULL;
647 Elm_Multibuttonentry_Item *item; 665 Elm_Widobj_Item *eo_item;
648 Evas_Coord width = -1, height = -1; 666 Evas_Coord width = -1, height = -1;
649 Elm_Multibuttonentry_Item_Filter *item_filter; 667 Elm_Multibuttonentry_Item_Filter *item_filter;
650 Elm_Multibuttonentry_Item *reference = (Elm_Multibuttonentry_Item *)ref; 668 Elm_Widobj_Item *eo_reference = (Elm_Widobj_Item *)ref;
651 Evas_Object *obj; 669 Evas_Object *obj;
652 670
653 obj = sd->parent; 671 obj = sd->parent;
@@ -681,16 +699,15 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
681 evas_object_size_hint_weight_set(btn, 0.0, 0.0); 699 evas_object_size_hint_weight_set(btn, 0.0, 0.0);
682 evas_object_show(btn); 700 evas_object_show(btn);
683 701
702 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_reference, reference);
703
684 // append item list 704 // append item list
685 item = elm_widget_item_new(obj, Elm_Multibuttonentry_Item); 705 eo_item = eo_add(ELM_MULTIBUTTONENTRY_ITEM_CLASS, obj);
686 if (!item) return NULL; 706 if (!eo_item) return NULL;
687 707
688 elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook); 708 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
689 elm_widget_item_text_set_hook_set(item, _item_text_set_hook);
690 elm_widget_item_text_get_hook_set(item, _item_text_get_hook);
691 elm_widget_item_signal_emit_hook_set(item, _item_signal_emit_hook);
692 709
693 elm_widget_item_data_set(item, data); 710 eo_do(eo_item, elm_wdg_item_data_set(data));
694 _button_resize(obj, btn, &rw, &vw); 711 _button_resize(obj, btn, &rw, &vw);
695 712
696 item->button = btn; 713 item->button = btn;
@@ -713,7 +730,7 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
713 _elm_access_say(text); 730 _elm_access_say(text);
714 eina_strbuf_free(buf); 731 eina_strbuf_free(buf);
715 732
716 _access_multibuttonentry_item_register(obj, item, EINA_TRUE); 733 _access_multibuttonentry_item_register(obj, eo_item, EINA_TRUE);
717 } 734 }
718 735
719 if (func) 736 if (func)
@@ -724,7 +741,7 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
724 switch (pos) 741 switch (pos)
725 { 742 {
726 case MULTIBUTTONENTRY_POS_START: 743 case MULTIBUTTONENTRY_POS_START:
727 sd->items = eina_list_prepend(sd->items, item); 744 sd->items = eina_list_prepend(sd->items, eo_item);
728 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK) 745 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK)
729 { 746 {
730 elm_widget_sub_object_add(obj, btn); 747 elm_widget_sub_object_add(obj, btn);
@@ -742,7 +759,7 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
742 break; 759 break;
743 760
744 case MULTIBUTTONENTRY_POS_END: 761 case MULTIBUTTONENTRY_POS_END:
745 sd->items = eina_list_append(sd->items, item); 762 sd->items = eina_list_append(sd->items, eo_item);
746 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK) 763 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK)
747 { 764 {
748 elm_widget_sub_object_add(obj, btn); 765 elm_widget_sub_object_add(obj, btn);
@@ -762,10 +779,10 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
762 break; 779 break;
763 780
764 case MULTIBUTTONENTRY_POS_BEFORE: 781 case MULTIBUTTONENTRY_POS_BEFORE:
765 if (reference) 782 if (eo_reference)
766 sd->items = eina_list_prepend_relative(sd->items, item, reference); 783 sd->items = eina_list_prepend_relative(sd->items, eo_item, eo_reference);
767 else 784 else
768 sd->items = eina_list_append(sd->items, item); 785 sd->items = eina_list_append(sd->items, eo_item);
769 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK) 786 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK)
770 { 787 {
771 elm_widget_sub_object_add(obj, btn); 788 elm_widget_sub_object_add(obj, btn);
@@ -774,7 +791,7 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
774 } 791 }
775 else 792 else
776 { 793 {
777 if (reference) 794 if (eo_reference)
778 elm_box_pack_before(sd->box, btn, reference->button); 795 elm_box_pack_before(sd->box, btn, reference->button);
779 else 796 else
780 { 797 {
@@ -791,10 +808,10 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
791 break; 808 break;
792 809
793 case MULTIBUTTONENTRY_POS_AFTER: 810 case MULTIBUTTONENTRY_POS_AFTER:
794 if (reference) 811 if (eo_reference)
795 sd->items = eina_list_append_relative(sd->items, item, reference); 812 sd->items = eina_list_append_relative(sd->items, eo_item, eo_reference);
796 else 813 else
797 sd->items = eina_list_append(sd->items, item); 814 sd->items = eina_list_append(sd->items, eo_item);
798 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK) 815 if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK)
799 { 816 {
800 elm_widget_sub_object_add(obj, btn); 817 elm_widget_sub_object_add(obj, btn);
@@ -802,7 +819,7 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
802 } 819 }
803 else 820 else
804 { 821 {
805 if (reference) 822 if (eo_reference)
806 elm_box_pack_after(sd->box, btn, reference->button); 823 elm_box_pack_after(sd->box, btn, reference->button);
807 else 824 else
808 { 825 {
@@ -821,11 +838,11 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
821 default: 838 default:
822 break; 839 break;
823 } 840 }
824 evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, item); 841 evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, eo_item);
825 842
826 free(str_utf8); 843 free(str_utf8);
827 844
828 return (Elm_Object_Item *)item; 845 return (Elm_Object_Item *)eo_item;
829} 846}
830 847
831//FIXME: having an empty event handling function and reacting on Evas 848//FIXME: having an empty event handling function and reacting on Evas
@@ -937,13 +954,14 @@ _entry_focus_in_cb(void *data,
937 Evas_Object *obj EINA_UNUSED, 954 Evas_Object *obj EINA_UNUSED,
938 void *event_info EINA_UNUSED) 955 void *event_info EINA_UNUSED)
939{ 956{
940 Elm_Multibuttonentry_Item *item = NULL; 957 Elm_Widobj_Item *eo_item = NULL;
941 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); 958 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
942 959
943 if (sd->selected_it) 960 if (sd->selected_it)
944 { 961 {
945 item = (Elm_Multibuttonentry_Item *)sd->selected_it; 962 eo_item = (Elm_Widobj_Item *)sd->selected_it;
946 elm_object_focus_set(sd->entry, EINA_FALSE); 963 elm_object_focus_set(sd->entry, EINA_FALSE);
964 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
947 evas_object_focus_set(item->button, EINA_TRUE); 965 evas_object_focus_set(item->button, EINA_TRUE);
948 } 966 }
949} 967}
@@ -978,7 +996,7 @@ _layout_key_down_cb(void *data,
978 Evas_Object *obj EINA_UNUSED, 996 Evas_Object *obj EINA_UNUSED,
979 void *event_info) 997 void *event_info)
980{ 998{
981 Elm_Multibuttonentry_Item *item = NULL; 999 Elm_Widobj_Item *eo_item = NULL;
982 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); 1000 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd);
983 Evas_Event_Key_Up *ev = (Evas_Event_Key_Up *)event_info; 1001 Evas_Event_Key_Up *ev = (Evas_Event_Key_Up *)event_info;
984 1002
@@ -990,10 +1008,10 @@ _layout_key_down_cb(void *data,
990 ((strcmp(ev->key, "BackSpace") == 0) || 1008 ((strcmp(ev->key, "BackSpace") == 0) ||
991 (strcmp(ev->key, "Delete") == 0))) 1009 (strcmp(ev->key, "Delete") == 0)))
992 { 1010 {
993 item = (Elm_Multibuttonentry_Item *)sd->selected_it; 1011 eo_item = (Elm_Widobj_Item *)sd->selected_it;
994 if (item && sd->editable) 1012 if (eo_item && sd->editable)
995 { 1013 {
996 elm_widget_item_del(item); 1014 eo_do(eo_item, elm_wdg_item_del());
997 elm_object_focus_set(sd->entry, EINA_TRUE); 1015 elm_object_focus_set(sd->entry, EINA_TRUE);
998 } 1016 }
999 } 1017 }
@@ -1001,9 +1019,12 @@ _layout_key_down_cb(void *data,
1001 (strcmp(ev->key, "BackSpace") == 0)) || 1019 (strcmp(ev->key, "BackSpace") == 0)) ||
1002 (strcmp(ev->key, "Delete") == 0))) 1020 (strcmp(ev->key, "Delete") == 0)))
1003 { 1021 {
1004 item = eina_list_data_get(eina_list_last(sd->items)); 1022 eo_item = eina_list_data_get(eina_list_last(sd->items));
1005 if (item) 1023 if (eo_item)
1006 _button_select(sd->parent, item->button); 1024 {
1025 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
1026 _button_select(sd->parent, item->button);
1027 }
1007 } 1028 }
1008 } 1029 }
1009 else 1030 else
@@ -1428,7 +1449,7 @@ _access_info_cb(void *data EINA_UNUSED, Evas_Object *obj)
1428 char *ret; 1449 char *ret;
1429 Eina_Strbuf *buf; 1450 Eina_Strbuf *buf;
1430 Eina_List *l = NULL; 1451 Eina_List *l = NULL;
1431 Elm_Multibuttonentry_Item *it; 1452 Elm_Widobj_Item *eo_item;
1432 1453
1433 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, NULL); 1454 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
1434 1455
@@ -1443,8 +1464,9 @@ _access_info_cb(void *data EINA_UNUSED, Evas_Object *obj)
1443 if (sd->label_str) eina_strbuf_append(buf, sd->label_str); 1464 if (sd->label_str) eina_strbuf_append(buf, sd->label_str);
1444 1465
1445 int invisible_its = 0; 1466 int invisible_its = 0;
1446 EINA_LIST_FOREACH (sd->items, l, it) 1467 EINA_LIST_FOREACH (sd->items, l, eo_item)
1447 { 1468 {
1469 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, it);
1448 if (it->visible) 1470 if (it->visible)
1449 eina_strbuf_append_printf(buf, ", %s", 1471 eina_strbuf_append_printf(buf, ", %s",
1450 edje_object_part_text_get(it->button, "elm.btn.text")); 1472 edje_object_part_text_get(it->button, "elm.btn.text"));
@@ -1493,12 +1515,13 @@ _elm_multibuttonentry_evas_object_smart_add(Eo *obj, Elm_Multibuttonentry_Data *
1493EOLIAN static void 1515EOLIAN static void
1494_elm_multibuttonentry_evas_object_smart_del(Eo *obj, Elm_Multibuttonentry_Data *sd) 1516_elm_multibuttonentry_evas_object_smart_del(Eo *obj, Elm_Multibuttonentry_Data *sd)
1495{ 1517{
1496 Elm_Multibuttonentry_Item *item; 1518 Elm_Widobj_Item *eo_item;
1497 1519
1498 EINA_LIST_FREE(sd->items, item) 1520 EINA_LIST_FREE(sd->items, eo_item)
1499 { 1521 {
1522 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
1500 evas_object_del(item->button); 1523 evas_object_del(item->button);
1501 free(item); 1524 eo_del(eo_item);
1502 } 1525 }
1503 sd->items = NULL; 1526 sd->items = NULL;
1504 1527
@@ -1535,7 +1558,7 @@ _elm_multibuttonentry_elm_widget_focus_next(Eo *obj, Elm_Multibuttonentry_Data *
1535 1558
1536 Eina_List *items = NULL; 1559 Eina_List *items = NULL;
1537 Eina_List *l = NULL; 1560 Eina_List *l = NULL;
1538 Elm_Multibuttonentry_Item *it; 1561 Elm_Widobj_Item *eo_item;
1539 Evas_Object *ao; 1562 Evas_Object *ao;
1540 Evas_Object *po; 1563 Evas_Object *po;
1541 1564
@@ -1553,8 +1576,9 @@ _elm_multibuttonentry_elm_widget_focus_next(Eo *obj, Elm_Multibuttonentry_Data *
1553 items = eina_list_append(items, ao); 1576 items = eina_list_append(items, ao);
1554 } 1577 }
1555 1578
1556 EINA_LIST_FOREACH (sd->items, l, it) 1579 EINA_LIST_FOREACH (sd->items, l, eo_item)
1557 { 1580 {
1581 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, it);
1558 po = (Evas_Object *)edje_object_part_object_get 1582 po = (Evas_Object *)edje_object_part_object_get
1559 (it->button, "elm.btn.text"); 1583 (it->button, "elm.btn.text");
1560 ao = evas_object_data_get(po, "_part_access_obj"); 1584 ao = evas_object_data_get(po, "_part_access_obj");
@@ -1582,7 +1606,7 @@ static void
1582_access_obj_process(Evas_Object *obj, Eina_Bool is_access) 1606_access_obj_process(Evas_Object *obj, Eina_Bool is_access)
1583{ 1607{
1584 Eina_List *l; 1608 Eina_List *l;
1585 Elm_Multibuttonentry_Item *it; 1609 Elm_Widobj_Item *it;
1586 1610
1587 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd); 1611 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
1588 1612
@@ -1725,23 +1749,21 @@ _elm_multibuttonentry_selected_item_get(Eo *obj EINA_UNUSED, Elm_Multibuttonentr
1725 return sd->selected_it; 1749 return sd->selected_it;
1726} 1750}
1727 1751
1728EAPI void 1752EOLIAN static void
1729elm_multibuttonentry_item_selected_set(Elm_Object_Item *it, 1753_elm_multibuttonentry_item_selected_set(Eo *eo_item EINA_UNUSED,
1730 Eina_Bool selected) 1754 Elm_Multibuttonentry_Item_Data *item,
1755 Eina_Bool selected)
1731{ 1756{
1732 Elm_Multibuttonentry_Item *item = (Elm_Multibuttonentry_Item *)it;
1733
1734 ELM_MULTIBUTTONENTRY_ITEM_CHECK_OR_RETURN(it);
1735
1736 if (selected) _button_select(WIDGET(item), item->button); 1757 if (selected) _button_select(WIDGET(item), item->button);
1737 else _button_select(WIDGET(item), NULL); 1758 else _button_select(WIDGET(item), NULL);
1738} 1759}
1739 1760
1740EAPI Eina_Bool 1761EOLIAN static Eina_Bool
1741elm_multibuttonentry_item_selected_get(const Elm_Object_Item *it) 1762_elm_multibuttonentry_item_selected_get(Eo *eo_item,
1763 Elm_Multibuttonentry_Item_Data *item EINA_UNUSED)
1742{ 1764{
1743 //TODO : To be implemented. 1765 //TODO : To be implemented.
1744 if (!it) return EINA_FALSE; 1766 if (!eo_item) return EINA_FALSE;
1745 1767
1746 return EINA_TRUE; 1768 return EINA_TRUE;
1747} 1769}
@@ -1749,15 +1771,16 @@ elm_multibuttonentry_item_selected_get(const Elm_Object_Item *it)
1749EOLIAN static void 1771EOLIAN static void
1750_elm_multibuttonentry_clear(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd) 1772_elm_multibuttonentry_clear(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
1751{ 1773{
1752 Elm_Multibuttonentry_Item *item; 1774 Elm_Widobj_Item *eo_item;
1753 1775
1754 if (sd->items) 1776 if (sd->items)
1755 { 1777 {
1756 EINA_LIST_FREE(sd->items, item) 1778 EINA_LIST_FREE(sd->items, eo_item)
1757 { 1779 {
1780 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
1758 elm_box_unpack(sd->box, item->button); 1781 elm_box_unpack(sd->box, item->button);
1759 evas_object_del(item->button); 1782 evas_object_del(item->button);
1760 free(item); 1783 eo_del(eo_item);
1761 } 1784 }
1762 sd->items = NULL; 1785 sd->items = NULL;
1763 } 1786 }
@@ -1765,18 +1788,18 @@ _elm_multibuttonentry_clear(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
1765 _view_update(sd); 1788 _view_update(sd);
1766} 1789}
1767 1790
1768EAPI Elm_Object_Item * 1791EOLIAN static Elm_Widobj_Item *
1769elm_multibuttonentry_item_prev_get(const Elm_Object_Item *it) 1792_elm_multibuttonentry_item_prev_get(Eo *it,
1793 Elm_Multibuttonentry_Item_Data *it_data)
1770{ 1794{
1771 Eina_List *l; 1795 Eina_List *l;
1772 Elm_Multibuttonentry_Item *item; 1796 Elm_Widobj_Item *eo_item;
1773 1797
1774 ELM_MULTIBUTTONENTRY_ITEM_CHECK_OR_RETURN(it, NULL); 1798 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(it_data), sd, NULL);
1775 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(it), sd, NULL);
1776 1799
1777 EINA_LIST_FOREACH(sd->items, l, item) 1800 EINA_LIST_FOREACH(sd->items, l, eo_item)
1778 { 1801 {
1779 if (item == (Elm_Multibuttonentry_Item *)it) 1802 if (eo_item == (Elm_Widobj_Item *)it)
1780 { 1803 {
1781 l = eina_list_prev(l); 1804 l = eina_list_prev(l);
1782 if (!l) return NULL; 1805 if (!l) return NULL;
@@ -1786,18 +1809,18 @@ elm_multibuttonentry_item_prev_get(const Elm_Object_Item *it)
1786 return NULL; 1809 return NULL;
1787} 1810}
1788 1811
1789EAPI Elm_Object_Item * 1812EOLIAN static Elm_Widobj_Item *
1790elm_multibuttonentry_item_next_get(const Elm_Object_Item *it) 1813_elm_multibuttonentry_item_next_get(Eo *it,
1814 Elm_Multibuttonentry_Item_Data *it_data)
1791{ 1815{
1792 Eina_List *l; 1816 Eina_List *l;
1793 Elm_Multibuttonentry_Item *item; 1817 Elm_Widobj_Item *eo_item;
1794 1818
1795 ELM_MULTIBUTTONENTRY_ITEM_CHECK_OR_RETURN(it, NULL); 1819 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(it_data), sd, NULL);
1796 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(WIDGET(it), sd, NULL);
1797 1820
1798 EINA_LIST_FOREACH(sd->items, l, item) 1821 EINA_LIST_FOREACH(sd->items, l, eo_item)
1799 { 1822 {
1800 if (item == (Elm_Multibuttonentry_Item *)it) 1823 if (eo_item == (Elm_Widobj_Item *)it)
1801 { 1824 {
1802 l = eina_list_next(l); 1825 l = eina_list_next(l);
1803 if (!l) return NULL; 1826 if (!l) return NULL;
@@ -1810,14 +1833,16 @@ elm_multibuttonentry_item_next_get(const Elm_Object_Item *it)
1810EINA_DEPRECATED EAPI void * 1833EINA_DEPRECATED EAPI void *
1811elm_multibuttonentry_item_data_get(const Elm_Object_Item *it) 1834elm_multibuttonentry_item_data_get(const Elm_Object_Item *it)
1812{ 1835{
1813 return elm_widget_item_data_get(it); 1836 void *ret = NULL;
1837 eo_do((Eo*)it, ret = elm_wdg_item_data_get());
1838 return ret;
1814} 1839}
1815 1840
1816EINA_DEPRECATED EAPI void 1841EINA_DEPRECATED EAPI void
1817elm_multibuttonentry_item_data_set(Elm_Object_Item *it, 1842elm_multibuttonentry_item_data_set(Elm_Object_Item *it,
1818 void *data) 1843 void *data)
1819{ 1844{
1820 return elm_widget_item_data_set(it, data); 1845 eo_do((Eo*)it, elm_wdg_item_data_set(data));
1821} 1846}
1822 1847
1823EOLIAN static void 1848EOLIAN static void
@@ -1898,4 +1923,36 @@ _elm_multibuttonentry_class_constructor(Eo_Class *klass)
1898 _elm_multibuttonentry_smart_focus_next_enable = EINA_TRUE; 1923 _elm_multibuttonentry_smart_focus_next_enable = EINA_TRUE;
1899} 1924}
1900 1925
1926EAPI void
1927elm_multibuttonentry_item_selected_set(Elm_Object_Item *it,
1928 Eina_Bool selected)
1929{
1930 eo_do((Eo*)it, elm_obj_multibuttonentry_item_selected_set(selected));
1931}
1932
1933EAPI Eina_Bool
1934elm_multibuttonentry_item_selected_get(const Elm_Object_Item *it)
1935{
1936 Eina_Bool ret;
1937 eo_do((Eo*)it, ret = elm_obj_multibuttonentry_item_selected_get());
1938 return ret;
1939}
1940
1941EAPI Elm_Object_Item *
1942elm_multibuttonentry_item_prev_get(const Elm_Object_Item *it)
1943{
1944 Elm_Widobj_Item *ret = NULL;
1945 eo_do((Eo*)it, ret = elm_obj_multibuttonentry_item_prev_get());
1946 return (Elm_Object_Item *)ret;
1947}
1948
1949EAPI Elm_Object_Item *
1950elm_multibuttonentry_item_next_get(const Elm_Object_Item *it)
1951{
1952 Elm_Widobj_Item *ret = NULL;
1953 eo_do((Eo*)it, ret = elm_obj_multibuttonentry_item_next_get());
1954 return (Elm_Object_Item *)ret;
1955}
1956
1957#include "elm_multibuttonentry_item.eo.c"
1901#include "elc_multibuttonentry.eo.c" 1958#include "elc_multibuttonentry.eo.c"
diff --git a/src/lib/elm_multibuttonentry_item.eo b/src/lib/elm_multibuttonentry_item.eo
new file mode 100644
index 000000000..619132c12
--- /dev/null
+++ b/src/lib/elm_multibuttonentry_item.eo
@@ -0,0 +1,57 @@
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 {
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 const;
36 return Elm_Widobj_Item*;
37 }
38 next_get {
39 /*@
40 Get the next item in the multibuttonentry
41
42 @return The item after the item @p it
43
44 @ingroup Multibuttonentry
45 */
46 const;
47 return Elm_Widobj_Item*;
48 }
49 }
50 implements {
51 Eo_Base::constructor;
52 Elm_Widget_Item::del_pre;
53 Elm_Widget_Item::signal_emit;
54 Elm_Widget_Item::part_text::get;
55 Elm_Widget_Item::part_text::set;
56 }
57} \ No newline at end of file
diff --git a/src/lib/elm_widget_multibuttonentry.h b/src/lib/elm_widget_multibuttonentry.h
index c0191372a..619372174 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/** 9/**
7 * @addtogroup Widget 10 * @addtogroup Widget
@@ -47,11 +50,11 @@ typedef enum _Multibuttonentry_View_State
47 MULTIBUTTONENTRY_VIEW_SHRINK 50 MULTIBUTTONENTRY_VIEW_SHRINK
48} Multibuttonentry_View_State; 51} Multibuttonentry_View_State;
49 52
50typedef struct _Multibuttonentry_Item Elm_Multibuttonentry_Item; 53typedef struct _Multibuttonentry_Item_Data Elm_Multibuttonentry_Item_Data;
51 54
52struct _Multibuttonentry_Item 55struct _Multibuttonentry_Item_Data
53{ 56{
54 ELM_WIDGET_ITEM; 57 Elm_Widget_Item_Data *base;
55 58
56 Evas_Object *button; 59 Evas_Object *button;
57 Evas_Coord vw, rw; // vw: visual width, real width 60 Evas_Coord vw, rw; // vw: visual width, real width
@@ -123,16 +126,19 @@ struct _Elm_Multibuttonentry_Data
123 return val; \ 126 return val; \
124 } 127 }
125 128
129#define ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(o, sd) \
130 Elm_Multibuttonentry_Item_Data * sd = eo_data_scope_get(o, ELM_MULTIBUTTONENTRY_ITEM_CLASS)
131
126#define ELM_MULTIBUTTONENTRY_CHECK(obj) \ 132#define ELM_MULTIBUTTONENTRY_CHECK(obj) \
127 if (EINA_UNLIKELY(!eo_isa((obj), ELM_MULTIBUTTONENTRY_CLASS))) \ 133 if (EINA_UNLIKELY(!eo_isa((obj), ELM_MULTIBUTTONENTRY_CLASS))) \
128 return 134 return
129 135
130#define ELM_MULTIBUTTONENTRY_ITEM_CHECK(it) \ 136#define ELM_MULTIBUTTONENTRY_ITEM_CHECK(obj) \
131 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, ); \ 137 if (EINA_UNLIKELY(!eo_isa((obj), ELM_MULTIBUTTONENTRY_ITEM_CLASS))) \
132 ELM_MULTIBUTTONENTRY_CHECK(it->base.widget); 138 return
133 139
134#define ELM_MULTIBUTTONENTRY_ITEM_CHECK_OR_RETURN(it, ...) \ 140#define ELM_MULTIBUTTONENTRY_ITEM_CHECK_OR_RETURN(obj, ...) \
135 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \ 141 if (EINA_UNLIKELY(!eo_isa((obj), ELM_MULTIBUTTONENTRY_ITEM_CLASS))) \
136 ELM_MULTIBUTTONENTRY_CHECK(it->base.widget) __VA_ARGS__; 142 return __VA_ARGS__;
137 143
138#endif 144#endif