static void _icon_thumb_finish(Elm_Icon_Smart_Data *sd, Ethumb_Client *ethumbd) { const char *file = NULL, *group = NULL; Eina_Bool ret; elm_image_file_get(ELM_WIDGET_DATA(sd)->obj, &file, &group); file = eina_stringshare_ref(file); group = eina_stringshare_ref(group); ret = _icon_thumb_display(sd); if (!ret && file) { if (!sd->thumb.retry) { _elm_icon_retry = eina_list_append(_elm_icon_retry, sd); sd->thumb.retry = EINA_TRUE; } /* Back to previous image */ elm_image_file_set(ELM_WIDGET_DATA(sd)->obj, file, group); } _icon_thumb_cleanup(ethumbd); eina_stringshare_del(file); eina_stringshare_del(group); }
PREFIX value ml_elm_image_file_get(value v_obj) { CAMLparam0(); CAMLlocal2(v, v1); const char *file, *group; elm_image_file_get(Evas_Object_val(v_obj), &file, &group); v = caml_alloc(2, 0); Store_field(v, 0, copy_string(file)); if(group == NULL) v1 = Val_int(0); else { v1 = caml_alloc(1, 0); Store_field(v1, 0, copy_string(group)); } Store_field(v, 1, v1); CAMLreturn(v); }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *icon; const char *path, *group, *name; win = elm_win_add(NULL, "icon", ELM_WIN_BASIC); elm_win_title_set(win, "Icon"); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_win_autodel_set(win, EINA_TRUE); bg = elm_bg_add(win); elm_bg_color_set(bg, 255,255 ,255); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bg); evas_object_show(bg); icon = elm_icon_add(win); elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO); elm_icon_standard_set(icon, "home"); path = NULL; group = NULL; name = NULL; elm_image_file_get(icon, &path, &group); name = elm_icon_standard_get(icon); printf("path = %s, group = %s, name = %s\n", path, group, name); elm_image_no_scale_set(icon, EINA_TRUE); elm_image_resizable_set(icon, EINA_FALSE, EINA_TRUE); elm_image_smooth_set(icon, EINA_FALSE); elm_image_fill_outside_set(icon, EINA_TRUE); evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, icon); evas_object_show(icon); evas_object_resize(win, 320, 320); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }