/** * @brief Negative test case of ug_init elm_button_icon_get() */ static void utc_UIFW_elm_button_icon_get_func_02(void) { Evas_Object *button = NULL; Evas_Object *icon = NULL; char buff[PATH_MAX]; button = elm_button_add(main_win); icon = elm_icon_add(main_win); snprintf(buff, sizeof(buff), "%s/images/logo_small.png", "/usr/share/elementary"); elm_icon_file_set(icon, buff, NULL); evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); elm_icon_scale_set(icon, EINA_TRUE, EINA_TRUE); elm_button_icon_set(button, icon); if(elm_button_icon_get(NULL) != NULL) { evas_object_del(button); button = NULL; tet_infoline("elm_button_icon_get() failed in negative test case"); tet_result(TET_FAIL); return; } tet_result(TET_PASS); }
int emusic_playlist_ctl_repeat(int mode) { Evas_Object *ic; ic = elm_button_icon_get(sd->repeat_btn); sd->repeat_mode = mode; switch(mode) { case REPEAT_ALL: elm_icon_file_set(ic, emusic_config_theme_get(), "icon/mp_repeat_all"); break; case REPEAT_NONE: elm_icon_file_set(ic, emusic_config_theme_get(), "icon/mp_repeat_off"); break; case REPEAT_CURRENT: elm_icon_file_set(ic, emusic_config_theme_get(), "icon/mp_repeat_once"); break; default: elm_icon_file_set(ic, emusic_config_theme_get(), "icon/mp_repeat_off"); break; } return TRUE; }
static void _button_clicked_shuffle_cb(void *data, Evas_Object *obj, void *event_info) { Evas_Object *ic; Em_Smart_Data *em = data; ic = elm_button_icon_get(sd->shuffle_btn); /* we have no broadcast so We have to do it our self */ if( sd->shuffle_mode == PLAYLIST_CHANGED_SHUFFLE ){ emusic_playlist_sort( NULL, NULL ); elm_icon_file_set(ic, emusic_config_theme_get(), "icon/mp_shuffle_off"); sd->shuffle_mode = PLAYLIST_CHANGED_SORT; } else{ emusic_playlist_shuffle( NULL ); elm_icon_file_set(ic, emusic_config_theme_get(), "icon/mp_shuffle_on"); sd->shuffle_mode = PLAYLIST_CHANGED_SHUFFLE; } }