aaaah missing map smooth and alpha flags.
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 23 Feb 2010 05:45:24 +0000 (05:45 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 23 Feb 2010 05:45:24 +0000 (05:45 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@46383 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/edje_cc_handlers.c
src/lib/edje_calc.c
src/lib/edje_data.c
src/lib/edje_private.h

index 0e65c0a..f5d8c87 100644 (file)
@@ -209,6 +209,8 @@ static void st_collections_group_parts_part_description_map_rotation_x(void);
 static void st_collections_group_parts_part_description_map_rotation_y(void);
 static void st_collections_group_parts_part_description_map_rotation_z(void);
 static void st_collections_group_parts_part_description_map_on(void);
+static void st_collections_group_parts_part_description_map_smooth(void);
+static void st_collections_group_parts_part_description_map_alpha(void);
 static void st_collections_group_parts_part_description_map_backface_cull(void);
 static void st_collections_group_parts_part_description_map_perspective_on(void);
 static void st_collections_group_parts_part_description_perspective_zplane(void);
@@ -433,6 +435,8 @@ New_Statement_Handler statement_handlers[] =
      {"collections.group.parts.part.description.map.rotation.y", st_collections_group_parts_part_description_map_rotation_y},
      {"collections.group.parts.part.description.map.rotation.z", st_collections_group_parts_part_description_map_rotation_z},
      {"collections.group.parts.part.description.map.on", st_collections_group_parts_part_description_map_on},
+     {"collections.group.parts.part.description.map.smooth", st_collections_group_parts_part_description_map_smooth},
+     {"collections.group.parts.part.description.map.alpha", st_collections_group_parts_part_description_map_alpha},
      {"collections.group.parts.part.description.map.backface_cull", st_collections_group_parts_part_description_map_backface_cull},
      {"collections.group.parts.part.description.map.perspective_on", st_collections_group_parts_part_description_map_perspective_on},
      {"collections.group.parts.part.description.perspective.zplane", st_collections_group_parts_part_description_perspective_zplane},
@@ -3098,6 +3102,8 @@ ob_collections_group_parts_part_description(void)
    ed->map.rot.y = FROM_DOUBLE(0.0);
    ed->map.rot.z = FROM_DOUBLE(0.0);
    ed->map.on = 0;
+   ed->map.smooth = 1;
+   ed->map.alpha = 1;
    ed->map.backcull = 0;
    ed->map.persp_on = 0;
    ed->persp.zplane = 0;
@@ -5934,7 +5940,7 @@ st_collections_group_parts_part_description_map_rotation_z(void)
     @parameters
         enable map at all (1/0)
     @effect
-        This enables mapping for the part.
+        This enables mapping for the part. Default is 0.
     @endproperty
 */
 static void
@@ -5957,6 +5963,79 @@ st_collections_group_parts_part_description_map_on(void)
 /**
     @page edcref
     @property
+        smooth
+    @context
+        description {
+            ..
+            map {
+                smooth: 1;
+            }
+            ..
+        }
+    @parameters
+        enable map smooth rendering (linear interpolation) (1/0)
+    @effect
+        This enable smooth map rendering. This may be linear interpolation,
+        asinortopic filtering or anything the engine decides is "smooth".
+        This is a best-effort hint and may not produce precisely the same
+        results in all engines and situations. Default is 1
+    @endproperty
+*/
+static void
+st_collections_group_parts_part_description_map_smooth(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));
+   
+   ed = ep->default_desc;
+   if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
+   ed->map.smooth = parse_bool(0);
+}
+
+/**
+    @page edcref
+    @property
+        alpha
+    @context
+        description {
+            ..
+            map {
+                alpha: 1;
+            }
+            ..
+        }
+    @parameters
+        enable map alpha rendering (1/0)
+    @effect
+        This enable alpha channel when map rendering. Default is 1
+    @endproperty
+*/
+static void
+st_collections_group_parts_part_description_map_alpha(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));
+   
+   ed = ep->default_desc;
+   if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
+   ed->map.alpha = parse_bool(0);
+}
+
+/**
+    @page edcref
+    @property
         backface_cull
     @context
         description {
index 7283023..77fe17f 100644 (file)
@@ -2415,6 +2415,13 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
                     }
                }
              
+             // handle smooth
+             if (chosen_desc->map.smooth) evas_map_smooth_set(map, 1);
+             else evas_map_smooth_set(map, 0);
+             // handle alpha
+             if (chosen_desc->map.alpha) evas_map_alpha_set(map, 1);
+             else evas_map_alpha_set(map, 0);
+             
              evas_object_map_set(mo, map);
              evas_object_map_enable_set(mo, 1);
              evas_map_free(map);
index 7f63c2c..b8ed6f0 100644 (file)
@@ -358,6 +358,8 @@ _edje_edd_init(void)
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "map.rot.y", map.rot.y, EDJE_T_FLOAT);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "map.rot.z", map.rot.z, EDJE_T_FLOAT);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "map.on", map.on, EET_T_UCHAR);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "map.smooth", map.smooth, EET_T_UCHAR);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "map.alpha", map.alpha, EET_T_UCHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "map.persp_on", map.persp_on, EET_T_UCHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "map.backcull", map.backcull, EET_T_UCHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "persp.zplane", persp.zplane, EET_T_INT);
index e9ad5aa..0155dc2 100644 (file)
@@ -691,6 +691,8 @@ struct _Edje_Part_Description
       unsigned char backcull;
       unsigned char on;
       unsigned char persp_on;
+      unsigned char smooth;
+      unsigned char alpha;
    } map;
    
    struct {