END_TEST START_TEST(edje_test_masking) { int x, y, w, h; Evas *evas = EDJE_TEST_INIT_EVAS(); const Evas_Object *sub, *clip2, *clip; Evas_Object *obj; Eina_Bool b; obj = edje_object_add(evas); fail_unless(edje_object_file_set(obj, test_layout_get("test_masking.edj"), "test_group")); evas_object_resize(obj, 100, 100); edje_object_part_geometry_get(obj, "background", &x, &y, &w, &h); fail_if(x != 0 || y != 0 || w != 100 || h != 100); clip = edje_object_part_object_get(obj, "clip2"); fail_if(!clip); /* check value of no_render flag as seen from evas land */ sub = edje_object_part_object_get(obj, "mask"); fail_if(!eo_do_ret(sub, b, evas_obj_no_render_get())); /* check that text has a clip (based on description.clip_to) */ sub = edje_object_part_object_get(obj, "text"); fail_if(!eo_do_ret(sub, clip2, evas_obj_clip_get())); /* test description.clip_to override */ sub = edje_object_part_object_get(obj, "noclip"); clip2 = eo_do_ret(sub, clip2, evas_obj_clip_get()); fail_if(clip != clip2); EDJE_TEST_FREE_EVAS(); }
END_TEST START_TEST(edje_test_filters) { Evas *evas = EDJE_TEST_INIT_EVAS(); const Evas_Object *text, *sub; Evas_Object *obj, *src = NULL; const char *prg, *name; Eina_Bool b; obj = edje_object_add(evas); fail_unless(edje_object_file_set(obj, test_layout_get("test_filters.edj"), "test_group")); evas_object_resize(obj, 200, 200); /* check value of no_render flag as seen from evas land */ sub = edje_object_part_object_get(obj, "mask"); fail_if(!eo_do_ret(sub, b, evas_obj_no_render_get())); /* text part: check filter status */ text = edje_object_part_object_get(obj, "text"); fail_if(!text); eo_do(text, efl_gfx_filter_program_get(&prg, &name)); fail_if(!prg); fail_if(!name || strcmp(name, "filterfile")); eo_do(text, efl_gfx_filter_source_get("mask", &src)); fail_if(!src); // TODO: Verify properly that the filter runs well EDJE_TEST_FREE_EVAS(); }
/* Updates the position of the cursor * It also updates automatically the text position and the selection */ static void _e_editable_cursor_update(Evas_Object *editable) { E_Editable_Smart_Data *sd; const Evas_Object *text_obj; Evas_Coord tx, ty; Evas_Coord cx, cy, ch; if ((!editable) || (!(sd = evas_object_smart_data_get(editable)))) return; if (!(text_obj = edje_object_part_object_get(sd->text_object, "e.text.text"))) return; evas_object_geometry_get(text_obj, &tx, &ty, NULL, NULL); _e_editable_char_geometry_get_from_pos(editable, sd->cursor_pos, &cx, &cy, NULL, &ch); evas_object_move(sd->cursor_object, tx + cx, ty + cy); evas_object_resize(sd->cursor_object, sd->cursor_width, ch); if (sd->cursor_visible && evas_object_visible_get(editable)) { evas_object_show(sd->cursor_object); edje_object_signal_emit(sd->cursor_object, "e,action,show,cursor", "e"); } _e_editable_selection_update(editable); _e_editable_text_position_update(editable, -1); }
END_TEST START_TEST(edje_test_simple_layout_geometry) { int x, y, w, h; int r, g, b, a; Evas *evas = EDJE_TEST_INIT_EVAS(); Evas_Object *obj, *bg; obj = edje_object_add(evas); fail_unless(edje_object_file_set(obj, test_layout_get("test_layout.edj"), "test_group")); /* rel1.relative: 0.0 0.0; * rel2.relative: 1.0 1.0; */ evas_object_resize(obj, 1000, 1000); edje_object_part_geometry_get(obj, "background", &x, &y, &w, &h); fail_if(x != 0 || y != 0); fail_if(w != 1000 || h != 1000); bg = edje_object_part_object_get(obj, "background"); fail_if(!bg); evas_object_color_get(bg, &r, &g, &b, &a); fail_if(r != 255 || g != 255 || b != 255 || a != 255); EDJE_TEST_FREE_EVAS(); }
Evas_Object * flickr_menu_new(Evas_Object *edje) { Evas_Object *bt = (Evas_Object *) edje_object_part_object_get(edje, "object.flickr"); evas_object_smart_callback_add(bt, "clicked", _menu_open_cb, edje); return bt; }
/** * Gets the cursor position at the coords ( @a x, @a y ). It's used to know * where to place the cursor or the selection bound on mouse evevents. * * @param editable an editable object * @param x the x coord, relative to the editable object * @param y the y coord, relative to the editable object * @return Returns the position where to place the cursor according to the * given coords */ EAPI int e_editable_pos_get_from_coords(Evas_Object *editable, Evas_Coord x, Evas_Coord y) { E_Editable_Smart_Data *sd; const Evas_Object *text_obj; Evas_Coord ox, oy; Evas_Coord tx, ty, tw, th; Evas_Coord cx, cw; Evas_Coord canvas_x, canvas_y; int index, pos, i, j; const char *text; if (evas_object_smart_smart_get(editable) != _e_editable_smart) SMARTERR(0); if ((!editable) || (!(sd = evas_object_smart_data_get(editable)))) return 0; if (!(text_obj = edje_object_part_object_get(sd->text_object, "e.text.text"))) return 0; evas_object_geometry_get(editable, &ox, &oy, NULL, NULL); evas_object_geometry_get(text_obj, &tx, &ty, &tw, &th); canvas_x = ox + x; canvas_y = oy + y; if ((canvas_y < ty) || (canvas_x < tx)) pos = 0; else if ((canvas_y > (ty + th)) || (canvas_x > (tx + tw))) pos = sd->unicode_length; else { index = evas_object_text_char_coords_get(text_obj, canvas_x - tx, canvas_y - ty, &cx, NULL, &cw, NULL); text = evas_object_text_text_get(text_obj); if ((index >= 0) && (text)) { if ((canvas_x - tx) > (cx + (cw / 2))) index++; i = 0; j = -1; pos = 0; while ((i < index) && (j != i)) { pos++; j = i; i = evas_string_char_next_get(text, i, NULL); } if (pos > sd->unicode_length) pos = sd->unicode_length; } else pos = 0; } return pos; }
/* Gets the geometry of the char according to its utf-8 pos */ static int _e_editable_char_geometry_get_from_pos(Evas_Object *editable, int utf_pos, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) { E_Editable_Smart_Data *sd; const Evas_Object *text_obj; const char *text; Evas_Coord x, w; int index = 0, i, last_pos, ret; if (cx) *cx = 0; if (cy) *cy = 0; if (cw) *cw = 0; if (ch) *ch = 0; if ((!editable) || (!(sd = evas_object_smart_data_get(editable)))) return 0; if (!(text_obj = edje_object_part_object_get(sd->text_object, "e.text.text"))) return 0; text = evas_object_text_text_get(text_obj); if ((!text) || (sd->unicode_length <= 0) || (utf_pos <= 0)) { e_editable_char_size_get(editable, cw, ch); return 1; } else { if (utf_pos >= sd->unicode_length) { utf_pos = sd->unicode_length - 1; last_pos = 1; } else last_pos = 0; for (i = 0; i < utf_pos; i++) index = evas_string_char_next_get(text, index, NULL); ret = evas_object_text_char_pos_get(text_obj, index, &x, cy, &w, ch); if (cx) *cx = x - 1 + (last_pos ? w : 0); if (cw) *cw = last_pos ? 1 : w; return ret; } }
/** * A utility function to get the average size of a character written inside * the editable object * * @param editable an editable object * @param w the location where to store the average width of a character * @param h the location where to store the average height of a character */ EAPI void e_editable_char_size_get(Evas_Object *editable, int *w, int *h) { int tw = 0, th = 0; Evas *evas; const Evas_Object *text_obj; Evas_Object *obj; E_Editable_Smart_Data *sd; char *text = "Tout est bon dans l'abricot sauf le noyau!" "Wakey wakey! Eggs and Bakey!"; const char *font, *font_source; Evas_Text_Style_Type style; int font_size; if (w) *w = 0; if (h) *h = 0; if (evas_object_smart_smart_get(editable) != _e_editable_smart) SMARTERRNR(); if ((!editable) || (!(evas = evas_object_evas_get(editable)))) return; if (!(sd = evas_object_smart_data_get(editable))) return; if (!(text_obj = edje_object_part_object_get(sd->text_object, "e.text.text"))) return; if ((sd->average_char_w <= 0) || (sd->average_char_h <= 0)) { font_source = evas_object_text_font_source_get(text_obj); evas_object_text_font_get(text_obj, &font, &font_size); style = evas_object_text_style_get(text_obj); obj = evas_object_text_add(evas); evas_object_scale_set(obj, edje_scale_get()); evas_object_text_font_source_set(obj, font_source); evas_object_text_font_set(obj, font, font_size); evas_object_text_style_set(obj, style); evas_object_text_text_set(obj, text); evas_object_geometry_get(obj, NULL, NULL, &tw, &th); evas_object_del(obj); sd->average_char_w = (tw / strlen(text)); sd->average_char_h = th; } if (w) *w = sd->average_char_w; if (h) *h = sd->average_char_h; }
/* Updates the selection of the editable object */ static void _e_editable_selection_update(Evas_Object *editable) { E_Editable_Smart_Data *sd; const Evas_Object *text_obj; Evas_Coord tx, ty; Evas_Coord cx, cy; Evas_Coord sx, sy, sw, sh; int start_pos, end_pos; if ((!editable) || (!(sd = evas_object_smart_data_get(editable)))) return; if (!(text_obj = edje_object_part_object_get(sd->text_object, "e.text.text"))) return; if ((sd->cursor_pos == sd->selection_pos) || (!sd->selection_visible)) evas_object_hide(sd->selection_object); else { evas_object_geometry_get(text_obj, &tx, &ty, NULL, NULL); start_pos = (sd->cursor_pos <= sd->selection_pos) ? sd->cursor_pos : sd->selection_pos; end_pos = (sd->cursor_pos >= sd->selection_pos) ? sd->cursor_pos : sd->selection_pos; _e_editable_char_geometry_get_from_pos(editable, start_pos, &cx, &cy, NULL, NULL); sx = tx + cx; sy = ty + cy; _e_editable_char_geometry_get_from_pos(editable, end_pos, &cx, NULL, NULL, &sh); sw = tx + cx - sx; evas_object_move(sd->selection_object, sx, sy); evas_object_resize(sd->selection_object, sw, sh); evas_object_show(sd->selection_object); } }
static inline void _get_pos(UI *ui, Evas_Coord_Point *coord, float *dx, float *dz, float *dw) { Evas_Coord x, y, w, h; Evas_Object *edj = elm_layout_edje_get(ui->theme); const Evas_Object *canvas = edje_object_part_object_get(edj, "canvas"); evas_object_geometry_get(canvas, &x, &y, &w, &h); *dx = (coord->x - x) / (float)w; *dz = (coord->y - y) / (float)h; if(*dx < 0.f) *dx = 0.f; if(*dx > 1.f) *dx = 1.f; if(*dz < 0.f) *dz = 0.f; if(*dz > 1.f) *dz = 1.f; *dw = 4.f / (float)w; }
int main(int argc, char *argv[]) { app_t app; int i; Evas_Object *o; ecore_init(); ecore_app_args_set(argc, (const char **)argv); ecore_evas_init(); edje_init(); edje_frametime_set(1.0 / 30.0); memset(&app, 0, sizeof(app)); app.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, WIDTH, HEIGHT); ecore_evas_data_set(app.ee, "app", &app); ecore_evas_title_set(app.ee, TITLE); ecore_evas_name_class_set(app.ee, WM_NAME, WM_CLASS); app.theme = THEME; for (i=1; i < argc; i++) if (strcmp (argv[i], "-fs") == 0) ecore_evas_fullscreen_set(app.ee, 1); else if (strncmp (argv[i], "-theme=", sizeof("-theme=") - 1) == 0) app.theme = argv[i] + sizeof("-theme=") - 1; else if (argv[i][0] != '-') app.infile = argv[i]; app.evas = ecore_evas_get(app.ee); app.edje_main = edje_object_add(app.evas); evas_data_attach_set(app.evas, &app); if (!edje_object_file_set(app.edje_main, app.theme, THEME_GROUP)) { fprintf(stderr, "Failed to load file \"%s\", part \"%s\".\n", app.theme, THEME_GROUP); return 1; } evas_object_move(app.edje_main, 0, 0); evas_object_resize(app.edje_main, WIDTH, HEIGHT); app.e_box = e_box_add(app.evas); e_box_orientation_set(app.e_box, 0); e_box_homogenous_set(app.e_box, 0); e_box_align_set(app.e_box, 0.0, 0.5); edje_object_part_swallow(app.edje_main, "contents_swallow", app.e_box); evas_object_show(app.edje_main); evas_object_show(app.e_box); ecore_evas_show(app.ee); _populate(&app); app.scroll.initial_delay_ms = 750; app.scroll.accel_ms = 600; setup_gui_list(&app); ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, app_signal_exit, NULL); ecore_evas_callback_resize_set(app.ee, resize_cb); evas_object_event_callback_add(app.edje_main, EVAS_CALLBACK_KEY_DOWN, key_down, &app); evas_object_focus_set(app.edje_main, 1); o = edje_object_part_object_get(app.edje_main, "back_button"); evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, mouse_down_back_button, &app); ecore_main_loop_begin(); return 0; }
static void setup_gui_list(app_t *app) { Evas_Object *obj; int item_w, item_h, box_w, box_h, i, n_items; destroy_gui_list(app); obj = _new_list_item(app, NULL); edje_object_size_min_calc(obj, &item_w, &item_h); evas_object_del(obj); app->item_height = item_h; e_box_freeze(app->e_box); evas_object_geometry_get(app->e_box, &app->box_x, &app->box_y, &box_w, &box_h); app->box_y -= item_h; evas_object_move(app->e_box, app->box_x, app->box_y); n_items = box_h / item_h + 3; app->n_evas_items = n_items; app->evas_items = malloc(n_items * sizeof(Evas_Object *)); for (i = 0; i < n_items; i++) { Evas_Object *obj; obj = _new_list_item(app, ""); app->evas_items[i] = obj; e_box_pack_end(app->e_box, obj); edje_object_size_min_calc(obj, &item_w, &item_h); e_box_pack_options_set(obj, 1, 1, 1, 0, 0.0, 0.5, item_w, item_h, 9999, item_h); evas_object_show(obj); } e_box_align_set(app->e_box, 0.0, 1.0); app->arrow_down = edje_object_part_object_get(app->edje_main, "arrow_down"); app->arrow_up = edje_object_part_object_get(app->edje_main, "arrow_up"); evas_object_event_callback_add(app->arrow_up, EVAS_CALLBACK_MOUSE_DOWN, mouse_down_arrow_up, app); evas_object_event_callback_add(app->arrow_up, EVAS_CALLBACK_MOUSE_UP, mouse_up_arrow_up, app); evas_object_event_callback_add(app->arrow_down, EVAS_CALLBACK_MOUSE_DOWN, mouse_down_arrow_down, app); evas_object_event_callback_add(app->arrow_down, EVAS_CALLBACK_MOUSE_UP, mouse_up_arrow_down, app); fill_gui_list(app); e_box_thaw(app->e_box); }
int main(int argc, char *argv[]) { app_t app; int i; char *engine = "x11-16"; ecore_init(); ecore_app_args_set(argc, (const char **)argv); ecore_evas_init(); edje_init(); edje_frametime_set(1.0 / 30.0); memset(&app, 0, sizeof(app)); app.theme = THEME; app.fs = 1; app.total_ms = 1000; app.fade_in = 1; for (i=1; i < argc; i++) if (strcmp (argv[i], "-fs") == 0) ecore_evas_fullscreen_set(app.ee, 1); else if (strncmp (argv[i], "-theme=", sizeof("-theme=") - 1) == 0) app.theme = argv[i] + sizeof("-theme=") - 1; else if (strncmp (argv[i], "-time=", sizeof("-time=") - 1) == 0) app.total_ms = atoi(argv[i] + sizeof("-time=") - 1); else if (strncmp (argv[i], "-engine=", sizeof("-engine=") - 1) == 0) engine = argv[i] + sizeof("-engine=") - 1; if (app.total_ms < 1) app.total_ms = 1000; app.ee = init_ecore_evas(engine); if (!app.ee) { fprintf(stderr, "Could not init engine '%s'.\n", engine); return 1; } ecore_evas_data_set(app.ee, "app", &app); ecore_evas_title_set(app.ee, TITLE); ecore_evas_name_class_set(app.ee, WM_NAME, WM_CLASS); ecore_evas_fullscreen_set(app.ee, app.fs); fprintf(stderr, "time to fade: %dms\n", app.total_ms); app.evas = ecore_evas_get(app.ee); app.edje_main = edje_object_add(app.evas); evas_data_attach_set(app.evas, &app); if (!edje_object_file_set(app.edje_main, app.theme, THEME_GROUP)) { fprintf(stderr, "Failed to load file \"%s\", part \"%s\".\n", app.theme, THEME_GROUP); return 1; } app.obj = edje_object_part_object_get(app.edje_main, "obj"); evas_object_move(app.edje_main, 0, 0); evas_object_resize(app.edje_main, WIDTH, HEIGHT); evas_object_show(app.edje_main); ecore_evas_show(app.ee); ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, app_signal_exit, NULL); ecore_evas_callback_resize_set(app.ee, resize_cb); evas_object_event_callback_add(app.edje_main, EVAS_CALLBACK_KEY_DOWN, key_down, &app); evas_object_focus_set(app.edje_main, 1); gettimeofday(&app.start, NULL); app.anim = ecore_animator_add(do_anim, &app); ecore_main_loop_begin(); return 0; }
void utils_slide_delete(List_Item *item) { int i = 0; Eina_List *l; List_Item *_item; EINA_LIST_FOREACH(l_slides, l, _item) { if(item == _item) break; else i++; } Evas_Object *lbl, *tb, *bt, *icon; char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "%s/theme.edj", PACKAGE_DATA_DIR); _inwin_delete_slide = elm_win_inwin_add(win); evas_object_show(_inwin_delete_slide); elm_object_style_set(_inwin_delete_slide, "minimal"); tb = elm_table_add(win); elm_win_inwin_content_set(_inwin_delete_slide, tb); //icon icon = edje_object_add(evas_object_evas_get(win)); edje_object_file_set(icon, buf, "list/slides/icon"); evas_object_size_hint_min_set(icon,1024*0.20,768*0.20); evas_object_size_hint_max_set(icon,1024*0.20,768*0.20); if(item->thumb) { int w = item->thumb->w; int h = item->thumb->h; int *image = calloc(w*h, sizeof(int)); memcpy(image, item->thumb->thumb, sizeof(int)*w*h); const Evas_Object *o_image = edje_object_part_object_get(icon, "object.icon"); evas_object_image_filled_set((Evas_Object*)o_image,1); evas_object_color_set((Evas_Object*)o_image,255,255,255,255); evas_object_image_size_set((Evas_Object*)o_image, w, h); evas_object_image_data_set((Evas_Object*)o_image, image); edje_object_signal_emit(icon, "icon,show", "eyelight"); } evas_object_show(icon); elm_table_pack(tb, icon, 0, 0, 2, 1); // bt= elm_button_add(win); elm_object_text_set(bt, "Invisible button to add a vertical space"); elm_table_pack(tb, bt, 0, 1, 1, 1); lbl = elm_label_add(win); elm_object_text_set(lbl, D_("Are you sure you want to delete this slide ?")); elm_table_pack(tb, lbl, 0, 2, 2, 1); evas_object_show(lbl); bt= elm_button_add(win); elm_object_text_set(bt, "Invisible button to add a vertical space"); elm_table_pack(tb, bt, 0, 3, 1, 1); bt= elm_button_add(win); elm_object_text_set(bt, D_("Yes, Delete the slide")); evas_object_smart_callback_add(bt, "clicked", _utils_slide_delete_cb, item); evas_object_color_set(bt, 255, 0, 0, 255); elm_table_pack(tb, bt, 0, 4, 1, 1); evas_object_show(bt); bt= elm_button_add(win); elm_object_text_set(bt, D_("No, do not delete the slide")); evas_object_smart_callback_add(bt, "clicked", _utils_slide_delete_cancel_cb, item); elm_table_pack(tb, bt, 1, 4, 1, 1); evas_object_show(bt); }
void eyelight_edit_image_properties_set(Eyelight_Viewer *pres, Eyelight_Edit *edit, char *file, int border, int shadow, int keep_aspect) { Eyelight_Node *node; char buf[EYELIGHT_BUFLEN]; EYELIGHT_ASSERT_RETURN_VOID(!!edit); EYELIGHT_ASSERT_RETURN_VOID(edit->node->name == EYELIGHT_NAME_IMAGE); if(edit->node->type == EYELIGHT_NODE_TYPE_PROP) { //change the prop into a block char *_file = strdup(eyelight_retrieve_value_of_prop(edit->node, 0)); edit->node->type = EYELIGHT_NODE_TYPE_BLOCK; Eyelight_Node *node_image_value = eina_list_nth(edit->node->l, 0); edit->node->l = eina_list_remove(edit->node->l, node_image_value); eyelight_node_free( &node_image_value, NULL ); Eyelight_Node *node_image = eyelight_node_new(EYELIGHT_NODE_TYPE_PROP, EYELIGHT_NAME_IMAGE, edit->node); Eyelight_Node *node_value = eyelight_node_new(EYELIGHT_NODE_TYPE_VALUE, EYELIGHT_NAME_NAME, node_image); node_value->value = _file; } if(file) { node = eyelight_retrieve_node_prop(edit->node, EYELIGHT_NAME_IMAGE); if(node) { node = eina_list_nth(node->l, 0); EYELIGHT_FREE(node->value); node->value = strdup(file); } else { node = eyelight_node_new(EYELIGHT_NODE_TYPE_PROP, EYELIGHT_NAME_IMAGE, edit->node); node = eyelight_node_new(EYELIGHT_NODE_TYPE_VALUE, EYELIGHT_NAME_NONE, node); node->value = strdup(file); } const Evas_Object *part_image = edje_object_part_object_get(edit->obj, "object.image"); char *image_path = eyelight_compile_image_path_new(pres,file); evas_object_image_file_set((Evas_Object*)part_image, image_path, NULL); EYELIGHT_FREE(image_path); } if(border > -1) { snprintf(buf, EYELIGHT_BUFLEN, "%d",border); node = eyelight_retrieve_node_prop(edit->node, EYELIGHT_NAME_BORDER); if(node) { node = eina_list_nth(node->l, 0); EYELIGHT_FREE(node->value); node->value = strdup(buf); } else { node = eyelight_node_new(EYELIGHT_NODE_TYPE_PROP, EYELIGHT_NAME_BORDER, edit->node); node = eyelight_node_new(EYELIGHT_NODE_TYPE_VALUE, EYELIGHT_NAME_NONE, node); node->value = strdup(buf); } if(border) edje_object_signal_emit(edit->obj, "border,show","eyelight"); else edje_object_signal_emit(edit->obj, "border,hide","eyelight"); } if(shadow > -1) { snprintf(buf, EYELIGHT_BUFLEN, "%d",shadow); node = eyelight_retrieve_node_prop(edit->node, EYELIGHT_NAME_SHADOW); if(node) { node = eina_list_nth(node->l, 0); EYELIGHT_FREE(node->value); node->value = strdup(buf); } else { node = eyelight_node_new(EYELIGHT_NODE_TYPE_PROP, EYELIGHT_NAME_SHADOW, edit->node); node = eyelight_node_new(EYELIGHT_NODE_TYPE_VALUE, EYELIGHT_NAME_NONE, node); node->value = strdup(buf); } if(shadow) edje_object_signal_emit(edit->obj, "shadow,show","eyelight"); else edje_object_signal_emit(edit->obj, "shadow,hide","eyelight"); } if(keep_aspect > -1) { double aspect_x = 0; double aspect_y = 0; snprintf(buf, EYELIGHT_BUFLEN, "%d", keep_aspect); node = eyelight_retrieve_node_prop(edit->node, EYELIGHT_NAME_KEEP_ASPECT); if(node) { node = eina_list_nth(node->l, 0); EYELIGHT_FREE(node->value); node->value = strdup(buf); } else { node = eyelight_node_new(EYELIGHT_NODE_TYPE_PROP, EYELIGHT_NAME_KEEP_ASPECT, edit->node); node = eyelight_node_new(EYELIGHT_NODE_TYPE_VALUE, EYELIGHT_NAME_NONE, node); node->value = strdup(buf); } if(keep_aspect) { Eyelight_Node *node_name = eyelight_retrieve_node_prop(edit->node, EYELIGHT_NAME_IMAGE); const char *file = eyelight_retrieve_value_of_prop(node_name, 0); Evas_Coord w, h; Evas_Object *o = evas_object_image_add(evas_object_evas_get(edit->obj)); char *image_path = eyelight_compile_image_path_new(pres,file); evas_object_image_file_set(o, image_path, NULL); evas_object_image_size_get(o, &w, &h); evas_object_del(o); aspect_x = w/(float)h; aspect_y = 1; EYELIGHT_FREE(image_path); } Edje_Message_Float_Set *msg = alloca(sizeof(Edje_Message_Float_Set) + (1 * sizeof(float))); msg->count = 2; msg->val[0] = aspect_x; msg->val[1] = aspect_y; edje_object_message_send(edit->obj,EDJE_MESSAGE_FLOAT_SET , 0, msg); } }