Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/lib


Modified Files:
        edje_calc.c edje_data.c edje_private.h edje_program.c 


Log Message:


nuke some FIXME's. smooth parameter now added for fills. program infinite
loops are now detected and limited to a recursion limit of 64 levels.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_calc.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- edje_calc.c 24 Jun 2003 02:33:04 -0000      1.1
+++ edje_calc.c 28 Jun 2003 03:08:25 -0000      1.2
@@ -453,6 +453,7 @@
        params->y += ep->drag.y;
      }
    /* fill */
+   params->smooth = desc->fill.smooth;
    params->fill.x = desc->fill.pos_abs_x + (params->w * desc->fill.pos_rel_x);
    params->fill.w = desc->fill.abs_x + (params->w * desc->fill.rel_x);
    params->fill.y = desc->fill.pos_abs_y + (params->h * desc->fill.pos_rel_y);
@@ -526,6 +527,11 @@
          }
        else
          p3.visible = p1.visible;
+
+       if (pos < 0.5)
+         p3.smooth = p1.smooth;
+       else
+         p3.smooth = p2.smooth;
        
        p3.x = (p1.x * (1.0 - pos)) + (p2.x * (pos));
        p3.y = (p1.y * (1.0 - pos)) + (p2.y * (pos));
@@ -579,6 +585,7 @@
        evas_object_move(ep->object, ed->x + p3.x, ed->y + p3.y);
        evas_object_resize(ep->object, p3.w, p3.h);
        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);
 //     printf("fill %3.3f %3.3f %3.3fx%3.3f\n", p3.fill.x, p3.fill.y, p3.fill.w, 
p3.fill.h);
 
        evas_object_image_border_set(ep->object, p3.border.l, p3.border.r, 
p3.border.t, p3.border.b);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_data.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- edje_data.c 25 Jun 2003 02:29:25 -0000      1.2
+++ edje_data.c 28 Jun 2003 03:08:25 -0000      1.3
@@ -160,6 +160,7 @@
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "border.r", border.r, EET_T_INT);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "border.t", border.t, EET_T_INT);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "border.b", border.b, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "fill.smooth", fill.smooth, EET_T_CHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "fill.pos_rel_x", fill.pos_rel_x, EET_T_DOUBLE);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "fill.pos_abs_x", fill.pos_abs_x, EET_T_INT);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "fill.rel_x", fill.rel_x, EET_T_DOUBLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_private.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- edje_private.h      26 Jun 2003 14:04:31 -0000      1.21
+++ edje_private.h      28 Jun 2003 03:08:25 -0000      1.22
@@ -11,7 +11,6 @@
 #include <fnmatch.h>
 
 /* FIXME:
- * add a smooth scale option to fill params
  * need "random" signals and events for hooking to, and "random" durations
  * free stuff - no more leaks
  * dragables have to work
@@ -33,11 +32,11 @@
  * need to be able to force anim times to 0.0 from API to turn off animation
  * need to detect relative part loops
  * need to detect clip_to part loops
- * need to detect anim time 0.0 loops
  * edje_cc should be able to force lossy, lossless, min and max quality and 
compression of encoded images
  * edje_cc needs to prune out unused images
  * edje_cc might need an option for limiting number of tween images
  * audit edje for corrupt/bad input files
+ * ? add containering (hbox, vbox, table, wrapping multi-line hbox & vbox)
  * ? somehow handle double click?
  * ? add numeric params to conditions for progs (ranges etc.)
  * ? containering for multiple children? (hbox, vbox, table, wrapping list)
@@ -283,6 +282,7 @@
    } border;
 
    struct {
+      char           smooth; /* fill with smooth scaling or not */
       double         pos_rel_x; /* fill offset x relative to area */
       int            pos_abs_x; /* fill offset x added to fill offset */
       double         rel_x; /* relative size compared to area */
@@ -406,6 +406,7 @@
 {
    double           x, y, w, h;
    char             visible : 1; 
+   char             smooth : 1;
    struct {
       double        x, y, w, h;
    } fill;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_program.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- edje_program.c      26 Jun 2003 14:04:31 -0000      1.3
+++ edje_program.c      28 Jun 2003 03:08:25 -0000      1.4
@@ -209,7 +209,16 @@
 _edje_program_run(Edje *ed, Edje_Program *pr)
 {
    Evas_List *l;
+   /* limit self-feeding loops in programs to 64 levels */
+   static int recursions = 0;
+   static int recursion_limit = 0;
 
+   if ((recursions >= 64) || (recursion_limit))
+     {
+       recursion_limit = 1;
+       return;
+     }
+   recursions++;
    _edje_freeze(ed);
    _edje_ref(ed);
    _edje_emit(ed, "program,start", pr->name);
@@ -302,6 +311,8 @@
      }
    _edje_unref(ed);
    _edje_thaw(ed);
+   recursions--;
+   if (recursions == 0) recursion_limit = 0;
 }
 
 void
@@ -310,12 +321,26 @@
    Evas_List *l;
    static Evas_List *emissions = NULL;
    Edje_Emission *ee;
+   /* limit self-feeding loops in callbacks to 64 levels */
+   static int recursions = 0;
+   static int recursion_limit = 0;
 
+   if ((recursions >= 64) || (recursion_limit))
+     {
+       recursion_limit = 1;
+       return;
+     }
+   recursions++;
    _edje_ref(ed);
    _edje_freeze(ed);
    printf("EMIT \"%s\" \"%s\"\n", sig, src);
    ee = calloc(1, sizeof(Edje_Emission));
-   if (!ee) return;
+   if (!ee)
+     {
+       recursions--;
+       if (recursions == 0) recursion_limit = 0;
+       return;
+     }
    ee->signal = strdup(sig);
    ee->source = strdup(src);
    if (emissions)
@@ -323,6 +348,8 @@
        emissions = evas_list_append(emissions, ee);
        _edje_thaw(ed);
        _edje_unref(ed);
+       recursions--;
+       if (recursions == 0) recursion_limit = 0;
        return;
      }
    else
@@ -385,4 +412,6 @@
      }
    _edje_thaw(ed);
    _edje_unref(ed);
+   recursions--;
+   if (recursions == 0) recursion_limit = 0;
 }




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to