in theory.. support middle solid/default/none changes in evas
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 12 Feb 2009 13:39:15 +0000 (13:39 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 12 Feb 2009 13:39:15 +0000 (13:39 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@39001 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/edje_cc_handlers.c
src/lib/edje_calc.c
src/lib/edje_edit.c

index 44a1d94..2194561 100644 (file)
@@ -3689,7 +3689,7 @@ st_collections_group_parts_part_description_rel2_to_y(void)
                 ..
                 tween:  "filenameN.ext";
                 border:  left right top bottom;
-                middle:  0-1;
+                middle:  0/1/NONE/DEFAULT/SOLID;
             }
             ..
         }
@@ -3828,11 +3828,11 @@ st_collections_group_parts_part_description_image_border(void)
     @property
         middle
     @parameters
-        [0 or 1]
+        0, 1, NONE, DEFAULT, SOLID
     @effect
-        If border is set, this boolean value tells Edje if the rest of the
-        image (not covered by the defined border) will be displayed or not.
-        The default value is 1.
+        If border is set, this value tells Edje if the rest of the
+        image (not covered by the defined border) will be displayed or not
+        or be assumed to be solid (without alpha). The default is 1/DEFAULT.
     @endproperty
 */
 static void
@@ -3857,7 +3857,13 @@ st_collections_group_parts_part_description_image_middle(void)
 
    ed = ep->default_desc;
    if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
-   ed->border.no_fill = !parse_bool(0);
+   ed->border.no_fill =  parse_enum(0,
+                                    "1", 0,
+                                    "DEFAULT", 0,
+                                    "0", 1,
+                                    "NONE", 1,
+                                    "SOLID", 2,
+                                    NULL);
 }
 
 /**
index 554e4e9..1abc50d 100644 (file)
@@ -1258,8 +1258,12 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
 
    evas_object_image_border_set(ep->object, p3->border.l, p3->border.r,
                                p3->border.t, p3->border.b);
-   evas_object_image_border_center_fill_set(ep->object,
-                                           !(chosen_desc->border.no_fill));
+   if (chosen_desc->border.no_fill == 0)
+     evas_object_image_border_center_fill_set(ep->object, EVAS_BORDER_FILL_DEFAULT);
+   else if (chosen_desc->border.no_fill == 1)
+     evas_object_image_border_center_fill_set(ep->object, EVAS_BORDER_FILL_NONE);
+   else if (chosen_desc->border.no_fill == 2)
+     evas_object_image_border_center_fill_set(ep->object, EVAS_BORDER_FILL_SOLID);
    image_id = ep->param1.description->image.id;
    if (image_id < 0)
      {
index 628851d..b8afb17 100644 (file)
@@ -3640,14 +3640,19 @@ EAPI unsigned char
 edje_edit_state_image_border_fill_get(Evas_Object *obj, const char *part, const char *state)
 {
    GET_PD_OR_RETURN(0);
-   return pd->border.no_fill ? 0 : 1;
+   if (pd->border.no_fill == 0) return 1;
+   else if (pd->border.no_fill == 1) return 0;
+   else if (pd->border.no_fill == 2) return 2;
+   return 0;
 }
 
 EAPI void
 edje_edit_state_image_border_fill_set(Evas_Object *obj, const char *part, const char *state, unsigned char fill)
 {
    GET_PD_OR_RETURN();
-   pd->border.no_fill = fill ? 0 : 1;
+   if (fill == 0) pd->border.no_fill = 1;
+   else if (fill == 1) pd->border.no_fill = 0;
+   else if (fill == 2) pd->border.no_fill = 2;
 
    edje_object_calc_force(obj);
 }
@@ -5068,8 +5073,12 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s
       
        if (pd->border.l || pd->border.r || pd->border.t || pd->border.b)
          fprintf(f, I6"border: %d %d %d %d;\n", pd->border.l, pd->border.r, pd->border.t, pd->border.b);
-       if (pd->border.no_fill)
-         fprintf(f, I6"middle: 0;\n");
+       if (pd->border.no_fill == 1)
+         fprintf(f, I6"middle: NONE;\n");
+       else if (pd->border.no_fill == 0)
+         fprintf(f, I6"middle: DEFAULT;\n");
+       else if (pd->border.no_fill == 2)
+         fprintf(f, I6"middle: SOLID;\n");
 
        fprintf(f, I5"}\n");//image
      }