From: hermet Date: Thu, 16 Feb 2012 07:31:55 +0000 (+0000) Subject: elementary/flip - deprecated APIs X-Git-Tag: REL_F_I9500_20120323_1~17^2~700 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cfc71355f9d0de0e2bb47be1b8d61ed7bc00909a;p=framework%2Fuifw%2Felementary.git elementary/flip - deprecated APIs elm_flip_content_front_set elm_flip_content_back_set elm_flip_content_front_unset elm_flip_content_back_unset elm_flip_content_front_get elm_flip_content_back_get git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@68009 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/data/themes/widgets/naviframe.edc b/data/themes/widgets/naviframe.edc index f49f9fc..71d2850 100644 --- a/data/themes/widgets/naviframe.edc +++ b/data/themes/widgets/naviframe.edc @@ -111,7 +111,7 @@ group { name:"elm/naviframe/item/basic/default"; description { state: "default" 0.0; min: 40 40; max: 40 40; - fixed: 1 1; + fixed: 1 1; align: 1 0.5; rel1.to: "elm.text.title"; rel1.relative: 0 0; diff --git a/doc/widgets/widget_preview_flip.c b/doc/widgets/widget_preview_flip.c index 45c8df1..b85d289 100644 --- a/doc/widgets/widget_preview_flip.c +++ b/doc/widgets/widget_preview_flip.c @@ -10,11 +10,11 @@ evas_object_show(o); Evas_Object *ic = elm_icon_add(win); elm_icon_standard_set(ic, "home"); evas_object_show(ic); -elm_flip_content_front_set(o, ic); +elm_object_part_content_set(o, "front", ic); ic = elm_icon_add(win); elm_icon_standard_set(ic, "file"); evas_object_show(ic); -elm_flip_content_back_set(o, ic); +elm_object_part_content_set(o, "back", ic); ecore_timer_add(0.35, _func, o); @@ -24,4 +24,4 @@ unsigned char _func(void *data) { elm_flip_go(data, ELM_FLIP_CUBE_RIGHT); return 0; -} \ No newline at end of file +} diff --git a/src/bin/test_flip.c b/src/bin/test_flip.c index bbf130b..5761f6d 100644 --- a/src/bin/test_flip.c +++ b/src/bin/test_flip.c @@ -91,7 +91,7 @@ test_flip(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info _ evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), "sky_01.jpg"); elm_bg_file_set(o, buf, NULL); - elm_flip_content_front_set(fl, o); + elm_object_part_content_set(fl, "front", o); evas_object_show(o); ly = elm_layout_add(win); @@ -99,7 +99,7 @@ test_flip(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info _ elm_layout_file_set(ly, buf, "layout"); 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_flip_content_back_set(fl, ly); + elm_object_part_content_set(fl, "back", ly); evas_object_show(ly); bt = elm_button_add(ly); @@ -264,7 +264,7 @@ test_flip2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_box_pack_end(o, li); evas_object_show(li); - elm_flip_content_front_set(fl, o); + elm_object_part_content_set(fl, "front", o); evas_object_show(o); en = elm_entry_add(win); @@ -305,7 +305,7 @@ test_flip2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_flip_content_back_set(fl, en); + elm_object_part_content_set(fl, "back", en); evas_object_show(en); evas_object_show(fl); @@ -400,7 +400,7 @@ test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_object_text_set(fr, "Front"); evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_flip_content_front_set(fl, fr); + elm_object_part_content_set(fl, "front", fr); evas_object_show(fr); fl_f = elm_flip_add(win); @@ -414,7 +414,7 @@ test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), "sky_01.jpg"); elm_bg_file_set(o, buf, NULL); - elm_flip_content_front_set(fl_f, o); + elm_object_part_content_set(fl_f, "front", o); evas_object_show(o); o = elm_bg_add(win); @@ -422,14 +422,14 @@ test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), "sky_02.jpg"); elm_bg_file_set(o, buf, NULL); - elm_flip_content_back_set(fl_f, o); + elm_object_part_content_set(fl_f, "back", o); evas_object_show(o); fr = elm_frame_add(win); elm_object_text_set(fr, "Back"); evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_flip_content_back_set(fl, fr); + elm_object_part_content_set(fl, "back", fr); evas_object_show(fr); fl_b = elm_flip_add(win); @@ -443,7 +443,7 @@ test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), "sky_03.jpg"); elm_bg_file_set(o, buf, NULL); - elm_flip_content_front_set(fl_b, o); + elm_object_part_content_set(fl_b, "front", o); evas_object_show(o); o = elm_bg_add(win); @@ -451,7 +451,7 @@ test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), "sky_04.jpg"); elm_bg_file_set(o, buf, NULL); - elm_flip_content_back_set(fl_b, o); + elm_object_part_content_set(fl_b, "back", o); evas_object_show(o); bx2 = elm_box_add(win); @@ -550,7 +550,7 @@ test_flip4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), "twofish.jpg"); evas_object_image_file_set(im, buf, NULL); - elm_flip_content_front_set(fl, im); + elm_object_part_content_set(fl, "front", im); evas_object_show(im); #if 0 @@ -559,7 +559,7 @@ test_flip4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), "sky_04.jpg"); evas_object_image_file_set(im, buf, NULL); - elm_flip_content_back_set(fl, im); + elm_object_part_content_set(fl, "back", im); evas_object_show(im); #else li = elm_list_add(win); @@ -569,7 +569,7 @@ test_flip4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_list_item_append(li, "Item 2", NULL, NULL, NULL, NULL); elm_list_item_append(li, "Item 3 (Which is very long just for testing purposes)", NULL, NULL, NULL, NULL); elm_list_go(li); - elm_flip_content_back_set(fl, li); + elm_object_part_content_set(fl, "back", li); evas_object_show(li); #endif diff --git a/src/bin/test_weather.c b/src/bin/test_weather.c index 873a1a7..e24a856 100644 --- a/src/bin/test_weather.c +++ b/src/bin/test_weather.c @@ -91,7 +91,7 @@ test_weather(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf weather[0] = eweather_object_add(evas_object_evas_get(win)); evas_object_size_hint_weight_set(weather[0], EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(weather[0], -1.0, -1.0); - elm_flip_content_front_set(fl, weather[0]); + elm_object_part_content_set(fl, "front", weather[0]); evas_object_show(weather[0]); module[1] = NULL; @@ -99,7 +99,7 @@ test_weather(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf eweather = eweather_object_eweather_get(weather[1]); evas_object_size_hint_weight_set(weather[1], EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(weather[1], -1.0, -1.0); - elm_flip_content_back_set(fl, weather[1]); + elm_object_part_content_set(fl, "back", weather[1]); evas_object_show(weather[1]); evas_object_show(fl); diff --git a/src/examples/flip_example_01.c b/src/examples/flip_example_01.c index 76cd3e7..c13c6c3 100644 --- a/src/examples/flip_example_01.c +++ b/src/examples/flip_example_01.c @@ -32,8 +32,8 @@ elm_main(int argc, char **argv) evas_object_show(rect2); flip = elm_flip_add(win); - elm_flip_content_front_set(flip, rect); - elm_flip_content_back_set(flip, rect2); + elm_object_part_content_set(flip, "front", rect); + elm_object_part_conetnt_set(flip, "back", rect2); evas_object_resize(flip, 150, 150); evas_object_move(flip, 10, 10); evas_object_show(flip); diff --git a/src/lib/elm_deprecated.h b/src/lib/elm_deprecated.h index 0e61698..4bf5b78 100644 --- a/src/lib/elm_deprecated.h +++ b/src/lib/elm_deprecated.h @@ -4554,3 +4554,80 @@ EINA_DEPRECATED EAPI void elm_entry_text_filter_prepend(Evas_Objec * @ingroup Entry */ EINA_DEPRECATED EAPI void elm_entry_text_filter_remove(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data); + +/** + * @brief Set the front content of the flip widget. + * + * @param obj The flip object + * @param content The new front content object + * + * 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_flip_content_front_unset() function. + * + * @deprecated Use elm_objecet_part_content_set(flip, "front") instead + */ +EINA_DEPRECATED EAPI void elm_flip_content_front_set(Evas_Object *obj, Evas_Object *content); + +/** + * @brief Set the back content of the flip widget. + * + * @param obj The flip object + * @param content The new back content object + * + * 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_flip_content_back_unset() function. + * + * @deprecated Use elm_objecet_part_content_set(flip, "back") instead + */ +EINA_DEPRECATED EAPI void elm_flip_content_back_set(Evas_Object *obj, Evas_Object *content); + +/** + * @brief Get the front content used for the flip + * + * @param obj The flip object + * @return The front content object that is being used + * + * Return the front content object which is set for this widget. + * + * @deprecated Use elm_objecet_part_content_get(flip, "front") instead + */ +EINA_DEPRECATED EAPI Evas_Object *elm_flip_content_front_get(const Evas_Object *obj); + +/** + * @brief Get the back content used for the flip + * + * @param obj The flip object + * @return The back content object that is being used + * + * Return the back content object which is set for this widget. + * + * @deprecated Use elm_objecet_part_content_get(flip, "back") instead + */ +EINA_DEPRECATED EAPI Evas_Object *elm_flip_content_back_get(const Evas_Object *obj); + +/** + * @brief Unset the front content used for the flip + * + * @param obj The flip object + * @return The front content object that was being used + * + * Unparent and return the front content object which was set for this widget. + * + * @deprecated Use elm_objecet_part_content_unset(flip, "front") instead + */ +EINA_DEPRECATED EAPI Evas_Object *elm_flip_content_front_unset(Evas_Object *obj); + +/** + * @brief Unset the back content used for the flip + * + * @param obj The flip object + * @return The back content object that was being used + * + * Unparent and return the back content object which was set for this widget. + * + * @deprecated Use elm_objecet_part_content_unset(flip, "back") instead + */ +EINA_DEPRECATED EAPI Evas_Object *elm_flip_content_back_unset(Evas_Object *obj); + diff --git a/src/lib/elm_flip.c b/src/lib/elm_flip.c index 0b37e10..380b1bf 100644 --- a/src/lib/elm_flip.c +++ b/src/lib/elm_flip.c @@ -88,19 +88,17 @@ _theme_hook(Evas_Object *obj) } static Eina_Bool -_elm_flip_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next) +_elm_flip_focus_next_hook(const Evas_Object *obj, + Elm_Focus_Direction dir, Evas_Object **next) { Widget_Data *wd = elm_widget_data_get(obj); - - if (!wd) - return EINA_FALSE; + if (!wd) return EINA_FALSE; /* Try Focus cycle in subitem */ if (wd->state) return elm_widget_focus_next_get(wd->front.content, dir, next); else return elm_widget_focus_next_get(wd->back.content, dir, next); - } static void @@ -1569,6 +1567,142 @@ _move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *even wd->job = ecore_job_add(_update_job, wd); } +static void +_flip_content_front_set(Evas_Object *obj, Evas_Object *content) +{ + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + + int i; + + if (wd->front.content == content) return; + if (wd->front.content) evas_object_del(wd->front.content); + wd->front.content = content; + if (content) + { + elm_widget_sub_object_add(obj, content); + evas_object_smart_member_add(content, obj); + evas_object_clip_set(content, wd->front.clip); + evas_object_event_callback_add(content, + EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + _sizing_eval(obj); + } + + // force calc to contents are the right size before transition + evas_smart_objects_calculate(evas_object_evas_get(obj)); + flip_show_hide(obj); + _configure(obj); + if (wd->intmode != ELM_FLIP_INTERACTION_NONE) + { + for (i = 0; i < 4; i++) evas_object_raise(wd->event[i]); + } +} + +static void +_flip_content_back_set(Evas_Object *obj, Evas_Object *content) +{ + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + + int i; + if (wd->back.content == content) return; + if (wd->back.content) evas_object_del(wd->back.content); + wd->back.content = content; + if (content) + { + elm_widget_sub_object_add(obj, content); + evas_object_smart_member_add(content, obj); + evas_object_clip_set(content, wd->back.clip); + evas_object_event_callback_add(content, + EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + _sizing_eval(obj); + } + + // force calc to contents are the right size before transition + evas_smart_objects_calculate(evas_object_evas_get(obj)); + flip_show_hide(obj); + _configure(obj); + if (wd->intmode != ELM_FLIP_INTERACTION_NONE) + { + for (i = 0; i < 4; i++) evas_object_raise(wd->event[i]); + } +} + +static Evas_Object * +_content_front_unset(Evas_Object *obj) +{ + Widget_Data *wd = elm_widget_data_get(obj); + if ((!wd) || (!wd->front.content)) return NULL; + + Evas_Object *content = wd->front.content; + evas_object_clip_unset(content); + elm_widget_sub_object_del(obj, content); + evas_object_event_callback_del_full(content, + EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + evas_object_smart_member_del(content); + wd->front.content = NULL; + return content; +} + +static Evas_Object * +_content_back_unset(Evas_Object *obj) +{ + Widget_Data *wd = elm_widget_data_get(obj); + if ((!wd) || (!wd->back.content)) return NULL; + + Evas_Object *content = wd->back.content; + evas_object_clip_unset(content); + elm_widget_sub_object_del(obj, content); + evas_object_event_callback_del_full(content, + EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + evas_object_smart_member_del(content); + wd->back.content = NULL; + return content; +} + +static void +_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + + if (!part || !strcmp(part, "front")) + _flip_content_front_set(obj, content); + else if (!strcmp(part, "back")) + _flip_content_back_set(obj, content); +} + +static Evas_Object * +_content_get_hook(const Evas_Object *obj, const char *part) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return NULL; + + if (!part || !strcmp(part, "front")) + return wd->front.content; + else if (!strcmp(part, "back")) + return wd->back.content; + + return NULL; +} + +static Evas_Object * +_content_unset_hook(Evas_Object *obj, const char *part) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + + if (!part || !strcmp(part, "front")) + return _content_front_unset(obj); + else if (!strcmp(part, "back")) + return _content_back_unset(obj); + + return NULL; +} + EAPI Evas_Object * elm_flip_add(Evas_Object *parent) { @@ -1586,11 +1720,14 @@ elm_flip_add(Evas_Object *parent) elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_focus_next_hook_set(obj, _elm_flip_focus_next_hook); elm_widget_can_focus_set(obj, EINA_FALSE); + 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->obj = obj; wd->clip = evas_object_rectangle_add(e); - evas_object_static_clip_set(wd->clip, 1); + evas_object_static_clip_set(wd->clip, EINA_TRUE); evas_object_color_set(wd->clip, 255, 255, 255, 255); evas_object_move(wd->clip, -49999, -49999); evas_object_resize(wd->clip, 99999, 99999); @@ -1599,7 +1736,7 @@ elm_flip_add(Evas_Object *parent) evas_object_smart_member_add(wd->clip, obj); wd->front.clip = evas_object_rectangle_add(e); - evas_object_static_clip_set(wd->front.clip, 1); + evas_object_static_clip_set(wd->front.clip, EINA_TRUE); evas_object_data_set(wd->front.clip, "_elm_leaveme", obj); evas_object_color_set(wd->front.clip, 255, 255, 255, 255); evas_object_move(wd->front.clip, -49999, -49999); @@ -1609,7 +1746,7 @@ elm_flip_add(Evas_Object *parent) evas_object_clip_set(wd->front.clip, wd->clip); wd->back.clip = evas_object_rectangle_add(e); - evas_object_static_clip_set(wd->back.clip, 1); + evas_object_static_clip_set(wd->back.clip, EINA_TRUE); evas_object_data_set(wd->back.clip, "_elm_leaveme", obj); evas_object_color_set(wd->back.clip, 255, 255, 255, 255); evas_object_move(wd->back.clip, -49999, -49999); @@ -1626,7 +1763,7 @@ elm_flip_add(Evas_Object *parent) evas_object_smart_callbacks_descriptions_set(obj, _signals); - wd->state = 1; + wd->state = EINA_TRUE; wd->intmode = ELM_FLIP_INTERACTION_NONE; _sizing_eval(obj); @@ -1637,114 +1774,37 @@ elm_flip_add(Evas_Object *parent) EAPI void elm_flip_content_front_set(Evas_Object *obj, Evas_Object *content) { - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - int i; - if (!wd) return; - if (wd->front.content == content) return; - if (wd->front.content) evas_object_del(wd->front.content); - wd->front.content = content; - if (content) - { - elm_widget_sub_object_add(obj, content); - evas_object_smart_member_add(content, obj); - evas_object_clip_set(content, wd->front.clip); - evas_object_event_callback_add(content, - EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - _sizing_eval(obj); - } - // force calc to contents are the right size before transition - evas_smart_objects_calculate(evas_object_evas_get(obj)); - flip_show_hide(obj); - _configure(obj); - if (wd->intmode != ELM_FLIP_INTERACTION_NONE) - { - for (i = 0; i < 4; i++) evas_object_raise(wd->event[i]); - } + elm_object_part_content_set(obj, NULL, content); } EAPI void elm_flip_content_back_set(Evas_Object *obj, Evas_Object *content) { - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - int i; - if (!wd) return; - if (wd->back.content == content) return; - if (wd->back.content) evas_object_del(wd->back.content); - wd->back.content = content; - if (content) - { - elm_widget_sub_object_add(obj, content); - evas_object_smart_member_add(content, obj); - evas_object_clip_set(content, wd->back.clip); - evas_object_event_callback_add(content, - EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - _sizing_eval(obj); - } - // force calc to contents are the right size before transition - evas_smart_objects_calculate(evas_object_evas_get(obj)); - flip_show_hide(obj); - _configure(obj); - if (wd->intmode != ELM_FLIP_INTERACTION_NONE) - { - for (i = 0; i < 4; i++) evas_object_raise(wd->event[i]); - } + elm_object_part_content_set(obj, "back", content); } EAPI Evas_Object * elm_flip_content_front_get(const Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - return wd->front.content; + return elm_object_part_content_get(obj, NULL); } - EAPI Evas_Object * elm_flip_content_back_get(const Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - return wd->back.content; + return elm_object_part_content_get(obj, "back"); } EAPI Evas_Object * elm_flip_content_front_unset(Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - if (!wd->front.content) return NULL; - Evas_Object *content = wd->front.content; - evas_object_clip_unset(content); - elm_widget_sub_object_del(obj, content); - evas_object_event_callback_del_full(content, - EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - evas_object_smart_member_del(content); - wd->front.content = NULL; - return content; + return elm_object_part_content_unset(obj, NULL); } EAPI Evas_Object * elm_flip_content_back_unset(Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - if (!wd->back.content) return NULL; - Evas_Object *content = wd->back.content; - evas_object_clip_unset(content); - elm_widget_sub_object_del(obj, content); - evas_object_event_callback_del_full(content, - EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - evas_object_smart_member_del(content); - wd->back.content = NULL; - return content; + return elm_object_part_content_unset(obj, "back"); } EAPI Eina_Bool diff --git a/src/lib/elm_flip.h b/src/lib/elm_flip.h index d63b6bd..a8bb1e5 100644 --- a/src/lib/elm_flip.h +++ b/src/lib/elm_flip.h @@ -18,6 +18,15 @@ * "animate,begin" - when a flip animation was started * "animate,done" - when a flip animation is finished * + * Default contents parts of the filp widget that you can use for are: + * @li "front" - A front content of the flip + * @li "back" - A back content of the flip + * + * Supported elm_object common APIs. + * @li elm_object_part_content_set + * @li elm_object_part_content_get + * @li elm_object_part_content_unset + * * @ref tutorial_flip show how to use most of the API. * * @{ @@ -62,69 +71,6 @@ typedef enum */ EAPI Evas_Object *elm_flip_add(Evas_Object *parent); -/** - * @brief Set the front content of the flip widget. - * - * @param obj The flip object - * @param content The new front content object - * - * 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_flip_content_front_unset() function. - */ -EAPI void elm_flip_content_front_set(Evas_Object *obj, Evas_Object *content); - -/** - * @brief Set the back content of the flip widget. - * - * @param obj The flip object - * @param content The new back content object - * - * 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_flip_content_back_unset() function. - */ -EAPI void elm_flip_content_back_set(Evas_Object *obj, Evas_Object *content); - -/** - * @brief Get the front content used for the flip - * - * @param obj The flip object - * @return The front content object that is being used - * - * Return the front content object which is set for this widget. - */ -EAPI Evas_Object *elm_flip_content_front_get(const Evas_Object *obj); - -/** - * @brief Get the back content used for the flip - * - * @param obj The flip object - * @return The back content object that is being used - * - * Return the back content object which is set for this widget. - */ -EAPI Evas_Object *elm_flip_content_back_get(const Evas_Object *obj); - -/** - * @brief Unset the front content used for the flip - * - * @param obj The flip object - * @return The front content object that was being used - * - * Unparent and return the front content object which was set for this widget. - */ -EAPI Evas_Object *elm_flip_content_front_unset(Evas_Object *obj); - -/** - * @brief Unset the back content used for the flip - * - * @param obj The flip object - * @return The back content object that was being used - * - * Unparent and return the back content object which was set for this widget. - */ -EAPI Evas_Object *elm_flip_content_back_unset(Evas_Object *obj); /** * @brief Get flip front visibility state