diff --git a/legacy/edje/src/bin/edje_cc_handlers.c b/legacy/edje/src/bin/edje_cc_handlers.c index 97a4731b39..622a759666 100644 --- a/legacy/edje/src/bin/edje_cc_handlers.c +++ b/legacy/edje/src/bin/edje_cc_handlers.c @@ -154,6 +154,7 @@ static void st_collections_group_parts_part_description_image_normal(void); static void st_collections_group_parts_part_description_image_tween(void); static void st_collections_group_parts_part_description_image_border(void); static void st_collections_group_parts_part_description_image_middle(void); +static void st_collections_group_parts_part_description_image_scale_hint(void); static void st_collections_group_parts_part_description_fill_smooth(void); static void st_collections_group_parts_part_description_fill_origin_relative(void); static void st_collections_group_parts_part_description_fill_origin_offset(void); @@ -349,6 +350,7 @@ New_Statement_Handler statement_handlers[] = {"collections.group.parts.part.description.image.images.image", st_images_image}, /* dup */ {"collections.group.parts.part.description.image.border", st_collections_group_parts_part_description_image_border}, {"collections.group.parts.part.description.image.middle", st_collections_group_parts_part_description_image_middle}, + {"collections.group.parts.part.description.image.scale_hint", st_collections_group_parts_part_description_image_scale_hint}, {"collections.group.parts.part.description.fill.smooth", st_collections_group_parts_part_description_fill_smooth}, {"collections.group.parts.part.description.fill.origin.relative", st_collections_group_parts_part_description_fill_origin_relative}, {"collections.group.parts.part.description.fill.origin.offset", st_collections_group_parts_part_description_fill_origin_offset}, @@ -3901,6 +3903,47 @@ st_collections_group_parts_part_description_image_middle(void) NULL); } +/** + @page edcref + @property + scale_hint + @parameters + 0, NANE, DYNAMIC, STATIC + @effect + Sets the evas image scale hint letting the engine more efectively save + cached copies of the scaled image if it maks sense + @endproperty +*/ +static void +st_collections_group_parts_part_description_image_scale_hint(void) +{ + Edje_Part_Collection *pc; + Edje_Part *ep; + Edje_Part_Description *ed; + + check_arg_count(1); + + pc = eina_list_data_get(eina_list_last(edje_collections)); + ep = eina_list_data_get(eina_list_last(pc->parts)); + + if (ep->type != EDJE_PART_TYPE_IMAGE) + { + fprintf(stderr, "%s: Error. parse error %s:%i. " + "image attributes in non-IMAGE part.\n", + progname, file_in, line - 1); + exit(-1); + } + + ed = ep->default_desc; + if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc)); + ed->image.scale_hint = parse_enum(0, + "NONE", EVAS_IMAGE_SCALE_HINT_NONE, + "DYNAMIC", EVAS_IMAGE_SCALE_HINT_DYNAMIC, + "STATIC", EVAS_IMAGE_SCALE_HINT_STATIC, + "0", EVAS_IMAGE_SCALE_HINT_NONE, + NULL); +} + /** @page edcref @block diff --git a/legacy/edje/src/lib/edje_calc.c b/legacy/edje/src/lib/edje_calc.c index 922e8a6f8d..dda6eba2cb 100644 --- a/legacy/edje/src/lib/edje_calc.c +++ b/legacy/edje/src/lib/edje_calc.c @@ -1270,7 +1270,6 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj evas_object_image_fill_set(ep->object, p3->fill.x, p3->fill.y, p3->fill.w, p3->fill.h); evas_object_image_smooth_scale_set(ep->object, p3->smooth); - evas_object_image_border_set(ep->object, p3->border.l, p3->border.r, p3->border.t, p3->border.b); if (chosen_desc->border.no_fill == 0) @@ -1551,6 +1550,8 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags) { case EDJE_PART_TYPE_RECTANGLE: case EDJE_PART_TYPE_IMAGE: + evas_object_image_scale_hint_set(ep->object, + chosen_desc->image.scale_hint); case EDJE_PART_TYPE_TEXTBLOCK: case EDJE_PART_TYPE_GRADIENT: case EDJE_PART_TYPE_BOX: diff --git a/legacy/edje/src/lib/edje_private.h b/legacy/edje/src/lib/edje_private.h index 6d24e0cda5..b2b14043e1 100644 --- a/legacy/edje/src/lib/edje_private.h +++ b/legacy/edje/src/lib/edje_private.h @@ -524,6 +524,7 @@ struct _Edje_Part_Description struct { Eina_List *tween_list; /* list of Edje_Part_Image_Id */ int id; /* the image id to use */ + int scale_hint; /* evas scale hint */ } image; struct { @@ -581,24 +582,24 @@ struct _Edje_Part_Description unsigned char min_y; /* if text size should be part min size */ unsigned char max_x; /* if text size should be part max size */ unsigned char max_y; /* if text size should be part max size */ - } text; struct { char *layout, *alt_layout; Edje_Alignment align; struct { - int x, y; + int x, y; } padding; struct { - Eina_Bool h, v; + Eina_Bool h, v; } min; } box; + struct { unsigned char homogeneous; Edje_Alignment align; struct { - int x, y; + int x, y; } padding; } table;