[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [E-devel] patch for edje



Try #2, thanks for the comments.

Fixed the ugly indentation.  Vim tabstop confilcts.

On Mon, 12 Jun 2006 18:42:03 +0200
Tilman Sauerbeck <tilman@code-monkey.de> wrote:

> > +      case EDJE_STATE_PARAM_COLOR_CLASS:
> > +         CHKPARAM(3);
> > +
> > +	 char *cc;
> 
> Declaring variables in the middle of a block isn't allowed in C89, and
> IMO we shouldn't break C89 support for no good reason
> (same problem in other places, too).
> 

I used the variable declaration in this way because it was used all over the place in the GET/SET macros that were allready there.  I just wanted the code to look similar to the rest of it.  I've changed all the char declarations to one initial declaration, but left the macros alone.

> >  
> > +   ed->dirty=1;
> > +   _edje_recalc(ed);
> > +
> >     return 0;
> >  }
> 
> OY! Always recalcing the Edje here seems too excessive. It used to work
> well without it for the ops we had before your patch AFAIK, so you
> should prolly only recalc for the new ops, and where it's really
> necessary.

I knew I was going to get a comment on this one.  For a reason I haven't tracked down yet.  The ops stopped doing a recalc on a mouse_event triggered .edc program.  They don't even work on a CVS build (i.e. not mine).  They did work (most of them) when I started working on it.  Halfway through due to some commit somewhere, this stopped working (I've looked through the edje cvs logs for the last month... I don't think it's in edje). I don't know if this is just me or not.  It'd be a great help if you could try this on your machine and let me know if it works.

However, this isn't why I put the recalc after every op.  I figured that if someone runs an edje script, they want whatever they've changed to appear right away.  And, since the actual recalc of the part doesn't happen until after the script in the .edc is finished I thought it'd be ok.  Do a gdb w/breakpoints on _edje_embryo_fn_set_state_val and _edje_part_recalc to see what I'm talking about.  I did notice that if I took out the _edje_recalc the effect was the same, there's plenty of calls to _edje_recalc after the script has run waiting for the object to thaw.  But the ed->dirty=1 needs to stay.

> 
> Regards,
> Tilman
> 
> -- 
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing on usenet and in e-mail?
> 

- Zigs
Index: data/include/edje.inc
===================================================================
RCS file: /var/cvs/e/e17/libs/edje/data/include/edje.inc,v
retrieving revision 1.20
diff -u -r1.20 edje.inc
--- data/include/edje.inc	9 Oct 2005 09:49:53 -0000	1.20
+++ data/include/edje.inc	13 Jun 2006 01:11:20 -0000
@@ -150,9 +150,31 @@
 	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, ...);
Index: src/lib/edje_embryo.c
===================================================================
RCS file: /var/cvs/e/e17/libs/edje/src/lib/edje_embryo.c,v
retrieving revision 1.51
diff -u -r1.51 edje_embryo.c
--- src/lib/edje_embryo.c	19 Mar 2006 04:22:35 -0000	1.51
+++ src/lib/edje_embryo.c	13 Jun 2006 01:11:22 -0000
@@ -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 @@
    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 @@
 
    *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 @@
 	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 *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 @@
 	 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 @@
 	 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 @@
 	 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 @@
 	 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 *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 @@
 	 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 @@
 	 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 @@
 	 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]);
@@ -1722,6 +1934,174 @@
 	 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;
      }
Index: src/lib/edje_private.h
===================================================================
RCS file: /var/cvs/e/e17/libs/edje/src/lib/edje_private.h,v
retrieving revision 1.107
diff -u -r1.107 edje_private.h
--- src/lib/edje_private.h	28 Mar 2006 07:45:54 -0000	1.107
+++ src/lib/edje_private.h	13 Jun 2006 01:11:23 -0000
@@ -168,7 +168,6 @@
 #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 @@
 #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 @@
 	 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;
Index: src/lib/edje_text.c
===================================================================
RCS file: /var/cvs/e/e17/libs/edje/src/lib/edje_text.c,v
retrieving revision 1.53
diff -u -r1.53 edje_text.c
--- src/lib/edje_text.c	28 Mar 2006 07:45:54 -0000	1.53
+++ src/lib/edje_text.c	13 Jun 2006 01:11:23 -0000
@@ -331,7 +331,9 @@
        (!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 @@
    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);