From: hermet Date: Wed, 16 Nov 2011 12:51:53 +0000 (+0000) Subject: elementary - modified content_set/get/unset part names to be simple names. X-Git-Tag: REL_F_I9500_20120323_1~17^2~1330 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29359f0fc325cc9ac3ab0888e66b40a900d28ec1;p=framework%2Fuifw%2Felementary.git elementary - modified content_set/get/unset part names to be simple names. Previous part names are just the swallow part names but in modified version, the part names chaned to simpler meaning names to use. i.e for button elm_object_content_part_set(button, "elm.swallow.icon", icon); -> elm_object_content_part_set(button, "icon", icon); git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@65295 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/doc/widgets/widget_preview_bubble2.c b/doc/widgets/widget_preview_bubble2.c index c2bf0ea..d032a71 100644 --- a/doc/widgets/widget_preview_bubble2.c +++ b/doc/widgets/widget_preview_bubble2.c @@ -9,7 +9,7 @@ elm_object_text_set(o, "Bubble"); Evas_Object *o2 = elm_icon_add(win); elm_icon_standard_set(o2, "home"); -elm_object_content_part_set(o, ELM_BUBBLE_CONTENT_ICON, o2); +elm_object_content_part_set(o, "icon", o2); evas_object_show(o2); #include "widget_preview_tmpl_foot.c" diff --git a/doc/widgets/widget_preview_bubble3.c b/doc/widgets/widget_preview_bubble3.c index bcd9a0c..ddf99b7 100644 --- a/doc/widgets/widget_preview_bubble3.c +++ b/doc/widgets/widget_preview_bubble3.c @@ -7,7 +7,7 @@ evas_object_show(o); Evas_Object *o2 = elm_icon_add(win); elm_icon_standard_set(o2, "home"); -elm_object_content_part_set(o, ELM_BUBBLE_CONTENT_ICON, o2); +elm_object_content_part_set(o, "icon", o2); evas_object_show(o2); #include "widget_preview_tmpl_foot.c" diff --git a/doc/widgets/widget_preview_button2.c b/doc/widgets/widget_preview_button2.c index 08ed5f0..87b40b0 100644 --- a/doc/widgets/widget_preview_button2.c +++ b/doc/widgets/widget_preview_button2.c @@ -9,7 +9,7 @@ elm_object_text_set(o, "Button"); Evas_Object *o2 = elm_icon_add(win); elm_icon_standard_set(o2, "home"); -elm_object_content_set(o, o2); +elm_object_content_part_set(o, "icon", o2); evas_object_show(o2); #include "widget_preview_tmpl_foot.c" diff --git a/doc/widgets/widget_preview_button3.c b/doc/widgets/widget_preview_button3.c index 1a020fd..764bdca 100644 --- a/doc/widgets/widget_preview_button3.c +++ b/doc/widgets/widget_preview_button3.c @@ -7,7 +7,7 @@ evas_object_show(o); Evas_Object *o2 = elm_icon_add(win); elm_icon_standard_set(o2, "home"); -elm_object_content_set(o, o2); +elm_object_content_part_set(o, "icon", o2); evas_object_show(o2); #include "widget_preview_tmpl_foot.c" diff --git a/doc/widgets/widget_preview_check2.c b/doc/widgets/widget_preview_check2.c index d62cc3b..ff9143d 100644 --- a/doc/widgets/widget_preview_check2.c +++ b/doc/widgets/widget_preview_check2.c @@ -9,7 +9,7 @@ elm_object_text_set(o, "Check"); Evas_Object *o2 = elm_icon_add(win); elm_icon_standard_set(o2, "home"); -elm_object_content_set(o, o2); +elm_object_content_part_set(o, "icon", o2); evas_object_show(o2); #include "widget_preview_tmpl_foot.c" diff --git a/doc/widgets/widget_preview_check3.c b/doc/widgets/widget_preview_check3.c index 6e4ab64..05b4298 100644 --- a/doc/widgets/widget_preview_check3.c +++ b/doc/widgets/widget_preview_check3.c @@ -7,7 +7,7 @@ evas_object_show(o); Evas_Object *o2 = elm_icon_add(win); elm_icon_standard_set(o2, "home"); -elm_object_content_set(o, o2); +elm_object_content_part_set(o, "icon", o2); evas_object_show(o2); #include "widget_preview_tmpl_foot.c" diff --git a/doc/widgets/widget_preview_panes.c b/doc/widgets/widget_preview_panes.c index 081c43b..1759c87 100644 --- a/doc/widgets/widget_preview_panes.c +++ b/doc/widgets/widget_preview_panes.c @@ -10,13 +10,13 @@ elm_object_text_set(bt, "Left"); evas_object_size_hint_weight_set(bt, 1.0, 1.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); evas_object_show(bt); -elm_object_content_part_set(panes, ELM_PANES_CONTENT_LEFT, bt); +elm_object_content_part_set(panes, "left", bt); bt = elm_button_add(win); elm_object_text_set(bt, "Right"); evas_object_size_hint_weight_set(bt, 1.0, 1.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); evas_object_show(bt); -elm_object_content_part_set(panes, ELM_PANES_CONTENT_RIGHT, bt); +elm_object_content_part_set(panes, "right", bt); #include "widget_preview_tmpl_foot.c" diff --git a/doc/widgets/widget_preview_progressbar.c b/doc/widgets/widget_preview_progressbar.c index 90c225e..b508423 100644 --- a/doc/widgets/widget_preview_progressbar.c +++ b/doc/widgets/widget_preview_progressbar.c @@ -15,7 +15,7 @@ evas_object_show(ic); pb = elm_progressbar_add(win); elm_object_text_set(pb, "Label"); elm_progressbar_span_size_set(pb, 100); -elm_object_content_set(pb, ic); +elm_object_content_part_set(pb, "icon", ic); elm_progressbar_unit_format_set(pb, "%1.1f units"); evas_object_size_hint_align_set(pb, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(pb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); diff --git a/src/bin/test.c b/src/bin/test.c index edebbcc..81debe6 100644 --- a/src/bin/test.c +++ b/src/bin/test.c @@ -548,7 +548,7 @@ add_tests: ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), t->icon); elm_icon_file_set(ic, buf, NULL); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); evas_object_show(ic); } elm_box_pack_end(tbx2, bt); diff --git a/src/bin/test_anchorblock.c b/src/bin/test_anchorblock.c index 10c2447..aa27371 100644 --- a/src/bin/test_anchorblock.c +++ b/src/bin/test_anchorblock.c @@ -149,7 +149,7 @@ test_anchorblock(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event bb = elm_bubble_add(win); elm_object_text_set(bb, "Message 3"); elm_object_text_part_set(bb, "info", "10:32 4/11/2008"); - elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic); + elm_object_content_part_set(bb, "icon", ic); evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL); evas_object_show(ic); evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0); @@ -176,7 +176,7 @@ test_anchorblock(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event bb = elm_bubble_add(win); elm_object_text_set(bb, "Message 2"); elm_object_text_part_set(bb, "info", "7:16 27/10/2008"); - elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic); + elm_object_content_part_set(bb, "icon", ic); evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL); evas_object_show(ic); evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0); @@ -213,7 +213,7 @@ test_anchorblock(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event bb = elm_bubble_add(win); elm_object_text_set(bb, "Message 1"); elm_object_text_part_set(bb, "info", "20:47 18/6/2008"); - elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic); + elm_object_content_part_set(bb, "icon", ic); evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL); evas_object_show(ic); evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0); diff --git a/src/bin/test_bg.c b/src/bin/test_bg.c index cc4dd3d..2f0c1be 100644 --- a/src/bin/test_bg.c +++ b/src/bin/test_bg.c @@ -26,10 +26,10 @@ _cb_overlay_changed(void *data, Evas_Object *obj, void *event __UNUSED__) parent = elm_object_parent_widget_get(o_bg); over = edje_object_add(evas_object_evas_get(parent)); edje_object_file_set(over, buff, "bg_overlay"); - elm_object_content_set(o_bg, over); + elm_object_content_part_set(o_bg, "overlay", over); } else - elm_object_content_set(o_bg, NULL); + elm_object_content_part_set(o_bg, "overlay", NULL); } static void diff --git a/src/bin/test_bubble.c b/src/bin/test_bubble.c index faea34e..af52928 100644 --- a/src/bin/test_bubble.c +++ b/src/bin/test_bubble.c @@ -39,7 +39,7 @@ test_bubble(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info bb = elm_bubble_add(win); elm_object_text_set(bb, "Message 1"); elm_object_text_part_set(bb, "info", "Corner: bottom_right"); - elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic); + elm_object_content_part_set(bb, "icon", ic); elm_bubble_corner_set(bb, "bottom_right"); evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL); evas_object_show(ic); diff --git a/src/bin/test_button.c b/src/bin/test_button.c index f2f1fb3..44714f1 100644 --- a/src/bin/test_button.c +++ b/src/bin/test_button.c @@ -64,7 +64,7 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); bt = elm_button_add(win); elm_object_text_set(bt, "Icon sized to button"); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)1); evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)1); elm_box_pack_end(bx, bt); @@ -77,7 +77,7 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_icon_scale_set(ic, 0, 0); bt = elm_button_add(win); elm_object_text_set(bt, "Icon no scale"); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)2); evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)2); elm_box_pack_end(bx, bt); @@ -90,7 +90,7 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); bt = elm_button_add(win); elm_object_text_set(bt, "Disabled Button"); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); elm_object_disabled_set(bt, 1); evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)3); evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)3); @@ -103,7 +103,7 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_icon_file_set(ic, buf, NULL); evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); bt = elm_button_add(win); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); elm_object_disabled_set(bt, 1); evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)4); evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)4); @@ -127,7 +127,7 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_icon_file_set(ic, buf, NULL); elm_icon_scale_set(ic, 0, 0); bt = elm_button_add(win); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)6); evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)6); elm_box_pack_end(bx, bt); @@ -148,7 +148,7 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); bt = elm_button_add(win); elm_object_style_set(bt, "anchor"); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)8); evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)8); elm_box_pack_end(bx, bt); @@ -162,7 +162,7 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info bt = elm_button_add(win); elm_object_access_info_set(bt, "This is some custom text describing this widget"); elm_object_style_set(bt, "anchor"); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); elm_object_disabled_set(bt, 1); evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)9); evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)9); diff --git a/src/bin/test_check.c b/src/bin/test_check.c index 284d6f5..b217517 100644 --- a/src/bin/test_check.c +++ b/src/bin/test_check.c @@ -40,7 +40,7 @@ test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5); elm_object_text_set(ck, "Icon sized to check"); - elm_object_content_set(ck, ic); + elm_object_content_part_set(ck, "icon", ic); elm_check_state_set(ck, 1); elm_box_pack_end(bx, ck); evas_object_show(ck); @@ -54,7 +54,7 @@ test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_icon_scale_set(ic, 0, 0); ck = elm_check_add(win); elm_object_text_set(ck, "Icon no scale"); - elm_object_content_set(ck, ic); + elm_object_content_part_set(ck, "icon", ic); elm_box_pack_end(bx, ck); evas_object_show(ck); evas_object_show(ic); @@ -74,7 +74,7 @@ test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5); elm_object_text_set(ck, "Disabled check"); - elm_object_content_set(ck, ic); + elm_object_content_part_set(ck, "icon", ic); elm_check_state_set(ck, 1); elm_box_pack_end(bx, ck); elm_object_disabled_set(ck, 1); @@ -86,7 +86,7 @@ test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_icon_file_set(ic, buf, NULL); elm_icon_scale_set(ic, 0, 0); ck = elm_check_add(win); - elm_object_content_set(ck, ic); + elm_object_content_part_set(ck, "icon", ic); elm_box_pack_end(bx, ck); evas_object_show(ck); evas_object_show(ic); diff --git a/src/bin/test_map.c b/src/bin/test_map.c index a341cf9..f5315de 100644 --- a/src/bin/test_map.c +++ b/src/bin/test_map.c @@ -546,7 +546,7 @@ _marker_get(Evas_Object *obj, Elm_Map_Marker *marker __UNUSED__, void *data) evas_object_show(icon); Evas_Object *o = elm_button_add(obj); - elm_object_content_set(o, icon); + elm_object_content_part_set(o, "icon", icon); evas_object_show(o); elm_box_pack_end(bx, o); } diff --git a/src/bin/test_naviframe.c b/src/bin/test_naviframe.c index ed0918f..59432c6 100644 --- a/src/bin/test_naviframe.c +++ b/src/bin/test_naviframe.c @@ -83,7 +83,7 @@ _page4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) bt = elm_button_add(nf); evas_object_smart_callback_add(bt, "clicked", _page5, nf); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); content = _content_new(nf, img4); @@ -98,7 +98,7 @@ _page4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) elm_app_data_dir_get()); elm_icon_file_set(ic, buf, NULL); evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); - elm_object_item_content_part_set(it, ELM_NAVIFRAME_ITEM_CONTENT_ICON, ic); + elm_object_item_content_part_set(it, "icon", ic); elm_naviframe_item_title_visible_set(it, EINA_FALSE); evas_object_smart_callback_add(content, "clicked", _title_visible, it); } @@ -133,7 +133,7 @@ _page3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) elm_icon_file_set(ic, buf, NULL); evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); - elm_object_item_content_part_set(it, ELM_NAVIFRAME_ITEM_CONTENT_ICON, ic); + elm_object_item_content_part_set(it, "icon", ic); } void @@ -152,13 +152,12 @@ _page2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) elm_app_data_dir_get()); elm_icon_file_set(ic, buf, NULL); evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); content = _content_new(nf, img2); it = elm_naviframe_item_push(nf, "Page 2", NULL, bt, content, NULL); - elm_object_item_text_part_set(it, ELM_NAVIFRAME_ITEM_TEXT_SUBTITLE, - "Here is sub-title part!"); + elm_object_item_text_part_set(it, "subtitle", "Here is sub-title part!"); } void diff --git a/src/bin/test_panes.c b/src/bin/test_panes.c index 8217490..6e27afb 100644 --- a/src/bin/test_panes.c +++ b/src/bin/test_panes.c @@ -73,7 +73,7 @@ test_panes(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(bt, 1.0, 1.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); evas_object_show(bt); - elm_object_content_part_set(panes, ELM_PANES_CONTENT_LEFT, bt); + elm_object_content_part_set(panes, "left", bt); // // @@ -88,7 +88,7 @@ test_panes(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_smart_callback_add(panes_h, "press", _press, panes_h); evas_object_smart_callback_add(panes_h, "unpress", _unpress, panes_h); - elm_object_content_part_set(panes, ELM_PANES_CONTENT_RIGHT, panes_h); + elm_object_content_part_set(panes, "right", panes_h); // // @@ -97,7 +97,7 @@ test_panes(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(bt); - elm_object_content_part_set(panes_h, ELM_PANES_CONTENT_LEFT, bt); + elm_object_content_part_set(panes_h, "left", bt); // // @@ -106,7 +106,7 @@ test_panes(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(bt); - elm_object_content_part_set(panes_h, ELM_PANES_CONTENT_RIGHT, bt); + elm_object_content_part_set(panes_h, "right", bt); // diff --git a/src/bin/test_progressbar.c b/src/bin/test_progressbar.c index 370347d..73e5232 100644 --- a/src/bin/test_progressbar.c +++ b/src/bin/test_progressbar.c @@ -115,7 +115,7 @@ test_progressbar(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event pb = elm_progressbar_add(win); elm_object_text_set(pb, "Label"); - elm_object_content_set(pb, ic1); + elm_object_content_part_set(pb, "icon", ic1); elm_progressbar_inverted_set(pb, 1); elm_progressbar_unit_format_set(pb, "%1.1f units"); elm_progressbar_span_size_set(pb, 200); @@ -162,7 +162,7 @@ test_progressbar(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event pb = elm_progressbar_add(win); elm_progressbar_horizontal_set(pb, EINA_FALSE); elm_object_text_set(pb, "Label"); - elm_object_content_set(pb, ic2); + elm_object_content_part_set(pb, "icon", ic2); elm_progressbar_inverted_set(pb, 1); elm_progressbar_unit_format_set(pb, "%1.2f%%"); elm_progressbar_span_size_set(pb, 200); diff --git a/src/bin/test_radio.c b/src/bin/test_radio.c index 2d0351c..e222623 100644 --- a/src/bin/test_radio.c +++ b/src/bin/test_radio.c @@ -33,7 +33,7 @@ test_radio(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(rd, EVAS_HINT_FILL, 0.5); elm_object_text_set(rd, "Icon sized to radio"); - elm_object_content_set(rd, ic); + elm_object_content_part_set(rd, "icon", ic); elm_box_pack_end(bx, rd); evas_object_show(rd); evas_object_show(ic); @@ -48,7 +48,7 @@ test_radio(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_radio_state_value_set(rd, 1); elm_radio_group_add(rd, rdg); elm_object_text_set(rd, "Icon no scale"); - elm_object_content_set(rd, ic); + elm_object_content_part_set(rd, "icon", ic); elm_box_pack_end(bx, rd); evas_object_show(rd); evas_object_show(ic); @@ -76,7 +76,7 @@ test_radio(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info rd = elm_radio_add(win); elm_radio_state_value_set(rd, 4); elm_radio_group_add(rd, rdg); - elm_object_content_set(rd, ic); + elm_object_content_part_set(rd, "icon", ic); elm_box_pack_end(bx, rd); evas_object_show(rd); evas_object_show(ic); @@ -89,7 +89,7 @@ test_radio(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info rd = elm_radio_add(win); elm_radio_state_value_set(rd, 5); elm_radio_group_add(rd, rdg); - elm_object_content_set(rd, ic); + elm_object_content_part_set(rd, "icon", ic); elm_object_disabled_set(rd, 1); elm_box_pack_end(bx, rd); evas_object_show(rd); diff --git a/src/bin/test_slider.c b/src/bin/test_slider.c index 17497dc..29abcf6 100644 --- a/src/bin/test_slider.c +++ b/src/bin/test_slider.c @@ -39,7 +39,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info sl = elm_slider_add(win); sl1 = sl; elm_object_text_set(sl, "Horizontal"); - elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_ICON, ic); + elm_object_content_part_set(sl, "icon", ic); elm_slider_unit_format_set(sl, "%1.1f units"); elm_slider_span_size_set(sl, 120); evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); @@ -56,7 +56,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info sl = elm_slider_add(win); elm_object_text_set(sl, "Disabled"); - elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_ICON, ic); + elm_object_content_part_set(sl, "icon", ic); elm_slider_unit_format_set(sl, "%1.1f units"); elm_slider_span_size_set(sl, 120); elm_slider_min_max_set(sl, 50, 150); @@ -75,7 +75,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info sl = elm_slider_add(win); elm_object_text_set(sl, "Horizontal inverted"); - elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_END, ic); + elm_object_content_part_set(sl, "end", ic); elm_slider_span_size_set(sl, 80); evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -97,7 +97,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info sl = elm_slider_add(win); elm_object_text_set(sl, "Disabled inverted"); - elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_END, ic); + elm_object_content_part_set(sl, "end", ic); elm_slider_span_size_set(sl, 80); evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -140,7 +140,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1); sl = elm_slider_add(win); - elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_ICON, ic); + elm_object_content_part_set(sl, "icon", ic); elm_object_text_set(sl, "Vertical inverted"); elm_slider_inverted_set(sl, EINA_TRUE); elm_slider_unit_format_set(sl, "units"); @@ -178,7 +178,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1); sl = elm_slider_add(win); - elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_ICON, ic); + elm_object_content_part_set(sl, "icon", ic); elm_object_text_set(sl, "Disabled vertical"); elm_slider_inverted_set(sl, EINA_TRUE); elm_slider_unit_format_set(sl, "units"); diff --git a/src/bin/test_toggle.c b/src/bin/test_toggle.c index 9fb813f..67eac34 100644 --- a/src/bin/test_toggle.c +++ b/src/bin/test_toggle.c @@ -33,7 +33,7 @@ test_toggle(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(tg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(tg, EVAS_HINT_FILL, 0.5); elm_object_text_set(tg, "Icon sized to toggle"); - elm_object_content_set(tg, ic); + elm_object_content_part_set(tg, "icon", ic); elm_check_state_set(tg, 1); elm_object_text_part_set(tg, "on", "Yes"); elm_object_text_part_set(tg, "off", "No"); @@ -49,7 +49,7 @@ test_toggle(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info tg = elm_check_add(win); elm_object_style_set(tg, "toggle"); elm_object_text_set(tg, "Icon no scale"); - elm_object_content_set(tg, ic); + elm_object_content_part_set(tg, "icon", ic); elm_box_pack_end(bx, tg); evas_object_show(tg); evas_object_show(ic); @@ -62,7 +62,7 @@ test_toggle(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info tg = elm_check_add(win); elm_object_style_set(tg, "toggle"); elm_object_text_set(tg, "Icon no scale"); - elm_object_content_set(tg, ic); + elm_object_content_part_set(tg, "icon", ic); elm_object_disabled_set(tg, 1); elm_box_pack_end(bx, tg); evas_object_show(tg); @@ -83,7 +83,7 @@ test_toggle(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info tg = elm_check_add(win); elm_object_style_set(tg, "toggle"); - elm_object_content_set(tg, ic); + elm_object_content_part_set(tg, "icon", ic); elm_box_pack_end(bx, tg); evas_object_show(tg); evas_object_show(ic); diff --git a/src/bin/test_transit.c b/src/bin/test_transit.c index 7dde1b5..50c56a2 100644 --- a/src/bin/test_transit.c +++ b/src/bin/test_transit.c @@ -262,7 +262,7 @@ test_transit(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf bt = elm_button_add(win); elm_object_text_set(bt, "ImageAnimation Effect"); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); elm_box_pack_end(bx, bt); evas_object_show(bt); evas_object_show(ic); @@ -392,7 +392,7 @@ test_transit5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_size_hint_max_set(ic, 50, 50); bt = elm_button_add(win); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); elm_object_text_set(bt, "Before Button - Blend Effect"); evas_object_move(bt, 25, 125); evas_object_resize(bt, 250, 50); @@ -404,7 +404,7 @@ test_transit5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_size_hint_max_set(ic, 50, 50); bt2 = elm_button_add(win); - elm_object_content_set(bt2, ic); + elm_object_content_part_set(bt2, "icon", ic); elm_object_text_set(bt2, "After Button - Blend Effect"); evas_object_move(bt2, 25, 125); evas_object_resize(bt2, 250, 50); @@ -438,7 +438,7 @@ test_transit6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_size_hint_max_set(ic, 50, 50); bt = elm_button_add(win); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); elm_object_text_set(bt, "Before Button - Fade Effect"); evas_object_move(bt, 25, 125); evas_object_resize(bt, 250, 50); @@ -450,7 +450,7 @@ test_transit6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_size_hint_max_set(ic, 50, 50); bt2 = elm_button_add(win); - elm_object_content_set(bt2, ic); + elm_object_content_part_set(bt2, "icon", ic); elm_object_text_set(bt2, "After Button - Fade Effect"); evas_object_move(bt2, 25, 125); evas_object_resize(bt2, 250, 50); diff --git a/src/bin/test_win_inline.c b/src/bin/test_win_inline.c index 348c361..f7f99be 100644 --- a/src/bin/test_win_inline.c +++ b/src/bin/test_win_inline.c @@ -55,7 +55,7 @@ fill(Evas_Object *win, Eina_Bool do_bg) bb = elm_bubble_add(win); elm_object_text_set(bb, "Message 3"); elm_object_text_part_set(bb, "info", "10:32 4/11/2008"); - elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic); + elm_object_content_part_set(bb, "icon", ic); evas_object_show(ic); evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -79,7 +79,7 @@ fill(Evas_Object *win, Eina_Bool do_bg) bb = elm_bubble_add(win); elm_object_text_set(bb, "Message 2"); elm_object_text_part_set(bb, "info", "7:16 27/10/2008"); - elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic); + elm_object_content_part_set(bb, "icon", ic); evas_object_show(ic); evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -114,7 +114,7 @@ fill(Evas_Object *win, Eina_Bool do_bg) bb = elm_bubble_add(win); elm_object_text_set(bb, "Message 1"); elm_object_text_part_set(bb, "info", "20:47 18/6/2008"); - elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic); + elm_object_content_part_set(bb, "icon", ic); evas_object_show(ic); evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL); diff --git a/src/edje_externals/elm_bubble.c b/src/edje_externals/elm_bubble.c index 0be2683..9f84533 100644 --- a/src/edje_externals/elm_bubble.c +++ b/src/edje_externals/elm_bubble.c @@ -20,7 +20,7 @@ external_bubble_state_set(void *data __UNUSED__, Evas_Object *obj, const void *f if (p->label) elm_object_text_set(obj, p->label); if (p->icon) - elm_object_content_part_set(obj, ELM_BUBBLE_CONTENT_ICON, p->icon); + elm_object_content_part_set(obj, "icon", p->icon); if (p->info) elm_object_text_part_set(obj, "info", p->info); if (p->content) elm_object_content_set(obj, p->content); } @@ -42,9 +42,8 @@ external_bubble_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ex { Evas_Object *icon = external_common_param_icon_get(obj, param); if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE; - elm_object_content_part_set(obj, ELM_BUBBLE_CONTENT_ICON, - icon); - return EINA_TRUE; + elm_object_content_part_set(obj, "icon", icon); + return EINA_TRUE; } } else if (!strcmp(param->name, "info")) diff --git a/src/edje_externals/elm_button.c b/src/edje_externals/elm_button.c index 2002602..08f8901 100644 --- a/src/edje_externals/elm_button.c +++ b/src/edje_externals/elm_button.c @@ -19,7 +19,7 @@ external_button_state_set(void *data __UNUSED__, Evas_Object *obj, const void *f if (p->label) elm_object_text_set(obj, p->label); if (p->icon) - elm_object_content_set(obj, p->icon); + elm_object_content_part_set(obj, "icon", p->icon); } static Eina_Bool @@ -39,7 +39,7 @@ external_button_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ex { Evas_Object *icon = external_common_param_icon_get(obj, param); if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE; - elm_object_content_set(obj, icon); + elm_object_content_part_set(obj, "icon", icon); return EINA_TRUE; } } diff --git a/src/edje_externals/elm_check.c b/src/edje_externals/elm_check.c index 0c3fd0a..d150e13 100644 --- a/src/edje_externals/elm_check.c +++ b/src/edje_externals/elm_check.c @@ -21,7 +21,7 @@ external_check_state_set(void *data __UNUSED__, Evas_Object *obj, const void *fr if (p->label) elm_object_text_set(obj, p->label); if (p->icon) - elm_object_content_set(obj, p->icon); + elm_object_content_part_set(obj, "icon", p->icon); if (p->state_exists) elm_check_state_set(obj, p->state); } @@ -43,7 +43,7 @@ external_check_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ext { Evas_Object *icon = external_common_param_icon_get(obj, param); if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE; - elm_object_content_set(obj, icon); + elm_object_content_part_set(obj, "icon", icon); return EINA_TRUE; } } diff --git a/src/edje_externals/elm_panes.c b/src/edje_externals/elm_panes.c index 1a7a8df..15d19ea 100644 --- a/src/edje_externals/elm_panes.c +++ b/src/edje_externals/elm_panes.c @@ -27,10 +27,10 @@ static void external_panes_state_set(void *data __UNUSED__, else return; if (p->content_left) - elm_object_content_part_set(obj, ELM_PANES_CONTENT_LEFT, p->content_left); + elm_object_content_part_set(obj, "left", p->content_left); if (p->content_right) - elm_object_content_part_set(obj, ELM_PANES_CONTENT_RIGHT, p->content_right); + elm_object_content_part_set(obj, "right", p->content_right); if (p->is_left_size) elm_panes_content_left_size_set(obj, p->left_size); @@ -51,7 +51,7 @@ static Eina_Bool external_panes_param_set(void *data __UNUSED__, Evas_Object *content = external_common_param_edje_object_get(obj, param); if ((strcmp(param->s, "")) && (!content)) return EINA_FALSE; - elm_object_content_part_set(obj, ELM_PANES_CONTENT_LEFT, content); + elm_object_content_part_set(obj, "left", content); return EINA_TRUE; } else if ((!strcmp(param->name, "content right")) @@ -60,7 +60,7 @@ static Eina_Bool external_panes_param_set(void *data __UNUSED__, Evas_Object *content = external_common_param_edje_object_get(obj, param); if ((strcmp(param->s, "")) && (!content)) return EINA_FALSE; - elm_object_content_part_set(obj, ELM_PANES_CONTENT_RIGHT, content); + elm_object_content_part_set(obj, "right", content); return EINA_TRUE; } else if ((!strcmp(param->name, "horizontal")) @@ -170,9 +170,9 @@ external_panes_content_get(void *data __UNUSED__, const Evas_Object *obj, const char *content) { if (!strcmp(content, "left")) - return elm_object_content_part_get(obj, ELM_PANES_CONTENT_LEFT); + return elm_object_content_part_get(obj, "left"); else if (!strcmp(content, "right")) - return elm_object_content_part_get(obj, ELM_PANES_CONTENT_RIGHT); + return elm_object_content_part_get(obj, "right"); ERR("unknown content '%s'", content); diff --git a/src/edje_externals/elm_progressbar.c b/src/edje_externals/elm_progressbar.c index d32a7cb..e32cb2e 100644 --- a/src/edje_externals/elm_progressbar.c +++ b/src/edje_externals/elm_progressbar.c @@ -28,7 +28,7 @@ external_progressbar_state_set(void *data __UNUSED__, Evas_Object *obj, const vo if (p->label) elm_object_text_set(obj, p->label); if (p->icon) - elm_object_content_set(obj, p->icon); + elm_object_content_part_set(obj, "icon", p->icon); if (p->span_exists) elm_progressbar_span_size_set(obj, p->span); if (p->value_exists) @@ -58,7 +58,7 @@ external_progressbar_param_set(void *data __UNUSED__, Evas_Object *obj, const Ed { Evas_Object *icon = external_common_param_icon_get(obj, param); if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE; - elm_object_content_set(obj, icon); + elm_object_content_part_set(obj, "icon", icon); return EINA_TRUE; } } diff --git a/src/edje_externals/elm_radio.c b/src/edje_externals/elm_radio.c index 839326b..77ce14a 100644 --- a/src/edje_externals/elm_radio.c +++ b/src/edje_externals/elm_radio.c @@ -22,7 +22,7 @@ external_radio_state_set(void *data __UNUSED__, Evas_Object *obj, const void *fr if (p->label) elm_object_text_set(obj, p->label); if (p->icon) - elm_object_content_set(obj, p->icon); + elm_object_content_part_set(obj, "icon", p->icon); if (p->value_exists) elm_radio_state_value_set(obj, p->value); if (p->group_name) @@ -50,7 +50,7 @@ external_radio_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ext { Evas_Object *icon = external_common_param_icon_get(obj, param); if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE; - elm_object_content_set(obj, icon); + elm_object_content_part_set(obj, "icon", icon); return EINA_TRUE; } } diff --git a/src/edje_externals/elm_slider.c b/src/edje_externals/elm_slider.c index 1e1f88f..e41242f 100644 --- a/src/edje_externals/elm_slider.c +++ b/src/edje_externals/elm_slider.c @@ -30,7 +30,7 @@ external_slider_state_set(void *data __UNUSED__, Evas_Object *obj, const void *f if (p->label) elm_object_text_set(obj, p->label); if (p->icon) - elm_object_content_part_set(obj, ELM_SLIDER_CONTENT_ICON, p->icon); + elm_object_content_part_set(obj, "icon", p->icon); if (p->span_exists) elm_slider_span_size_set(obj, p->span); if ((p->min_exists) && (p->max_exists)) @@ -73,7 +73,7 @@ external_slider_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ex { Evas_Object *icon = external_common_param_icon_get(obj, param); if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE; - elm_object_content_part_set(obj, ELM_SLIDER_CONTENT_ICON, icon); + elm_object_content_part_set(obj, "icon", icon); return EINA_TRUE; } } diff --git a/src/edje_externals/elm_toggle.c b/src/edje_externals/elm_toggle.c index 7d9e097..cd188e6 100644 --- a/src/edje_externals/elm_toggle.c +++ b/src/edje_externals/elm_toggle.c @@ -24,7 +24,7 @@ external_toggle_state_set(void *data __UNUSED__, Evas_Object *obj, const void *f if (p->label) elm_object_text_set(obj, p->label); if (p->icon) - elm_object_content_set(obj, p->icon); + elm_object_content_part_set(obj, "icon", p->icon); if (p->on) elm_object_text_part_set(obj, "on", p->on); @@ -52,7 +52,7 @@ external_toggle_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ex { Evas_Object *icon = external_common_param_icon_get(obj, param); if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE; - elm_object_content_set(obj, icon); + elm_object_content_part_set(obj, "icon", icon); return EINA_TRUE; } } diff --git a/src/examples/bg_example_03.c b/src/examples/bg_example_03.c index b78139b..1139d10 100644 --- a/src/examples/bg_example_03.c +++ b/src/examples/bg_example_03.c @@ -38,10 +38,10 @@ _cb_overlay_changed(void *data, Evas_Object *obj, void *event __UNUSED__) parent = elm_object_parent_widget_get(o_bg); over = edje_object_add(evas_object_evas_get(parent)); edje_object_file_set(over, buff, "bg_overlay"); - elm_object_content_set(o_bg, over); + elm_object_content_part_set(o_bg, "overlay", over); } else - elm_object_content_set(o_bg, NULL); + elm_object_content_part_set(o_bg, "overlay", NULL); } static void diff --git a/src/examples/bubble_example_01.c b/src/examples/bubble_example_01.c index 9303d78..01970e8 100644 --- a/src/examples/bubble_example_01.c +++ b/src/examples/bubble_example_01.c @@ -40,7 +40,7 @@ elm_main(int argc, char **argv) evas_object_show(icon); bubble = elm_bubble_add(win); - elm_object_content_part_set(bubble, ELM_BUBBLE_CONTENT_ICON, icon); + elm_object_content_part_set(bubble, "icon", icon); elm_bubble_info_set(bubble, "INFO"); elm_object_text_set(bubble, "LABEL"); elm_bubble_content_set(bubble, label); diff --git a/src/examples/button_example_01.c b/src/examples/button_example_01.c index bd5a5b1..36e26de 100644 --- a/src/examples/button_example_01.c +++ b/src/examples/button_example_01.c @@ -24,7 +24,7 @@ static void _btn_cursors_release_cb(void *data, Evas_Object *btn __UNUSED__, void *ev __UNUSED__) { App_Data *app = data; - elm_object_content_set(app->mid, app->icon_still); + elm_object_content_part_set(app->mid, "icon", app->icon_still); app->icon_still = NULL; } @@ -40,7 +40,7 @@ _btn_cursors_move_cb(void *data, Evas_Object *btn, void *ev __UNUSED__) app->icon_still = elm_object_content_unset(app->mid); icon = elm_icon_add(app->mid); elm_icon_standard_set(icon, "chat"); - elm_object_content_set(app->mid, icon); + elm_object_content_part_set(app->mid, "icon", icon); } evas_object_size_hint_align_get(app->mid, &ax, &ay); @@ -185,7 +185,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) icon = elm_icon_add(win); elm_icon_standard_set(icon, "arrow_up"); - elm_object_content_set(btn, icon); + elm_object_content_part_set(btn, "icon", icon); data.cursors.up = btn; @@ -210,7 +210,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) icon = elm_icon_add(win); elm_icon_standard_set(icon, "arrow_left"); - elm_object_content_set(btn, icon); + elm_object_content_part_set(btn, "icon", icon); data.cursors.left = btn; @@ -221,7 +221,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) icon = elm_icon_add(win); elm_icon_standard_set(icon, "close"); - elm_object_content_set(btn, icon); + elm_object_content_part_set(btn, "icon", icon); data.mid = btn; @@ -239,7 +239,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) icon = elm_icon_add(win); elm_icon_standard_set(icon, "arrow_right"); - elm_object_content_set(btn, icon); + elm_object_content_part_set(btn, "icon", icon); data.cursors.right = btn; @@ -257,7 +257,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) icon = elm_icon_add(win); elm_icon_standard_set(icon, "arrow_down"); - elm_object_content_set(btn, icon); + elm_object_content_part_set(btn, "icon", icon); data.cursors.down = btn; diff --git a/src/examples/check_example_01.c b/src/examples/check_example_01.c index 2f5e99a..a559779 100644 --- a/src/examples/check_example_01.c +++ b/src/examples/check_example_01.c @@ -40,7 +40,7 @@ elm_main(int argc, char **argv) cb2 = elm_check_add(win); elm_object_text_set(cb2, "another checkbox"); elm_check_state_set(cb2, EINA_TRUE); - elm_object_content_set(cb2, icon); + elm_object_content_part_set(cb2, "icon", icon); evas_object_move(cb2, 10, 50); evas_object_resize(cb2, 200, 30); evas_object_show(cb2); diff --git a/src/examples/entry_example.c b/src/examples/entry_example.c index e677c95..27e6fa5 100644 --- a/src/examples/entry_example.c +++ b/src/examples/entry_example.c @@ -553,7 +553,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) icon = elm_layout_add(win); elm_layout_theme_set(icon, "entry", "emoticon/haha", "default"); - elm_object_content_set(o, icon); + elm_object_content_part_set(o, "icon", icon); evas_object_smart_callback_add(o, "clicked", _image_insert_cb, &app); diff --git a/src/examples/panes_example.c b/src/examples/panes_example.c index 354672b..5db8fd6 100644 --- a/src/examples/panes_example.c +++ b/src/examples/panes_example.c @@ -86,7 +86,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__) evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(bt); - elm_object_content_part_set(panes, ELM_PANES_CONTENT_LEFT, bt); + elm_object_content_part_set(panes, "left", bt); panes_h = elm_panes_add(win); elm_panes_horizontal_set(panes_h, EINA_TRUE); @@ -94,21 +94,21 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__) EVAS_HINT_EXPAND); evas_object_size_hint_align_set(panes_h, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(panes_h); - elm_object_content_part_set(panes, ELM_PANES_CONTENT_RIGHT, panes_h); + elm_object_content_part_set(panes, "right", panes_h); bt = elm_button_add(win); elm_object_text_set(bt, "Up"); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(bt); - elm_object_content_part_set(panes_h, ELM_PANES_CONTENT_LEFT, bt); + elm_object_content_part_set(panes_h, "left", bt); bt = elm_button_add(win); elm_object_text_set(bt, "Down"); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(bt); - elm_object_content_part_set(panes_h, ELM_PANES_CONTENT_RIGHT, bt); + elm_object_content_part_set(panes_h, "right", bt); evas_object_smart_callback_add(panes, "clicked", _clicked, panes); evas_object_smart_callback_add(panes, "clicked,double", _clicked_double, diff --git a/src/examples/progressbar_example.c b/src/examples/progressbar_example.c index 81f9216..12b2572 100644 --- a/src/examples/progressbar_example.c +++ b/src/examples/progressbar_example.c @@ -143,7 +143,7 @@ elm_main(int argc __UNUSED__, /* pb with label, icon, custom unit label and span size set */ pb = elm_progressbar_add(win); elm_object_text_set(pb, "Label"); - elm_object_content_set(pb, ic1); + elm_object_content_part_set(pb, "icon", ic1); elm_progressbar_inverted_set(pb, EINA_TRUE); elm_progressbar_unit_format_set(pb, "%1.1f units"); elm_progressbar_span_size_set(pb, 200); @@ -192,7 +192,7 @@ elm_main(int argc __UNUSED__, pb = elm_progressbar_add(win); elm_progressbar_horizontal_set(pb, EINA_FALSE); elm_object_text_set(pb, "Label"); - elm_object_content_set(pb, ic2); + elm_object_content_part_set(pb, "icon", ic2); elm_progressbar_inverted_set(pb, EINA_TRUE); elm_progressbar_unit_format_set(pb, "%1.2f%%"); elm_progressbar_span_size_set(pb, 200); diff --git a/src/examples/radio_example_01.c b/src/examples/radio_example_01.c index 78fa010..05bf935 100644 --- a/src/examples/radio_example_01.c +++ b/src/examples/radio_example_01.c @@ -37,7 +37,7 @@ elm_main(int argc, char **argv) elm_radio_value_pointer_set(radio, &val); ic = elm_icon_add(win); elm_icon_standard_set(ic, "home"); - elm_object_content_set(radio, ic); + elm_object_content_part_set(radio, "icon", ic); elm_box_pack_end(bx, radio); evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -51,7 +51,7 @@ elm_main(int argc, char **argv) elm_radio_group_add(radio, group); ic = elm_icon_add(win); elm_icon_standard_set(ic, "file"); - elm_object_content_set(radio, ic); + elm_object_content_part_set(radio, "icon", ic); elm_box_pack_end(bx, radio); evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); diff --git a/src/examples/slider_example.c b/src/examples/slider_example.c index 53568cd..9e93031 100644 --- a/src/examples/slider_example.c +++ b/src/examples/slider_example.c @@ -85,12 +85,12 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__) ic = elm_icon_add(win); elm_icon_standard_set(ic, "home"); elm_icon_scale_set(ic, EINA_FALSE, EINA_FALSE); - elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_ICON, ic); + elm_object_content_part_set(sl, "icon", ic); ic = elm_icon_add(win); elm_icon_standard_set(ic, "folder"); elm_icon_scale_set(ic, EINA_FALSE, EINA_FALSE); - elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_END, ic); + elm_object_content_part_set(sl, "end", ic); evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); diff --git a/src/examples/transit_example_03.c b/src/examples/transit_example_03.c index 0af77be..702ccee 100644 --- a/src/examples/transit_example_03.c +++ b/src/examples/transit_example_03.c @@ -47,8 +47,8 @@ _transit_wipe(Elm_Transit *trans) { /* hide the object clipping it from the left to the right */ elm_transit_effect_wipe_add(trans, - ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE, - ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT); + ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE, + ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT); } static void @@ -110,7 +110,7 @@ _transit_start(void *data, Evas_Object *o, void *event_info __UNUSED__) int i; struct Context *ctxt = data; Evas_Object *obj = ctxt->obj; // the object on which the transition will be - // applied + // applied // FIXME: Should check if there's another transit going before starting a new // one @@ -123,8 +123,8 @@ _transit_start(void *data, Evas_Object *o, void *event_info __UNUSED__) * checked and use its callback to add this transition to trans */ for (i = 0; _transitions[i].label; i++) { - if (_transitions[i].checked) - _transitions[i].transition_add_cb(trans); + if (_transitions[i].checked) + _transitions[i].transition_add_cb(trans); } /* get the various options for this transition from the context structure */ @@ -227,7 +227,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__) icon = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/icon_07.png", PACKAGE_DATA_DIR); elm_icon_file_set(icon, buf, NULL); - elm_object_content_set(obj, icon); + elm_object_content_part_set(obj, "icon", icon); evas_object_move(obj, 160, 60); evas_object_resize(obj, 250, 100); evas_object_show(obj); @@ -261,7 +261,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__) * array */ for (i = 0; _transitions[i].label; i++) _checkbox_transition_add(vbox, _transitions[i].label, - &_transitions[i].checked); + &_transitions[i].checked); elm_box_pack_end(hbox, vbox); evas_object_show(vbox); diff --git a/src/examples/transit_example_04.c b/src/examples/transit_example_04.c index 8290fe5..9a1641c 100644 --- a/src/examples/transit_example_04.c +++ b/src/examples/transit_example_04.c @@ -132,7 +132,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__) icon = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/icon_07.png", PACKAGE_DATA_DIR); elm_icon_file_set(icon, buf, NULL); - elm_object_content_set(obj, icon); + elm_object_content_part_set(obj, "icon", icon); evas_object_move(obj, 160, 60); evas_object_resize(obj, 250, 100); evas_object_show(obj); @@ -145,7 +145,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__) icon = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/icon_08.png", PACKAGE_DATA_DIR); elm_icon_file_set(icon, buf, NULL); - elm_object_content_set(obj, icon); + elm_object_content_part_set(obj, "icon", icon); evas_object_move(obj, 160, 60); evas_object_resize(obj, 250, 100); diff --git a/src/examples/web_example.c b/src/examples/web_example.c index 730951b..3e75382 100644 --- a/src/examples/web_example.c +++ b/src/examples/web_example.c @@ -405,7 +405,7 @@ _win_search_trigger_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED ic = elm_icon_add(ad->win); elm_icon_standard_set(ic, "arrow_up"); - elm_object_content_set(btn, ic); + elm_object_content_part_set(btn, "icon", ic); evas_object_smart_callback_add(btn, "clicked", _search_prev_cb, ad); @@ -415,7 +415,7 @@ _win_search_trigger_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED ic = elm_icon_add(ad->win); elm_icon_standard_set(ic, "arrow_down"); - elm_object_content_set(btn, ic); + elm_object_content_part_set(btn, "icon", ic); evas_object_smart_callback_add(btn, "clicked", _search_next_cb, ad); @@ -425,7 +425,7 @@ _win_search_trigger_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED ic = elm_icon_add(ad->win); elm_icon_standard_set(ic, "close"); - elm_object_content_set(btn, ic); + elm_object_content_part_set(btn, "icon", ic); evas_object_smart_callback_add(btn, "clicked", _search_close_cb, ad); @@ -523,7 +523,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) ic = elm_icon_add(win); elm_icon_standard_set(ic, "arrow_left"); - elm_object_content_set(btn, ic); + elm_object_content_part_set(btn, "icon", ic); evas_object_smart_callback_add(btn, "clicked", _nav_back_cb, ad); @@ -535,7 +535,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) ic = elm_icon_add(win); elm_icon_standard_set(ic, "refresh"); - elm_object_content_set(btn, ic); + elm_object_content_part_set(btn, "icon", ic); evas_object_smart_callback_add(btn, "clicked", _nav_refresh_cb, ad); @@ -547,7 +547,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) ic = elm_icon_add(win); elm_icon_standard_set(ic, "arrow_right"); - elm_object_content_set(btn, ic); + elm_object_content_part_set(btn, "icon", ic); evas_object_smart_callback_add(btn, "clicked", _nav_fwd_cb, ad); @@ -564,7 +564,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) ic = elm_icon_add(win); elm_icon_standard_set(ic, "file"); - elm_object_content_set(btn, ic); + elm_object_content_part_set(btn, "icon", ic); evas_object_smart_callback_add(btn, "clicked", _add_tab_cb, ad); @@ -586,7 +586,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) ic = elm_icon_add(win); elm_icon_standard_set(ic, "close"); - elm_object_content_set(btn, ic); + elm_object_content_part_set(btn, "icon", ic); pager = elm_pager_add(win); evas_object_size_hint_weight_set(pager, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index ed111d5..4d837b3 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -4520,7 +4520,7 @@ extern "C" { * centered, scaled or stretched. * * Default contents parts of the bg widget that you can use for are: - * @li "elm.swallow.content" - overlay of the bg + * @li "overlay" - overlay of the bg * * Here is some sample code using it: * @li @ref bg_01_example_page @@ -4635,7 +4635,7 @@ extern "C" { * deleted, even if you set the new one to NULL. If you want to keep that * old content object, use the elm_bg_overlay_unset() function. * - * @deprecated use elm_object_content_set() instead + * @deprecated use elm_object_content_part_set() instead * * @ingroup Bg */ @@ -4650,7 +4650,7 @@ extern "C" { * * Return the content object which is set for this widget * - * @deprecated use elm_object_content_get() instead + * @deprecated use elm_object_content_part_get() instead * * @ingroup Bg */ @@ -4664,7 +4664,7 @@ extern "C" { * * Unparent and return the overlay object which was set for this widget * - * @deprecated use elm_object_content_unset() instead + * @deprecated use elm_object_content_part_unset() instead * * @ingroup Bg */ @@ -6005,10 +6005,10 @@ extern "C" { * @li hoversel_vertical_entry: Another internal for @ref Hoversel. * * Default contents parts of the button widget that you can use for are: - * @li "elm.swallow.content" - A icon of the button + * @li "icon" - A icon of the button * * Default text parts of the button widget that you can use for are: - * @li "elm.text" - Label of the button + * @li "default" - Label of the button * * Follow through a complete example @ref button_example_01 "here". * @{ @@ -6054,7 +6054,7 @@ extern "C" { * * @param obj The button object * @param icon The icon object for the button - * @deprecated use elm_object_content_set() instead. + * @deprecated use elm_object_content_part_set() instead. */ EINA_DEPRECATED EAPI void elm_button_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); /** @@ -6067,7 +6067,7 @@ extern "C" { * @param obj The button object * @return The icon object that is being used * - * @deprecated use elm_button_icon_unset() instead + * @deprecated use elm_object_content_part_get() instead */ EINA_DEPRECATED EAPI Evas_Object *elm_button_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); /** @@ -6080,7 +6080,7 @@ extern "C" { * * @param obj The button object * @return The icon object that was being used - * @deprecated use elm_object_content_unset() instead. + * @deprecated use elm_object_content_part_unset() instead. */ EINA_DEPRECATED EAPI Evas_Object *elm_button_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); /** @@ -6860,11 +6860,8 @@ extern "C" { * @note When Elementary is in desktop mode the thumbscroll(a.k.a. * fingerscroll) won't work. * - * To set/get/unset the content of the panel, you can use - * elm_object_content_set/get/unset APIs. - * Once the content object is set, a previously set one will be deleted. - * If you want to keep that old content object, use the - * elm_object_content_unset() function + * Default contents parts of the scroller widget that you can use for are: + * @li "default" - A content of the scroller * * In @ref tutorial_scroller you'll find an example of how to use most of * this API. @@ -7611,7 +7608,7 @@ extern "C" { * Of all this styles only default shows the title. Frame emits no signals. * * Default contents parts of the frame widget that you can use for are: - * @li "elm.swallow.content" - A content of the frame + * @li "default" - A content of the frame * * Default text parts of the frame widget that you can use for are: * @li "elm.text" - Label of the frame @@ -10377,7 +10374,7 @@ extern "C" { * @li "block,clicked" - when a click outside of the notify happens * * Default contents parts of the notify widget that you can use for are: - * @li "elm.swallow.content" - A content of the notify + * @li "default" - A content of the notify * * @ref tutorial_notify show usage of the API. * @@ -12348,13 +12345,18 @@ extern "C" { * Signals that you can add callbacks for are: * @li "clicked" - This is called when a user has clicked the bubble. * - * For an example of using a buble see @ref bubble_01_example_page "this". + * Default contents parts of the bubble that you can use for are: + * @li "default" - A content of the bubble + * @li "icon" - An icon of the bubble + * + * Default text parts of the button widget that you can use for are: + * @li NULL - Label of the bubble + * + * For an example of using a buble see @ref bubble_01_example_page "this". * * @{ */ -#define ELM_BUBBLE_CONTENT_ICON "elm.swallow.icon" - /** * Add a new bubble to the parent * @@ -17333,16 +17335,15 @@ extern "C" { * - @c "default" * * Default contents parts of the slider widget that you can use for are: - * @li "elm.swallow.icon" - A icon of the slider - * @li "elm.swallow.end" - A end part content of the slider + * @li "icon" - A icon of the slider + * @li "end" - A end part content of the slider * + * Default text parts of the silder widget that you can use for are: + * @li "default" - Label of the silder * Here is an example on its usage: * @li @ref slider_example */ -#define ELM_SLIDER_CONTENT_ICON "elm.swallow.icon" -#define ELM_SLIDER_CONTENT_END "elm.swallow.end" - /** * @addtogroup Slider * @{ @@ -17400,7 +17401,7 @@ extern "C" { * it won't get properly displayed. * * @ingroup Slider - * @deprecated use elm_object_content_set() instead. + * @deprecated use elm_object_content_part_set() instead. */ EINA_DEPRECATED EAPI void elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); @@ -17419,7 +17420,7 @@ extern "C" { * * @see elm_slider_icon_set() for more details * @see elm_slider_icon_get() - * @deprecated use elm_object_content_unset() instead. + * @deprecated use elm_object_content_part_unset() instead. * * @ingroup Slider */ @@ -17438,7 +17439,7 @@ extern "C" { * @see elm_slider_icon_set() for more details * @see elm_slider_icon_unset() * - * @deprecated use elm_object_content_get() instead. + * @deprecated use elm_object_content_part_get() instead. * * @ingroup Slider */ @@ -17460,7 +17461,7 @@ extern "C" { * @warning If the object being set does not have minimum size hints set, * it won't get properly displayed. * - * @deprecated use elm_object_content_part_set(obj, "elm.swallow.end", end) instead. + * @deprecated use elm_object_content_part_set() instead. * * @ingroup Slider */ @@ -17482,7 +17483,7 @@ extern "C" { * @see elm_slider_end_set() for more details. * @see elm_slider_end_get() * - * @deprecated use elm_object_content_part_unset(obj, "elm.swallow.end") + * @deprecated use elm_object_content_part_unset() instead * instead. * * @ingroup Slider @@ -17503,7 +17504,7 @@ extern "C" { * @see elm_slider_end_unset() * * - * @deprecated use elm_object_content_part_unset(obj, "elm.swallow.end") + * @deprecated use elm_object_content_part_get() instead * instead. * * @ingroup Slider @@ -19781,7 +19782,7 @@ extern "C" { * the check object(event_info is NULL). * * Default contents parts of the check widget that you can use for are: - * @li "elm.swallow.content" - A icon of the check + * @li "icon" - A icon of the check * * Default text parts of the check widget that you can use for are: * @li "elm.text" - Label of the check @@ -19825,7 +19826,7 @@ extern "C" { * If you want to keep that old content object, use the * elm_object_content_unset() function. * - * @deprecated use elm_object_content_set() instead. + * @deprecated use elm_object_content_part_set() instead. * */ EINA_DEPRECATED EAPI void elm_check_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); @@ -19835,7 +19836,7 @@ extern "C" { * @param obj The check object * @return The icon object * - * @deprecated use elm_object_content_get() instead. + * @deprecated use elm_object_content_part_get() instead. * */ EINA_DEPRECATED EAPI Evas_Object *elm_check_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); @@ -19847,7 +19848,7 @@ extern "C" { * * Unparent and return the icon object which was set for this widget. * - * @deprecated use elm_object_content_unset() instead. + * @deprecated use elm_object_content_part_unset() instead. * */ EINA_DEPRECATED EAPI Evas_Object *elm_check_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); @@ -19919,7 +19920,7 @@ extern "C" { * the radio objects within the group of radio objects that work together. * * Default contents parts of the radio widget that you can use for are: - * @li "elm.swallow.content" - A icon of the radio + * @li "icon" - A icon of the radio * * @ref tutorial_radio show most of this API in action. * @{ @@ -19959,7 +19960,7 @@ extern "C" { * want to keep that old content object, use the elm_radio_icon_unset() * function. * - * @deprecated use elm_object_content_set() instead. + * @deprecated use elm_object_content_part_set() instead. * */ EINA_DEPRECATED EAPI void elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); @@ -19971,7 +19972,7 @@ extern "C" { * * @see elm_radio_icon_set() * - * @deprecated use elm_object_content_get() instead. + * @deprecated use elm_object_content_part_get() instead. * */ EINA_DEPRECATED EAPI Evas_Object *elm_radio_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); @@ -19984,7 +19985,7 @@ extern "C" { * Unparent and return the icon object which was set for this widget. * * @see elm_radio_icon_set() - * @deprecated use elm_object_content_unset() instead. + * @deprecated use elm_object_content_part_unset() instead. * */ EINA_DEPRECATED EAPI Evas_Object *elm_radio_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); @@ -21069,7 +21070,7 @@ extern "C" { * "pulse" effect is available) * * Default contents parts of the progressbar widget that you can use for are: - * @li "elm.swallow.content" - A icon of the progressbar + * @li "icon" - A icon of the progressbar * * Here is an example on its usage: * @li @ref progressbar_example @@ -21207,7 +21208,7 @@ extern "C" { * elm_progressbar_icon_unset() function. * * @see elm_progressbar_icon_get() - * @deprecated use elm_object_content_set() instead. + * @deprecated use elm_object_content_part_set() instead. * * @ingroup Progressbar */ @@ -21221,7 +21222,7 @@ extern "C" { * otherwise (and on errors) * * @see elm_progressbar_icon_set() for more details - * @deprecated use elm_object_content_get() instead. + * @deprecated use elm_object_content_part_get() instead. * * @ingroup Progressbar */ @@ -21238,7 +21239,7 @@ extern "C" { * for this widget, previously, on success. * * @see elm_progressbar_icon_set() for more details - * @deprecated use elm_object_content_unset() instead. + * @deprecated use elm_object_content_part_unset() instead. * * @ingroup Progressbar */ @@ -23812,11 +23813,8 @@ extern "C" { * @li ELM_PANEL_ORIENT_LEFT * @li ELM_PANEL_ORIENT_RIGHT * - * To set/get/unset the content of the panel, you can use - * elm_object_content_set/get/unset APIs. - * Once the content object is set, a previously set one will be deleted. - * If you want to keep that old content object, use the - * elm_object_content_unset() function + * Default contents parts of the panel widget that you can use for are: + * @li "default" - A content of the panel * * @ref tutorial_panel shows one way to use this widget. * @{ @@ -23947,8 +23945,8 @@ extern "C" { * - @c "default" * * Default contents parts of the panes widget that you can use for are: - * @li "elm.swallow.left" - A leftside content of the panes - * @li "elm.swallow.right" - A rightside content of the panes + * @li "left" - A leftside content of the panes + * @li "right" - A rightside content of the panes * * If panes is displayed vertically, left content will be displayed at * top. @@ -23957,9 +23955,6 @@ extern "C" { * @li @ref panes_example */ -#define ELM_PANES_CONTENT_LEFT "elm.swallow.left" -#define ELM_PANES_CONTENT_RIGHT "elm.swallow.right" - /** * @addtogroup Panes * @{ @@ -24523,7 +24518,7 @@ extern "C" { * - @c "default" * * Default contents parts of the conformant widget that you can use for are: - * @li "elm.swallow.content" - A content of the conformant + * @li "default" - A content of the conformant * * See how to use this widget in this example: * @ref conformant_example @@ -24634,11 +24629,8 @@ extern "C" { * need to resize or move it frequently (the content object and its * children). * - * To set/get/unset the content of the mapbuf, you can use - * elm_object_content_set/get/unset APIs. - * Once the content object is set, a previously set one will be deleted. - * If you want to keep that old content object, use the - * elm_object_content_unset() function. + * Default contents parts of the mapbuf widget that you can use for are: + * @li "default" - A content of the mapbuf * * To enable map, elm_mapbuf_enabled_set() should be used. * @@ -26494,7 +26486,7 @@ extern "C" { * "dismissed" - the ctxpopup was dismissed * * Default contents parts of the ctxpopup widget that you can use for are: - * @li "elm.swallow.content" - A content of the ctxpopup + * @li "default" - A content of the ctxpopup * * @ref tutorial_ctxpopup shows the usage of a good deal of the API. * @{ @@ -28144,7 +28136,8 @@ extern "C" { * "rewind,clicked" - the user clicked the rewind button. * "stop,clicked" - the user clicked the stop button. * - * To set the video of the player, you can use elm_object_content_set() API. + * Default contents parts of the player widget that you can use for are: + * @li "video" - A video of the player * */ @@ -28156,7 +28149,7 @@ extern "C" { * * This function inserts a new player widget on the canvas. * - * @see elm_object_content_set() + * @see elm_object_content_part_set() * * @ingroup Video */ @@ -28174,7 +28167,7 @@ extern "C" { * * @see elm_player_add() * @see elm_video_add() - * @deprecated use elm_object_content_set() instead + * @deprecated use elm_object_content_part_set() instead * * @ingroup Video */ @@ -28370,23 +28363,18 @@ extern "C" { * @li "title,clicked" - User clicked title area * * Default contents parts of the naviframe items that you can use for are: - * @li "elm.swallow.content" - A main content of the page - * @li "elm.swallow.icon" - A icon in the title area - * @li "elm.swallow.prev_btn" - A button to go to the previous page - * @li "elm.swallow.next_btn" - A button to go to the next page + * @li "default" - A main content of the page + * @li "icon" - A icon in the title area + * @li "prev_btn" - A button to go to the previous page + * @li "next_btn" - A button to go to the next page * * Default text parts of the naviframe items that you can use for are: - * @li "elm.text.title" - Title label in the title area - * @li "elm.text.subtitle" - Sub-title label in the title area + * @li "default" - Title label in the title area + * @li "subtitle" - Sub-title label in the title area * * @ref tutorial_naviframe gives a good overview of the usage of the API. */ -#define ELM_NAVIFRAME_ITEM_CONTENT_ICON "elm.swallow.icon" -#define ELM_NAVIFRAME_ITEM_CONTENT_PREV_BTN "elm.swallow.prev_btn" -#define ELM_NAVIFRAME_ITEM_CONTNET_NEXT_BTN "elm.swallow.next_btn" -#define ELM_NAVIFRAME_ITEM_TEXT_SUBTITLE "elm.text.subtitle" - /** * @addtogroup Naviframe * @{ diff --git a/src/lib/elc_ctxpopup.c b/src/lib/elc_ctxpopup.c index 1268dd9..7c0daa1 100644 --- a/src/lib/elc_ctxpopup.c +++ b/src/lib/elc_ctxpopup.c @@ -791,13 +791,15 @@ _theme_hook(Evas_Object *obj) } static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd; + if (part && strcmp(part, "default")) return; + wd = elm_widget_data_get(obj); if ((!wd) || (!content)) return; @@ -819,13 +821,13 @@ _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, } static Evas_Object * -_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) +_content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd; Evas_Object *content; - + if (part && strcmp(part, "default")) return NULL; wd = elm_widget_data_get(obj); if (!wd) return NULL; @@ -845,11 +847,12 @@ _content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + if (part && strcmp(part, "default")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->content; } diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c index 2c71099..73a93da 100644 --- a/src/lib/elc_fileselector.c +++ b/src/lib/elc_fileselector.c @@ -839,7 +839,7 @@ elm_fileselector_add(Evas_Object *parent) evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); bt = elm_button_add(parent); elm_widget_mirrored_automatic_set(bt, EINA_FALSE); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Up")); evas_object_size_hint_align_set(bt, 0.0, 0.0); @@ -854,7 +854,7 @@ elm_fileselector_add(Evas_Object *parent) evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); bt = elm_button_add(parent); elm_widget_mirrored_automatic_set(bt, EINA_FALSE); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Home")); evas_object_size_hint_align_set(bt, 0.0, 0.0); diff --git a/src/lib/elc_fileselector_button.c b/src/lib/elc_fileselector_button.c index d104736..10341e4 100644 --- a/src/lib/elc_fileselector_button.c +++ b/src/lib/elc_fileselector_button.c @@ -512,7 +512,7 @@ elm_fileselector_button_icon_set(Evas_Object *obj, evas_object_del(icon); return; } - elm_object_content_set(wd->btn, icon); + elm_object_content_part_set(wd->btn, "icon", icon); } EAPI Evas_Object * @@ -521,7 +521,7 @@ elm_fileselector_button_icon_get(const Evas_Object *obj) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - return elm_object_content_get(wd->btn); + return elm_object_content_part_get(wd->btn, "icon"); } EAPI Evas_Object * @@ -530,6 +530,6 @@ elm_fileselector_button_icon_unset(Evas_Object *obj) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - return elm_object_content_unset(wd->btn); + return elm_object_content_part_unset(wd->btn, "icon"); } diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c index 6cb93e2..b4a7625 100644 --- a/src/lib/elc_hoversel.c +++ b/src/lib/elc_hoversel.c @@ -206,7 +206,7 @@ _activate(Evas_Object *obj) elm_icon_file_set(ic, item->icon_file, item->icon_group); else if (item->icon_type == ELM_ICON_STANDARD) elm_icon_standard_set(ic, item->icon_file); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); evas_object_show(ic); } evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); @@ -374,7 +374,7 @@ elm_hoversel_icon_set(Evas_Object *obj, Evas_Object *icon) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - elm_object_content_set(wd->btn, icon); + elm_object_content_part_set(wd->btn, "icon", icon); } EAPI Evas_Object * @@ -383,7 +383,7 @@ elm_hoversel_icon_get(const Evas_Object *obj) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if ((!wd) || (!wd->btn)) return NULL; - return elm_object_content_get(wd->btn); + return elm_object_content_part_get(wd->btn, "icon"); } EAPI Evas_Object * @@ -392,7 +392,7 @@ elm_hoversel_icon_unset(Evas_Object *obj) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if ((!wd) || (!wd->btn)) return NULL; - return elm_object_content_unset(wd->btn); + return elm_object_content_part_unset(wd->btn, "icon"); } EAPI void diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c index 884573c..5bd1ebe 100644 --- a/src/lib/elc_naviframe.c +++ b/src/lib/elc_naviframe.c @@ -39,6 +39,7 @@ struct _Elm_Naviframe_Item Evas_Object *content; Evas_Object *title_prev_btn; Evas_Object *title_next_btn; + Evas_Object *icon; const char *style; Eina_Bool back_btn: 1; Eina_Bool title_visible: 1; @@ -110,6 +111,10 @@ static void _title_next_btn_del(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _title_icon_del(void *data, + Evas *e, + Evas_Object *obj, + void *event_info); static void _title_content_set(Elm_Naviframe_Item *it, Elm_Naviframe_Content_Item_Pair *pair, const char *part, @@ -118,6 +123,7 @@ static void _title_prev_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn, Eina_Bool back_btn); static void _title_next_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn); +static void _title_icon_set(Elm_Naviframe_Item *it, Evas_Object *icon); static void _item_del(Elm_Naviframe_Item *it); static void _pushed_finished(void *data, Evas_Object *obj, @@ -233,8 +239,10 @@ _item_text_set_hook(Elm_Object_Item *it, Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it; char buf[1024]; - if (!part) + if (!part || !strcmp(part, "default")) snprintf(buf, sizeof(buf), "elm.text.title"); + else if(!strcmp("subtitle", part)) + snprintf(buf, sizeof(buf), "elm.text.subtitle"); else snprintf(buf, sizeof(buf), "%s", part); @@ -280,8 +288,10 @@ _item_text_get_hook(const Elm_Object_Item *it, const char *part) Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it; char buf[1024]; - if (!part) + if (!part || !strcmp(part, "default")) snprintf(buf, sizeof(buf), "elm.text.title"); + else if(!strcmp("subtitle", part)) + snprintf(buf, sizeof(buf), "elm.text.subtitle"); else snprintf(buf, sizeof(buf), "%s", part); @@ -304,21 +314,26 @@ _item_content_set_hook(Elm_Object_Item *it, Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it; //specified parts - if ((!part) || (!strcmp(part, "elm.swallow.content"))) + if (!part || !strcmp("default", part)) { _item_content_set(navi_it, content); return; } - else if (!strcmp(part, "elm.swallow.prev_btn")) + else if (!strcmp(part, "prev_btn")) { _title_prev_btn_set(navi_it, content, EINA_FALSE); return; } - else if(!strcmp(part, "elm.swallow.next_btn")) + else if (!strcmp(part, "next_btn")) { _title_next_btn_set(navi_it, content); return; } + else if (!strcmp(part, "icon")) + { + _title_icon_set(navi_it, content); + return; + } //common part _title_content_set(navi_it, pair, part, content); @@ -332,12 +347,14 @@ _item_content_get_hook(const Elm_Object_Item *it, const char *part) Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it; //specified parts - if ((!part) || (!strcmp(part, "elm.swallow.content"))) + if (!part || !strcmp("default", part)) return navi_it->content; - else if (!strcmp(part, "elm.swallow.prev_btn")) + else if (!strcmp(part, "prev_btn")) return navi_it->title_prev_btn; - else if(!strcmp(part, "elm.swallow.next_btn")) + else if (!strcmp(part, "next_btn")) return navi_it->title_next_btn; + else if (!strcmp(part, "icon")) + return navi_it->icon; //common parts EINA_INLIST_FOREACH(navi_it->content_list, pair) @@ -360,9 +377,10 @@ _item_content_unset_hook(Elm_Object_Item *it, const char *part) //specified parts //FIXME: could be unset the below specified contents also. if (!part || - !strcmp(part, "elm.swallow.content") || - !strcmp(part, "elm.swallow.prev_btn") || - !strcmp(part, "elm.swallow.next_btn")) + !strcmp(part, "default") || + !strcmp(part, "prev_btn") || + !strcmp(part, "next_btn") || + !strcmp(part, "icon")) { WRN("You can not unset the content! : naviframe=%p", WIDGET(navi_it)); @@ -537,6 +555,17 @@ _title_next_btn_del(void *data, } static void +_title_icon_del(void *data, + Evas *e __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) +{ + Elm_Naviframe_Item *it = data; + it->icon = NULL; + edje_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm"); +} + +static void _item_content_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, @@ -662,6 +691,36 @@ _title_next_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn) } static void +_title_icon_set(Elm_Naviframe_Item *it, Evas_Object *icon) +{ + if (it->icon == icon) return; + + if (it->icon) + evas_object_del(it->icon); + + it->icon = icon; + + if (!icon) + { + edje_object_signal_emit(VIEW(it), + "elm,state,icon,hide", + "elm"); + return; + } + + elm_widget_sub_object_add(WIDGET(it), icon); + evas_object_event_callback_add(icon, + EVAS_CALLBACK_DEL, + _title_icon_del, + it); + edje_object_part_swallow(VIEW(it), "elm.swallow.icon", icon); + edje_object_signal_emit(VIEW(it), "elm,state,icon,show", "elm"); + + _item_sizing_eval(it); +} + + +static void _item_del(Elm_Naviframe_Item *it) { Widget_Data *wd; @@ -677,6 +736,8 @@ _item_del(Elm_Naviframe_Item *it) evas_object_del(it->title_prev_btn); if (it->title_next_btn) evas_object_del(it->title_next_btn); + if (it->icon) + evas_object_del(it->icon); if ((it->content) && (!wd->preserve)) evas_object_del(it->content); diff --git a/src/lib/elc_player.c b/src/lib/elc_player.c index dd071c7..e249954 100644 --- a/src/lib/elc_player.c +++ b/src/lib/elc_player.c @@ -418,7 +418,7 @@ _player_button_add(Evas_Object *parent, Evas_Object *obj, Evas_Object *layout, c evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); bt = elm_button_add(parent); elm_widget_mirrored_automatic_set(bt, EINA_FALSE); - elm_object_content_set(bt, ic); + elm_object_content_part_set(bt, "icon", ic); evas_object_size_hint_align_set(bt, 0.0, 0.0); elm_object_style_set(bt, "anchor"); evas_object_smart_callback_add(bt, "clicked", func, obj); @@ -454,15 +454,17 @@ _double_to_time(double value) #endif static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { + if (!part || strcmp(part, "video")) return; #ifdef HAVE_EMOTION ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); + double pos, length; Eina_Bool seekable; - if (!_elm_video_check(content)) return ; + if (!_elm_video_check(content)) return; _cleanup_callback(wd); @@ -585,5 +587,5 @@ elm_player_add(Evas_Object *parent) EAPI void elm_player_video_set(Evas_Object *player, Evas_Object *video) { - _content_set_hook(player, NULL, video); + _content_set_hook(player, "video", video); } diff --git a/src/lib/elm_bg.c b/src/lib/elm_bg.c index 5261cd0..dd463e9 100644 --- a/src/lib/elm_bg.c +++ b/src/lib/elm_bg.c @@ -117,10 +117,14 @@ _custom_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void } static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (!part || strcmp(part, "overlay")) return; + + wd = elm_widget_data_get(obj); if (!wd) return; if (wd->overlay) { @@ -138,22 +142,25 @@ _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *co } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + if (!part || strcmp(part, "overlay")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->overlay; } static Evas_Object * -_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) +_content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; Evas_Object *overlay; - if (!wd) return NULL; - if (!wd->overlay) return NULL; + if (!part || strcmp(part, "overlay")) return NULL; + wd = elm_widget_data_get(obj); + if (!wd || !wd->overlay) return NULL; overlay = wd->overlay; elm_widget_sub_object_del(obj, wd->overlay); edje_object_part_unswallow(wd->base, wd->overlay); @@ -294,19 +301,19 @@ elm_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b) EAPI void elm_bg_overlay_set(Evas_Object *obj, Evas_Object *overlay) { - _content_set_hook(obj, NULL, overlay); + _content_set_hook(obj, "overlay", overlay); } EAPI Evas_Object * elm_bg_overlay_get(const Evas_Object *obj) { - return _content_get_hook(obj, NULL); + return _content_get_hook(obj, "overlay"); } EAPI Evas_Object * elm_bg_overlay_unset(Evas_Object *obj) { - return _content_unset_hook(obj, NULL); + return _content_unset_hook(obj, "overlay"); } EAPI void diff --git a/src/lib/elm_bubble.c b/src/lib/elm_bubble.c index 4858d68..4e37d5d 100644 --- a/src/lib/elm_bubble.c +++ b/src/lib/elm_bubble.c @@ -157,9 +157,9 @@ _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if ((!part) || !strcmp(part, "elm.swallow.content")) + if (!part || !strcmp(part, "default")) _content_set(obj, content); - else if(!strcmp(part, "elm.swallow.icon")) + else if(!strcmp(part, "icon")) _icon_set(obj, content); } @@ -169,9 +169,9 @@ _content_get_hook(const Evas_Object *obj, const char *part) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - if ((!part) || !strcmp(part, "elm.swallow.content")) + if (!part || !strcmp(part, "default")) return wd->content; - else if(!strcmp(part, "elm.swallow.icon")) + else if(!strcmp(part, "icon")) return wd->icon; return NULL; } @@ -182,9 +182,9 @@ _content_unset_hook(Evas_Object *obj, const char *part) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - if ((!part) || !strcmp(part, "elm.swallow.content")) + if (!part || !strcmp(part, "default")) return _content_unset(obj); - else if(!strcmp(part, "elm.swallow.icon")) + else if(!strcmp(part, "icon")) return _icon_unset(obj); return NULL; } diff --git a/src/lib/elm_button.c b/src/lib/elm_button.c index 7e2ff28..9572cd2 100644 --- a/src/lib/elm_button.c +++ b/src/lib/elm_button.c @@ -176,11 +176,12 @@ _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *so } static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; + if (!part || strcmp(part, "icon")) return; if (wd->icon == content) return; if (wd->icon) evas_object_del(wd->icon); wd->icon = content; @@ -198,19 +199,25 @@ _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *co } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (!part || strcmp(part, "icon")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->icon; } static Evas_Object * -_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) +_content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (!part || strcmp(part, "icon")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->icon) return NULL; Evas_Object *icon = wd->icon; @@ -474,19 +481,19 @@ elm_button_label_get(const Evas_Object *obj) EAPI void elm_button_icon_set(Evas_Object *obj, Evas_Object *icon) { - _content_set_hook(obj, NULL, icon); + _content_set_hook(obj, "icon", icon); } EAPI Evas_Object * elm_button_icon_get(const Evas_Object *obj) { - return _content_get_hook(obj, NULL); + return _content_get_hook(obj, "icon"); } EAPI Evas_Object * elm_button_icon_unset(Evas_Object *obj) { - return _content_unset_hook(obj, NULL); + return _content_unset_hook(obj, "icon"); } EAPI void diff --git a/src/lib/elm_check.c b/src/lib/elm_check.c index c4e57c8..cf7f8c6 100644 --- a/src/lib/elm_check.c +++ b/src/lib/elm_check.c @@ -207,10 +207,13 @@ _activate_hook(Evas_Object *obj) } static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (strcmp(part, "icon")) return; + wd = elm_widget_data_get(obj); if (!wd) return; if (wd->icon == content) return; if (wd->icon) evas_object_del(wd->icon); @@ -229,19 +232,25 @@ _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *co } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (strcmp(part, "icon")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->icon; } static Evas_Object * -_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) +_content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (strcmp(part, "icon")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->icon) return NULL; Evas_Object *icon = wd->icon; @@ -461,19 +470,19 @@ elm_check_states_labels_get(const Evas_Object *obj, const char **ontext, const c EAPI void elm_check_icon_set(Evas_Object *obj, Evas_Object *icon) { - _content_set_hook(obj, NULL, icon); + _content_set_hook(obj, "icon", icon); } EAPI Evas_Object * elm_check_icon_get(const Evas_Object *obj) { - return _content_get_hook(obj, NULL); + return _content_get_hook(obj, "icon"); } EAPI Evas_Object * elm_check_icon_unset(Evas_Object *obj) { - return _content_unset_hook(obj, NULL); + return _content_unset_hook(obj, "icon"); } EAPI void diff --git a/src/lib/elm_conform.c b/src/lib/elm_conform.c index 1ccacac..b44c7aa 100644 --- a/src/lib/elm_conform.c +++ b/src/lib/elm_conform.c @@ -121,11 +121,12 @@ _theme_hook(Evas_Object *obj) } static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - + Widget_Data *wd; + if (part && strcmp(part, "default")) return; + wd = elm_widget_data_get(obj); if (!wd) return; if (wd->content == content) return; if (wd->content) evas_object_del(wd->content); @@ -142,21 +143,24 @@ _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *co } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + if (part && strcmp(part, "default")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->content; } static Evas_Object * -_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) +_content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; Evas_Object *content; - + if (part && strcmp(part, "default")) return NULL; + wd = elm_widget_data_get(obj); if ((!wd) || (!wd->content)) return NULL; content = wd->content; elm_widget_sub_object_del(obj, wd->content); diff --git a/src/lib/elm_factory.c b/src/lib/elm_factory.c index ecb5b5c..16d6327 100644 --- a/src/lib/elm_factory.c +++ b/src/lib/elm_factory.c @@ -26,8 +26,8 @@ static void _move(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, v static void _resize(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__); static void _child_change(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__); static void _child_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__); -static void _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content); -static Evas_Object *_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__); +static void _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content); +static Evas_Object *_content_get_hook(const Evas_Object *obj, const char *part); static const char SIG_REALIZE[] = "realize"; static const char SIG_UNREALIZE[] = "unrealize"; @@ -212,10 +212,13 @@ _child_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __ } static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (part && strcmp(part, "default")) return; + wd = elm_widget_data_get(obj); if (!wd) return; if (wd->content == content) return; if (wd->content) @@ -250,10 +253,12 @@ _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *co } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + if (part && strcmp(part, "default")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->content; } diff --git a/src/lib/elm_frame.c b/src/lib/elm_frame.c index 7dae02b..a8732da 100644 --- a/src/lib/elm_frame.c +++ b/src/lib/elm_frame.c @@ -125,10 +125,13 @@ _elm_frame_label_get(const Evas_Object *obj, const char *item) } static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (part && strcmp(part, "default")) return; + wd = elm_widget_data_get(obj); if (!wd) return; if (wd->content == content) return; if (wd->content) evas_object_del(wd->content); @@ -144,20 +147,25 @@ _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *co } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (part && strcmp(part, "default")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->content; } static Evas_Object * -_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) +_content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; Evas_Object *content; + if (part && strcmp(part, "default")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->content) return NULL; content = wd->content; diff --git a/src/lib/elm_mapbuf.c b/src/lib/elm_mapbuf.c index 9e01249..05a0c92 100644 --- a/src/lib/elm_mapbuf.c +++ b/src/lib/elm_mapbuf.c @@ -147,10 +147,13 @@ _resize(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, } static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (part && strcmp(part, "default")) return; + wd = elm_widget_data_get(obj); if (!wd) return; if (wd->content == content) return; if (wd->content) evas_object_del(wd->content); @@ -173,20 +176,26 @@ _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *co } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (part && strcmp(part, "default")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->content; } static Evas_Object * -_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) +_content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; Evas_Object *content; + + if (part && strcmp(part, "default")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->content) return NULL; content = wd->content; diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c index 3b2de35..ff3eb6a 100644 --- a/src/lib/elm_notify.c +++ b/src/lib/elm_notify.c @@ -414,10 +414,12 @@ _elm_notify_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Eva } static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + if (part && strcmp(part ,"default")) return; + wd = elm_widget_data_get(obj); if (!wd) return; if (wd->content == content) return; if (wd->content) evas_object_del(wd->content); @@ -437,21 +439,24 @@ _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *co } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - + Widget_Data *wd; + if (part && strcmp(part ,"default")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->content; } static Evas_Object * -_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) +_content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; Evas_Object *content; + if (part && strcmp(part ,"default")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->content) return NULL; content = wd->content; diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c index 3da5b9e..b4de56d 100644 --- a/src/lib/elm_panel.c +++ b/src/lib/elm_panel.c @@ -226,10 +226,13 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty } static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (part && strcmp(part, "default")) return; + wd = elm_widget_data_get(obj); if (!wd) return; if (wd->content == content) return; if (wd->content) @@ -244,20 +247,25 @@ _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *co } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (part && strcmp(part, "default")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->content; } static Evas_Object * -_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) +_content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; Evas_Object *content; + if (part && strcmp(part, "default")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->content) return NULL; content = wd->content; diff --git a/src/lib/elm_panes.c b/src/lib/elm_panes.c index d2fd836..b31d5cf 100644 --- a/src/lib/elm_panes.c +++ b/src/lib/elm_panes.c @@ -274,12 +274,14 @@ static void _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; + Widget_Data *wd; - if ((!part) || (!strcmp(part, "elm.swallow.right"))) + if (!part) return; + wd = elm_widget_data_get(obj); + if (!wd) return; + if (!strcmp(part, "right")) _content_right_set(obj, content); - else if(!strcmp(part, "elm.swallow.left")) + else if(!strcmp(part, "left")) _content_left_set(obj, content); } @@ -287,11 +289,14 @@ static Evas_Object * _content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (!part) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; - if ((!part) || (!strcmp(part, "elm.swallow.right"))) + if (!strcmp(part, "right")) return wd->contents.left; - else if (!strcmp(part, "elm.swallow.left")) + else if (!strcmp(part, "left")) return wd->contents.right; return NULL; } @@ -300,14 +305,15 @@ static Evas_Object * _content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; + Widget_Data *wd; - if ((!part) || (!strcmp(part, "elm.swallow.right"))) + if (!part) return NULL; + wd = elm_widget_data_get(obj); + if (!wd) return NULL; + if (!strcmp(part, "right")) _content_right_unset(obj); - else if (!strcmp(part, "elm.swallow.left")) + else if (!strcmp(part, "left")) _content_left_unset(obj); - return NULL; } @@ -362,37 +368,37 @@ elm_panes_add(Evas_Object *parent) EAPI void elm_panes_content_left_set(Evas_Object *obj, Evas_Object *content) { - _content_set_hook(obj, "elm.swallow.left", content); + _content_set_hook(obj, "left", content); } EAPI void elm_panes_content_right_set(Evas_Object *obj, Evas_Object *content) { - _content_set_hook(obj, NULL, content); + _content_set_hook(obj, "right", content); } EAPI Evas_Object * elm_panes_content_left_get(const Evas_Object *obj) { - return _content_get_hook(obj, "elm.swallow.left"); + return _content_get_hook(obj, "left"); } EAPI Evas_Object * elm_panes_content_right_get(const Evas_Object *obj) { - return _content_get_hook(obj, NULL); + return _content_get_hook(obj, "right"); } EAPI Evas_Object * elm_panes_content_left_unset(Evas_Object *obj) { - return _content_unset_hook(obj, "elm.swallow.left"); + return _content_unset_hook(obj, "left"); } EAPI Evas_Object * elm_panes_content_right_unset(Evas_Object *obj) { - return _content_unset_hook(obj, "elm.swallow.right"); + return _content_unset_hook(obj, "right"); } EAPI double diff --git a/src/lib/elm_progressbar.c b/src/lib/elm_progressbar.c index a44c5f3..9ada9fb 100644 --- a/src/lib/elm_progressbar.c +++ b/src/lib/elm_progressbar.c @@ -198,10 +198,12 @@ _elm_progressbar_label_get(const Evas_Object *obj, const char *item) } static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + if (!part || strcmp(part, "icon")) return; + wd = elm_widget_data_get(obj); if (!wd) return; if (wd->icon == content) return; if (wd->icon) evas_object_del(wd->icon); @@ -220,22 +222,27 @@ _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *co } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + if (!part || strcmp(part, "icon")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->icon; } static Evas_Object * -_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) +_content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + Evas_Object *icon; + if (!part || strcmp(part, "icon")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->icon) return NULL; - Evas_Object *icon = wd->icon; + icon = wd->icon; elm_widget_sub_object_del(obj, wd->icon); evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); @@ -366,19 +373,19 @@ elm_progressbar_label_get(const Evas_Object *obj) EAPI void elm_progressbar_icon_set(Evas_Object *obj, Evas_Object *icon) { - _content_set_hook(obj, NULL, icon); + _content_set_hook(obj, "icon", icon); } EAPI Evas_Object * elm_progressbar_icon_get(const Evas_Object *obj) { - return _content_get_hook(obj, NULL); + return _content_get_hook(obj, "icon"); } EAPI Evas_Object * elm_progressbar_icon_unset(Evas_Object *obj) { - return _content_unset_hook(obj, NULL); + return _content_unset_hook(obj, "icon"); } EAPI void diff --git a/src/lib/elm_radio.c b/src/lib/elm_radio.c index 0c3224d..3a3617d 100644 --- a/src/lib/elm_radio.c +++ b/src/lib/elm_radio.c @@ -299,10 +299,13 @@ _access_state_cb(void *data __UNUSED__, Evas_Object *obj, Elm_Widget_Item *item } static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (!part || strcmp(part, "icon")) return; + wd = elm_widget_data_get(obj); if (!wd) return; if (wd->icon == content) return; if (wd->icon) evas_object_del(wd->icon); @@ -321,22 +324,28 @@ _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *co } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + + if (!part || strcmp(part, "icon")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->icon; } static Evas_Object * -_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) +_content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + Evas_Object *icon; + if (!part || strcmp(part, "icon")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->icon) return NULL; - Evas_Object *icon = wd->icon; + icon = wd->icon; elm_widget_sub_object_del(obj, wd->icon); evas_object_event_callback_del_full(wd->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); @@ -416,19 +425,19 @@ elm_radio_label_get(const Evas_Object *obj) EAPI void elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon) { - _content_set_hook(obj, NULL, icon); + _content_set_hook(obj, "icon", icon); } EAPI Evas_Object * elm_radio_icon_get(const Evas_Object *obj) { - return _content_get_hook(obj, NULL); + return _content_get_hook(obj, "icon"); } EAPI Evas_Object * elm_radio_icon_unset(Evas_Object *obj) { - return _content_unset_hook(obj, NULL); + return _content_unset_hook(obj, "icon"); } EAPI void diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c index 9c64860..90380ae 100644 --- a/src/lib/elm_scroller.c +++ b/src/lib/elm_scroller.c @@ -423,10 +423,12 @@ _elm_scroller_edje_object_get(Evas_Object *obj) } static void -_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + if (part && strcmp(part, "default")) return; + wd = elm_widget_data_get(obj); if (!wd) return; if (wd->content == content) return; if (wd->content) evas_object_del(wd->content); @@ -445,20 +447,24 @@ _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *co } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + if (part && strcmp(part, "default")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->content; } static Evas_Object * -_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) +_content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; Evas_Object *content; + if (part && strcmp(part, "default")) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->content) return NULL; content = wd->content; diff --git a/src/lib/elm_slider.c b/src/lib/elm_slider.c index e721dab..209dbe5 100644 --- a/src/lib/elm_slider.c +++ b/src/lib/elm_slider.c @@ -580,32 +580,36 @@ static void _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - if ((!part) || (!strcmp(part, "elm.swallow.icon"))) + if (!part) return; + if (!strcmp(part, "icon")) _icon_set(obj, content); - else if (!strcmp(part, "elm.swallow.end")) + else if (!strcmp(part, "end")) _end_set(obj, content); } static Evas_Object * -_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +_content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; + if (!part) return NULL; + wd = elm_widget_data_get(obj); if (!wd) return NULL; - if ((!part) || (!strcmp(part, "elm.swallow.icon"))) + if (!strcmp(part, "icon")) return wd->icon; - else if (!strcmp(part, "elm.swallow.end")) + else if (!strcmp(part, "end")) return wd->end; return NULL; } static Evas_Object * -_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__) +_content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - if ((!part) || (!strcmp(part, "elm.swallow.icon"))) + if (!part) return NULL; + if (!strcmp(part, "icon")) return _icon_unset(obj); - else if (!strcmp(part, "elm.swallow.end")) + else if (!strcmp(part, "end")) return _end_unset(obj); return NULL; } @@ -684,19 +688,19 @@ elm_slider_label_get(const Evas_Object *obj) EAPI void elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon) { - _content_set_hook(obj, NULL, icon); + _content_set_hook(obj, "icon", icon); } EAPI Evas_Object * elm_slider_icon_unset(Evas_Object *obj) { - return _content_unset_hook(obj, NULL); + return _content_unset_hook(obj, "icon"); } EAPI Evas_Object * elm_slider_icon_get(const Evas_Object *obj) { - return _content_get_hook(obj, NULL); + return _content_get_hook(obj, "icon"); } EAPI void @@ -903,19 +907,19 @@ elm_slider_units_format_function_set(Evas_Object *obj, const char *(*func)(doubl EAPI void elm_slider_end_set(Evas_Object *obj, Evas_Object *end) { - _content_set_hook(obj, "elm.swallow.end", end); + _content_set_hook(obj, "end", end); } EAPI Evas_Object * elm_slider_end_unset(Evas_Object *obj) { - return _content_unset_hook(obj, "elm.swallow.end"); + return _content_unset_hook(obj, "end"); } EAPI Evas_Object * elm_slider_end_get(const Evas_Object *obj) { - return _content_get_hook(obj, "elm.swallow.end"); + return _content_get_hook(obj, "end"); } EAPI void diff --git a/src/lib/elm_toggle.c b/src/lib/elm_toggle.c index e2b195e..28fbcfa 100644 --- a/src/lib/elm_toggle.c +++ b/src/lib/elm_toggle.c @@ -28,19 +28,19 @@ elm_toggle_label_get(const Evas_Object *obj) EAPI void elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon) { - elm_object_content_set(obj, icon); + elm_object_content_part_set(obj, "icon", icon); } EAPI Evas_Object * elm_toggle_icon_get(const Evas_Object *obj) { - return elm_object_content_get(obj); + return elm_object_content_part_get(obj, "icon"); } EAPI Evas_Object * elm_toggle_icon_unset(Evas_Object *obj) { - return elm_object_content_unset(obj); + return elm_object_content_part_unset(obj, "icon"); } EAPI void