/** * @brief Positive test case of elm_nocontents_custom_set() */ static void utc_UIFW_elm_nocontents_custom_set_func_01(void) { Evas_Object *no_contents = NULL; Evas_Object *custom_area,*btn , *icon; Evas_Object *custom; char buf[255] = {0,}; no_contents = elm_nocontents_add(main_win); evas_object_show(no_contents); custom_area = elm_layout_add (main_win); elm_layout_file_set (custom_area, NULL, "winset-test/nocontents/search_google"); elm_nocontents_custom_set(no_contents,custom_area); btn = elm_button_add (main_win); icon = elm_icon_add (main_win); snprintf (buf, sizeof(buf), "%s/30_SmartSearch_google_icon.png", PKG_DATA_DIR); elm_icon_file_set (icon, buf, NULL); elm_icon_scale_set (icon, 1, 1); elm_button_icon_set (btn, icon); elm_layout_content_set (custom_area, "buttons", btn); custom = elm_nocontents_custom_get(no_contents); if (!custom) { tet_infoline("elm_nocontents_custom_set() failed in positive test case"); tet_result(TET_FAIL); return; } tet_result(TET_PASS); }
/** * @brief Positive test case of elm_popup_title_icon_set() */ static void utc_UIFW_elm_popup_title_icon_set_func_01(void) { Evas_Object *icon = elm_icon_add(popup); snprintf(buf, sizeof(buf), "%s/logo_small.png", ICON_DIR); elm_icon_file_set(icon, buf, NULL); evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); elm_icon_scale_set(icon, 1, 1); elm_popup_title_icon_set(popup,icon); tet_result(TET_PASS); }
/** * @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); }
static void bs_service_ctrl_btn_add (const char *icon, const char *part, void (*cb) (void *data, Evas_Object *obj, void *ev)) { Evas_Object *layout, *ic, *bt; layout = elm_layout_add(enna->layout); ic = elm_icon_add(layout); elm_icon_file_set(ic, enna_config_theme_get(), icon); elm_icon_scale_set(ic, 0, 0); evas_object_show(ic); bt = elm_button_add(layout); evas_object_smart_callback_add(bt, "clicked", cb, NULL); elm_button_icon_set(bt, ic); elm_object_style_set(bt, "mediaplayer"); evas_object_size_hint_weight_set(bt, 0.0, 1.0); evas_object_size_hint_align_set(bt, 0.5, 0.5); evas_object_show(bt); elm_layout_content_set(mod->o_layout, part, bt); }
void vm_info_cb(void *data, Evas_Object *obj, void *event_info) { Elm_Genlist_Item *gl; vmitem *item; zrpc_vm *vm; const char *os_icon, *state; char tmp[PATH_MAX]; Eina_List *l; zrpc_disk *d; zrpc_vif *v; int cpus; elm_toolbar_item_unselect_all(win->main_vm->bar); gl = elm_genlist_selected_item_get(win->main_vm->list); if (!gl) return; ecore_timer_del(win->timerget); item = (vmitem*)elm_genlist_item_data_get(gl); vm = item->vm; win->info->vmuuid = eina_stringshare_ref(vm->uuid); evas_object_smart_callback_del(win->main_vm->list, "clicked", vm_info_cb); create_info_vm(); win->info->state = NULL; zinfo_job_updatevm(win); for (cpus = 0;cpus < vm->vcpus;cpus++) { win->info->cpus = elm_icon_add(win->win); elm_icon_file_set(win->info->cpus, "images/cpu.png", NULL); elm_icon_scale_set(win->info->cpus, 0, 0); elm_icon_smooth_set(win->info->cpus, 1); evas_object_size_hint_weight_set(win->info->state_icon, 0.0, 0.0); evas_object_size_hint_align_set(win->info->state_icon, 0.0, 1.0); elm_box_pack_after(win->info->vbox2, win->info->cpus, win->info->state_label); evas_object_show(win->info->cpus); } elm_frame_label_set(win->info->frame, vm->name); os_icon = get_os_icon(vm); elm_icon_file_set(win->info->os_icon, os_icon, NULL); eina_stringshare_del(os_icon); elm_label_label_set(win->info->os, vm->os); elm_label_label_set (win->info->uuid, vm->uuid); elm_label_label_set(win->info->puuid, vm->puuid); EINA_LIST_FOREACH(vm->disks, l, d) elm_hoversel_item_add(win->info->disks, d->ext_dev, NULL, ELM_ICON_NONE, NULL, d); state = get_state_icon(vm->state); elm_icon_file_set(win->info->state_icon, state, NULL); eina_stringshare_del(state); EINA_LIST_FOREACH(vm->vifs, l, v) elm_hoversel_item_add(win->info->vifs, v->name, NULL, ELM_ICON_NONE, NULL, v); sprintf(tmp, "Kernel: %s", vm->kernel); elm_label_label_set(win->info->kernel, tmp); sprintf(tmp, "Ramdisk: %s", vm->ramdisk); elm_label_label_set(win->info->ramdisk, tmp); sprintf(tmp, "Kernel args: %s", vm->cmdline); elm_label_label_set(win->info->cmdline, tmp); evas_object_key_ungrab(win->win, "Up", 0, 0); evas_object_key_ungrab(win->win, "Down", 0, 0); evas_object_key_ungrab(win->win, "Left", 0, 0); evas_object_key_ungrab(win->win, "Right", 0, 0); evas_object_key_ungrab(win->win, "Home", 0, 0); evas_object_key_ungrab(win->win, "End", 0, 0); elm_flip_content_back_set(win->main_vm->fl, win->info->frame); win->view = win->info->vmview; elm_flip_go(win->main_vm->fl, ELM_FLIP_ROTATE_X_CENTER_AXIS); EINA_LIST_FREE(win->elist, item) free_vmitem(item); win->elist = NULL; eina_list_free(win->list); win->list = NULL; evas_object_hide(win->main_vm->box2); evas_object_del(win->main_vm->box2); win->timerget = ecore_timer_add(5, zinfo_job_updatevm, NULL); }