From 5a3be0fd8c8077bed5e02230d03f2d447ce2ec75 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 28 Jun 2006 18:31:56 +0000 Subject: [PATCH] zigs patch for edje adding more embryo script power to set state vals SVN revision: 23616 --- legacy/edje/AUTHORS | 1 + legacy/edje/data/include/edje.inc | 28 +- legacy/edje/src/lib/edje_embryo.c | 440 +++++++++++++++++++++++++++-- legacy/edje/src/lib/edje_private.h | 32 ++- legacy/edje/src/lib/edje_text.c | 6 +- 5 files changed, 468 insertions(+), 39 deletions(-) diff --git a/legacy/edje/AUTHORS b/legacy/edje/AUTHORS index 8000783fe1..108b3190ca 100644 --- a/legacy/edje/AUTHORS +++ b/legacy/edje/AUTHORS @@ -1,2 +1,3 @@ The Rasterman (Carsten Haitzler) Tilman Sauerbeck (tilman at code-monkey de) +ZigsMcKenzie diff --git a/legacy/edje/data/include/edje.inc b/legacy/edje/data/include/edje.inc index 4a75dd965d..e0dc9d6150 100644 --- a/legacy/edje/data/include/edje.inc +++ b/legacy/edje/data/include/edje.inc @@ -150,9 +150,31 @@ enum State_Param STATE_MAX = 3, STATE_STEP = 4, STATE_ASPECT = 5, - STATE_COLOR = 6, - STATE_COLOR2 = 7, - STATE_COLOR3 = 8 + STATE_ASPECT_PREF = 6, + STATE_COLOR = 7, + STATE_COLOR2 = 8, + STATE_COLOR3 = 9, + STATE_COLOR_CLASS = 10, + STATE_REL1 = 11, + STATE_REL1_TO = 12, + STATE_REL1_OFFSET = 13, + STATE_REL2 = 14, + STATE_REL2_TO = 15, + STATE_REL2_OFFSET = 16, + STATE_IMAGE = 17, + STATE_BORDER = 18, + STATE_FILL_SMOOTH = 19, + STATE_FILL_POS = 20, + STATE_FILL_SIZE = 21, + STATE_TEXT = 22, + STATE_TEXT_CLASS = 23, + STATE_TEXT_FONT = 24, + STATE_TEXT_STYLE = 25, + STATE_TEXT_SIZE = 26, + STATE_TEXT_FIT = 27, + STATE_TEXT_MIN = 28, + STATE_TEXT_ALIGN = 29, + STATE_VISIBLE = 30 }; native set_state_val(part_id, State_Param:p, ...); diff --git a/legacy/edje/src/lib/edje_embryo.c b/legacy/edje/src/lib/edje_embryo.c index a2f9095021..b4eb41e852 100644 --- a/legacy/edje/src/lib/edje_embryo.c +++ b/legacy/edje/src/lib/edje_embryo.c @@ -134,6 +134,28 @@ * color[r,g,b,a] * color2[r,g,b,a] * color3[r,g,b,a] + * aspect_preference + * rel1[relx,rely] + * rel1[part_id,part_id] + * rel1[offx,offy] + * rel2[relx,relyr] + * rel2[part_id,part_id] + * rel2[offx,offy] + * image[image_id] <- all images have an Id not name in the edje + * border[l,r,t,b] + * fill[smooth] + * fill[pos_relx,pos_rely,pos_offx,pos_offy] + * fill[sz_relx,sz_rely,sz_offx,sz_offy] + * color_class + * text[text] + * text[text_class] + * text[font] + * text[size] + * text[style] + * text[fit_x,fit_y] + * text[min_x,min_y] + * text[align_x,align_y] + * visible * * ** part_id and program_id need to be able to be "found" from strings * @@ -152,27 +174,6 @@ * set_clip(part_id, clip_part_id) * get_clip(part_id) * - * - * Need to implement support for the following properties - * in get/set_state_val(): - * - * aspect_preference - * rel1[relx,rely,part_id,part_id] - * rel1[offx,offy] - * rel2[relx,rely,part_id,part_id] - * rel2[offx,offy] - * image[image_id] <- all images have an Id not name in the edje - * border[l,r,t,b] - * fill[smooth] - * fill[pos_relx,pos_rely,pos_offx,pos_offy] - * fill[sz_relx,sz_rely,sz_offx,sz_offy] - * color_class - * text[text_class] - * text[font] - * text[size] - * text[fit_x,fit_y] - * text[min_x,min_y] - * text[align_x,align_y] * * ADD/DEL CUSTOM OBJECTS UNDER SOLE EMBRYO SCRIPT CONTROL * @@ -187,6 +188,12 @@ ___l = embryo_data_string_length_get(ep, ___cptr); \ if (((str) = alloca(___l + 1))) \ embryo_data_string_get(ep, ___cptr, (str));}} +#define GETSTREVAS(str, par) { \ + if ((str)) { \ + if ((par) && (!strcmp((par), (str)))) return 0; \ + if ((par)) evas_stringshare_del((par)); \ + (par) = (char *)evas_stringshare_add((str)); } \ + else (par) = NULL; } #define GETFLOAT(val, par) { \ float *___cptr; \ if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \ @@ -199,6 +206,18 @@ Embryo_Cell *___cptr; \ if ((___cptr = embryo_data_address_get(ep, (par)))) { \ embryo_data_string_set(ep, str, ___cptr);}} +#define SETSTRALLOCATE(s) { \ + if (s) { \ + if (strlen((s)) < params[4]) { \ + SETSTR((s), params[3]); } \ + else { \ + char *ss; \ + ss = alloca(strlen((s))); \ + strcpy(ss, (s)); \ + ss[params[4] - 2] = 0; \ + SETSTR(ss, params[3]); }} \ + else \ + SETSTR("", params[3]);} #define SETFLOAT(val, par) { \ float *___cptr; \ if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \ @@ -570,7 +589,7 @@ _edje_embryo_fn_replace_float(Embryo_Program *ep, Embryo_Cell *params) CHKPARAM(3); _edje_var_list_nth_float_set(ed, (int) params[1], (int) params[2], - EMBRYO_CELL_TO_FLOAT(params[3])); + EMBRYO_CELL_TO_FLOAT(params[3])); return 0; } @@ -1514,7 +1533,7 @@ _edje_embryo_fn_custom_state(Embryo_Program *ep, Embryo_Cell *params) *d = *parent; - d->state.name = evas_stringshare_add("custom"); + d->state.name = (char *)evas_stringshare_add("custom"); d->state.value = 0.0; /* make sure all the allocated memory is getting copied, @@ -1532,7 +1551,7 @@ _edje_embryo_fn_custom_state(Embryo_Program *ep, Embryo_Cell *params) d->image.tween_list = evas_list_append(d->image.tween_list, iid_new); } -#define DUP(x) x ? evas_stringshare_add(x) : NULL +#define DUP(x) x ? (char *)evas_stringshare_add(x) : NULL d->color_class = DUP(d->color_class); d->text.text = DUP(d->text.text); d->text.text_class = DUP(d->text.text_class); @@ -1551,6 +1570,7 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) { Edje *ed = embryo_program_data_get(ep); Edje_Real_Part *rp; + char *s; /* we need at least 3 arguments */ if (params[0] < (sizeof(Embryo_Cell) * 3)) @@ -1603,7 +1623,13 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) GETFLOAT(rp->custom.description->aspect.max, params[4]); break; - case EDJE_STATE_PARAM_COLOR: + case EDJE_STATE_PARAM_ASPECT_PREF: + CHKPARAM(3); + + GETINT(rp->custom.description->aspect.prefer, params[3]); + + break; + case EDJE_STATE_PARAM_COLOR: CHKPARAM(6); GETINT(rp->custom.description->color.r, params[3]); @@ -1612,7 +1638,7 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) GETINT(rp->custom.description->color.a, params[6]); break; - case EDJE_STATE_PARAM_COLOR2: + case EDJE_STATE_PARAM_COLOR2: CHKPARAM(6); GETINT(rp->custom.description->color2.r, params[3]); @@ -1621,7 +1647,7 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) GETINT(rp->custom.description->color2.a, params[6]); break; - case EDJE_STATE_PARAM_COLOR3: + case EDJE_STATE_PARAM_COLOR3: CHKPARAM(6); GETINT(rp->custom.description->color3.r, params[3]); @@ -1630,10 +1656,189 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) GETINT(rp->custom.description->color3.a, params[6]); break; + case EDJE_STATE_PARAM_COLOR_CLASS: + CHKPARAM(3); + + GETSTR(s, params[3]); + GETSTREVAS(s, rp->custom.description->color_class); + + break; + case EDJE_STATE_PARAM_REL1: + CHKPARAM(4); + + GETFLOAT(rp->custom.description->rel1.relative_x, params[3]); + GETFLOAT(rp->custom.description->rel1.relative_y, params[4]); + + break; + case EDJE_STATE_PARAM_REL1_TO: + CHKPARAM(4); + + GETINT(rp->custom.description->rel1.id_x, params[3]); + GETINT(rp->custom.description->rel1.id_y, params[4]); + + if (rp->param1.description->rel1.id_x >= 0) + rp->param1.rel1_to_x = ed->table_parts[rp->param1.description->rel1.id_x % ed->table_parts_size]; + if (rp->param1.description->rel1.id_y >= 0) + rp->param1.rel1_to_y = ed->table_parts[rp->param1.description->rel1.id_y % ed->table_parts_size]; + + break; + case EDJE_STATE_PARAM_REL1_OFFSET: + CHKPARAM(4); + + GETINT(rp->custom.description->rel1.offset_x, params[3]); + GETINT(rp->custom.description->rel1.offset_y, params[4]); + + break; + case EDJE_STATE_PARAM_REL2: + CHKPARAM(4); + + GETFLOAT(rp->custom.description->rel2.relative_x, params[3]); + GETFLOAT(rp->custom.description->rel2.relative_y, params[4]); + + break; + case EDJE_STATE_PARAM_REL2_TO: + CHKPARAM(4); + + GETINT(rp->custom.description->rel2.id_x, params[3]); + GETINT(rp->custom.description->rel2.id_y, params[4]); + + if (rp->param1.description->rel2.id_x >= 0) + rp->param1.rel2_to_x = ed->table_parts[rp->param1.description->rel2.id_x % ed->table_parts_size]; + if (rp->param1.description->rel2.id_y >= 0) + rp->param1.rel2_to_y = ed->table_parts[rp->param1.description->rel2.id_y % ed->table_parts_size]; + + break; + case EDJE_STATE_PARAM_REL2_OFFSET: + CHKPARAM(4); + + GETINT(rp->custom.description->rel2.offset_x, params[3]); + GETINT(rp->custom.description->rel2.offset_y, params[4]); + + break; + case EDJE_STATE_PARAM_IMAGE: + if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; + CHKPARAM(3); + + GETINT(rp->custom.description->image.id, params[3]); + + break; + case EDJE_STATE_PARAM_BORDER: + if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; + CHKPARAM(6); + + GETINT(rp->custom.description->border.l, params[3]); + GETINT(rp->custom.description->border.r, params[4]); + GETINT(rp->custom.description->border.t, params[5]); + GETINT(rp->custom.description->border.b, params[6]); + + break; + case EDJE_STATE_PARAM_FILL_SMOOTH: + if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; + CHKPARAM(3); + + GETINT(rp->custom.description->fill.smooth, params[3]); + + break; + case EDJE_STATE_PARAM_FILL_POS: + if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; + CHKPARAM(6); + + GETFLOAT(rp->custom.description->fill.pos_rel_x, params[3]); + GETFLOAT(rp->custom.description->fill.pos_rel_y, params[4]); + GETINT(rp->custom.description->fill.pos_abs_x, params[5]); + GETINT(rp->custom.description->fill.pos_abs_y, params[6]); + + break; + case EDJE_STATE_PARAM_FILL_SIZE: + if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; + CHKPARAM(6); + + GETFLOAT(rp->custom.description->fill.rel_x, params[3]); + GETFLOAT(rp->custom.description->fill.rel_y, params[4]); + GETINT(rp->custom.description->fill.abs_x, params[5]); + GETINT(rp->custom.description->fill.abs_y, params[6]); + + break; + case EDJE_STATE_PARAM_TEXT: + if ( (rp->part->type != EDJE_PART_TYPE_TEXT) && \ + (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) + return 0; + CHKPARAM(3); + + GETSTR(s, params[3]); + GETSTREVAS(s, rp->custom.description->text.text); + + break; + case EDJE_STATE_PARAM_TEXT_CLASS: + if ( (rp->part->type != EDJE_PART_TYPE_TEXT) && \ + (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) + return 0; + CHKPARAM(3); + + GETSTR(s, params[3]); + GETSTREVAS(s, rp->custom.description->text.text_class); + + break; + case EDJE_STATE_PARAM_TEXT_FONT: + if ((rp->part->type != EDJE_PART_TYPE_TEXT)) return 0; + CHKPARAM(3); + + GETSTR(s, params[3]); + GETSTREVAS(s, rp->custom.description->text.font); + + break; + case EDJE_STATE_PARAM_TEXT_STYLE: + if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return 0; + CHKPARAM(3); + + GETSTR(s, params[3]); + GETSTREVAS(s, rp->custom.description->text.style); + + break; + case EDJE_STATE_PARAM_TEXT_SIZE: + if ((rp->part->type != EDJE_PART_TYPE_TEXT)) return 0; + CHKPARAM(3); + + GETINT(rp->custom.description->text.size, params[3]); + + break; + case EDJE_STATE_PARAM_TEXT_FIT: + if ((rp->part->type != EDJE_PART_TYPE_TEXT)) return 0; + CHKPARAM(4); + + GETINT(rp->custom.description->text.fit_x, params[3]); + GETINT(rp->custom.description->text.fit_y, params[4]); + + break; + case EDJE_STATE_PARAM_TEXT_MIN: + if ( (rp->part->type != EDJE_PART_TYPE_TEXT) && \ + (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) + return 0; + CHKPARAM(4); + + GETINT(rp->custom.description->text.min_x, params[3]); + GETINT(rp->custom.description->text.min_y, params[4]); + + break; + case EDJE_STATE_PARAM_TEXT_ALIGN: + if ((rp->part->type != EDJE_PART_TYPE_TEXT)) return 0; + CHKPARAM(4); + + GETFLOAT(rp->custom.description->text.align.x, params[3]); + GETFLOAT(rp->custom.description->text.align.y, params[4]); + + break; + case EDJE_STATE_PARAM_VISIBLE: + CHKPARAM(3); + + GETINT(rp->custom.description->visible, params[3]); + + break; default: break; } + ed->dirty=1; return 0; } @@ -1643,6 +1848,7 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params) { Edje *ed = embryo_program_data_get(ep); Edje_Real_Part *rp; + char *s; /* we need at least 3 arguments */ if (params[0] < (sizeof(Embryo_Cell) * 3)) @@ -1695,7 +1901,13 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params) SETFLOAT(rp->custom.description->aspect.max, params[4]); break; - case EDJE_STATE_PARAM_COLOR: + case EDJE_STATE_PARAM_ASPECT_PREF: + CHKPARAM(3); + + SETINT(rp->custom.description->aspect.prefer, params[3]); + + break; + case EDJE_STATE_PARAM_COLOR: CHKPARAM(6); SETINT(rp->custom.description->color.r, params[3]); @@ -1704,7 +1916,7 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params) SETINT(rp->custom.description->color.a, params[6]); break; - case EDJE_STATE_PARAM_COLOR2: + case EDJE_STATE_PARAM_COLOR2: CHKPARAM(6); SETINT(rp->custom.description->color2.r, params[3]); @@ -1713,7 +1925,7 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params) SETINT(rp->custom.description->color2.a, params[6]); break; - case EDJE_STATE_PARAM_COLOR3: + case EDJE_STATE_PARAM_COLOR3: CHKPARAM(6); SETINT(rp->custom.description->color3.r, params[3]); @@ -1721,6 +1933,174 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params) SETINT(rp->custom.description->color3.b, params[5]); SETINT(rp->custom.description->color3.a, params[6]); + break; + case EDJE_STATE_PARAM_COLOR_CLASS: + CHKPARAM(4); + + s = rp->custom.description->color_class; + SETSTRALLOCATE(s); + + break; + case EDJE_STATE_PARAM_REL1: + CHKPARAM(4); + + SETFLOAT(rp->custom.description->rel1.relative_x, params[3]); + SETFLOAT(rp->custom.description->rel1.relative_y, params[4]); + + break; + case EDJE_STATE_PARAM_REL1_TO: + CHKPARAM(4); + + SETINT(rp->custom.description->rel1.id_x, params[3]); + SETINT(rp->custom.description->rel1.id_y, params[4]); + + break; + case EDJE_STATE_PARAM_REL1_OFFSET: + CHKPARAM(4); + + SETINT(rp->custom.description->rel1.offset_x, params[3]); + SETINT(rp->custom.description->rel1.offset_y, params[4]); + + break; + case EDJE_STATE_PARAM_REL2: + CHKPARAM(4); + + SETFLOAT(rp->custom.description->rel2.relative_x, params[3]); + SETFLOAT(rp->custom.description->rel2.relative_y, params[4]); + + break; + case EDJE_STATE_PARAM_REL2_TO: + CHKPARAM(4); + + SETINT(rp->custom.description->rel2.id_x, params[3]); + SETINT(rp->custom.description->rel2.id_y, params[4]); + + break; + case EDJE_STATE_PARAM_REL2_OFFSET: + CHKPARAM(4); + + SETINT(rp->custom.description->rel2.offset_x, params[3]); + SETINT(rp->custom.description->rel2.offset_y, params[4]); + + break; + case EDJE_STATE_PARAM_IMAGE: + if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; + CHKPARAM(3); + + SETINT(rp->custom.description->image.id, params[3]); + + break; + case EDJE_STATE_PARAM_BORDER: + if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; + CHKPARAM(6); + + SETINT(rp->custom.description->border.l, params[3]); + SETINT(rp->custom.description->border.r, params[4]); + SETINT(rp->custom.description->border.t, params[5]); + SETINT(rp->custom.description->border.b, params[6]); + + break; + case EDJE_STATE_PARAM_FILL_SMOOTH: + if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; + CHKPARAM(3); + + SETINT(rp->custom.description->fill.smooth, params[3]); + + break; + case EDJE_STATE_PARAM_FILL_POS: + if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; + CHKPARAM(6); + + SETFLOAT(rp->custom.description->fill.pos_rel_x, params[3]); + SETFLOAT(rp->custom.description->fill.pos_rel_y, params[4]); + SETINT(rp->custom.description->fill.pos_abs_x, params[5]); + SETINT(rp->custom.description->fill.pos_abs_y, params[6]); + + break; + case EDJE_STATE_PARAM_FILL_SIZE: + if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; + CHKPARAM(6); + + SETFLOAT(rp->custom.description->fill.rel_x, params[3]); + SETFLOAT(rp->custom.description->fill.rel_y, params[4]); + SETINT(rp->custom.description->fill.abs_x, params[5]); + SETINT(rp->custom.description->fill.abs_y, params[6]); + + break; + case EDJE_STATE_PARAM_TEXT: + if ( (rp->part->type != EDJE_PART_TYPE_TEXT) && \ + (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) + return 0; + CHKPARAM(4); + + s = rp->custom.description->text.text; + SETSTRALLOCATE(s); + + break; + case EDJE_STATE_PARAM_TEXT_CLASS: + if ( (rp->part->type != EDJE_PART_TYPE_TEXT) && \ + (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) + return 0; + CHKPARAM(4); + + s = rp->custom.description->text.text_class; + SETSTRALLOCATE(s); + + break; + case EDJE_STATE_PARAM_TEXT_FONT: + if ((rp->part->type != EDJE_PART_TYPE_TEXT)) return 0; + CHKPARAM(4); + + s = rp->custom.description->text.font; + SETSTRALLOCATE(s); + + break; + case EDJE_STATE_PARAM_TEXT_STYLE: + if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return 0; + CHKPARAM(4); + + s = rp->custom.description->text.style; + SETSTRALLOCATE(s); + + break; + case EDJE_STATE_PARAM_TEXT_SIZE: + if ((rp->part->type != EDJE_PART_TYPE_TEXT)) return 0; + CHKPARAM(3); + + SETINT(rp->custom.description->text.size, params[3]); + + break; + case EDJE_STATE_PARAM_TEXT_FIT: + if ((rp->part->type != EDJE_PART_TYPE_TEXT)) return 0; + CHKPARAM(4); + + SETINT(rp->custom.description->text.fit_x, params[3]); + SETINT(rp->custom.description->text.fit_y, params[4]); + + break; + case EDJE_STATE_PARAM_TEXT_MIN: + if ( (rp->part->type != EDJE_PART_TYPE_TEXT) && \ + (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) + return 0; + CHKPARAM(4); + + SETINT(rp->custom.description->text.min_x, params[3]); + SETINT(rp->custom.description->text.min_y, params[4]); + + break; + case EDJE_STATE_PARAM_TEXT_ALIGN: + if ((rp->part->type != EDJE_PART_TYPE_TEXT)) return 0; + CHKPARAM(4); + + SETFLOAT(rp->custom.description->text.align.x, params[3]); + SETFLOAT(rp->custom.description->text.align.y, params[4]); + + break; + case EDJE_STATE_PARAM_VISIBLE: + CHKPARAM(3); + + SETINT(rp->custom.description->visible, params[3]); + break; default: break; diff --git a/legacy/edje/src/lib/edje_private.h b/legacy/edje/src/lib/edje_private.h index 18d7403d59..d48a0f7365 100644 --- a/legacy/edje/src/lib/edje_private.h +++ b/legacy/edje/src/lib/edje_private.h @@ -168,7 +168,6 @@ typedef struct _Edje_Part_Description Edje_Part_Description; #define EDJE_ASPECT_PREFER_VERTICAL 1 #define EDJE_ASPECT_PREFER_HORIZONTAL 2 #define EDJE_ASPECT_PREFER_BOTH 3 - #define EDJE_VAR_MAGIC_BASE 0x12fe84ba #define EDJE_STATE_PARAM_NONE 0 @@ -177,10 +176,32 @@ typedef struct _Edje_Part_Description Edje_Part_Description; #define EDJE_STATE_PARAM_MAX 3 #define EDJE_STATE_PARAM_STEP 4 #define EDJE_STATE_PARAM_ASPECT 5 -#define EDJE_STATE_PARAM_COLOR 6 -#define EDJE_STATE_PARAM_COLOR2 7 -#define EDJE_STATE_PARAM_COLOR3 8 -#define EDJE_STATE_PARAM_LAST 9 +#define EDJE_STATE_PARAM_ASPECT_PREF 6 +#define EDJE_STATE_PARAM_COLOR 7 +#define EDJE_STATE_PARAM_COLOR2 8 +#define EDJE_STATE_PARAM_COLOR3 9 +#define EDJE_STATE_PARAM_COLOR_CLASS 10 +#define EDJE_STATE_PARAM_REL1 11 +#define EDJE_STATE_PARAM_REL1_TO 12 +#define EDJE_STATE_PARAM_REL1_OFFSET 13 +#define EDJE_STATE_PARAM_REL2 14 +#define EDJE_STATE_PARAM_REL2_TO 15 +#define EDJE_STATE_PARAM_REL2_OFFSET 16 +#define EDJE_STATE_PARAM_IMAGE 17 +#define EDJE_STATE_PARAM_BORDER 18 +#define EDJE_STATE_PARAM_FILL_SMOOTH 19 +#define EDJE_STATE_PARAM_FILL_POS 20 +#define EDJE_STATE_PARAM_FILL_SIZE 21 +#define EDJE_STATE_PARAM_TEXT 22 +#define EDJE_STATE_PARAM_TEXT_CLASS 23 +#define EDJE_STATE_PARAM_TEXT_FONT 24 +#define EDJE_STATE_PARAM_TEXT_STYLE 25 +#define EDJE_STATE_PARAM_TEXT_SIZE 26 +#define EDJE_STATE_PARAM_TEXT_FIT 27 +#define EDJE_STATE_PARAM_TEXT_MIN 28 +#define EDJE_STATE_PARAM_TEXT_ALIGN 29 +#define EDJE_STATE_PARAM_VISIBLE 30 +#define EDJE_STATE_PARAM_LAST 31 /*----------*/ @@ -593,6 +614,7 @@ struct _Edje_Real_Part int out_size; double align_x, align_y; double elipsis; + int fit_x, fit_y; } cache; Edje_Real_Part *source; Edje_Real_Part *text_source; diff --git a/legacy/edje/src/lib/edje_text.c b/legacy/edje/src/lib/edje_text.c index 38fc266827..fe28632c94 100644 --- a/legacy/edje/src/lib/edje_text.c +++ b/legacy/edje/src/lib/edje_text.c @@ -331,7 +331,9 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep, (!strcmp(ep->text.cache.in_str, text)) && (ep->text.cache.align_x == params->text.align.x) && (ep->text.cache.align_y == params->text.align.y) && - (ep->text.cache.elipsis == params->text.elipsis)) + (ep->text.cache.elipsis == params->text.elipsis) && + (ep->text.cache.fit_x == chosen_desc->text.fit_x) && + (ep->text.cache.fit_y == chosen_desc->text.fit_y)) { text = (char *) ep->text.cache.out_str; size = ep->text.cache.out_size; @@ -462,6 +464,8 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep, ep->text.cache.align_x = params->text.align.x; ep->text.cache.align_y = params->text.align.y; ep->text.cache.elipsis = params->text.elipsis; + ep->text.cache.fit_x = chosen_desc->text.fit_x; + ep->text.cache.fit_y = chosen_desc->text.fit_y; arrange_text: if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);