edje - support edc proxy.source_clip
authorChunEon Park <chuneon.park@samsung.com>
Fri, 31 May 2013 12:04:29 +0000 (21:04 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Tue, 11 Jun 2013 11:10:10 +0000 (20:10 +0900)
edje - support edc source_visible

commit f55092ab93380915cd451e01bfb0b73436ba411c
Author: ChunEon Park <hermet>@hermet.pe.kr>
Date: Fri May 31 20:08:59 2013 +0900

commit 80e13538076f5e72ce96ac6f59e6b872441a18b5
Author: ChunEon Park <hermet>@hermet.pe.kr>
Date: Fri May 31 17:35:30 2013 +0900

Change-Id: I19d03e0ecf431799accf9b37e24b30f56f30ec1f

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

index be92a1b..678d411 100644 (file)
@@ -257,6 +257,8 @@ static void st_collections_group_parts_part_description_table_homogeneous(void);
 static void st_collections_group_parts_part_description_table_align(void);
 static void st_collections_group_parts_part_description_table_padding(void);
 static void st_collections_group_parts_part_description_table_min(void);
+static void st_collections_group_parts_part_description_proxy_source_visible(void);
+static void st_collections_group_parts_part_description_proxy_source_clip(void);
 static void st_collections_group_parts_part_description_map_perspective(void);
 static void st_collections_group_parts_part_description_map_light(void);
 static void st_collections_group_parts_part_description_map_rotation_center(void);
@@ -538,6 +540,8 @@ New_Statement_Handler statement_handlers[] =
      {"collections.group.parts.part.description.table.align", st_collections_group_parts_part_description_table_align},
      {"collections.group.parts.part.description.table.padding", st_collections_group_parts_part_description_table_padding},
      {"collections.group.parts.part.description.table.min", st_collections_group_parts_part_description_table_min},
+     {"collections.group.parts.part.description.proxy.source_visible", st_collections_group_parts_part_description_proxy_source_visible},
+     {"collections.group.parts.part.description.proxy.source_clip", st_collections_group_parts_part_description_proxy_source_clip},
      {"collections.group.parts.part.description.map.perspective", st_collections_group_parts_part_description_map_perspective},
      {"collections.group.parts.part.description.map.light", st_collections_group_parts_part_description_map_light},
      {"collections.group.parts.part.description.map.rotation.center", st_collections_group_parts_part_description_map_rotation_center},
@@ -965,7 +969,8 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c
            ed = mem_alloc(SZ(Edje_Part_Description_Proxy));
 
            ed->proxy.id = -1;
-
+           ed->proxy.source_visible = EINA_TRUE;
+           ed->proxy.source_clip = EINA_TRUE;
            _edje_part_description_fill(&ed->proxy.fill);
 
            result = &ed->common;
@@ -7038,6 +7043,42 @@ static void st_collections_group_parts_part_description_table_padding(void)
 }
 
 static void
+st_collections_group_parts_part_description_proxy_source_clip(void)
+{
+   Edje_Part_Description_Proxy *ed;
+
+   check_arg_count(1);
+
+   if (current_part->type != EDJE_PART_TYPE_PROXY)
+     {
+        ERR("parse error %s:%i. proxy attributes in non-PROXY part.",
+            file_in, line - 1);
+        exit(-1);
+     }
+
+   ed = (Edje_Part_Description_Proxy*) current_desc;
+   ed->proxy.source_clip = parse_bool(0);
+}
+
+static void
+st_collections_group_parts_part_description_proxy_source_visible(void)
+{
+   Edje_Part_Description_Proxy *ed;
+
+   check_arg_count(1);
+
+   if (current_part->type != EDJE_PART_TYPE_PROXY)
+     {
+        ERR("parse error %s:%i. proxy attributes in non-PROXY part.",
+            file_in, line - 1);
+        exit(-1);
+     }
+
+   ed = (Edje_Part_Description_Proxy*) current_desc;
+   ed->proxy.source_visible = parse_bool(0);
+}
+
+static void
 st_collections_group_parts_part_description_table_min(void)
 {
    Edje_Part_Description_Table *ed;
index 956c177..46bfdf6 100644 (file)
@@ -2438,6 +2438,8 @@ _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
    evas_object_image_fill_set(ep->object, p3->type.common.fill.x, p3->type.common.fill.y,
                               p3->type.common.fill.w, p3->type.common.fill.h);
    evas_object_image_smooth_scale_set(ep->object, p3->smooth);
+   evas_object_image_source_visible_set(ep->object, chosen_desc->proxy.source_visible);
+   evas_object_image_source_clip_set(ep->object, chosen_desc->proxy.source_clip);
 }
 
 static void
index be2776b..956f340 100644 (file)
@@ -645,6 +645,8 @@ _edje_edd_init(void)
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.angle", proxy.fill.angle, EET_T_INT);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.spread", proxy.fill.spread, EET_T_INT);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.type", proxy.fill.type, EET_T_CHAR);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.source_visible", proxy.source_visible, EET_T_CHAR);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.source_clip", proxy.source_clip, EET_T_CHAR);
 
    EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Text);
    eddc.func.mem_free = mem_free_text;
index c807f1b..9d847f8 100644 (file)
@@ -3139,6 +3139,8 @@ edje_edit_state_add(Evas_Object *obj, const char *part, const char *name, double
        memset(&pro->proxy, 0, sizeof (pro->proxy));
 
        pro->proxy.id = -1;
+       pro->proxy.source_visible = EINA_TRUE;
+       pro->proxy.source_clip = EINA_TRUE;
        pro->proxy.fill.smooth = 1;
        pro->proxy.fill.pos_rel_x = 0.0;
        pro->proxy.fill.pos_abs_x = 0;
index 3875781..9a19225 100644 (file)
@@ -987,6 +987,8 @@ struct _Edje_Part_Description_Spec_Proxy
    Edje_Part_Description_Spec_Fill   fill;
 
    int id; /* the part id to use as a source for this state */
+   Eina_Bool source_visible;  /* source object visibility */
+   Eina_Bool source_clip;     /* source object clip */
 };
 
 struct _Edje_Part_Description_Spec_Text