From ed39ad7b1ba18eb132cbc0a3ab7d745ff75379b6 Mon Sep 17 00:00:00 2001 From: hermet Date: Sat, 29 Oct 2011 04:32:24 +0000 Subject: [PATCH] elemetary - notify, factory, frame, panel, mapbuf applied content_set/get/unset. do it later for the remainder. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@64502 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- doc/widgets/widget_preview_frame.c | 2 +- doc/widgets/widget_preview_mapbuf.c | 2 +- doc/widgets/widget_preview_notify.c | 2 +- doc/widgets/widget_preview_panel.c | 2 +- src/bin/config.c | 36 ++++++------- src/bin/test.c | 2 +- src/bin/test_colorselector.c | 4 +- src/bin/test_factory.c | 10 ++-- src/bin/test_flip.c | 4 +- src/bin/test_focus.c | 2 +- src/bin/test_genlist.c | 4 +- src/bin/test_launcher.c | 6 +-- src/bin/test_notify.c | 18 +++---- src/bin/test_panel.c | 8 +-- src/bin/test_scaling.c | 6 +-- src/bin/test_slideshow.c | 2 +- src/bin/test_web.c | 4 +- src/edje_externals/elm_notify.c | 4 +- src/examples/anchorblock_example_01.c | 4 +- src/examples/entry_example.c | 6 +-- src/examples/frame_example_01.c | 8 +-- src/examples/general_funcs_example.c | 2 +- src/examples/mapbuf_example.c | 2 +- src/examples/notify_example_01.c | 8 +-- src/examples/panel_example_01.c | 6 +-- src/examples/slideshow_example.c | 2 +- src/examples/win_example.c | 2 +- src/lib/Elementary.h.in | 62 ++++++++++++++-------- src/lib/elm_factory.c | 80 +++++++++++++++++------------ src/lib/elm_frame.c | 77 +++++++++++++++++---------- src/lib/elm_mapbuf.c | 97 +++++++++++++++++++++-------------- src/lib/elm_notify.c | 87 +++++++++++++++++++------------ src/lib/elm_panel.c | 73 ++++++++++++++++---------- src/lib/elm_web.c | 2 +- 34 files changed, 377 insertions(+), 259 deletions(-) diff --git a/doc/widgets/widget_preview_frame.c b/doc/widgets/widget_preview_frame.c index d41f13c..0ef7e6a 100644 --- a/doc/widgets/widget_preview_frame.c +++ b/doc/widgets/widget_preview_frame.c @@ -12,6 +12,6 @@ evas_object_size_hint_weight_set(o2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(o2); elm_object_text_set(o2, "Frame content"); -elm_frame_content_set(o, o2); +elm_object_content_set(o, o2); #include "widget_preview_tmpl_foot.c" diff --git a/doc/widgets/widget_preview_mapbuf.c b/doc/widgets/widget_preview_mapbuf.c index 812c76c..c43977c 100644 --- a/doc/widgets/widget_preview_mapbuf.c +++ b/doc/widgets/widget_preview_mapbuf.c @@ -23,7 +23,7 @@ for (i = 0; i < 8; i++) } } -elm_mapbuf_content_set(o, tb); +elm_object_content_set(o, tb); elm_mapbuf_enabled_set(o, EINA_TRUE); #include "widget_preview_tmpl_foot.c" diff --git a/doc/widgets/widget_preview_notify.c b/doc/widgets/widget_preview_notify.c index ae0d4c2..ab8176b 100644 --- a/doc/widgets/widget_preview_notify.c +++ b/doc/widgets/widget_preview_notify.c @@ -9,7 +9,7 @@ Evas_Object *o2 = elm_label_add(win); elm_object_text_set(o2, "content"); evas_object_show(o2); -elm_notify_content_set(o, o2); +elm_object_content_set(o, o2); #include "widget_preview_tmpl_foot.c" diff --git a/doc/widgets/widget_preview_panel.c b/doc/widgets/widget_preview_panel.c index 8ae9e24..f1cc4c2 100644 --- a/doc/widgets/widget_preview_panel.c +++ b/doc/widgets/widget_preview_panel.c @@ -9,7 +9,7 @@ Evas_Object *o2 = elm_label_add(win); elm_object_text_set(o2, "content"); evas_object_show(o2); -elm_panel_content_set(o, o2); +elm_object_content_set(o, o2); #include "widget_preview_tmpl_foot.c" diff --git a/src/bin/config.c b/src/bin/config.c index a74a97f..4e662ea 100644 --- a/src/bin/config.c +++ b/src/bin/config.c @@ -81,7 +81,7 @@ struct _Fonts_Data evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0); \ evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5); \ elm_object_text_set(lb, label); \ - elm_frame_content_set(pd, lb); \ + elm_object_content_set(pd, lb); \ evas_object_show(lb); \ } \ while (0) @@ -584,7 +584,7 @@ _status_basic(Evas_Object *win, elm_object_text_set(lb, "Applying configuration change" ); - elm_frame_content_set(fr, lb); + elm_object_content_set(fr, lb); evas_object_show(lb); } @@ -647,7 +647,7 @@ _status_config(Evas_Object *win, // FIXME: add theme selector (basic mode and advanced for fallbacks) // FIXME: save config // FIXME: profile selector / creator etc. - elm_frame_content_set(fr, bx); + elm_object_content_set(fr, bx); evas_object_show(bx); } @@ -1288,7 +1288,7 @@ _sample_theme_new(Evas_Object *win) li = elm_list_add(win); evas_object_size_hint_weight_set(li, 1.0, 1.0); evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, li); + elm_object_content_set(fr, li); evas_object_show(li); elm_list_item_append(li, "List Item 1", NULL, NULL, NULL, NULL); @@ -1343,7 +1343,7 @@ _status_config_themes(Evas_Object *win, elm_list_multi_select_set(li, EINA_TRUE); evas_object_size_hint_weight_set(li, 1.0, 1.0); evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(pd, li); + elm_object_content_set(pd, li); evas_object_show(li); list = elm_theme_name_available_list_new(); @@ -1428,7 +1428,7 @@ _status_config_themes(Evas_Object *win, elm_object_text_set(bt, "Browse..."); evas_object_size_hint_weight_set(bt, 1.0, 1.0); evas_object_size_hint_align_set(bt, 0.9, 0.9); - elm_frame_content_set(pd, bt); + elm_object_content_set(pd, bt); evas_object_show(bt); */ pd = elm_frame_add(win); @@ -1442,14 +1442,14 @@ _status_config_themes(Evas_Object *win, elm_object_text_set(fr, "Preview"); evas_object_size_hint_weight_set(fr, 1.0, 1.0); evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(pd, fr); + elm_object_content_set(pd, fr); evas_object_show(fr); sc = elm_scroller_add(win); elm_scroller_bounce_set(sc, 0, 0); evas_object_size_hint_weight_set(sc, 1.0, 1.0); evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, sc); + elm_object_content_set(fr, sc); evas_object_show(sc); sample = _sample_theme_new(win); @@ -1477,7 +1477,7 @@ _status_config_themes(Evas_Object *win, elm_object_text_set(bt, "Use Theme"); evas_object_size_hint_weight_set(bt, 1.0, 0.0); evas_object_size_hint_align_set(bt, 0.5, 0.5); - elm_frame_content_set(pd, bt); + elm_object_content_set(pd, bt); evas_object_show(bt); evas_object_data_set(win, "themes", tb); @@ -1964,7 +1964,7 @@ _status_config_fonts(Evas_Object *win, li = elm_list_add(win); evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, li); + elm_object_content_set(fr, li); evas_object_show(li); evas_object_data_set(win, "font_classes_list", li); @@ -1980,7 +1980,7 @@ _status_config_fonts(Evas_Object *win, li = elm_list_add(win); evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, li); + elm_object_content_set(fr, li); evas_object_show(li); evas_object_data_set(win, "font_names_list", li); @@ -2004,7 +2004,7 @@ _status_config_fonts(Evas_Object *win, li = elm_list_add(win); evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, li); + elm_object_content_set(fr, li); evas_object_show(li); evas_object_data_set(win, "font_styles_list", li); @@ -2021,7 +2021,7 @@ _status_config_fonts(Evas_Object *win, li = elm_list_add(win); evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, li); + elm_object_content_set(fr, li); evas_object_show(li); evas_object_data_set(win, "font_sizes_list", li); @@ -2099,7 +2099,7 @@ _status_config_fonts(Evas_Object *win, elm_box_pack_end(bx, bt); evas_object_show(bt); - elm_frame_content_set(pd, bx); + elm_object_content_set(pd, bx); evas_object_data_set(win, "fonts", base); @@ -2316,7 +2316,7 @@ _status_config_profiles(Evas_Object *win, elm_object_text_set(fr, "Available Profiles"); evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, fr_bx1); + elm_object_content_set(fr, fr_bx1); elm_box_pack_end(bx, fr); evas_object_show(fr); @@ -2411,7 +2411,7 @@ _status_config_profiles(Evas_Object *win, elm_box_pack_end(btn_bx, bt); evas_object_show(bt); - elm_frame_content_set(pd, btn_bx); + elm_object_content_set(pd, btn_bx); evas = evas_object_evas_get(li); evas_event_freeze(evas); @@ -2781,7 +2781,7 @@ _status_config_rendering(Evas_Object *win, evas_object_show(fr); li = elm_list_add(win); - elm_frame_content_set(fr, li); + elm_object_content_set(fr, li); evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -2812,7 +2812,7 @@ _status_config_rendering(Evas_Object *win, elm_object_text_set(bt, "Use Engine"); evas_object_size_hint_weight_set(bt, 0.0, 0.0); evas_object_size_hint_align_set(bt, 0.5, 0.5); - elm_frame_content_set(pd, bt); + elm_object_content_set(pd, bt); evas_object_show(bt); evas_object_data_set(win, "rendering", bx); diff --git a/src/bin/test.c b/src/bin/test.c index 48f7144..95fe971 100644 --- a/src/bin/test.c +++ b/src/bin/test.c @@ -264,7 +264,7 @@ my_win_main(char *autorun, Eina_Bool test_win_only) "Please select a test from the list below
" "by clicking the test button to show the
" "test window."); - elm_frame_content_set(fr, lb); + elm_object_content_set(fr, lb); evas_object_show(lb); tg = elm_check_add(win); diff --git a/src/bin/test_colorselector.c b/src/bin/test_colorselector.c index 23dd072..1498bd5 100644 --- a/src/bin/test_colorselector.c +++ b/src/bin/test_colorselector.c @@ -55,7 +55,7 @@ test_colorselector(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *eve elm_layout_file_set(ly, buf, "main"); evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_frame_content_set(fr, ly); + elm_object_content_set(fr, ly); evas_object_show(ly); re = evas_object_rectangle_add(evas_object_evas_get(win)); @@ -79,7 +79,7 @@ test_colorselector(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *eve elm_colorselector_color_set(cp, r, g, b, a); evas_object_size_hint_weight_set(cp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(cp, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, cp); + elm_object_content_set(fr, cp); evas_object_show(cp); evas_object_smart_callback_add(cp, "changed", _colorselector_clicked_cb, re); diff --git a/src/bin/test_factory.c b/src/bin/test_factory.c index 9675e29..bd66219 100644 --- a/src/bin/test_factory.c +++ b/src/bin/test_factory.c @@ -16,8 +16,8 @@ static void fac_unrealize(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { // setting factory content to null deletes it - printf("--------DELETE for factory %p [f: %p]\n", elm_factory_content_get(obj), obj); - elm_factory_content_set(obj, NULL); + printf("--------DELETE for factory %p [f: %p]\n", elm_object_content_get(obj), obj); + elm_object_content_set(obj, NULL); } static void @@ -51,7 +51,7 @@ fac_realize_end(void *data, Evas_Object *obj, void *event_info __UNUSED__) evas_object_show(bt); } - elm_factory_content_set(obj, bx); + elm_object_content_set(obj, bx); evas_object_show(bx); } @@ -89,7 +89,7 @@ fac_realize2(void *data, Evas_Object *obj, void *event_info __UNUSED__) evas_object_show(fc); } - elm_factory_content_set(obj, bx); + elm_object_content_set(obj, bx); evas_object_show(bx); } @@ -127,7 +127,7 @@ fac_realize1(void *data, Evas_Object *obj, void *event_info __UNUSED__) evas_object_show(fc); } - elm_factory_content_set(obj, bx); + elm_object_content_set(obj, bx); evas_object_show(bx); } diff --git a/src/bin/test_flip.c b/src/bin/test_flip.c index 1ab9cfe..4b8a0a2 100644 --- a/src/bin/test_flip.c +++ b/src/bin/test_flip.c @@ -409,7 +409,7 @@ test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info fl_f = elm_flip_add(win); evas_object_size_hint_align_set(fl_f, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(fl_f, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_frame_content_set(fr, fl_f); + elm_object_content_set(fr, fl_f); evas_object_show(fl_f); o = elm_bg_add(win); @@ -438,7 +438,7 @@ test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info fl_b = elm_flip_add(win); evas_object_size_hint_align_set(fl_b, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(fl_b, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_frame_content_set(fr, fl_b); + elm_object_content_set(fr, fl_b); evas_object_show(fl_b); o = elm_bg_add(win); diff --git a/src/bin/test_focus.c b/src/bin/test_focus.c index 871d8bd..08f3713 100644 --- a/src/bin/test_focus.c +++ b/src/bin/test_focus.c @@ -330,7 +330,7 @@ test_focus(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info { Evas_Object *tb = elm_table_add(win); evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_frame_content_set(fr, tb); + elm_object_content_set(fr, tb); my_show(tb); for (j = 0; j < 1; j++) for (i = 0; i < 2; i++) diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c index 23f2d16..f97bc08 100644 --- a/src/bin/test_genlist.c +++ b/src/bin/test_genlist.c @@ -1721,7 +1721,7 @@ test_genlist10(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i evas_object_show(fr); bx2 = elm_box_add(win); - elm_frame_content_set(fr, bx2); + elm_object_content_set(fr, bx2); evas_object_show(bx2); lb = elm_label_add(win); @@ -1840,7 +1840,7 @@ test_genlist11(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i elm_object_text_set(lb, "Enable reorder mode if you want to move item.
" "Then long press and drag item."); - elm_frame_content_set(fr, lb); + elm_object_content_set(fr, lb); evas_object_show(lb); gl = elm_genlist_add(win); diff --git a/src/bin/test_launcher.c b/src/bin/test_launcher.c index 4c7e767..250481c 100644 --- a/src/bin/test_launcher.c +++ b/src/bin/test_launcher.c @@ -254,7 +254,7 @@ test_launcher(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in elm_table_pack(tb, pad, 6, 1, 1, 10); mb = elm_mapbuf_add(win); - elm_mapbuf_content_set(mb, tb); + elm_object_content_set(mb, tb); evas_object_show(tb); for (j = 0; j < 5; j++) @@ -422,7 +422,7 @@ test_launcher2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i evas_object_show(bt); mb = elm_mapbuf_add(win); - elm_mapbuf_content_set(mb, ly); + elm_object_content_set(mb, ly); evas_object_show(ly); elm_box_pack_end(bx, mb); @@ -781,7 +781,7 @@ test_launcher3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i mb = elm_mapbuf_add(win); mbs = eina_list_append(mbs, mb); - elm_mapbuf_content_set(mb, tb); + elm_object_content_set(mb, tb); evas_object_show(tb); elm_box_pack_end(bx, mb); evas_object_show(mb); diff --git a/src/bin/test_notify.c b/src/bin/test_notify.c index 1491a37..37fffe3 100644 --- a/src/bin/test_notify.c +++ b/src/bin/test_notify.c @@ -60,7 +60,7 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); bx = elm_box_add(win); - elm_notify_content_set(notify, bx); + elm_object_content_set(notify, bx); elm_box_horizontal_set(bx, EINA_TRUE); evas_object_show(bx); @@ -90,7 +90,7 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_smart_callback_add(notify, "block,clicked", _notify_block, NULL); bx = elm_box_add(win); - elm_notify_content_set(notify, bx); + elm_object_content_set(notify, bx); elm_box_horizontal_set(bx, EINA_TRUE); evas_object_show(bx); @@ -119,7 +119,7 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_smart_callback_add(notify, "timeout", _notify_timeout, NULL); bx = elm_box_add(win); - elm_notify_content_set(notify, bx); + elm_object_content_set(notify, bx); elm_box_horizontal_set(bx, EINA_TRUE); evas_object_show(bx); @@ -147,7 +147,7 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_smart_callback_add(notify, "timeout", _notify_timeout, NULL); bx = elm_box_add(win); - elm_notify_content_set(notify, bx); + elm_object_content_set(notify, bx); elm_box_horizontal_set(bx, EINA_TRUE); evas_object_show(bx); @@ -173,7 +173,7 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_RIGHT); bx = elm_box_add(win); - elm_notify_content_set(notify, bx); + elm_object_content_set(notify, bx); elm_box_horizontal_set(bx, EINA_TRUE); evas_object_show(bx); @@ -199,7 +199,7 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_TOP_LEFT); bx = elm_box_add(win); - elm_notify_content_set(notify, bx); + elm_object_content_set(notify, bx); elm_box_horizontal_set(bx, EINA_TRUE); evas_object_show(bx); @@ -225,7 +225,7 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_TOP_RIGHT); bx = elm_box_add(win); - elm_notify_content_set(notify, bx); + elm_object_content_set(notify, bx); elm_box_horizontal_set(bx, EINA_TRUE); evas_object_show(bx); @@ -251,7 +251,7 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM_LEFT); bx = elm_box_add(win); - elm_notify_content_set(notify, bx); + elm_object_content_set(notify, bx); elm_box_horizontal_set(bx, EINA_TRUE); evas_object_show(bx); @@ -277,7 +277,7 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM_RIGHT); bx = elm_box_add(win); - elm_notify_content_set(notify, bx); + elm_object_content_set(notify, bx); elm_box_horizontal_set(bx, EINA_TRUE); evas_object_show(bx); diff --git a/src/bin/test_panel.c b/src/bin/test_panel.c index adfaa2b..ffe2a58 100644 --- a/src/bin/test_panel.c +++ b/src/bin/test_panel.c @@ -188,7 +188,7 @@ test_panel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_toolbar_item_append(toolbar, "home", "Hello", _tstatus, panel); - elm_panel_content_set(panel, toolbar); + elm_object_content_set(panel, toolbar); elm_box_pack_end(vbx, panel); evas_object_show(panel); @@ -209,7 +209,7 @@ test_panel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(list); - elm_panel_content_set(panel, list); + elm_object_content_set(panel, list); elm_box_pack_end(bx, panel); evas_object_show(panel); @@ -228,7 +228,7 @@ test_panel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(list); - elm_panel_content_set(panel, list); + elm_object_content_set(panel, list); elm_box_pack_end(bx, panel); evas_object_show(panel); @@ -252,7 +252,7 @@ test_panel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_toolbar_item_append(toolbar, "home", "Hello", _bstatus, panel); - elm_panel_content_set(panel, toolbar); + elm_object_content_set(panel, toolbar); elm_box_pack_end(vbx, panel); evas_object_show(panel); diff --git a/src/bin/test_scaling.c b/src/bin/test_scaling.c index e25f733..6a33c83 100644 --- a/src/bin/test_scaling.c +++ b/src/bin/test_scaling.c @@ -89,7 +89,7 @@ test_scaling2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in "Parent frame scale
" "is 0.5. Child should
" "inherit it."); - elm_frame_content_set(fr, lb); + elm_object_content_set(fr, lb); evas_object_show(lb); elm_box_pack_end(bx, fr); evas_object_show(fr); @@ -101,7 +101,7 @@ test_scaling2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in "Parent frame scale
" "is 1.0. Child should
" "inherit it."); - elm_frame_content_set(fr, lb); + elm_object_content_set(fr, lb); evas_object_show(lb); elm_object_scale_set(fr, 1.0); elm_box_pack_end(bx, fr); @@ -114,7 +114,7 @@ test_scaling2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in "Parent frame scale
" "is 2.0. Child should
" "inherit it."); - elm_frame_content_set(fr, lb); + elm_object_content_set(fr, lb); evas_object_show(lb); elm_object_scale_set(fr, 2.0); elm_box_pack_end(bx, fr); diff --git a/src/bin/test_slideshow.c b/src/bin/test_slideshow.c index 14d3a97..b351dc1 100644 --- a/src/bin/test_slideshow.c +++ b/src/bin/test_slideshow.c @@ -143,7 +143,7 @@ test_slideshow(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i bx = elm_box_add(win); elm_box_horizontal_set(bx, EINA_TRUE); - elm_notify_content_set(notify, bx); + elm_object_content_set(notify, bx); evas_object_show(bx); evas_object_event_callback_add(bx, EVAS_CALLBACK_MOUSE_IN, _mouse_in, diff --git a/src/bin/test_web.c b/src/bin/test_web.c index 2c0941b..7dbf45d 100644 --- a/src/bin/test_web.c +++ b/src/bin/test_web.c @@ -138,7 +138,7 @@ _alert_hook(void *data __UNUSED__, Evas_Object *obj, const char *message) label = elm_label_add(obj); elm_object_text_set(label, message); - elm_notify_content_set(popup, label); + elm_object_content_set(popup, label); evas_object_show(label); return popup; @@ -175,7 +175,7 @@ _confirm_hook(void *data __UNUSED__, Evas_Object *obj, const char *message, Eina evas_object_show(popup); box = elm_box_add(obj); - elm_notify_content_set(popup, box); + elm_object_content_set(popup, box); evas_object_show(box); label = elm_label_add(obj); diff --git a/src/edje_externals/elm_notify.c b/src/edje_externals/elm_notify.c index a1a1a67..ef9ff70 100644 --- a/src/edje_externals/elm_notify.c +++ b/src/edje_externals/elm_notify.c @@ -53,7 +53,7 @@ static void external_notify_state_set(void *data __UNUSED__, else return; if (p->content) { - elm_notify_content_set(obj, p->content); + elm_object_content_set(obj, p->content); } if (p->repeat_events_exists) elm_notify_repeat_events_set(obj, p->repeat_events); @@ -76,7 +76,7 @@ static Eina_Bool external_notify_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_notify_content_set(obj, content); + elm_object_content_set(obj, content); return EINA_TRUE; } else if ((!strcmp(param->name, "repeat_events")) diff --git a/src/examples/anchorblock_example_01.c b/src/examples/anchorblock_example_01.c index a4fb5e9..628319e 100644 --- a/src/examples/anchorblock_example_01.c +++ b/src/examples/anchorblock_example_01.c @@ -61,7 +61,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) evas_object_smart_callback_add(o, "anchor,clicked", _anchorblock_clicked_cb, NULL); evas_object_show(o); - elm_frame_content_set(frame, o); + elm_object_content_set(frame, o); frame = elm_frame_add(win); elm_object_text_set(frame, "Anchorview"); @@ -77,7 +77,7 @@ elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) evas_object_smart_callback_add(o, "anchor,clicked", _anchorview_clicked_cb, NULL); evas_object_show(o); - elm_frame_content_set(frame, o); + elm_object_content_set(frame, o); elm_run(); diff --git a/src/examples/entry_example.c b/src/examples/entry_example.c index 7870aff..e677c95 100644 --- a/src/examples/entry_example.c +++ b/src/examples/entry_example.c @@ -183,7 +183,7 @@ _page_settings_add(Evas_Object *parent, App_Inwin_Data *aid) box2 = elm_box_add(parent); evas_object_size_hint_weight_set(box2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(box2, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(sizeopts, box2); + elm_object_content_set(sizeopts, box2); evas_object_show(box2); sizebox = elm_box_add(parent); @@ -257,7 +257,7 @@ _page_settings_add(Evas_Object *parent, App_Inwin_Data *aid) elm_object_text_set(ewidth, buf); evas_object_size_hint_weight_set(ewidth, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(ewidth, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fwidth, ewidth); + elm_object_content_set(fwidth, ewidth); evas_object_show(ewidth); evas_object_smart_callback_add(ewidth, "changed", _width_changed_cb, aid); @@ -279,7 +279,7 @@ _page_settings_add(Evas_Object *parent, App_Inwin_Data *aid) elm_object_text_set(eheight, buf); evas_object_size_hint_weight_set(eheight, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(eheight, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fheight, eheight); + elm_object_content_set(fheight, eheight); evas_object_show(eheight); evas_object_smart_callback_add(eheight, "changed", _height_changed_cb, aid); diff --git a/src/examples/frame_example_01.c b/src/examples/frame_example_01.c index 32577ac..d3e4b35 100644 --- a/src/examples/frame_example_01.c +++ b/src/examples/frame_example_01.c @@ -27,7 +27,7 @@ elm_main(int argc, char **argv) evas_object_show(r1); f1= elm_frame_add(win); - elm_frame_content_set(f1, r1); + elm_object_content_set(f1, r1); elm_object_text_set(f1, "Default frame"); evas_object_resize(f1, 100, 100); evas_object_move(f1, 25, 25); @@ -38,7 +38,7 @@ elm_main(int argc, char **argv) evas_object_show(r2); f2 = elm_frame_add(win); - elm_frame_content_set(f2, r2); + elm_object_content_set(f2, r2); elm_object_text_set(f2, "Padding frame"); evas_object_resize(f2, 100, 100); evas_object_move(f2, 150, 25); @@ -50,7 +50,7 @@ elm_main(int argc, char **argv) evas_object_show(r3); f3 = elm_frame_add(win); - elm_frame_content_set(f3, r3); + elm_object_content_set(f3, r3); elm_object_text_set(f3, "Top outdent frame"); evas_object_resize(f3, 100, 100); evas_object_move(f3, 25, 150); @@ -62,7 +62,7 @@ elm_main(int argc, char **argv) evas_object_show(r4); f4 = elm_frame_add(win); - elm_frame_content_set(f4, r4); + elm_object_content_set(f4, r4); elm_object_text_set(f4, "Bottom outdent frame"); evas_object_resize(f4, 100, 100); evas_object_move(f4, 150, 150); diff --git a/src/examples/general_funcs_example.c b/src/examples/general_funcs_example.c index 283e063..c4c89e4 100644 --- a/src/examples/general_funcs_example.c +++ b/src/examples/general_funcs_example.c @@ -117,7 +117,7 @@ elm_main(int argc __UNUSED__, d.btn = elm_button_add(win); elm_object_text_set(d.btn, "Click me"); - elm_frame_content_set(frame, d.btn); + elm_object_content_set(frame, d.btn); fprintf(stdout, "Elementary's finger size is set to %d pixels\n.", elm_finger_size_get()); diff --git a/src/examples/mapbuf_example.c b/src/examples/mapbuf_example.c index a7cd78f..2684284 100644 --- a/src/examples/mapbuf_example.c +++ b/src/examples/mapbuf_example.c @@ -87,7 +87,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__) } } - elm_mapbuf_content_set(mb, tb); + elm_object_content_set(mb, tb); evas_object_show(mb); hbx = elm_box_add(win); diff --git a/src/examples/notify_example_01.c b/src/examples/notify_example_01.c index c071964..c19119d 100644 --- a/src/examples/notify_example_01.c +++ b/src/examples/notify_example_01.c @@ -36,7 +36,7 @@ elm_main(int argc, char **argv) notify = elm_notify_add(win); elm_notify_repeat_events_set(notify, EINA_FALSE); elm_notify_timeout_set(notify, 5); - elm_notify_content_set(notify, content); + elm_object_content_set(notify, content); evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(notify); elm_box_pack_end(bx, notify); @@ -48,7 +48,7 @@ elm_main(int argc, char **argv) notify = elm_notify_add(win); elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM); - elm_notify_content_set(notify, content); + elm_object_content_set(notify, content); evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(notify); elm_box_pack_end(bx, notify); @@ -59,7 +59,7 @@ elm_main(int argc, char **argv) notify = elm_notify_add(win); elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_CENTER); - elm_notify_content_set(notify, content); + elm_object_content_set(notify, content); evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(notify); elm_box_pack_end(bx, notify); @@ -77,4 +77,4 @@ static void _hide(void *data, Evas_Object *obj, void *event_info) { evas_object_hide(obj); -} \ No newline at end of file +} diff --git a/src/examples/panel_example_01.c b/src/examples/panel_example_01.c index d5b49dc..8e848bf 100644 --- a/src/examples/panel_example_01.c +++ b/src/examples/panel_example_01.c @@ -39,7 +39,7 @@ elm_main(int argc, char **argv) elm_object_text_set(content, "content"); evas_object_show(content); evas_object_size_hint_min_set(content, 100, 30); - elm_panel_content_set(panel, content); + elm_object_content_set(panel, content); panel = elm_panel_add(win); elm_panel_orient_set(panel, ELM_PANEL_ORIENT_RIGHT); @@ -53,7 +53,7 @@ elm_main(int argc, char **argv) elm_object_text_set(content, "content2"); evas_object_show(content); evas_object_size_hint_min_set(content, 100, 30); - elm_panel_content_set(panel, content); + elm_object_content_set(panel, content); panel = elm_panel_add(win); evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -65,7 +65,7 @@ elm_main(int argc, char **argv) elm_object_text_set(content, "content2"); evas_object_show(content); evas_object_size_hint_min_set(content, 100, 30); - elm_panel_content_set(panel, content); + elm_object_content_set(panel, content); evas_object_show(win); diff --git a/src/examples/slideshow_example.c b/src/examples/slideshow_example.c index 534efa5..d6f133f 100644 --- a/src/examples/slideshow_example.c +++ b/src/examples/slideshow_example.c @@ -230,7 +230,7 @@ elm_main(int argc __UNUSED__, bx = elm_box_add(win); elm_box_horizontal_set(bx, EINA_TRUE); - elm_notify_content_set(notify, bx); + elm_object_content_set(notify, bx); evas_object_show(bx); evas_object_event_callback_add(bx, EVAS_CALLBACK_MOUSE_IN, _mouse_in, diff --git a/src/examples/win_example.c b/src/examples/win_example.c index c369cdd..8746b84 100644 --- a/src/examples/win_example.c +++ b/src/examples/win_example.c @@ -118,7 +118,7 @@ _main_win_del_cb(void *data __UNUSED__, Evas_Object *obj, void *event __UNUSED__ box = elm_box_add(obj); evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_notify_content_set(msg, box); + elm_object_content_set(msg, box); evas_object_show(box); lbl = elm_label_add(obj); diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 7e61eb0..a500e94 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -4516,7 +4516,6 @@ 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 * * Here is some sample code using it: @@ -6165,11 +6164,9 @@ 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 * * Default text parts of the button widget that you can use for are: - * * @li "elm.text" - Label of the button * * Follow through a complete example @ref button_example_01 "here". @@ -7761,6 +7758,12 @@ 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 + * + * Default text parts of the frame widget that you can use for are: + * @li "elm.text" - Label of the frame + * * For a detailed example see the @ref tutorial_frame. * * @{ @@ -7801,7 +7804,7 @@ extern "C" { * @param obj The frame object * @param content The content will be filled in this frame object */ - EAPI void elm_frame_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); + EINA_DEPRECATED EAPI void elm_frame_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); /** * @brief Get the content of the frame widget * @@ -7810,7 +7813,7 @@ extern "C" { * @param obj The frame object * @return The content that is being used */ - EAPI Evas_Object *elm_frame_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EINA_DEPRECATED EAPI Evas_Object *elm_frame_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); /** * @brief Unset the content of the frame widget * @@ -7819,7 +7822,7 @@ extern "C" { * @param obj The frame object * @return The content that was being used */ - EAPI Evas_Object *elm_frame_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); + EINA_DEPRECATED EAPI Evas_Object *elm_frame_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); /** * @} */ @@ -10417,6 +10420,9 @@ extern "C" { * @li "timeout" - when timeout happens on notify and it's hidden * @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 + * * @ref tutorial_notify show usage of the API. * * @{ @@ -10459,7 +10465,7 @@ extern "C" { * you want to keep that old content object, use the * elm_notify_content_unset() function. */ - EAPI void elm_notify_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); + EINA_DEPRECATED EAPI void elm_notify_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); /** * @brief Unset the content of the notify widget * @@ -10470,7 +10476,7 @@ extern "C" { * * @see elm_notify_content_set() */ - EAPI Evas_Object *elm_notify_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); + EINA_DEPRECATED EAPI Evas_Object *elm_notify_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); /** * @brief Return the content of the notify widget * @@ -10479,7 +10485,7 @@ extern "C" { * * @see elm_notify_content_set() */ - EAPI Evas_Object *elm_notify_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EINA_DEPRECATED EAPI Evas_Object *elm_notify_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); /** * @brief Set the notify parent * @@ -19669,11 +19675,9 @@ 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 * * Default text parts of the check widget that you can use for are: - * * @li "elm.text" - Label of the check * * @ref tutorial_check should give you a firm grasp of how to use this widget @@ -23676,6 +23680,12 @@ extern "C" { * @li ELM_PANEL_ORIENT_LEFT * @li ELM_PANEL_ORIENT_RIGHT * + * To set/get/unset the contetn 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 + * * @ref tutorial_panel shows one way to use this widget. * @{ */ @@ -23723,7 +23733,7 @@ extern "C" { * If you want to keep that old content object, use the * elm_panel_content_unset() function. */ - EAPI void elm_panel_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); + EINA_DEPRECATED EAPI void elm_panel_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); /** * @brief Get the content of the panel. * @@ -23734,7 +23744,7 @@ extern "C" { * * @see elm_panel_content_set() */ - EAPI Evas_Object *elm_panel_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EINA_DEPRECATED EAPI Evas_Object *elm_panel_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); /** * @brief Unset the content of the panel. * @@ -23745,7 +23755,7 @@ extern "C" { * * @see elm_panel_content_set() */ - EAPI Evas_Object *elm_panel_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); + EINA_DEPRECATED EAPI Evas_Object *elm_panel_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); /** * @brief Set the state of the panel. * @@ -24456,6 +24466,14 @@ 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. + * + * To enable map, elm_mapbuf_enabled_set() should be used. + * * See how to use this widget in this example: * @ref mapbuf_example */ @@ -24492,7 +24510,7 @@ extern "C" { * * @ingroup Mapbuf */ - EAPI void elm_mapbuf_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); + EINA_DEPRECATED EAPI void elm_mapbuf_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); /** * Get the content of the mapbuf. @@ -24506,7 +24524,7 @@ extern "C" { * * @ingroup Mapbuf */ - EAPI Evas_Object *elm_mapbuf_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EINA_DEPRECATED EAPI Evas_Object *elm_mapbuf_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); /** * Unset the content of the mapbuf. @@ -24520,7 +24538,7 @@ extern "C" { * * @ingroup Mapbuf */ - EAPI Evas_Object *elm_mapbuf_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); + EINA_DEPRECATED EAPI Evas_Object *elm_mapbuf_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); /** * Enable or disable the map. @@ -26297,6 +26315,9 @@ extern "C" { * Signals that you can add callbacks for are: * "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 + * * @ref tutorial_ctxpopup shows the usage of a good deal of the API. * @{ */ @@ -27903,8 +27924,8 @@ extern "C" { */ EAPI Evas_Object *elm_factory_add(Evas_Object *parent); - EAPI void elm_factory_content_set(Evas_Object *obj, Evas_Object *content); - EAPI Evas_Object *elm_factory_content_get(const Evas_Object *obj); + EINA_DEPRECATED EAPI void elm_factory_content_set(Evas_Object *obj, Evas_Object *content); + EINA_DEPRECATED EAPI Evas_Object *elm_factory_content_get(const Evas_Object *obj); EAPI void elm_factory_maxmin_mode_set(Evas_Object *obj, Eina_Bool enabled); EAPI Eina_Bool elm_factory_maxmin_mode_get(const Evas_Object *obj); EAPI void elm_factory_maxmin_reset_set(Evas_Object *obj); @@ -28155,19 +28176,16 @@ extern "C" { * application. * * Signals that you can add callback for are: - * * @li "transition,finished" - When the transition is finished in changing * the item * @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.prev_btn" - A button to go to the previous page * @li "elm.swallow.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 * * @ref tutorial_naviframe gives a good overview of the usage of the API. diff --git a/src/lib/elm_factory.c b/src/lib/elm_factory.c index 3fa5787..ecb5b5c 100644 --- a/src/lib/elm_factory.c +++ b/src/lib/elm_factory.c @@ -26,6 +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 const char SIG_REALIZE[] = "realize"; static const char SIG_UNREALIZE[] = "unrealize"; @@ -209,36 +211,8 @@ _child_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __ // printf("FAC-- = %i\n", fac); } -EAPI Evas_Object * -elm_factory_add(Evas_Object *parent) -{ - Evas_Object *obj; - Evas *e; - Widget_Data *wd; - - ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL); - - ELM_SET_WIDTYPE(widtype, "factory"); - elm_widget_type_set(obj, "factory"); - elm_widget_sub_object_add(parent, obj); - elm_widget_data_set(obj, wd); - elm_widget_del_hook_set(obj, _del_hook); - elm_widget_focus_next_hook_set(obj, _focus_next_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); - elm_widget_changed_hook_set(obj, _changed); - - evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move, NULL); - evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, NULL); - - evas_object_smart_callbacks_descriptions_set(obj, _signals); - - wd->obj = obj; - wd->last_calc_count = -1; - return obj; -} - -EAPI void -elm_factory_content_set(Evas_Object *obj, Evas_Object *content) +static void +_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -275,8 +249,8 @@ elm_factory_content_set(Evas_Object *obj, Evas_Object *content) } } -EAPI Evas_Object * -elm_factory_content_get(const Evas_Object *obj) +static Evas_Object * +_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); @@ -284,6 +258,48 @@ elm_factory_content_get(const Evas_Object *obj) return wd->content; } +EAPI Evas_Object * +elm_factory_add(Evas_Object *parent) +{ + Evas_Object *obj; + Evas *e; + Widget_Data *wd; + + ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL); + + ELM_SET_WIDTYPE(widtype, "factory"); + elm_widget_type_set(obj, "factory"); + elm_widget_sub_object_add(parent, obj); + elm_widget_data_set(obj, wd); + elm_widget_del_hook_set(obj, _del_hook); + elm_widget_focus_next_hook_set(obj, _focus_next_hook); + elm_widget_content_set_hook_set(obj, _content_set_hook); + elm_widget_content_get_hook_set(obj, _content_get_hook); + elm_widget_can_focus_set(obj, EINA_FALSE); + elm_widget_changed_hook_set(obj, _changed); + + evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move, NULL); + evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, NULL); + + evas_object_smart_callbacks_descriptions_set(obj, _signals); + + wd->obj = obj; + wd->last_calc_count = -1; + return obj; +} + +EAPI void +elm_factory_content_set(Evas_Object *obj, Evas_Object *content) +{ + _content_set_hook(obj, NULL, content); +} + +EAPI Evas_Object * +elm_factory_content_get(const Evas_Object *obj) +{ + return _content_get_hook(obj, NULL); +} + EAPI void elm_factory_maxmin_mode_set(Evas_Object *obj, Eina_Bool enabled) { diff --git a/src/lib/elm_frame.c b/src/lib/elm_frame.c index ee33efc..fb1019c 100644 --- a/src/lib/elm_frame.c +++ b/src/lib/elm_frame.c @@ -124,6 +124,49 @@ _elm_frame_label_get(const Evas_Object *obj, const char *item) return wd->label; } +static void +_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + if (wd->content == content) return; + if (wd->content) evas_object_del(wd->content); + wd->content = content; + if (content) + { + elm_widget_sub_object_add(obj, content); + evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + edje_object_part_swallow(wd->frm, "elm.swallow.content", content); + } + _sizing_eval(obj); +} + +static Evas_Object * +_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *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__) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + Evas_Object *content; + if (!wd) return NULL; + if (!wd->content) return NULL; + content = wd->content; + elm_widget_sub_object_del(obj, wd->content); + edje_object_part_unswallow(wd->frm, wd->content); + wd->content = NULL; + return content; +} + EAPI Evas_Object * elm_frame_add(Evas_Object *parent) { @@ -143,6 +186,9 @@ elm_frame_add(Evas_Object *parent) elm_widget_can_focus_set(obj, EINA_FALSE); elm_widget_text_set_hook_set(obj, _elm_frame_label_set); elm_widget_text_get_hook_set(obj, _elm_frame_label_get); + elm_widget_content_set_hook_set(obj, _content_set_hook); + elm_widget_content_get_hook_set(obj, _content_get_hook); + elm_widget_content_unset_hook_set(obj, _content_unset_hook); wd->frm = edje_object_add(e); _elm_theme_object_set(obj, wd->frm, "frame", "base", "default"); @@ -170,42 +216,17 @@ elm_frame_label_get(const Evas_Object *obj) EAPI void elm_frame_content_set(Evas_Object *obj, Evas_Object *content) { - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (wd->content == content) return; - if (wd->content) evas_object_del(wd->content); - wd->content = content; - if (content) - { - elm_widget_sub_object_add(obj, content); - evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - edje_object_part_swallow(wd->frm, "elm.swallow.content", content); - } - _sizing_eval(obj); + _content_set_hook(obj, NULL, content); } EAPI Evas_Object * elm_frame_content_get(const Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->content; + return _content_get_hook(obj, NULL); } EAPI Evas_Object * elm_frame_content_unset(Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *content; - if (!wd) return NULL; - if (!wd->content) return NULL; - content = wd->content; - elm_widget_sub_object_del(obj, wd->content); - edje_object_part_unswallow(wd->frm, wd->content); - wd->content = NULL; - return content; + return _content_unset_hook(obj, NULL); } diff --git a/src/lib/elm_mapbuf.c b/src/lib/elm_mapbuf.c index c87ecff..ab6f152 100644 --- a/src/lib/elm_mapbuf.c +++ b/src/lib/elm_mapbuf.c @@ -146,6 +146,59 @@ _resize(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, _configure(data); } +static void +_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + if (wd->content == content) return; + if (wd->content) evas_object_del(wd->content); + wd->content = content; + if (content) + { + evas_object_data_set(content, "_elm_leaveme", (void *)1); + elm_widget_sub_object_add(content, obj); + evas_object_smart_member_add(content, obj); + evas_object_clip_set(content, wd->clip); + evas_object_color_set(wd->clip, 255, 255, 255, 255); + evas_object_event_callback_add(content, + EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + } + else + evas_object_color_set(wd->clip, 0, 0, 0, 0); + _sizing_eval(obj); + _configure(obj); +} + +static Evas_Object * +_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *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__) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + Evas_Object *content; + if (!wd) return NULL; + if (!wd->content) return NULL; + content = wd->content; + elm_widget_sub_object_del(obj, content); + evas_object_smart_member_del(content); + evas_object_color_set(wd->clip, 0, 0, 0, 0); + evas_object_clip_unset(content); + evas_object_data_del(content, "_elm_leaveme"); + wd->content = NULL; + return content; +} + EAPI Evas_Object * elm_mapbuf_add(Evas_Object *parent) { @@ -161,6 +214,9 @@ elm_mapbuf_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); + elm_widget_content_set_hook_set(obj, _content_set_hook); + elm_widget_content_get_hook_set(obj, _content_get_hook); + elm_widget_content_unset_hook_set(obj, _content_unset_hook); elm_widget_can_focus_set(obj, EINA_FALSE); wd->clip = evas_object_rectangle_add(e); @@ -185,54 +241,19 @@ elm_mapbuf_add(Evas_Object *parent) EAPI void elm_mapbuf_content_set(Evas_Object *obj, Evas_Object *content) { - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (wd->content == content) return; - if (wd->content) evas_object_del(wd->content); - wd->content = content; - if (content) - { - evas_object_data_set(content, "_elm_leaveme", (void *)1); - elm_widget_sub_object_add(content, obj); - evas_object_smart_member_add(content, obj); - evas_object_clip_set(content, wd->clip); - evas_object_color_set(wd->clip, 255, 255, 255, 255); - evas_object_event_callback_add(content, - EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - } - else - evas_object_color_set(wd->clip, 0, 0, 0, 0); - _sizing_eval(obj); - _configure(obj); + _content_set_hook(obj, NULL, content); } EAPI Evas_Object * elm_mapbuf_content_get(const Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->content; + return _content_get_hook(obj, NULL); } EAPI Evas_Object * elm_mapbuf_content_unset(Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *content; - if (!wd) return NULL; - if (!wd->content) return NULL; - content = wd->content; - elm_widget_sub_object_del(obj, content); - evas_object_smart_member_del(content); - evas_object_color_set(wd->clip, 0, 0, 0, 0); - evas_object_clip_unset(content); - evas_object_data_del(content, "_elm_leaveme"); - wd->content = NULL; - return content; + return _content_unset_hook(obj, NULL); } EAPI void diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c index e9f1d98..116d475 100644 --- a/src/lib/elm_notify.c +++ b/src/lib/elm_notify.c @@ -413,6 +413,54 @@ _elm_notify_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Eva return elm_widget_focus_next_get(cur, dir, next); } +static void +_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + if (wd->content == content) return; + if (wd->content) evas_object_del(wd->content); + wd->content = content; + + if (content) + { + elm_widget_sub_object_add(obj, content); + evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + evas_object_event_callback_add(content, EVAS_CALLBACK_RESIZE, + _content_resize, obj); + edje_object_part_swallow(wd->notify, "elm.swallow.content", content); + } + _sizing_eval(obj); + _calc(obj); +} + +static Evas_Object * +_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *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__) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + Evas_Object *content; + if (!wd) return NULL; + if (!wd->content) return NULL; + content = wd->content; + elm_widget_sub_object_del(obj, wd->content); + edje_object_part_unswallow(wd->notify, wd->content); + wd->content = NULL; + return content; +} + EAPI Evas_Object * elm_notify_add(Evas_Object *parent) { @@ -431,6 +479,9 @@ elm_notify_add(Evas_Object *parent) elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_can_focus_set(obj, EINA_FALSE); elm_widget_focus_next_hook_set(obj, _elm_notify_focus_next_hook); + elm_widget_content_set_hook_set(obj, _content_set_hook); + elm_widget_content_get_hook_set(obj, _content_get_hook); + elm_widget_content_unset_hook_set(obj, _content_unset_hook); wd->repeat_events = EINA_TRUE; @@ -456,49 +507,19 @@ elm_notify_add(Evas_Object *parent) EAPI void elm_notify_content_set(Evas_Object *obj, Evas_Object *content) { - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (wd->content == content) return; - if (wd->content) evas_object_del(wd->content); - wd->content = content; - - if (content) - { - elm_widget_sub_object_add(obj, content); - evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - evas_object_event_callback_add(content, EVAS_CALLBACK_RESIZE, - _content_resize, obj); - edje_object_part_swallow(wd->notify, "elm.swallow.content", content); - } - _sizing_eval(obj); - _calc(obj); + _content_set_hook(obj, NULL, content); } EAPI Evas_Object * elm_notify_content_unset(Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *content; - if (!wd) return NULL; - if (!wd->content) return NULL; - content = wd->content; - elm_widget_sub_object_del(obj, wd->content); - edje_object_part_unswallow(wd->notify, wd->content); - wd->content = NULL; - return content; + return _content_unset_hook(obj, NULL); } EAPI Evas_Object * elm_notify_content_get(const Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - - if (!wd) return NULL; - return wd->content; + return _content_get_hook(obj, NULL); } EAPI void diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c index 30c9089..3da5b9e 100644 --- a/src/lib/elm_panel.c +++ b/src/lib/elm_panel.c @@ -225,6 +225,47 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty return EINA_TRUE; } +static void +_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + if (wd->content == content) return; + if (wd->content) + evas_object_box_remove_all(wd->bx, EINA_TRUE); + wd->content = content; + if (content) + { + evas_object_box_append(wd->bx, wd->content); + evas_object_show(wd->content); + } + _sizing_eval(obj); +} + +static Evas_Object * +_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *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__) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + Evas_Object *content; + if (!wd) return NULL; + if (!wd->content) return NULL; + content = wd->content; + evas_object_box_remove_all(wd->bx, EINA_FALSE); + wd->content = NULL; + return content; +} + EAPI Evas_Object * elm_panel_add(Evas_Object *parent) { @@ -247,6 +288,9 @@ elm_panel_add(Evas_Object *parent) elm_widget_focus_next_hook_set(obj, _elm_panel_focus_next_hook); elm_widget_can_focus_set(obj, EINA_TRUE); elm_widget_event_hook_set(obj, _event_hook); + elm_widget_content_set_hook_set(obj, _content_set_hook); + elm_widget_content_get_hook_set(obj, _content_get_hook); + elm_widget_content_unset_hook_set(obj, _content_unset_hook); wd->scr = elm_smart_scroller_add(e); elm_smart_scroller_widget_set(wd->scr, obj); @@ -321,42 +365,19 @@ elm_panel_orient_get(const Evas_Object *obj) EAPI void elm_panel_content_set(Evas_Object *obj, Evas_Object *content) { - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (wd->content == content) return; - if (wd->content) - evas_object_box_remove_all(wd->bx, EINA_TRUE); - wd->content = content; - if (content) - { - evas_object_box_append(wd->bx, wd->content); - evas_object_show(wd->content); - } - _sizing_eval(obj); + _content_set_hook(obj, NULL, content); } EAPI Evas_Object * elm_panel_content_get(const Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->content; + return _content_get_hook(obj, NULL); } EAPI Evas_Object * elm_panel_content_unset(Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *content; - if (!wd) return NULL; - if (!wd->content) return NULL; - content = wd->content; - evas_object_box_remove_all(wd->bx, EINA_FALSE); - wd->content = NULL; - return content; + return _content_unset_hook(obj, NULL); } EAPI void diff --git a/src/lib/elm_web.c b/src/lib/elm_web.c index 46169df..b230f2e 100644 --- a/src/lib/elm_web.c +++ b/src/lib/elm_web.c @@ -909,7 +909,7 @@ _ewk_view_popup_create_cb(void *data, Evas_Object *obj, void *event_info) elm_list_mode_set(list, ELM_LIST_EXPAND); evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_notify_content_set(notify, list); + elm_object_content_set(notify, list); evas_object_show(list); EINA_LIST_FOREACH(m->items, itr, it) -- 2.7.4