summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2011-10-25 01:23:25 +0000
committerChunEon Park <hermet@hermet.pe.kr>2011-10-25 01:23:25 +0000
commit8d85b136bf242372c5daf24473778fecc25a1e96 (patch)
treef350258aedd1f8002e30057710893800339d0a60 /legacy
parentda7bf528c95d54f84c695977593de07a8f82854c (diff)
elementary/button -> use elm_object_content_set/get/unset
SVN revision: 64370
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/doc/examples.dox2
-rw-r--r--legacy/elementary/doc/widgets/widget_preview_button2.c2
-rw-r--r--legacy/elementary/doc/widgets/widget_preview_button3.c2
-rw-r--r--legacy/elementary/src/bin/test_button.c14
-rw-r--r--legacy/elementary/src/bin/test_map.c2
-rw-r--r--legacy/elementary/src/bin/test_naviframe.c4
-rw-r--r--legacy/elementary/src/bin/test_transit.c10
-rw-r--r--legacy/elementary/src/edje_externals/elm_button.c4
-rw-r--r--legacy/elementary/src/examples/button_example_01.c16
-rw-r--r--legacy/elementary/src/examples/entry_example.c2
-rw-r--r--legacy/elementary/src/examples/transit_example_03.c2
-rw-r--r--legacy/elementary/src/examples/transit_example_04.c4
-rw-r--r--legacy/elementary/src/examples/web_example.c16
-rw-r--r--legacy/elementary/src/lib/Elementary.h.in12
-rw-r--r--legacy/elementary/src/lib/elc_fileselector.c4
-rw-r--r--legacy/elementary/src/lib/elc_fileselector_button.c6
-rw-r--r--legacy/elementary/src/lib/elc_hoversel.c8
-rw-r--r--legacy/elementary/src/lib/elc_player.c2
-rw-r--r--legacy/elementary/src/lib/elm_button.c84
19 files changed, 111 insertions, 85 deletions
diff --git a/legacy/elementary/doc/examples.dox b/legacy/elementary/doc/examples.dox
index 2e92f13882..a861cec6bc 100644
--- a/legacy/elementary/doc/examples.dox
+++ b/legacy/elementary/doc/examples.dox
@@ -842,7 +842,7 @@
842 * callback, where we move the button doing some size hint magic. To 842 * callback, where we move the button doing some size hint magic. To
843 * understand how that works better, refer to the @ref Box documentation. 843 * understand how that works better, refer to the @ref Box documentation.
844 * Also, the first time the function is called, we change the icon in the 844 * Also, the first time the function is called, we change the icon in the
845 * middle button, using elm_button_icon_unset() first to keep the reference 845 * middle button, using elm_object_content_unset() first to keep the reference
846 * to the previous one, so we don't need to recreate it when we are done 846 * to the previous one, so we don't need to recreate it when we are done
847 * moving it. 847 * moving it.
848 * @skip static void 848 * @skip static void
diff --git a/legacy/elementary/doc/widgets/widget_preview_button2.c b/legacy/elementary/doc/widgets/widget_preview_button2.c
index d19c0944f5..08ed5f0160 100644
--- a/legacy/elementary/doc/widgets/widget_preview_button2.c
+++ b/legacy/elementary/doc/widgets/widget_preview_button2.c
@@ -9,7 +9,7 @@ elm_object_text_set(o, "Button");
9 9
10Evas_Object *o2 = elm_icon_add(win); 10Evas_Object *o2 = elm_icon_add(win);
11elm_icon_standard_set(o2, "home"); 11elm_icon_standard_set(o2, "home");
12elm_button_icon_set(o, o2); 12elm_object_content_set(o, o2);
13evas_object_show(o2); 13evas_object_show(o2);
14 14
15#include "widget_preview_tmpl_foot.c" 15#include "widget_preview_tmpl_foot.c"
diff --git a/legacy/elementary/doc/widgets/widget_preview_button3.c b/legacy/elementary/doc/widgets/widget_preview_button3.c
index 3e1f9d6e48..1a020fdf2a 100644
--- a/legacy/elementary/doc/widgets/widget_preview_button3.c
+++ b/legacy/elementary/doc/widgets/widget_preview_button3.c
@@ -7,7 +7,7 @@ evas_object_show(o);
7 7
8Evas_Object *o2 = elm_icon_add(win); 8Evas_Object *o2 = elm_icon_add(win);
9elm_icon_standard_set(o2, "home"); 9elm_icon_standard_set(o2, "home");
10elm_button_icon_set(o, o2); 10elm_object_content_set(o, o2);
11evas_object_show(o2); 11evas_object_show(o2);
12 12
13#include "widget_preview_tmpl_foot.c" 13#include "widget_preview_tmpl_foot.c"
diff --git a/legacy/elementary/src/bin/test_button.c b/legacy/elementary/src/bin/test_button.c
index b595f8020c..95abab11e5 100644
--- a/legacy/elementary/src/bin/test_button.c
+++ b/legacy/elementary/src/bin/test_button.c
@@ -64,7 +64,7 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
64 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); 64 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
65 bt = elm_button_add(win); 65 bt = elm_button_add(win);
66 elm_object_text_set(bt, "Icon sized to button"); 66 elm_object_text_set(bt, "Icon sized to button");
67 elm_button_icon_set(bt, ic); 67 elm_object_content_set(bt, ic);
68 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)1); 68 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)1);
69 evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)1); 69 evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)1);
70 elm_box_pack_end(bx, bt); 70 elm_box_pack_end(bx, bt);
@@ -77,7 +77,7 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
77 elm_icon_scale_set(ic, 0, 0); 77 elm_icon_scale_set(ic, 0, 0);
78 bt = elm_button_add(win); 78 bt = elm_button_add(win);
79 elm_object_text_set(bt, "Icon no scale"); 79 elm_object_text_set(bt, "Icon no scale");
80 elm_button_icon_set(bt, ic); 80 elm_object_content_set(bt, ic);
81 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)2); 81 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)2);
82 evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)2); 82 evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)2);
83 elm_box_pack_end(bx, bt); 83 elm_box_pack_end(bx, bt);
@@ -90,7 +90,7 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
90 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); 90 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
91 bt = elm_button_add(win); 91 bt = elm_button_add(win);
92 elm_object_text_set(bt, "Disabled Button"); 92 elm_object_text_set(bt, "Disabled Button");
93 elm_button_icon_set(bt, ic); 93 elm_object_content_set(bt, ic);
94 elm_object_disabled_set(bt, 1); 94 elm_object_disabled_set(bt, 1);
95 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)3); 95 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)3);
96 evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)3); 96 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
103 elm_icon_file_set(ic, buf, NULL); 103 elm_icon_file_set(ic, buf, NULL);
104 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); 104 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
105 bt = elm_button_add(win); 105 bt = elm_button_add(win);
106 elm_button_icon_set(bt, ic); 106 elm_object_content_set(bt, ic);
107 elm_object_disabled_set(bt, 1); 107 elm_object_disabled_set(bt, 1);
108 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)4); 108 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)4);
109 evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)4); 109 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
127 elm_icon_file_set(ic, buf, NULL); 127 elm_icon_file_set(ic, buf, NULL);
128 elm_icon_scale_set(ic, 0, 0); 128 elm_icon_scale_set(ic, 0, 0);
129 bt = elm_button_add(win); 129 bt = elm_button_add(win);
130 elm_button_icon_set(bt, ic); 130 elm_object_content_set(bt, ic);
131 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)6); 131 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)6);
132 evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)6); 132 evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)6);
133 elm_box_pack_end(bx, bt); 133 elm_box_pack_end(bx, bt);
@@ -148,7 +148,7 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
148 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); 148 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
149 bt = elm_button_add(win); 149 bt = elm_button_add(win);
150 elm_object_style_set(bt, "anchor"); 150 elm_object_style_set(bt, "anchor");
151 elm_button_icon_set(bt, ic); 151 elm_object_content_set(bt, ic);
152 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)8); 152 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)8);
153 evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)8); 153 evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)8);
154 elm_box_pack_end(bx, bt); 154 elm_box_pack_end(bx, bt);
@@ -162,7 +162,7 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
162 bt = elm_button_add(win); 162 bt = elm_button_add(win);
163 elm_object_access_info_set(bt, "This is some custom text describing this widget"); 163 elm_object_access_info_set(bt, "This is some custom text describing this widget");
164 elm_object_style_set(bt, "anchor"); 164 elm_object_style_set(bt, "anchor");
165 elm_button_icon_set(bt, ic); 165 elm_object_content_set(bt, ic);
166 elm_object_disabled_set(bt, 1); 166 elm_object_disabled_set(bt, 1);
167 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)9); 167 evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)9);
168 evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)9); 168 evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)9);
diff --git a/legacy/elementary/src/bin/test_map.c b/legacy/elementary/src/bin/test_map.c
index f85a12ae8a..a341cf9670 100644
--- a/legacy/elementary/src/bin/test_map.c
+++ b/legacy/elementary/src/bin/test_map.c
@@ -546,7 +546,7 @@ _marker_get(Evas_Object *obj, Elm_Map_Marker *marker __UNUSED__, void *data)
546 evas_object_show(icon); 546 evas_object_show(icon);
547 547
548 Evas_Object *o = elm_button_add(obj); 548 Evas_Object *o = elm_button_add(obj);
549 elm_button_icon_set(o, icon); 549 elm_object_content_set(o, icon);
550 evas_object_show(o); 550 evas_object_show(o);
551 elm_box_pack_end(bx, o); 551 elm_box_pack_end(bx, o);
552 } 552 }
diff --git a/legacy/elementary/src/bin/test_naviframe.c b/legacy/elementary/src/bin/test_naviframe.c
index 8cc9cd9106..df4973dfdd 100644
--- a/legacy/elementary/src/bin/test_naviframe.c
+++ b/legacy/elementary/src/bin/test_naviframe.c
@@ -37,7 +37,7 @@ _page4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
37 snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png", elm_app_data_dir_get()); 37 snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png", elm_app_data_dir_get());
38 elm_icon_file_set(ic, buf, NULL); 38 elm_icon_file_set(ic, buf, NULL);
39 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); 39 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
40 elm_button_icon_set(bt, ic); 40 elm_object_content_set(bt, ic);
41 41
42 bt2 = elm_button_add(nf); 42 bt2 = elm_button_add(nf);
43 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL); 43 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -115,7 +115,7 @@ _page2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
115 snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png", elm_app_data_dir_get()); 115 snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png", elm_app_data_dir_get());
116 elm_icon_file_set(ic, buf, NULL); 116 elm_icon_file_set(ic, buf, NULL);
117 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); 117 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
118 elm_button_icon_set(bt, ic); 118 elm_object_content_set(bt, ic);
119 119
120 it = elm_naviframe_item_push(nf, 120 it = elm_naviframe_item_push(nf,
121 "Page 2", 121 "Page 2",
diff --git a/legacy/elementary/src/bin/test_transit.c b/legacy/elementary/src/bin/test_transit.c
index e1ddc399f2..5c23418b6c 100644
--- a/legacy/elementary/src/bin/test_transit.c
+++ b/legacy/elementary/src/bin/test_transit.c
@@ -255,7 +255,7 @@ test_transit(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf
255 255
256 bt = elm_button_add(win); 256 bt = elm_button_add(win);
257 elm_object_text_set(bt, "ImageAnimation Effect"); 257 elm_object_text_set(bt, "ImageAnimation Effect");
258 elm_button_icon_set(bt, ic); 258 elm_object_content_set(bt, ic);
259 elm_box_pack_end(bx, bt); 259 elm_box_pack_end(bx, bt);
260 evas_object_show(bt); 260 evas_object_show(bt);
261 evas_object_show(ic); 261 evas_object_show(ic);
@@ -386,7 +386,7 @@ test_transit5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
386 evas_object_size_hint_max_set(ic, 50, 50); 386 evas_object_size_hint_max_set(ic, 50, 50);
387 387
388 bt = elm_button_add(win); 388 bt = elm_button_add(win);
389 elm_button_icon_set(bt, ic); 389 elm_object_content_set(bt, ic);
390 elm_object_text_set(bt, "Before Button - Blend Effect"); 390 elm_object_text_set(bt, "Before Button - Blend Effect");
391 evas_object_move(bt, 25, 125); 391 evas_object_move(bt, 25, 125);
392 evas_object_resize(bt, 250, 50); 392 evas_object_resize(bt, 250, 50);
@@ -398,7 +398,7 @@ test_transit5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
398 evas_object_size_hint_max_set(ic, 50, 50); 398 evas_object_size_hint_max_set(ic, 50, 50);
399 399
400 bt2 = elm_button_add(win); 400 bt2 = elm_button_add(win);
401 elm_button_icon_set(bt2, ic); 401 elm_object_content_set(bt2, ic);
402 elm_object_text_set(bt2, "After Button - Blend Effect"); 402 elm_object_text_set(bt2, "After Button - Blend Effect");
403 evas_object_move(bt2, 25, 125); 403 evas_object_move(bt2, 25, 125);
404 evas_object_resize(bt2, 250, 50); 404 evas_object_resize(bt2, 250, 50);
@@ -432,7 +432,7 @@ test_transit6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
432 evas_object_size_hint_max_set(ic, 50, 50); 432 evas_object_size_hint_max_set(ic, 50, 50);
433 433
434 bt = elm_button_add(win); 434 bt = elm_button_add(win);
435 elm_button_icon_set(bt, ic); 435 elm_object_content_set(bt, ic);
436 elm_object_text_set(bt, "Before Button - Fade Effect"); 436 elm_object_text_set(bt, "Before Button - Fade Effect");
437 evas_object_move(bt, 25, 125); 437 evas_object_move(bt, 25, 125);
438 evas_object_resize(bt, 250, 50); 438 evas_object_resize(bt, 250, 50);
@@ -444,7 +444,7 @@ test_transit6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
444 evas_object_size_hint_max_set(ic, 50, 50); 444 evas_object_size_hint_max_set(ic, 50, 50);
445 445
446 bt2 = elm_button_add(win); 446 bt2 = elm_button_add(win);
447 elm_button_icon_set(bt2, ic); 447 elm_object_content_set(bt2, ic);
448 elm_object_text_set(bt2, "After Button - Fade Effect"); 448 elm_object_text_set(bt2, "After Button - Fade Effect");
449 evas_object_move(bt2, 25, 125); 449 evas_object_move(bt2, 25, 125);
450 evas_object_resize(bt2, 250, 50); 450 evas_object_resize(bt2, 250, 50);
diff --git a/legacy/elementary/src/edje_externals/elm_button.c b/legacy/elementary/src/edje_externals/elm_button.c
index f1b6f38404..2002602967 100644
--- a/legacy/elementary/src/edje_externals/elm_button.c
+++ b/legacy/elementary/src/edje_externals/elm_button.c
@@ -19,7 +19,7 @@ external_button_state_set(void *data __UNUSED__, Evas_Object *obj, const void *f
19 if (p->label) 19 if (p->label)
20 elm_object_text_set(obj, p->label); 20 elm_object_text_set(obj, p->label);
21 if (p->icon) 21 if (p->icon)
22 elm_button_icon_set(obj, p->icon); 22 elm_object_content_set(obj, p->icon);
23} 23}
24 24
25static Eina_Bool 25static Eina_Bool
@@ -39,7 +39,7 @@ external_button_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ex
39 { 39 {
40 Evas_Object *icon = external_common_param_icon_get(obj, param); 40 Evas_Object *icon = external_common_param_icon_get(obj, param);
41 if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE; 41 if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
42 elm_button_icon_set(obj, icon); 42 elm_object_content_set(obj, icon);
43 return EINA_TRUE; 43 return EINA_TRUE;
44 } 44 }
45 } 45 }
diff --git a/legacy/elementary/src/examples/button_example_01.c b/legacy/elementary/src/examples/button_example_01.c
index d430b4e772..bd5a5b1a66 100644
--- a/legacy/elementary/src/examples/button_example_01.c
+++ b/legacy/elementary/src/examples/button_example_01.c
@@ -24,7 +24,7 @@ static void
24_btn_cursors_release_cb(void *data, Evas_Object *btn __UNUSED__, void *ev __UNUSED__) 24_btn_cursors_release_cb(void *data, Evas_Object *btn __UNUSED__, void *ev __UNUSED__)
25{ 25{
26 App_Data *app = data; 26 App_Data *app = data;
27 elm_button_icon_set(app->mid, app->icon_still); 27 elm_object_content_set(app->mid, app->icon_still);
28 app->icon_still = NULL; 28 app->icon_still = NULL;
29} 29}
30 30
@@ -37,10 +37,10 @@ _btn_cursors_move_cb(void *data, Evas_Object *btn, void *ev __UNUSED__)
37 if (!app->icon_still) 37 if (!app->icon_still)
38 { 38 {
39 Evas_Object *icon; 39 Evas_Object *icon;
40 app->icon_still = elm_button_icon_unset(app->mid); 40 app->icon_still = elm_object_content_unset(app->mid);
41 icon = elm_icon_add(app->mid); 41 icon = elm_icon_add(app->mid);
42 elm_icon_standard_set(icon, "chat"); 42 elm_icon_standard_set(icon, "chat");
43 elm_button_icon_set(app->mid, icon); 43 elm_object_content_set(app->mid, icon);
44 } 44 }
45 45
46 evas_object_size_hint_align_get(app->mid, &ax, &ay); 46 evas_object_size_hint_align_get(app->mid, &ax, &ay);
@@ -185,7 +185,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__)
185 185
186 icon = elm_icon_add(win); 186 icon = elm_icon_add(win);
187 elm_icon_standard_set(icon, "arrow_up"); 187 elm_icon_standard_set(icon, "arrow_up");
188 elm_button_icon_set(btn, icon); 188 elm_object_content_set(btn, icon);
189 189
190 data.cursors.up = btn; 190 data.cursors.up = btn;
191 191
@@ -210,7 +210,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__)
210 210
211 icon = elm_icon_add(win); 211 icon = elm_icon_add(win);
212 elm_icon_standard_set(icon, "arrow_left"); 212 elm_icon_standard_set(icon, "arrow_left");
213 elm_button_icon_set(btn, icon); 213 elm_object_content_set(btn, icon);
214 214
215 data.cursors.left = btn; 215 data.cursors.left = btn;
216 216
@@ -221,7 +221,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__)
221 221
222 icon = elm_icon_add(win); 222 icon = elm_icon_add(win);
223 elm_icon_standard_set(icon, "close"); 223 elm_icon_standard_set(icon, "close");
224 elm_button_icon_set(btn, icon); 224 elm_object_content_set(btn, icon);
225 225
226 data.mid = btn; 226 data.mid = btn;
227 227
@@ -239,7 +239,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__)
239 239
240 icon = elm_icon_add(win); 240 icon = elm_icon_add(win);
241 elm_icon_standard_set(icon, "arrow_right"); 241 elm_icon_standard_set(icon, "arrow_right");
242 elm_button_icon_set(btn, icon); 242 elm_object_content_set(btn, icon);
243 243
244 data.cursors.right = btn; 244 data.cursors.right = btn;
245 245
@@ -257,7 +257,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__)
257 257
258 icon = elm_icon_add(win); 258 icon = elm_icon_add(win);
259 elm_icon_standard_set(icon, "arrow_down"); 259 elm_icon_standard_set(icon, "arrow_down");
260 elm_button_icon_set(btn, icon); 260 elm_object_content_set(btn, icon);
261 261
262 data.cursors.down = btn; 262 data.cursors.down = btn;
263 263
diff --git a/legacy/elementary/src/examples/entry_example.c b/legacy/elementary/src/examples/entry_example.c
index 5d14a184c0..7870affbb2 100644
--- a/legacy/elementary/src/examples/entry_example.c
+++ b/legacy/elementary/src/examples/entry_example.c
@@ -553,7 +553,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__)
553 553
554 icon = elm_layout_add(win); 554 icon = elm_layout_add(win);
555 elm_layout_theme_set(icon, "entry", "emoticon/haha", "default"); 555 elm_layout_theme_set(icon, "entry", "emoticon/haha", "default");
556 elm_button_icon_set(o, icon); 556 elm_object_content_set(o, icon);
557 557
558 evas_object_smart_callback_add(o, "clicked", _image_insert_cb, &app); 558 evas_object_smart_callback_add(o, "clicked", _image_insert_cb, &app);
559 559
diff --git a/legacy/elementary/src/examples/transit_example_03.c b/legacy/elementary/src/examples/transit_example_03.c
index dfc1269ffb..0af77beed9 100644
--- a/legacy/elementary/src/examples/transit_example_03.c
+++ b/legacy/elementary/src/examples/transit_example_03.c
@@ -227,7 +227,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
227 icon = elm_icon_add(win); 227 icon = elm_icon_add(win);
228 snprintf(buf, sizeof(buf), "%s/images/icon_07.png", PACKAGE_DATA_DIR); 228 snprintf(buf, sizeof(buf), "%s/images/icon_07.png", PACKAGE_DATA_DIR);
229 elm_icon_file_set(icon, buf, NULL); 229 elm_icon_file_set(icon, buf, NULL);
230 elm_button_icon_set(obj, icon); 230 elm_object_content_set(obj, icon);
231 evas_object_move(obj, 160, 60); 231 evas_object_move(obj, 160, 60);
232 evas_object_resize(obj, 250, 100); 232 evas_object_resize(obj, 250, 100);
233 evas_object_show(obj); 233 evas_object_show(obj);
diff --git a/legacy/elementary/src/examples/transit_example_04.c b/legacy/elementary/src/examples/transit_example_04.c
index 0915d13244..8290fe53ac 100644
--- a/legacy/elementary/src/examples/transit_example_04.c
+++ b/legacy/elementary/src/examples/transit_example_04.c
@@ -132,7 +132,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
132 icon = elm_icon_add(win); 132 icon = elm_icon_add(win);
133 snprintf(buf, sizeof(buf), "%s/images/icon_07.png", PACKAGE_DATA_DIR); 133 snprintf(buf, sizeof(buf), "%s/images/icon_07.png", PACKAGE_DATA_DIR);
134 elm_icon_file_set(icon, buf, NULL); 134 elm_icon_file_set(icon, buf, NULL);
135 elm_button_icon_set(obj, icon); 135 elm_object_content_set(obj, icon);
136 evas_object_move(obj, 160, 60); 136 evas_object_move(obj, 160, 60);
137 evas_object_resize(obj, 250, 100); 137 evas_object_resize(obj, 250, 100);
138 evas_object_show(obj); 138 evas_object_show(obj);
@@ -145,7 +145,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
145 icon = elm_icon_add(win); 145 icon = elm_icon_add(win);
146 snprintf(buf, sizeof(buf), "%s/images/icon_08.png", PACKAGE_DATA_DIR); 146 snprintf(buf, sizeof(buf), "%s/images/icon_08.png", PACKAGE_DATA_DIR);
147 elm_icon_file_set(icon, buf, NULL); 147 elm_icon_file_set(icon, buf, NULL);
148 elm_button_icon_set(obj, icon); 148 elm_object_content_set(obj, icon);
149 evas_object_move(obj, 160, 60); 149 evas_object_move(obj, 160, 60);
150 evas_object_resize(obj, 250, 100); 150 evas_object_resize(obj, 250, 100);
151 151
diff --git a/legacy/elementary/src/examples/web_example.c b/legacy/elementary/src/examples/web_example.c
index ac80bd685d..730951bf47 100644
--- a/legacy/elementary/src/examples/web_example.c
+++ b/legacy/elementary/src/examples/web_example.c
@@ -405,7 +405,7 @@ _win_search_trigger_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED
405 405
406 ic = elm_icon_add(ad->win); 406 ic = elm_icon_add(ad->win);
407 elm_icon_standard_set(ic, "arrow_up"); 407 elm_icon_standard_set(ic, "arrow_up");
408 elm_button_icon_set(btn, ic); 408 elm_object_content_set(btn, ic);
409 409
410 evas_object_smart_callback_add(btn, "clicked", _search_prev_cb, ad); 410 evas_object_smart_callback_add(btn, "clicked", _search_prev_cb, ad);
411 411
@@ -415,7 +415,7 @@ _win_search_trigger_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED
415 415
416 ic = elm_icon_add(ad->win); 416 ic = elm_icon_add(ad->win);
417 elm_icon_standard_set(ic, "arrow_down"); 417 elm_icon_standard_set(ic, "arrow_down");
418 elm_button_icon_set(btn, ic); 418 elm_object_content_set(btn, ic);
419 419
420 evas_object_smart_callback_add(btn, "clicked", _search_next_cb, ad); 420 evas_object_smart_callback_add(btn, "clicked", _search_next_cb, ad);
421 421
@@ -425,7 +425,7 @@ _win_search_trigger_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED
425 425
426 ic = elm_icon_add(ad->win); 426 ic = elm_icon_add(ad->win);
427 elm_icon_standard_set(ic, "close"); 427 elm_icon_standard_set(ic, "close");
428 elm_button_icon_set(btn, ic); 428 elm_object_content_set(btn, ic);
429 429
430 evas_object_smart_callback_add(btn, "clicked", _search_close_cb, ad); 430 evas_object_smart_callback_add(btn, "clicked", _search_close_cb, ad);
431 431
@@ -523,7 +523,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__)
523 523
524 ic = elm_icon_add(win); 524 ic = elm_icon_add(win);
525 elm_icon_standard_set(ic, "arrow_left"); 525 elm_icon_standard_set(ic, "arrow_left");
526 elm_button_icon_set(btn, ic); 526 elm_object_content_set(btn, ic);
527 527
528 evas_object_smart_callback_add(btn, "clicked", _nav_back_cb, ad); 528 evas_object_smart_callback_add(btn, "clicked", _nav_back_cb, ad);
529 529
@@ -535,7 +535,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__)
535 535
536 ic = elm_icon_add(win); 536 ic = elm_icon_add(win);
537 elm_icon_standard_set(ic, "refresh"); 537 elm_icon_standard_set(ic, "refresh");
538 elm_button_icon_set(btn, ic); 538 elm_object_content_set(btn, ic);
539 539
540 evas_object_smart_callback_add(btn, "clicked", _nav_refresh_cb, ad); 540 evas_object_smart_callback_add(btn, "clicked", _nav_refresh_cb, ad);
541 541
@@ -547,7 +547,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__)
547 547
548 ic = elm_icon_add(win); 548 ic = elm_icon_add(win);
549 elm_icon_standard_set(ic, "arrow_right"); 549 elm_icon_standard_set(ic, "arrow_right");
550 elm_button_icon_set(btn, ic); 550 elm_object_content_set(btn, ic);
551 551
552 evas_object_smart_callback_add(btn, "clicked", _nav_fwd_cb, ad); 552 evas_object_smart_callback_add(btn, "clicked", _nav_fwd_cb, ad);
553 553
@@ -564,7 +564,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__)
564 564
565 ic = elm_icon_add(win); 565 ic = elm_icon_add(win);
566 elm_icon_standard_set(ic, "file"); 566 elm_icon_standard_set(ic, "file");
567 elm_button_icon_set(btn, ic); 567 elm_object_content_set(btn, ic);
568 568
569 evas_object_smart_callback_add(btn, "clicked", _add_tab_cb, ad); 569 evas_object_smart_callback_add(btn, "clicked", _add_tab_cb, ad);
570 570
@@ -586,7 +586,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__)
586 586
587 ic = elm_icon_add(win); 587 ic = elm_icon_add(win);
588 elm_icon_standard_set(ic, "close"); 588 elm_icon_standard_set(ic, "close");
589 elm_button_icon_set(btn, ic); 589 elm_object_content_set(btn, ic);
590 590
591 pager = elm_pager_add(win); 591 pager = elm_pager_add(win);
592 evas_object_size_hint_weight_set(pager, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 592 evas_object_size_hint_weight_set(pager, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in
index 6ebb1165d7..e6c1614a8c 100644
--- a/legacy/elementary/src/lib/Elementary.h.in
+++ b/legacy/elementary/src/lib/Elementary.h.in
@@ -6189,7 +6189,7 @@ extern "C" {
6189 * @param obj The button object 6189 * @param obj The button object
6190 * @param icon The icon object for the button 6190 * @param icon The icon object for the button
6191 */ 6191 */
6192 EAPI void elm_button_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); 6192 EINA_DEPRECATED EAPI void elm_button_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1);
6193 /** 6193 /**
6194 * Get the icon used for the button 6194 * Get the icon used for the button
6195 * 6195 *
@@ -6202,7 +6202,7 @@ extern "C" {
6202 * 6202 *
6203 * @see elm_button_icon_unset() 6203 * @see elm_button_icon_unset()
6204 */ 6204 */
6205 EAPI Evas_Object *elm_button_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); 6205 EINA_DEPRECATED EAPI Evas_Object *elm_button_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
6206 /** 6206 /**
6207 * Remove the icon set without deleting it and return the object 6207 * Remove the icon set without deleting it and return the object
6208 * 6208 *
@@ -6214,7 +6214,7 @@ extern "C" {
6214 * @param obj The button object 6214 * @param obj The button object
6215 * @return The icon object that was being used 6215 * @return The icon object that was being used
6216 */ 6216 */
6217 EAPI Evas_Object *elm_button_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); 6217 EINA_DEPRECATED EAPI Evas_Object *elm_button_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
6218 /** 6218 /**
6219 * Turn on/off the autorepeat event generated when the button is kept pressed 6219 * Turn on/off the autorepeat event generated when the button is kept pressed
6220 * 6220 *
@@ -14036,7 +14036,7 @@ extern "C" {
14036 * deleted, if you want to keep that old content object, use the 14036 * deleted, if you want to keep that old content object, use the
14037 * elm_hoversel_icon_unset() function. 14037 * elm_hoversel_icon_unset() function.
14038 * 14038 *
14039 * @see elm_button_icon_set() 14039 * @see elm_object_content_set() for the button widget
14040 */ 14040 */
14041 EAPI void elm_hoversel_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); 14041 EAPI void elm_hoversel_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1);
14042 /** 14042 /**
@@ -14046,7 +14046,7 @@ extern "C" {
14046 * @return The icon object 14046 * @return The icon object
14047 * 14047 *
14048 * Get the icon of the button that is always visible (before it is clicked 14048 * Get the icon of the button that is always visible (before it is clicked
14049 * and expanded). Also see elm_button_icon_get(). 14049 * and expanded). Also see elm_object_content_get() for the button widget.
14050 * 14050 *
14051 * @see elm_hoversel_icon_set() 14051 * @see elm_hoversel_icon_set()
14052 */ 14052 */
@@ -14061,7 +14061,7 @@ extern "C" {
14061 * (before it is clicked and expanded). 14061 * (before it is clicked and expanded).
14062 * 14062 *
14063 * @see elm_hoversel_icon_set() 14063 * @see elm_hoversel_icon_set()
14064 * @see elm_button_icon_unset() 14064 * @see elm_object_content_unset() for the button widget
14065 */ 14065 */
14066 EAPI Evas_Object *elm_hoversel_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); 14066 EAPI Evas_Object *elm_hoversel_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
14067 /** 14067 /**
diff --git a/legacy/elementary/src/lib/elc_fileselector.c b/legacy/elementary/src/lib/elc_fileselector.c
index c0d17e57d2..2c71099b87 100644
--- a/legacy/elementary/src/lib/elc_fileselector.c
+++ b/legacy/elementary/src/lib/elc_fileselector.c
@@ -839,7 +839,7 @@ elm_fileselector_add(Evas_Object *parent)
839 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); 839 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
840 bt = elm_button_add(parent); 840 bt = elm_button_add(parent);
841 elm_widget_mirrored_automatic_set(bt, EINA_FALSE); 841 elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
842 elm_button_icon_set(bt, ic); 842 elm_object_content_set(bt, ic);
843 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Up")); 843 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Up"));
844 evas_object_size_hint_align_set(bt, 0.0, 0.0); 844 evas_object_size_hint_align_set(bt, 0.0, 0.0);
845 845
@@ -854,7 +854,7 @@ elm_fileselector_add(Evas_Object *parent)
854 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); 854 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
855 bt = elm_button_add(parent); 855 bt = elm_button_add(parent);
856 elm_widget_mirrored_automatic_set(bt, EINA_FALSE); 856 elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
857 elm_button_icon_set(bt, ic); 857 elm_object_content_set(bt, ic);
858 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Home")); 858 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Home"));
859 evas_object_size_hint_align_set(bt, 0.0, 0.0); 859 evas_object_size_hint_align_set(bt, 0.0, 0.0);
860 860
diff --git a/legacy/elementary/src/lib/elc_fileselector_button.c b/legacy/elementary/src/lib/elc_fileselector_button.c
index 2ba72900b5..c5197f6739 100644
--- a/legacy/elementary/src/lib/elc_fileselector_button.c
+++ b/legacy/elementary/src/lib/elc_fileselector_button.c
@@ -497,7 +497,7 @@ elm_fileselector_button_icon_set(Evas_Object *obj,
497 evas_object_del(icon); 497 evas_object_del(icon);
498 return; 498 return;
499 } 499 }
500 elm_button_icon_set(wd->btn, icon); 500 elm_object_content_set(wd->btn, icon);
501} 501}
502 502
503EAPI Evas_Object * 503EAPI Evas_Object *
@@ -506,7 +506,7 @@ elm_fileselector_button_icon_get(const Evas_Object *obj)
506 ELM_CHECK_WIDTYPE(obj, widtype) NULL; 506 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
507 Widget_Data *wd = elm_widget_data_get(obj); 507 Widget_Data *wd = elm_widget_data_get(obj);
508 if (!wd) return NULL; 508 if (!wd) return NULL;
509 return elm_button_icon_get(wd->btn); 509 return elm_object_content_get(wd->btn);
510} 510}
511 511
512EAPI Evas_Object * 512EAPI Evas_Object *
@@ -515,6 +515,6 @@ elm_fileselector_button_icon_unset(Evas_Object *obj)
515 ELM_CHECK_WIDTYPE(obj, widtype) NULL; 515 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
516 Widget_Data *wd = elm_widget_data_get(obj); 516 Widget_Data *wd = elm_widget_data_get(obj);
517 if (!wd) return NULL; 517 if (!wd) return NULL;
518 return elm_button_icon_unset(wd->btn); 518 return elm_object_content_unset(wd->btn);
519} 519}
520 520
diff --git a/legacy/elementary/src/lib/elc_hoversel.c b/legacy/elementary/src/lib/elc_hoversel.c
index 772ca10835..e0b983c10a 100644
--- a/legacy/elementary/src/lib/elc_hoversel.c
+++ b/legacy/elementary/src/lib/elc_hoversel.c
@@ -204,7 +204,7 @@ _activate(Evas_Object *obj)
204 elm_icon_file_set(ic, item->icon_file, item->icon_group); 204 elm_icon_file_set(ic, item->icon_file, item->icon_group);
205 else if (item->icon_type == ELM_ICON_STANDARD) 205 else if (item->icon_type == ELM_ICON_STANDARD)
206 elm_icon_standard_set(ic, item->icon_file); 206 elm_icon_standard_set(ic, item->icon_file);
207 elm_button_icon_set(bt, ic); 207 elm_object_content_set(bt, ic);
208 evas_object_show(ic); 208 evas_object_show(ic);
209 } 209 }
210 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 210 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
@@ -372,7 +372,7 @@ elm_hoversel_icon_set(Evas_Object *obj, Evas_Object *icon)
372 ELM_CHECK_WIDTYPE(obj, widtype); 372 ELM_CHECK_WIDTYPE(obj, widtype);
373 Widget_Data *wd = elm_widget_data_get(obj); 373 Widget_Data *wd = elm_widget_data_get(obj);
374 if (!wd) return; 374 if (!wd) return;
375 elm_button_icon_set(wd->btn, icon); 375 elm_object_content_set(wd->btn, icon);
376} 376}
377 377
378EAPI Evas_Object * 378EAPI Evas_Object *
@@ -381,7 +381,7 @@ elm_hoversel_icon_get(const Evas_Object *obj)
381 ELM_CHECK_WIDTYPE(obj, widtype) NULL; 381 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
382 Widget_Data *wd = elm_widget_data_get(obj); 382 Widget_Data *wd = elm_widget_data_get(obj);
383 if ((!wd) || (!wd->btn)) return NULL; 383 if ((!wd) || (!wd->btn)) return NULL;
384 return elm_button_icon_get(wd->btn); 384 return elm_object_content_get(wd->btn);
385} 385}
386 386
387EAPI Evas_Object * 387EAPI Evas_Object *
@@ -390,7 +390,7 @@ elm_hoversel_icon_unset(Evas_Object *obj)
390 ELM_CHECK_WIDTYPE(obj, widtype) NULL; 390 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
391 Widget_Data *wd = elm_widget_data_get(obj); 391 Widget_Data *wd = elm_widget_data_get(obj);
392 if ((!wd) || (!wd->btn)) return NULL; 392 if ((!wd) || (!wd->btn)) return NULL;
393 return elm_button_icon_unset(wd->btn); 393 return elm_object_content_unset(wd->btn);
394} 394}
395 395
396EAPI void 396EAPI void
diff --git a/legacy/elementary/src/lib/elc_player.c b/legacy/elementary/src/lib/elc_player.c
index c54d04dc7a..60cba07b45 100644
--- a/legacy/elementary/src/lib/elc_player.c
+++ b/legacy/elementary/src/lib/elc_player.c
@@ -418,7 +418,7 @@ _player_button_add(Evas_Object *parent, Evas_Object *obj, Evas_Object *layout, c
418 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); 418 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
419 bt = elm_button_add(parent); 419 bt = elm_button_add(parent);
420 elm_widget_mirrored_automatic_set(bt, EINA_FALSE); 420 elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
421 elm_button_icon_set(bt, ic); 421 elm_object_content_set(bt, ic);
422 evas_object_size_hint_align_set(bt, 0.0, 0.0); 422 evas_object_size_hint_align_set(bt, 0.0, 0.0);
423 elm_object_style_set(bt, "anchor"); 423 elm_object_style_set(bt, "anchor");
424 evas_object_smart_callback_add(bt, "clicked", func, obj); 424 evas_object_smart_callback_add(bt, "clicked", func, obj);
diff --git a/legacy/elementary/src/lib/elm_button.c b/legacy/elementary/src/lib/elm_button.c
index 11ed19902e..cafc17e91f 100644
--- a/legacy/elementary/src/lib/elm_button.c
+++ b/legacy/elementary/src/lib/elm_button.c
@@ -20,6 +20,9 @@ static void _del_hook(Evas_Object *obj);
20static void _del_pre_hook(Evas_Object *obj); 20static void _del_pre_hook(Evas_Object *obj);
21static void _theme_hook(Evas_Object *obj); 21static void _theme_hook(Evas_Object *obj);
22static void _disable_hook(Evas_Object *obj); 22static void _disable_hook(Evas_Object *obj);
23static void _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content);
24static Evas_Object *_content_get_hook(const Evas_Object *obj, const char *part);
25static Evas_Object *_content_unset_hook(Evas_Object *obj, const char *part);
23static void _sizing_eval(Evas_Object *obj); 26static void _sizing_eval(Evas_Object *obj);
24static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); 27static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
25static void _sub_del(void *data, Evas_Object *obj, void *event_info); 28static void _sub_del(void *data, Evas_Object *obj, void *event_info);
@@ -173,6 +176,51 @@ _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *so
173} 176}
174 177
175static void 178static void
179_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content)
180{
181 ELM_CHECK_WIDTYPE(obj, widtype);
182 Widget_Data *wd = elm_widget_data_get(obj);
183 if (!wd) return;
184 if (wd->icon == content) return;
185 if (wd->icon) evas_object_del(wd->icon);
186 wd->icon = content;
187 if (content)
188 {
189 elm_widget_sub_object_add(obj, content);
190 evas_object_event_callback_add(content,
191 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
192 _changed_size_hints, obj);
193 edje_object_part_swallow(wd->btn, "elm.swallow.content", content);
194 edje_object_signal_emit(wd->btn, "elm,state,icon,visible", "elm");
195 edje_object_message_signal_process(wd->btn);
196 }
197 _sizing_eval(obj);
198}
199
200static Evas_Object *
201_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__)
202{
203 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
204 Widget_Data *wd = elm_widget_data_get(obj);
205 if (!wd) return NULL;
206 return wd->icon;
207}
208
209static Evas_Object *
210_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__)
211{
212 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
213 Widget_Data *wd = elm_widget_data_get(obj);
214 if (!wd) return NULL;
215 if (!wd->icon) return NULL;
216 Evas_Object *icon = wd->icon;
217 elm_widget_sub_object_del(obj, wd->icon);
218 edje_object_part_unswallow(wd->btn, wd->icon);
219 wd->icon = NULL;
220 return icon;
221}
222
223static void
176_sizing_eval(Evas_Object *obj) 224_sizing_eval(Evas_Object *obj)
177{ 225{
178 Widget_Data *wd = elm_widget_data_get(obj); 226 Widget_Data *wd = elm_widget_data_get(obj);
@@ -376,6 +424,9 @@ elm_button_add(Evas_Object *parent)
376 elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); 424 elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
377 elm_widget_text_set_hook_set(obj, _elm_button_label_set); 425 elm_widget_text_set_hook_set(obj, _elm_button_label_set);
378 elm_widget_text_get_hook_set(obj, _elm_button_label_get); 426 elm_widget_text_get_hook_set(obj, _elm_button_label_get);
427 elm_widget_content_set_hook_set(obj, _content_set_hook);
428 elm_widget_content_get_hook_set(obj, _content_get_hook);
429 elm_widget_content_unset_hook_set(obj, _content_unset_hook);
379 430
380 wd->btn = edje_object_add(e); 431 wd->btn = edje_object_add(e);
381 _elm_theme_object_set(obj, wd->btn, "button", "base", "default"); 432 _elm_theme_object_set(obj, wd->btn, "button", "base", "default");
@@ -417,48 +468,23 @@ elm_button_label_get(const Evas_Object *obj)
417 return _elm_button_label_get(obj, NULL); 468 return _elm_button_label_get(obj, NULL);
418} 469}
419 470
471
420EAPI void 472EAPI void
421elm_button_icon_set(Evas_Object *obj, Evas_Object *icon) 473elm_button_icon_set(Evas_Object *obj, Evas_Object *icon)
422{ 474{
423 ELM_CHECK_WIDTYPE(obj, widtype); 475 _content_set_hook(obj, NULL, icon);
424 Widget_Data *wd = elm_widget_data_get(obj);
425 if (!wd) return;
426 if (wd->icon == icon) return;
427 if (wd->icon) evas_object_del(wd->icon);
428 wd->icon = icon;
429 if (icon)
430 {
431 elm_widget_sub_object_add(obj, icon);
432 evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
433 _changed_size_hints, obj);
434 edje_object_part_swallow(wd->btn, "elm.swallow.content", icon);
435 edje_object_signal_emit(wd->btn, "elm,state,icon,visible", "elm");
436 edje_object_message_signal_process(wd->btn);
437 }
438 _sizing_eval(obj);
439} 476}
440 477
441EAPI Evas_Object * 478EAPI Evas_Object *
442elm_button_icon_get(const Evas_Object *obj) 479elm_button_icon_get(const Evas_Object *obj)
443{ 480{
444 ELM_CHECK_WIDTYPE(obj, widtype) NULL; 481 return _content_get_hook(obj, NULL);
445 Widget_Data *wd = elm_widget_data_get(obj);
446 if (!wd) return NULL;
447 return wd->icon;
448} 482}
449 483
450EAPI Evas_Object * 484EAPI Evas_Object *
451elm_button_icon_unset(Evas_Object *obj) 485elm_button_icon_unset(Evas_Object *obj)
452{ 486{
453 ELM_CHECK_WIDTYPE(obj, widtype) NULL; 487 return _content_unset_hook(obj, NULL);
454 Widget_Data *wd = elm_widget_data_get(obj);
455 if (!wd) return NULL;
456 if (!wd->icon) return NULL;
457 Evas_Object *icon = wd->icon;
458 elm_widget_sub_object_del(obj, wd->icon);
459 edje_object_part_unswallow(wd->btn, wd->icon);
460 wd->icon = NULL;
461 return icon;
462} 488}
463 489
464EAPI void 490EAPI void