From f55092ab93380915cd451e01bfb0b73436ba411c Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Fri, 31 May 2013 20:08:59 +0900 Subject: [PATCH] edje - support edc proxy.source_clip --- ChangeLog | 2 +- NEWS | 2 +- data/edje/vim/syntax/edc.vim | 2 +- src/bin/edje/edje_cc_handlers.c | 21 +++++++++++++++++++++ src/lib/edje/edje_calc.c | 4 ++-- src/lib/edje/edje_data.c | 1 + src/lib/edje/edje_edit.c | 1 + src/lib/edje/edje_private.h | 1 + 8 files changed, 29 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index d08de9ff8d..71570ff19d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,5 @@ 2013-05-31 ChunEon Park (Hermet) - * Edje: support edc proxy.source_visible + * Edje: support edc proxy.source_visible, proxy.source_clip 2013-05-31 Jérémy Zurcher * Added --enable-image-loader-xyz=yes|static|auto|no for all loaders diff --git a/NEWS b/NEWS index bae0c24d6b..16bcda4c85 100644 --- a/NEWS +++ b/NEWS @@ -103,7 +103,7 @@ Additions: * Edje: - Add edje_object_part_text_input_panel_layout_variation_set/get API - Add EDJE_INPUT_PANEL_LAYOUT_DATETIME layout - - support edc proxy.source_visible + - support edc proxy.source_visible, proxy.source_clip * Evil: - Add mkdtemp. * ecore_x: diff --git a/data/edje/vim/syntax/edc.vim b/data/edje/vim/syntax/edc.vim index 08c6bec6e9..6f41ae326f 100644 --- a/data/edje/vim/syntax/edc.vim +++ b/data/edje/vim/syntax/edc.vim @@ -31,7 +31,7 @@ syn keyword edcLabel source5 source6 multiline pointer_mode contained syn keyword edcLabel state visible step aspect fixed middle contained syn keyword edcLabel aspect_preference ellipsis elipsis image contained syn keyword edcLabel relative offset to to_x to_y contained -syn keyword edcLabel source_visible contained +syn keyword edcLabel source_visible source_clip contained syn keyword edcLabel border border_scale scale_hint color color2 color3 font size contained syn keyword edcLabel signal action transition in filter contained syn keyword edcLabel target after fit align contained diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index dd9840c910..7017816ab2 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -322,6 +322,7 @@ 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); #ifdef HAVE_EPHYSICS static void st_collections_group_parts_part_description_physics_mass(void); @@ -636,6 +637,7 @@ New_Statement_Handler statement_handlers[] = {"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}, #ifdef HAVE_EPHYSICS {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass}, @@ -1100,6 +1102,7 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c 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; @@ -7395,6 +7398,24 @@ static void st_collections_group_parts_part_description_table_padding(void) ed->table.padding.y = parse_int_range(1, 0, 0x7fffffff); } +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) { diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index ce1796aab9..f6723138de 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -2491,8 +2491,8 @@ _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj p3->type.common.fill.w, p3->type.common.fill.h), evas_obj_image_smooth_scale_set(p3->smooth), - evas_obj_image_source_visible_set(chosen_desc->proxy.source_visible) - ); + evas_obj_image_source_visible_set(chosen_desc->proxy.source_visible), + evas_obj_image_source_clip_set(chosen_desc->proxy.source_clip)); } static void diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c index 7a9a31d92e..324c2a2598 100644 --- a/src/lib/edje/edje_data.c +++ b/src/lib/edje/edje_data.c @@ -724,6 +724,7 @@ _edje_edd_init(void) 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; diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index c9b9f84e60..0e772c534e 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -3096,6 +3096,7 @@ edje_edit_state_add(Evas_Object *obj, const char *part, const char *name, double 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; diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index 968bc4962e..5aeaf99066 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -1131,6 +1131,7 @@ struct _Edje_Part_Description_Spec_Proxy 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