summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-01 17:31:30 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-17 15:08:42 +0300
commitaca812bc3b8cc64c17546a6bca22224aebcca7af (patch)
tree635369265c94600027e79a89936043e16da4c7da
parenteb928d7c439371326e217f3f1e7ad79f24bdc063 (diff)
Porting to Eo: Elm Popup Item
-rw-r--r--src/lib/Makefile.am11
-rw-r--r--src/lib/elc_popup.c113
-rw-r--r--src/lib/elm_popup_item.eo17
-rw-r--r--src/lib/elm_widget_popup.h18
4 files changed, 87 insertions, 72 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 53f8e9fbb..cba8aa481 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -877,7 +877,9 @@ BUILT_SOURCES = \
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 \ 879 elm_diskselector_item.eo.c \
880 elm_diskselector_item.eo.h 880 elm_diskselector_item.eo.h \
881 elm_popup_item.eo.c \
882 elm_popup_item.eo.h
881 883
882elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@ 884elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@
883elementaryeolianfiles_DATA = \ 885elementaryeolianfiles_DATA = \
@@ -988,7 +990,8 @@ elementaryeolianfiles_DATA = \
988 elm_gengrid_item.eo \ 990 elm_gengrid_item.eo \
989 elm_list_item.eo \ 991 elm_list_item.eo \
990 elm_toolbar_item.eo \ 992 elm_toolbar_item.eo \
991 elm_diskselector_item.eo 993 elm_diskselector_item.eo \
994 elm_popup_item.eo
992 995
993EXTRA_DIST += ${elementaryeolianfiles_DATA} 996EXTRA_DIST += ${elementaryeolianfiles_DATA}
994 997
@@ -1099,6 +1102,7 @@ nodist_includesunstable_HEADERS = \
1099 elm_list_item.eo.h \ 1102 elm_list_item.eo.h \
1100 elm_toolbar_item.eo.h \ 1103 elm_toolbar_item.eo.h \
1101 elm_diskselector_item.eo.h \ 1104 elm_diskselector_item.eo.h \
1105 elm_popup_item.eo.h \
1102 elm_ctxpopup_item.eo.h \ 1106 elm_ctxpopup_item.eo.h \
1103 elm_slideshow_item.eo.h \ 1107 elm_slideshow_item.eo.h \
1104 elm_layout.eo.legacy.h \ 1108 elm_layout.eo.legacy.h \
@@ -1180,7 +1184,8 @@ nodist_includesunstable_HEADERS = \
1180 elm_gengrid_item.eo.legacy.h \ 1184 elm_gengrid_item.eo.legacy.h \
1181 elm_list_item.eo.legacy.h \ 1185 elm_list_item.eo.legacy.h \
1182 elm_toolbar_item.eo.legacy.h \ 1186 elm_toolbar_item.eo.legacy.h \
1183 elm_diskselector_item.eo.legacy.h 1187 elm_diskselector_item.eo.legacy.h \
1188 elm_popup_item.eo.legacy.h
1184 1189
1185if HAVE_CXX11 1190if HAVE_CXX11
1186 1191
diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c
index 76ac2c55b..f3ec354e1 100644
--- a/src/lib/elc_popup.c
+++ b/src/lib/elc_popup.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_popup.h" 8#include "elm_widget_popup.h"
@@ -14,6 +15,8 @@
14#include "elm_interface_atspi_widget_action.h" 15#include "elm_interface_atspi_widget_action.h"
15#include "elm_interface_atspi_widget_action.eo.h" 16#include "elm_interface_atspi_widget_action.eo.h"
16 17
18#include "elm_popup_item.eo.h"
19
17#define MY_CLASS ELM_POPUP_CLASS 20#define MY_CLASS ELM_POPUP_CLASS
18 21
19#define MY_CLASS_NAME "Elm_Popup" 22#define MY_CLASS_NAME "Elm_Popup"
@@ -56,11 +59,11 @@ static void _on_content_del(void *data, Evas *e, Evas_Object *obj, void *event_
56EOLIAN static Eina_Bool 59EOLIAN static Eina_Bool
57_elm_popup_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd) 60_elm_popup_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
58{ 61{
59 Elm_Popup_Item *it; 62 Elm_Popup_Item_Data *it;
60 Eina_List *l; 63 Eina_List *l;
61 64
62 EINA_LIST_FOREACH(sd->items, l, it) 65 EINA_LIST_FOREACH(sd->items, l, it)
63 elm_widget_item_translate(it); 66 eo_do((Eo *)EO_OBJ(it), elm_wdg_item_translate());
64 67
65 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate()); 68 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate());
66 eo_do(sd->main_layout, elm_obj_widget_translate()); 69 eo_do(sd->main_layout, elm_obj_widget_translate());
@@ -181,12 +184,12 @@ _list_del(Elm_Popup_Data *sd)
181static void 184static void
182_items_remove(Elm_Popup_Data *sd) 185_items_remove(Elm_Popup_Data *sd)
183{ 186{
184 Elm_Popup_Item *it; 187 Elm_Popup_Item_Data *it;
185 188
186 if (!sd->items) return; 189 if (!sd->items) return;
187 190
188 EINA_LIST_FREE(sd->items, it) 191 EINA_LIST_FREE(sd->items, it)
189 elm_widget_item_del(it); 192 eo_do((Eo *)EO_OBJ(it), elm_wdg_item_del());
190 193
191 sd->items = NULL; 194 sd->items = NULL;
192} 195}
@@ -294,7 +297,7 @@ _access_obj_process(Eo *obj, Eina_Bool is_access)
294EOLIAN static Eina_Bool 297EOLIAN static Eina_Bool
295_elm_popup_elm_widget_theme_apply(Eo *obj, Elm_Popup_Data *sd) 298_elm_popup_elm_widget_theme_apply(Eo *obj, Elm_Popup_Data *sd)
296{ 299{
297 Elm_Popup_Item *it; 300 Elm_Popup_Item_Data *it;
298 unsigned int i = 0; 301 unsigned int i = 0;
299 Eina_List *elist; 302 Eina_List *elist;
300 char buf[1024], style[1024]; 303 char buf[1024], style[1024];
@@ -371,7 +374,7 @@ _elm_popup_elm_widget_theme_apply(Eo *obj, Elm_Popup_Data *sd)
371} 374}
372 375
373static void 376static void
374_item_sizing_eval(Elm_Popup_Item *it) 377_item_sizing_eval(Elm_Popup_Item_Data *it)
375{ 378{
376 Evas_Coord min_w = -1, min_h = -1, max_w = -1, max_h = -1; 379 Evas_Coord min_w = -1, min_h = -1, max_w = -1, max_h = -1;
377 Evas_Object *edje = elm_layout_edje_get(VIEW(it)); 380 Evas_Object *edje = elm_layout_edje_get(VIEW(it));
@@ -386,7 +389,7 @@ EOLIAN static void
386_elm_popup_elm_layout_sizing_eval(Eo *obj, Elm_Popup_Data *sd) 389_elm_popup_elm_layout_sizing_eval(Eo *obj, Elm_Popup_Data *sd)
387{ 390{
388 Eina_List *elist; 391 Eina_List *elist;
389 Elm_Popup_Item *it; 392 Elm_Popup_Item_Data *it;
390 Evas_Coord h_box = 0, minh_box = 0; 393 Evas_Coord h_box = 0, minh_box = 0;
391 Evas_Coord minw = -1, minh = -1; 394 Evas_Coord minw = -1, minh = -1;
392 395
@@ -415,7 +418,7 @@ _elm_popup_elm_layout_sizing_eval(Eo *obj, Elm_Popup_Data *sd)
415EOLIAN static Eina_Bool 418EOLIAN static Eina_Bool
416_elm_popup_elm_widget_sub_object_del(Eo *obj, Elm_Popup_Data *sd, Evas_Object *sobj) 419_elm_popup_elm_widget_sub_object_del(Eo *obj, Elm_Popup_Data *sd, Evas_Object *sobj)
417{ 420{
418 Elm_Popup_Item *it; 421 Elm_Popup_Item_Data *it;
419 Eina_Bool int_ret = EINA_FALSE; 422 Eina_Bool int_ret = EINA_FALSE;
420 423
421 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_sub_object_del(sobj)); 424 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_sub_object_del(sobj));
@@ -623,15 +626,15 @@ _item_select_cb(void *data,
623 const char *emission EINA_UNUSED, 626 const char *emission EINA_UNUSED,
624 const char *source EINA_UNUSED) 627 const char *source EINA_UNUSED)
625{ 628{
626 Elm_Popup_Item *it = data; 629 Elm_Popup_Item_Data *it = data;
627 630
628 if (!it || it->disabled) return; 631 if (!it || it->disabled) return;
629 if (it->func) 632 if (it->func)
630 it->func((void *)it->base.data, WIDGET(it), data); 633 it->func((void *)it->base->data, WIDGET(it), EO_OBJ(it));
631} 634}
632 635
633static void 636static void
634_item_text_set(Elm_Popup_Item *it, 637_item_text_set(Elm_Popup_Item_Data *it,
635 const char *label) 638 const char *label)
636{ 639{
637 if (!eina_stringshare_replace(&it->label, label)) return; 640 if (!eina_stringshare_replace(&it->label, label)) return;
@@ -648,13 +651,11 @@ _item_text_set(Elm_Popup_Item *it,
648 edje_object_message_signal_process(elm_layout_edje_get(VIEW(it))); 651 edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
649} 652}
650 653
651static void 654EOLIAN static void
652_item_text_set_hook(Elm_Object_Item *item, 655_elm_popup_item_elm_widget_item_part_text_set(Eo *eo_it EINA_UNUSED, Elm_Popup_Item_Data *it,
653 const char *part, 656 const char *part,
654 const char *label) 657 const char *label)
655{ 658{
656 Elm_Popup_Item *it = (Elm_Popup_Item *)item;
657
658 ELM_POPUP_ITEM_CHECK_OR_RETURN(it); 659 ELM_POPUP_ITEM_CHECK_OR_RETURN(it);
659 660
660 if ((!part) || (!strcmp(part, "default"))) 661 if ((!part) || (!strcmp(part, "default")))
@@ -666,12 +667,10 @@ _item_text_set_hook(Elm_Object_Item *item,
666 WRN("The part name is invalid! : popup=%p", WIDGET(it)); 667 WRN("The part name is invalid! : popup=%p", WIDGET(it));
667} 668}
668 669
669static const char * 670EOLIAN static const char *
670_item_text_get_hook(const Elm_Object_Item *item, 671_elm_popup_item_elm_widget_item_part_text_get(Eo *eo_it EINA_UNUSED, Elm_Popup_Item_Data *it,
671 const char *part) 672 const char *part)
672{ 673{
673 Elm_Popup_Item *it = (Elm_Popup_Item *)item;
674
675 ELM_POPUP_ITEM_CHECK_OR_RETURN(it, NULL); 674 ELM_POPUP_ITEM_CHECK_OR_RETURN(it, NULL);
676 675
677 if ((!part) || (!strcmp(part, "default"))) 676 if ((!part) || (!strcmp(part, "default")))
@@ -683,7 +682,7 @@ _item_text_get_hook(const Elm_Object_Item *item,
683} 682}
684 683
685static void 684static void
686_item_icon_set(Elm_Popup_Item *it, 685_item_icon_set(Elm_Popup_Item_Data *it,
687 Evas_Object *icon) 686 Evas_Object *icon)
688{ 687{
689 if (it->icon == icon) return; 688 if (it->icon == icon) return;
@@ -703,13 +702,11 @@ _item_icon_set(Elm_Popup_Item *it,
703 edje_object_message_signal_process(elm_layout_edje_get(VIEW(it))); 702 edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
704} 703}
705 704
706static void 705EOLIAN static void
707_item_content_set_hook(Elm_Object_Item *item, 706_elm_popup_item_elm_widget_item_part_content_set(Eo *eo_it EINA_UNUSED, Elm_Popup_Item_Data *it,
708 const char *part, 707 const char *part,
709 Evas_Object *content) 708 Evas_Object *content)
710{ 709{
711 Elm_Popup_Item *it = (Elm_Popup_Item *)item;
712
713 ELM_POPUP_ITEM_CHECK_OR_RETURN(it); 710 ELM_POPUP_ITEM_CHECK_OR_RETURN(it);
714 711
715 if ((!(part)) || (!strcmp(part, "default"))) 712 if ((!(part)) || (!strcmp(part, "default")))
@@ -718,12 +715,10 @@ _item_content_set_hook(Elm_Object_Item *item,
718 WRN("The part name is invalid! : popup=%p", WIDGET(it)); 715 WRN("The part name is invalid! : popup=%p", WIDGET(it));
719} 716}
720 717
721static Evas_Object * 718EOLIAN static Evas_Object *
722_item_content_get_hook(const Elm_Object_Item *item, 719_elm_popup_item_elm_widget_item_part_content_get(Eo *eo_it EINA_UNUSED, Elm_Popup_Item_Data *it,
723 const char *part) 720 const char *part)
724{ 721{
725 Elm_Popup_Item *it = (Elm_Popup_Item *)item;
726
727 ELM_POPUP_ITEM_CHECK_OR_RETURN(it, NULL); 722 ELM_POPUP_ITEM_CHECK_OR_RETURN(it, NULL);
728 723
729 if ((!(part)) || (!strcmp(part, "default"))) 724 if ((!(part)) || (!strcmp(part, "default")))
@@ -735,7 +730,7 @@ _item_content_get_hook(const Elm_Object_Item *item,
735} 730}
736 731
737static Evas_Object * 732static Evas_Object *
738_item_icon_unset(Elm_Popup_Item *it) 733_item_icon_unset(Elm_Popup_Item_Data *it)
739{ 734{
740 Evas_Object *icon = it->icon; 735 Evas_Object *icon = it->icon;
741 736
@@ -749,12 +744,11 @@ _item_icon_unset(Elm_Popup_Item *it)
749 return icon; 744 return icon;
750} 745}
751 746
752static Evas_Object * 747EOLIAN static Evas_Object *
753_item_content_unset_hook(const Elm_Object_Item *item, 748_elm_popup_item_elm_widget_item_part_content_unset(Eo *eo_it EINA_UNUSED, Elm_Popup_Item_Data *it,
754 const char *part) 749 const char *part)
755{ 750{
756 Evas_Object *content = NULL; 751 Evas_Object *content = NULL;
757 Elm_Popup_Item *it = (Elm_Popup_Item *)item;
758 752
759 ELM_POPUP_ITEM_CHECK_OR_RETURN(it, NULL); 753 ELM_POPUP_ITEM_CHECK_OR_RETURN(it, NULL);
760 754
@@ -766,11 +760,9 @@ _item_content_unset_hook(const Elm_Object_Item *item,
766 return content; 760 return content;
767} 761}
768 762
769static void 763EOLIAN static void
770_item_disable_hook(Elm_Object_Item *item) 764_elm_popup_item_elm_widget_item_disable(Eo *eo_it EINA_UNUSED, Elm_Popup_Item_Data *it)
771{ 765{
772 Elm_Popup_Item *it = (Elm_Popup_Item *)item;
773
774 ELM_POPUP_ITEM_CHECK_OR_RETURN(it); 766 ELM_POPUP_ITEM_CHECK_OR_RETURN(it);
775 767
776 if (elm_widget_item_disabled_get(it)) 768 if (elm_widget_item_disabled_get(it))
@@ -779,11 +771,9 @@ _item_disable_hook(Elm_Object_Item *item)
779 elm_layout_signal_emit(VIEW(it), "elm,state,item,enabled", "elm"); 771 elm_layout_signal_emit(VIEW(it), "elm,state,item,enabled", "elm");
780} 772}
781 773
782static Eina_Bool 774EOLIAN static Eina_Bool
783_item_del_pre_hook(Elm_Object_Item *item) 775_elm_popup_item_elm_widget_item_del_pre(Eo *eo_it EINA_UNUSED, Elm_Popup_Item_Data *it)
784{ 776{
785 Elm_Popup_Item *it = (Elm_Popup_Item *)item;
786
787 ELM_POPUP_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 777 ELM_POPUP_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
788 ELM_POPUP_DATA_GET(WIDGET(it), sd); 778 ELM_POPUP_DATA_GET(WIDGET(it), sd);
789 779
@@ -798,8 +788,8 @@ _item_del_pre_hook(Elm_Object_Item *item)
798 return EINA_TRUE; 788 return EINA_TRUE;
799} 789}
800 790
801static void 791EOLIAN static void
802_item_signal_emit_hook(Elm_Object_Item *it, 792_elm_popup_item_elm_widget_item_signal_emit(Eo *eo_it EINA_UNUSED, Elm_Popup_Item_Data *it,
803 const char *emission, 793 const char *emission,
804 const char *source) 794 const char *source)
805{ 795{
@@ -811,9 +801,9 @@ _item_focused_cb(void *data,
811 Evas_Object *obj EINA_UNUSED, 801 Evas_Object *obj EINA_UNUSED,
812 void *event_info EINA_UNUSED) 802 void *event_info EINA_UNUSED)
813{ 803{
814 Elm_Object_Item *it = data; 804 Elm_Popup_Item_Data *it = data;
815 805
816 evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_FOCUSED, it); 806 evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_FOCUSED, EO_OBJ(it));
817} 807}
818 808
819static void 809static void
@@ -821,25 +811,23 @@ _item_unfocused_cb(void *data,
821 Evas_Object *obj EINA_UNUSED, 811 Evas_Object *obj EINA_UNUSED,
822 void *event_info EINA_UNUSED) 812 void *event_info EINA_UNUSED)
823{ 813{
824 Elm_Object_Item *it = data; 814 Elm_Popup_Item_Data *it = data;
825 815
826 evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_UNFOCUSED, it); 816 evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_UNFOCUSED, EO_OBJ(it));
817}
818
819EOLIAN static void
820_elm_popup_item_eo_base_constructor(Eo *eo_it, Elm_Popup_Item_Data *it)
821{
822 eo_do_super(eo_it, ELM_POPUP_ITEM_CLASS, eo_constructor());
823 it->base = eo_data_scope_get(eo_it, ELM_WIDGET_ITEM_CLASS);
827} 824}
828 825
829static void 826static void
830_item_new(Elm_Popup_Item *it) 827_item_new(Elm_Popup_Item_Data *it)
831{ 828{
832 char style[1024]; 829 char style[1024];
833 830
834 elm_widget_item_text_set_hook_set(it, _item_text_set_hook);
835 elm_widget_item_text_get_hook_set(it, _item_text_get_hook);
836 elm_widget_item_content_set_hook_set(it, _item_content_set_hook);
837 elm_widget_item_content_get_hook_set(it, _item_content_get_hook);
838 elm_widget_item_content_unset_hook_set(it, _item_content_unset_hook);
839 elm_widget_item_disable_hook_set(it, _item_disable_hook);
840 elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook);
841 elm_widget_item_signal_emit_hook_set(it, _item_signal_emit_hook);
842
843 VIEW(it) = elm_layout_add(WIDGET(it)); 831 VIEW(it) = elm_layout_add(WIDGET(it));
844 elm_object_focus_allow_set(VIEW(it), EINA_TRUE); 832 elm_object_focus_allow_set(VIEW(it), EINA_TRUE);
845 833
@@ -1659,11 +1647,11 @@ EOLIAN static Elm_Object_Item*
1659_elm_popup_item_append(Eo *obj, Elm_Popup_Data *sd, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) 1647_elm_popup_item_append(Eo *obj, Elm_Popup_Data *sd, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
1660{ 1648{
1661 Evas_Object *prev_content; 1649 Evas_Object *prev_content;
1662 Elm_Popup_Item *it; 1650 Eo *eo_it;
1663
1664 1651
1665 it = elm_widget_item_new(obj, Elm_Popup_Item); 1652 eo_it = eo_add(ELM_POPUP_ITEM_CLASS, obj);
1666 if (!it) return NULL; 1653 if (!eo_it) return NULL;
1654 ELM_POPUP_ITEM_DATA_GET(eo_it, it);
1667 if (sd->content || sd->text_content_obj) 1655 if (sd->content || sd->text_content_obj)
1668 { 1656 {
1669 prev_content = eo_do(sd->content_area, 1657 prev_content = eo_do(sd->content_area,
@@ -1676,7 +1664,7 @@ _elm_popup_item_append(Eo *obj, Elm_Popup_Data *sd, const char *label, Evas_Obje
1676 _list_add(obj); 1664 _list_add(obj);
1677 1665
1678 it->func = func; 1666 it->func = func;
1679 it->base.data = data; 1667 it->base->data = data;
1680 1668
1681 _item_new(it); 1669 _item_new(it);
1682 _item_icon_set(it, icon); 1670 _item_icon_set(it, icon);
@@ -1688,7 +1676,7 @@ _elm_popup_item_append(Eo *obj, Elm_Popup_Data *sd, const char *label, Evas_Obje
1688 _scroller_size_calc(obj); 1676 _scroller_size_calc(obj);
1689 elm_layout_sizing_eval(obj); 1677 elm_layout_sizing_eval(obj);
1690 1678
1691 return (Elm_Object_Item *)it; 1679 return EO_OBJ(it);
1692} 1680}
1693 1681
1694static void 1682static void
@@ -1713,3 +1701,4 @@ _elm_popup_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED
1713} 1701}
1714 1702
1715#include "elm_popup.eo.c" 1703#include "elm_popup.eo.c"
1704#include "elm_popup_item.eo.c"
diff --git a/src/lib/elm_popup_item.eo b/src/lib/elm_popup_item.eo
new file mode 100644
index 000000000..20196773c
--- /dev/null
+++ b/src/lib/elm_popup_item.eo
@@ -0,0 +1,17 @@
1class Elm_Popup_Item(Elm_Widget_Item)
2{
3 legacy_prefix: null;
4 eo_prefix: elm_obj_popup_item;
5 implements {
6 Eo.Base.constructor;
7 Elm_Widget_Item.del_pre;
8 Elm_Widget_Item.disable;
9 Elm_Widget_Item.signal_emit;
10 Elm_Widget_Item.part_text.get;
11 Elm_Widget_Item.part_text.set;
12 Elm_Widget_Item.part_content.get;
13 Elm_Widget_Item.part_content.set;
14 Elm_Widget_Item.part_content_unset;
15 }
16}
17
diff --git a/src/lib/elm_widget_popup.h b/src/lib/elm_widget_popup.h
index 4210b345c..682cb6ca4 100644
--- a/src/lib/elm_widget_popup.h
+++ b/src/lib/elm_widget_popup.h
@@ -10,6 +10,7 @@
10 * IT AT RUNTIME. 10 * IT AT RUNTIME.
11 */ 11 */
12 12
13#include "elm_object_item_migration_temp.h"
13/** 14/**
14 * @addtogroup Widget 15 * @addtogroup Widget
15 * @{ 16 * @{
@@ -54,10 +55,10 @@ struct _Elm_Popup_Data
54 Eina_Bool scr_size_recalc : 1; 55 Eina_Bool scr_size_recalc : 1;
55}; 56};
56 57
57typedef struct _Elm_Popup_Item Elm_Popup_Item; 58typedef struct _Elm_Popup_Item_Data Elm_Popup_Item_Data;
58struct _Elm_Popup_Item 59struct _Elm_Popup_Item_Data
59{ 60{
60 Elm_Widget_Item_Data base; 61 Elm_Widget_Item_Data *base;
61 62
62 const char *label; 63 const char *label;
63 Evas_Object *icon; 64 Evas_Object *icon;
@@ -102,11 +103,14 @@ struct _Action_Area_Data
102 return 103 return
103 104
104#define ELM_POPUP_ITEM_CHECK(it) \ 105#define ELM_POPUP_ITEM_CHECK(it) \
105 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, ); \ 106 ELM_WIDGET_ITEM_CHECK_OR_RETURN(it->base, ); \
106 ELM_POPUP_CHECK(it->base.widget); 107 ELM_POPUP_CHECK(it->base->widget);
107 108
108#define ELM_POPUP_ITEM_CHECK_OR_RETURN(it, ...) \ 109#define ELM_POPUP_ITEM_CHECK_OR_RETURN(it, ...) \
109 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, __VA_ARGS__); \ 110 ELM_WIDGET_ITEM_CHECK_OR_RETURN(it->base, __VA_ARGS__); \
110 ELM_POPUP_CHECK(it->base.widget) __VA_ARGS__; 111 ELM_POPUP_CHECK(it->base->widget) __VA_ARGS__;
112
113#define ELM_POPUP_ITEM_DATA_GET(o, sd) \
114 Elm_Popup_Item_Data* sd = eo_data_scope_get((Eo *)o, ELM_POPUP_ITEM_CLASS)
111 115
112#endif 116#endif