From: Shinwoo Kim Date: Tue, 29 Mar 2011 15:12:30 +0000 (+0900) Subject: Rollback to b10370157701da03ba646464110cdd63d7909bc8 X-Git-Tag: 2.0_alpha~207 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c57fc040362e49f37a476d6871903cf28333f4ed;p=framework%2Fuifw%2Fedje.git Rollback to b10370157701da03ba646464110cdd63d7909bc8 --- diff --git a/ChangeLog b/ChangeLog index c82c832..6f6b21e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -48,25 +48,3 @@ This lets you limit the size of the font that will be used. Especially useful when using fit. -2011-03-10 WooHyun Jung - - * Fix: Emit clicked signal on entry if still in - missing. - -2011-03-10 Cedric BAIL - - * Correctly propagate recursive event with existing and non existing - part. - -2011-03-11 Cedric BAIL - - * Add PROXY part. - -2011-03-19 Carsten Haitzler (The Rasterman) - - * Change edje_decc to only use edje_cc as the compiler for security - and correctness reasons. - -2011-03-23 Brett Nash (nash) - - * Move some of edje over to use smart clipper in evas. This _should_ - be transparent to users. diff --git a/configure.ac b/configure.ac index 1ad482f..0f377ed 100644 --- a/configure.ac +++ b/configure.ac @@ -316,7 +316,7 @@ fi ### Checks for header files -AC_CHECK_HEADERS([locale.h sys/resource.h]) +AC_CHECK_HEADERS([locale.h]) EFL_CHECK_PATH_MAX diff --git a/edje.spec.in b/edje.spec.in index b2bf0b0..1d6e2a7 100644 --- a/edje.spec.in +++ b/edje.spec.in @@ -87,7 +87,6 @@ test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT %{_libdir}/*.a %{_libdir}/pkgconfig/* %{_includedir}/edje-1/*.h -%{_libdir}/edje/utils/epp %files bin %defattr(-, root, root) diff --git a/src/bin/edje_cc_handlers.c b/src/bin/edje_cc_handlers.c index 35c6ca7..358d58f 100644 --- a/src/bin/edje_cc_handlers.c +++ b/src/bin/edje_cc_handlers.c @@ -156,7 +156,6 @@ static void st_collections_group_parts_part_table_items_item_span(void); static void ob_collections_group_parts_part_description(void); static void st_collections_group_parts_part_description_inherit(void); -static void st_collections_group_parts_part_description_source(void); static void st_collections_group_parts_part_description_state(void); static void st_collections_group_parts_part_description_visible(void); static void st_collections_group_parts_part_description_align(void); @@ -401,7 +400,6 @@ New_Statement_Handler statement_handlers[] = {"collections.group.parts.part.table.items.item.position", st_collections_group_parts_part_table_items_item_position}, {"collections.group.parts.part.table.items.item.span", st_collections_group_parts_part_table_items_item_span}, {"collections.group.parts.part.description.inherit", st_collections_group_parts_part_description_inherit}, - {"collections.group.parts.part.description.source", st_collections_group_parts_part_description_source}, {"collections.group.parts.part.description.state", st_collections_group_parts_part_description_state}, {"collections.group.parts.part.description.visible", st_collections_group_parts_part_description_visible}, {"collections.group.parts.part.description.align", st_collections_group_parts_part_description_align}, @@ -779,23 +777,6 @@ statement_handler_num(void) return sizeof(statement_handlers) / sizeof (New_Object_Handler); } -static void -_edje_part_description_fill(Edje_Part_Description_Spec_Fill *fill) -{ - fill->smooth = 1; - fill->pos_rel_x = FROM_DOUBLE(0.0); - fill->pos_abs_x = 0; - fill->rel_x = FROM_DOUBLE(1.0); - fill->abs_x = 0; - fill->pos_rel_y = FROM_DOUBLE(0.0); - fill->pos_abs_y = 0; - fill->rel_y = FROM_DOUBLE(1.0); - fill->abs_y = 0; - fill->angle = 0; - fill->spread = 0; - fill->type = EDJE_FILL_TYPE_SCALE; -} - static Edje_Part_Description_Common * _edje_part_description_alloc(unsigned char type, const char *collection, const char *part) { @@ -834,25 +815,22 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c ed = mem_alloc(SZ(Edje_Part_Description_Image)); ed->image.id = -1; - - _edje_part_description_fill(&ed->image.fill); + ed->image.fill.smooth = 1; + ed->image.fill.pos_rel_x = FROM_DOUBLE(0.0); + ed->image.fill.pos_abs_x = 0; + ed->image.fill.rel_x = FROM_DOUBLE(1.0); + ed->image.fill.abs_x = 0; + ed->image.fill.pos_rel_y = FROM_DOUBLE(0.0); + ed->image.fill.pos_abs_y = 0; + ed->image.fill.rel_y = FROM_DOUBLE(1.0); + ed->image.fill.abs_y = 0; + ed->image.fill.angle = 0; + ed->image.fill.spread = 0; + ed->image.fill.type = EDJE_FILL_TYPE_SCALE; result = &ed->common; break; } - case EDJE_PART_TYPE_PROXY: - { - Edje_Part_Description_Proxy *ed; - - ed = mem_alloc(SZ(Edje_Part_Description_Proxy)); - - ed->proxy.id = -1; - - _edje_part_description_fill(&ed->proxy.fill); - - result = &ed->common; - break; - } case EDJE_PART_TYPE_BOX: { Edje_Part_Description_Box *ed; @@ -2236,7 +2214,6 @@ st_collections_group_parts_part_type(void) "BOX", EDJE_PART_TYPE_BOX, "TABLE", EDJE_PART_TYPE_TABLE, "EXTERNAL", EDJE_PART_TYPE_EXTERNAL, - "PROXY", EDJE_PART_TYPE_PROXY, NULL); if (ep->default_desc || ep->other.desc_count > 0) @@ -3698,15 +3675,6 @@ st_collections_group_parts_part_description_inherit(void) break; } - case EDJE_PART_TYPE_PROXY: - { - Edje_Part_Description_Proxy *ped = (Edje_Part_Description_Proxy*) ed; - Edje_Part_Description_Proxy *pparent = (Edje_Part_Description_Proxy*) parent; - - ped->proxy.id = pparent->proxy.id; - - break; - } case EDJE_PART_TYPE_BOX: { Edje_Part_Description_Box *bed = (Edje_Part_Description_Box *) ed; @@ -3752,48 +3720,6 @@ st_collections_group_parts_part_description_inherit(void) /** @page edcref - - @property - source - @parameters - [another part's name] - @effect - Causes the part to use another part content as the content of this part. - Only work with PROXY part. - @endproperty -*/ -static void -st_collections_group_parts_part_description_source(void) -{ - Edje_Part_Collection *pc; - Edje_Part *ep; - Edje_Part_Description_Proxy *ed; - char *name; - - check_arg_count(1); - - pc = eina_list_data_get(eina_list_last(edje_collections)); - ep = pc->parts[pc->parts_count - 1]; - - if (ep->type != EDJE_PART_TYPE_PROXY) - { - ERR("%s: Error. parse error %s:%i. " - "source attributes in non-PROXY part.", - progname, file_in, line - 1); - exit(-1); - } - - ed = (Edje_Part_Description_Proxy*) ep->default_desc; - if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1]; - - name = parse_str(0); - - data_queue_part_lookup(pc, name, &(ed->proxy.id)); - free(name); -} - -/** - @page edcref @property state @parameters @@ -4836,45 +4762,25 @@ st_collections_group_parts_part_description_fill_smooth(void) { Edje_Part_Collection *pc; Edje_Part *ep; - Edje_Part_Description_Spec_Fill *fill; + Edje_Part_Description_Image *ed; check_arg_count(1); pc = eina_list_data_get(eina_list_last(edje_collections)); ep = pc->parts[pc->parts_count - 1]; - switch (ep->type) + if (ep->type != EDJE_PART_TYPE_IMAGE) { - case EDJE_PART_TYPE_IMAGE: - { - Edje_Part_Description_Image *ed; - - ed = (Edje_Part_Description_Image*) ep->default_desc; - if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1]; - - fill = &ed->image.fill; - break; - } - case EDJE_PART_TYPE_PROXY: - { - Edje_Part_Description_Proxy *ed; - - ed = (Edje_Part_Description_Proxy*) ep->default_desc; - if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1]; - - fill = &ed->proxy.fill; - break; - } - default: - { - ERR("%s: Error. parse error %s:%i. " - "image and proxy attributes in non-IMAGE, non-PROXY `%s` part (%i).", - progname, file_in, line - 1, ep->name, ep->type); - exit(-1); - } + ERR("%s: Error. parse error %s:%i. " + "image attributes in non-IMAGE part.", + progname, file_in, line - 1); + exit(-1); } - fill->smooth = parse_bool(0); + ed = (Edje_Part_Description_Image*) ep->default_desc; + if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1]; + + ed->image.fill.smooth = parse_bool(0); } /** @@ -4943,48 +4849,28 @@ st_collections_group_parts_part_description_fill_type(void) { Edje_Part_Collection *pc; Edje_Part *ep; - Edje_Part_Description_Spec_Fill *fill; + Edje_Part_Description_Image *ed; check_arg_count(1); pc = eina_list_data_get(eina_list_last(edje_collections)); ep = pc->parts[pc->parts_count - 1]; - switch (ep->type) + if (ep->type != EDJE_PART_TYPE_IMAGE) { - case EDJE_PART_TYPE_IMAGE: - { - Edje_Part_Description_Image *ed; - - ed = (Edje_Part_Description_Image*) ep->default_desc; - if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1]; - - fill = &ed->image.fill; - break; - } - case EDJE_PART_TYPE_PROXY: - { - Edje_Part_Description_Proxy *ed; - - ed = (Edje_Part_Description_Proxy*) ep->default_desc; - if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1]; - - fill = &ed->proxy.fill; - break; - } - default: - { - ERR("%s: Error. parse error %s:%i. " - "image and proxy attributes in non-IMAGE, non-PROXY part.", - progname, file_in, line - 1); - exit(-1); - } + ERR("%s: Error. parse error %s:%i. " + "image attributes in non-IMAGE part.", + progname, file_in, line - 1); + exit(-1); } - fill->type = parse_enum(0, - "SCALE", EDJE_FILL_TYPE_SCALE, - "TILE", EDJE_FILL_TYPE_TILE, - NULL); + ed = (Edje_Part_Description_Image*) ep->default_desc; + if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1]; + + ed->image.fill.type = parse_enum(0, + "SCALE", EDJE_FILL_TYPE_SCALE, + "TILE", EDJE_FILL_TYPE_TILE, + NULL); } /** @@ -5023,46 +4909,26 @@ st_collections_group_parts_part_description_fill_origin_relative(void) { Edje_Part_Collection *pc; Edje_Part *ep; - Edje_Part_Description_Spec_Fill *fill; + Edje_Part_Description_Image *ed; check_arg_count(2); pc = eina_list_data_get(eina_list_last(edje_collections)); ep = pc->parts[pc->parts_count - 1]; - switch (ep->type) + if (ep->type != EDJE_PART_TYPE_IMAGE) { - case EDJE_PART_TYPE_IMAGE: - { - Edje_Part_Description_Image *ed; - - ed = (Edje_Part_Description_Image*) ep->default_desc; - if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1]; - - fill = &ed->image.fill; - break; - } - case EDJE_PART_TYPE_PROXY: - { - Edje_Part_Description_Proxy *ed; - - ed = (Edje_Part_Description_Proxy*) ep->default_desc; - if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1]; - - fill = &ed->proxy.fill; - break; - } - default: - { - ERR("%s: Error. parse error %s:%i. " - "image and proxy attributes in non-IMAGE, non-PROXY part.", - progname, file_in, line - 1); - exit(-1); - } + ERR("%s: Error. parse error %s:%i. " + "image attributes in non-IMAGE part.", + progname, file_in, line - 1); + exit(-1); } - fill->pos_rel_x = FROM_DOUBLE(parse_float_range(0, -999999999.0, 999999999.0)); - fill->pos_rel_y = FROM_DOUBLE(parse_float_range(1, -999999999.0, 999999999.0)); + ed = (Edje_Part_Description_Image*) ep->default_desc; + if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1]; + + ed->image.fill.pos_rel_x = FROM_DOUBLE(parse_float_range(0, -999999999.0, 999999999.0)); + ed->image.fill.pos_rel_y = FROM_DOUBLE(parse_float_range(1, -999999999.0, 999999999.0)); } /** @@ -5080,47 +4946,26 @@ st_collections_group_parts_part_description_fill_origin_offset(void) { Edje_Part_Collection *pc; Edje_Part *ep; - Edje_Part_Description_Spec_Fill *fill; + Edje_Part_Description_Image *ed; check_arg_count(2); pc = eina_list_data_get(eina_list_last(edje_collections)); ep = pc->parts[pc->parts_count - 1]; - - switch (ep->type) + if (ep->type != EDJE_PART_TYPE_IMAGE) { - case EDJE_PART_TYPE_IMAGE: - { - Edje_Part_Description_Image *ed; - - ed = (Edje_Part_Description_Image*) ep->default_desc; - if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1]; - - fill = &ed->image.fill; - break; - } - case EDJE_PART_TYPE_PROXY: - { - Edje_Part_Description_Proxy *ed; - - ed = (Edje_Part_Description_Proxy*) ep->default_desc; - if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1]; - - fill = &ed->proxy.fill; - break; - } - default: - { - ERR("%s: Error. parse error %s:%i. " - "image and proxy attributes in non-IMAGE, non-PROXY part.", - progname, file_in, line - 1); - exit(-1); - } + ERR("%s: Error. parse error %s:%i. " + "image attributes in non-IMAGE part.", + progname, file_in, line - 1); + exit(-1); } - fill->pos_abs_x = parse_int(0); - fill->pos_abs_y = parse_int(1); + ed = (Edje_Part_Description_Image*) ep->default_desc; + if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1]; + + ed->image.fill.pos_abs_x = parse_int(0); + ed->image.fill.pos_abs_y = parse_int(1); } /** @@ -5161,46 +5006,26 @@ st_collections_group_parts_part_description_fill_size_relative(void) { Edje_Part_Collection *pc; Edje_Part *ep; - Edje_Part_Description_Spec_Fill *fill; + Edje_Part_Description_Image *ed; check_arg_count(2); pc = eina_list_data_get(eina_list_last(edje_collections)); ep = pc->parts[pc->parts_count - 1]; - switch (ep->type) + if (ep->type != EDJE_PART_TYPE_IMAGE) { - case EDJE_PART_TYPE_IMAGE: - { - Edje_Part_Description_Image *ed; - - ed = (Edje_Part_Description_Image*) ep->default_desc; - if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1]; - - fill = &ed->image.fill; - break; - } - case EDJE_PART_TYPE_PROXY: - { - Edje_Part_Description_Proxy *ed; - - ed = (Edje_Part_Description_Proxy*) ep->default_desc; - if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1]; - - fill = &ed->proxy.fill; - break; - } - default: - { - ERR("%s: Error. parse error %s:%i. " - "image and proxy attributes in non-IMAGE, non-PROXY part.", - progname, file_in, line - 1); - exit(-1); - } + ERR("%s: Error. parse error %s:%i. " + "image attributes in non-IMAGE part.", + progname, file_in, line - 1); + exit(-1); } - fill->rel_x = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0)); - fill->rel_y = FROM_DOUBLE(parse_float_range(1, 0.0, 999999999.0)); + ed = (Edje_Part_Description_Image*) ep->default_desc; + if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1]; + + ed->image.fill.rel_x = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0)); + ed->image.fill.rel_y = FROM_DOUBLE(parse_float_range(1, 0.0, 999999999.0)); } /** @@ -5218,46 +5043,26 @@ st_collections_group_parts_part_description_fill_size_offset(void) { Edje_Part_Collection *pc; Edje_Part *ep; - Edje_Part_Description_Spec_Fill *fill; + Edje_Part_Description_Image *ed; check_arg_count(2); pc = eina_list_data_get(eina_list_last(edje_collections)); ep = pc->parts[pc->parts_count - 1]; - switch (ep->type) + if (ep->type != EDJE_PART_TYPE_IMAGE) { - case EDJE_PART_TYPE_IMAGE: - { - Edje_Part_Description_Image *ed; - - ed = (Edje_Part_Description_Image*) ep->default_desc; - if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1]; - - fill = &ed->image.fill; - break; - } - case EDJE_PART_TYPE_PROXY: - { - Edje_Part_Description_Proxy *ed; - - ed = (Edje_Part_Description_Proxy*) ep->default_desc; - if (ep->other.desc_count) ed = (Edje_Part_Description_Proxy*) ep->other.desc[ep->other.desc_count - 1]; - - fill = &ed->proxy.fill; - break; - } - default: - { - ERR("%s: Error. parse error %s:%i. " - "image and proxy attributes in non-IMAGE, non-PROXY part.", - progname, file_in, line - 1); - exit(-1); - } + ERR("%s: Error. parse error %s:%i. " + "image attributes in non-IMAGE part.", + progname, file_in, line - 1); + exit(-1); } - fill->abs_x = parse_int(0); - fill->abs_y = parse_int(1); + ed = (Edje_Part_Description_Image*) ep->default_desc; + if (ep->other.desc_count) ed = (Edje_Part_Description_Image*) ep->other.desc[ep->other.desc_count - 1]; + + ed->image.fill.abs_x = parse_int(0); + ed->image.fill.abs_y = parse_int(1); } @@ -7080,6 +6885,7 @@ st_collections_group_programs_program_action(void) "FOCUS_OBJECT", EDJE_ACTION_TYPE_FOCUS_OBJECT, "PARAM_COPY", EDJE_ACTION_TYPE_PARAM_COPY, "PARAM_SET", EDJE_ACTION_TYPE_PARAM_SET, + "HIDE_VISIBLE_PASSWORD", EDJE_ACTION_TYPE_HIDE_VISIBLE_PASSWORD, NULL); if (ep->action == EDJE_ACTION_TYPE_STATE_SET) { @@ -7142,6 +6948,7 @@ st_collections_group_programs_program_action(void) /* this is implicitly set by script {} so this is here just for * completeness */ break; + case EDJE_ACTION_TYPE_HIDE_VISIBLE_PASSWORD: case EDJE_ACTION_TYPE_FOCUS_OBJECT: case EDJE_ACTION_TYPE_FOCUS_SET: check_arg_count(1); @@ -7228,6 +7035,8 @@ st_collections_group_programs_program_target(void) data_queue_part_lookup(pc, name, &(et->id)); else if (ep->action == EDJE_ACTION_TYPE_FOCUS_OBJECT) data_queue_part_lookup(pc, name, &(et->id)); + else if (ep->action == EDJE_ACTION_TYPE_HIDE_VISIBLE_PASSWORD) + data_queue_part_lookup(pc, name, &(et->id)); else { ERR("%s: Error. parse error %s:%i. " diff --git a/src/bin/edje_cc_parse.c b/src/bin/edje_cc_parse.c index 19adf0a..40a457a 100644 --- a/src/bin/edje_cc_parse.c +++ b/src/bin/edje_cc_parse.c @@ -30,16 +30,9 @@ void *alloca (size_t); #include #include "edje_cc.h" -#include "edje_prefix.h" #include #include -#ifdef _WIN32 -# define EPP_EXT ".exe" -#else -# define EPP_EXT -#endif - static void new_object(void); static void new_statement(void); static char *perform_math (char *input); @@ -645,7 +638,7 @@ get_verbatim_line2(void) void compile(void) { - char buf[4096], buf2[4096]; + char buf[4096]; char inc[4096]; static char tmpn[4096]; int fd; @@ -700,11 +693,10 @@ compile(void) * Run the input through the C pre-processor. */ ret = -1; - snprintf(buf2, sizeof(buf2), "%s/edje/utils/epp"EPP_EXT, e_prefix_lib_get()); - if (ecore_file_exists(buf2)) + if (ecore_file_exists(EPP_DIR"/epp")) { - snprintf(buf, sizeof(buf), "%s %s -I%s %s -o %s", - buf2, file_in, inc, def, tmpn); + snprintf(buf, sizeof(buf), EPP_DIR"/epp %s -I%s %s -o %s", + file_in, inc, def, tmpn); ret = system(buf); } /* @@ -755,6 +747,19 @@ compile(void) if (ret == EXIT_SUCCESS) file_in = tmpn; free(def); +/* OLD CODE + snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s -E -o %s", + file_in, inc, def, tmpn); + ret = system(buf); + if (ret < 0) + { + snprintf(buf, sizeof(buf), "gcc -I%s %s -E -o %s %s", + inc, def, tmpn, file_in); + ret = system(buf); + } + if (ret >= 0) file_in = tmpn; + free(def); + */ } fd = open(file_in, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR); if (fd < 0) diff --git a/src/bin/edje_decc.c b/src/bin/edje_decc.c index aeab754..5735afc 100644 --- a/src/bin/edje_decc.c +++ b/src/bin/edje_decc.c @@ -142,8 +142,6 @@ decomp(void) eet_close(ef); return 0; } - /* force compiler to be edje_cc */ - edje_file->compiler = strdup("edje_cc"); if (!edje_file->compiler) { edje_file->compiler = strdup("edje_cc"); diff --git a/src/bin/edje_inspector.c b/src/bin/edje_inspector.c index 1ab8fd9..4dc2ecd 100644 --- a/src/bin/edje_inspector.c +++ b/src/bin/edje_inspector.c @@ -187,8 +187,6 @@ part_type_name_get(Edje_Part_Type t) return "TEXT"; case EDJE_PART_TYPE_IMAGE: return "IMAGE"; - case EDJE_PART_TYPE_PROXY: - return "PROXY"; case EDJE_PART_TYPE_SWALLOW: return "SWALLOW"; case EDJE_PART_TYPE_TEXTBLOCK: @@ -512,82 +510,6 @@ state_details(Evas_Object *ed, const char *part, const char *state, double value if (machine) puts("IMAGE-END"); else if (detail > 1) puts(INDENT4 "}"); } - else if (t == EDJE_PART_TYPE_PROXY) - { - int x2, y2; - double dx2, dy2; - Eina_Bool has_orgin, has_size; - - if (machine) puts("PROXY-BEGIN"); - else puts(INDENT4 "proxy {"); - // TODO Support source - // TODO support proxy.fill.smooth - - dx = edje_edit_state_fill_origin_relative_x_get - (ed, part, state, value); - dy = edje_edit_state_fill_origin_relative_y_get - (ed, part, state, value); - x = edje_edit_state_fill_origin_offset_x_get - (ed, part, state, value); - y = edje_edit_state_fill_origin_offset_y_get - (ed, part, state, value); - - dx2 = edje_edit_state_fill_size_relative_x_get - (ed, part, state, value); - dy2 = edje_edit_state_fill_size_relative_y_get - (ed, part, state, value); - x2 = edje_edit_state_fill_size_offset_x_get - (ed, part, state, value); - y2 = edje_edit_state_fill_size_offset_y_get - (ed, part, state, value); - - has_orgin = (FDIFF(dx, 0.0) || FDIFF(dy, 0.0) || (x) || (y)); - has_size = (FDIFF(dx2, 1.0) || FDIFF(dy2, 1.0) || (x2) || (y2)); - - if ((has_orgin) || (has_size)) - { - if (machine) puts("PROXY-FILL-BEGIN"); - else puts(INDENT5 "fill {"); - - if (has_orgin) - { - if (machine) - printf("ORIGIN-RELATIVE-X: %g\n" - "ORIGIN-RELATIVE-Y: %g\n" - "ORIGIN-OFFSET-X: %d\n" - "ORIGIN-OFFSET-Y: %d\n", - dx, dy, x, y); - else - printf(INDENT6 "origin {\n" - INDENT7 "relative: %g %g;\n" - INDENT7 "offset: %d %d;\n" - INDENT6 "}\n", - dx, dy, x, y); - } - - if (has_size) - { - if (machine) - printf("SIZE-RELATIVE-X: %g\n" - "SIZE-RELATIVE-Y: %g\n" - "SIZE-OFFSET-X: %d\n" - "SIZE-OFFSET-Y: %d\n", - dx2, dy2, x2, y2); - else - printf(INDENT6 "size {\n" - INDENT7 "relative: %g %g;\n" - INDENT7 "offset: %d %d;\n" - INDENT6 "}\n", - dx2, dy2, x2, y2); - } - - if (machine) puts("PROXY-FILL-END"); - else puts(INDENT5 "}"); - } - - if (machine) puts("PROXY-END"); - else puts(INDENT4 "}"); - } else if ((t == EDJE_PART_TYPE_TEXTBLOCK) || (t == EDJE_PART_TYPE_TEXT)) { if (machine) puts("TEXT-BEGIN"); diff --git a/src/bin/epp/Makefile.am b/src/bin/epp/Makefile.am index 6db5016..2d3f3aa 100644 --- a/src/bin/epp/Makefile.am +++ b/src/bin/epp/Makefile.am @@ -38,10 +38,9 @@ epp_CPPFLAGS = \ $(CWARNFLAGS) DEFS= \ --DHAVE_CONFIG_H \ -DHAVE_STRERROR \ -DFATAL_EXIT_CODE=1 \ --DSUCCESS_EXIT_CODE=0 \ +-DSUCCESS_EXIT_CODE=1 \ -DGCC_INCLUDE_DIR=\"/usr/include\" \ -DGPLUSPLUS_INCLUDE_DIR=\"/usr/include\" \ -DTOOL_INCLUDE_DIR=\"/usr/bin\" \ diff --git a/src/bin/epp/cppalloc.c b/src/bin/epp/cppalloc.c index 4ce0dd0..2106e1c 100644 --- a/src/bin/epp/cppalloc.c +++ b/src/bin/epp/cppalloc.c @@ -23,12 +23,8 @@ * You are forbidden to forbid anyone else to use, share and improve * what you give them. Help stamp out software-hoarding! */ -#ifdef HAVE_CONFIG_H -# include -#endif - #include - +#include "config.h" #include "cpplib.h" static void diff --git a/src/bin/epp/cpperror.c b/src/bin/epp/cpperror.c index f4cd5eb..caaa513 100644 --- a/src/bin/epp/cpperror.c +++ b/src/bin/epp/cpperror.c @@ -23,13 +23,9 @@ * You are forbidden to forbid anyone else to use, share and improve * what you give them. Help stamp out software-hoarding! */ -#ifdef HAVE_CONFIG_H -# include -#endif - #include #include - +#include "config.h" #include "cpplib.h" /* Print the file names and line numbers of the #include diff --git a/src/bin/epp/cppexp.c b/src/bin/epp/cppexp.c index 5fcb33f..507fec3 100644 --- a/src/bin/epp/cppexp.c +++ b/src/bin/epp/cppexp.c @@ -24,25 +24,22 @@ /* Parse a C expression from text in a string */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include "config.h" +#include "cpplib.h" +#include "cpphash.h" #ifdef __EMX__ -# include +#include #endif #ifdef MULTIBYTE_CHARS -# include +#include #endif #include #include #include -#include "cpplib.h" -#include "cpphash.h" - /* This is used for communicating lists of keywords with cccp.c. */ struct arglist { struct arglist *next; diff --git a/src/bin/epp/cpphash.c b/src/bin/epp/cpphash.c index e3b68e0..8545b9a 100644 --- a/src/bin/epp/cpphash.c +++ b/src/bin/epp/cpphash.c @@ -23,18 +23,15 @@ * You are forbidden to forbid anyone else to use, share and improve * what you give them. Help stamp out software-hoarding! */ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include - +#include "config.h" #include "cpplib.h" #include "cpphash.h" static HASHNODE *hashtab[HASHSIZE]; +#include +#include + #define IS_IDCHAR(ch) is_idchar[(unsigned char)(ch)] /* diff --git a/src/bin/epp/cpplib.c b/src/bin/epp/cpplib.c index 0e5b47a..cb9e094 100644 --- a/src/bin/epp/cpplib.c +++ b/src/bin/epp/cpplib.c @@ -23,23 +23,9 @@ * You are forbidden to forbid anyone else to use, share and improve * what you give them. Help stamp out software-hoarding! */ -#ifdef HAVE_CONFIG_H -# include -#endif +const char *version_string = "0.0.0"; -#ifdef HAVE_ALLOCA_H -# include -#elif defined __GNUC__ -# define alloca __builtin_alloca -#elif defined _AIX -# define alloca __alloca -#elif defined _MSC_VER -# include -# define alloca _alloca -#else -# include -void *alloca (size_t); -#endif +#include "config.h" #ifdef __EMX__ #include @@ -56,8 +42,6 @@ void *alloca (size_t); #include "cpplib.h" #include "cpphash.h" -const char *version_string = "0.0.0"; - #ifndef STDC_VALUE #define STDC_VALUE 1 #endif @@ -71,7 +55,12 @@ const char *version_string = "0.0.0"; #include #include #include +#ifdef __STDC__ #include +#endif +#ifdef HAVE_ALLOCA_H +#include +#endif #include #include #include @@ -82,9 +71,7 @@ const char *version_string = "0.0.0"; #ifndef USG #include #include /* for __DATE__ and __TIME__ */ -#ifdef HAVE_SYS_RESOURCE_H -# include -#endif +#include #else #include /* CYGNUS LOCAL: shebs -noquiet */ #include @@ -983,7 +970,7 @@ cpp_skip_hspace(cpp_reader * pfile) } else if (c == '@' && CPP_BUFFER(pfile)->has_escapes && is_hor_space[PEEKN(1)]) - FORWARD(1); + FORWARD(2); else return; } @@ -2756,8 +2743,6 @@ macroexpand(cpp_reader * pfile, HASHNODE * hp) continue; if (i < nargs || (nargs == 0 && i == 0)) { - unsigned char *bp; - /* if we are working on last arg which absorbs rest of args... */ if (i == nargs - 1 && defn->rest_args) rest_args = 1; @@ -2765,20 +2750,6 @@ macroexpand(cpp_reader * pfile, HASHNODE * hp) token = macarg(pfile, rest_args); args[i].raw_length = CPP_WRITTEN(pfile) - args[i].raw; args[i].newlines = 0; /* FIXME */ - bp = ARG_BASE + args[i].raw; - while (is_space[(unsigned char)(*bp)]) { bp++; } - args[i].raw_length -= bp - (ARG_BASE + args[i].raw); - args[i].raw = bp - ARG_BASE; - if (args[i].raw_length > 0) - { - bp = ARG_BASE + args[i].raw + args[i].raw_length - 1; - while (is_space[(unsigned char)(*bp)]) - { - bp--; - args[i].raw_length--; - if (args[i].raw_length < 1) break; - } - } } else token = macarg(pfile, 0); @@ -3080,6 +3051,7 @@ macroexpand(cpp_reader * pfile, HASHNODE * hp) if (totlen > xbuf_len) abort(); } + /* if there is anything left of the definition * after handling the arg list, copy that in too. */ @@ -3095,6 +3067,7 @@ macroexpand(cpp_reader * pfile, HASHNODE * hp) xbuf[totlen] = 0; xbuf_len = totlen; + } pfile->output_escapes--; @@ -4619,22 +4592,7 @@ cpp_get_token(cpp_reader * pfile) } else if (CPP_TRADITIONAL(pfile)) { - if (newlines > 0) - { - output_line_command(pfile, 0, same_file); - return CPP_VSPACE; - } - else - { - return CPP_COMMENT; - } - } - else if (newlines > 0) - { - output_line_command(pfile, 0, same_file); - CPP_RESERVE(pfile, 1); - CPP_PUTC_Q(pfile, ' '); - return CPP_VSPACE; + return CPP_COMMENT; } else { @@ -4859,9 +4817,10 @@ cpp_get_token(cpp_reader * pfile) } else if (is_space[c]) { - CPP_RESERVE(pfile, 1); + CPP_RESERVE(pfile, 2); if (pfile->output_escapes) CPP_PUTC_Q(pfile, '@'); + CPP_PUTC_Q(pfile, c); return CPP_HSPACE; } } diff --git a/src/bin/epp/cppmain.c b/src/bin/epp/cppmain.c index fdcc00c..0cf2d94 100644 --- a/src/bin/epp/cppmain.c +++ b/src/bin/epp/cppmain.c @@ -21,14 +21,11 @@ * You are forbidden to forbid anyone else to use, share and improve * what you give them. Help stamp out software-hoarding! */ -#ifdef HAVE_CONFIG_H -# include -#endif - #include #include #include +#include "config.h" #include "cpplib.h" #define EPP_DEBUG 0 @@ -93,6 +90,8 @@ main(int argc, char **argv) continue; case CPP_VSPACE: + if (!got_text) + goto next; break; default: diff --git a/src/lib/Edje.h b/src/lib/Edje.h index 569265e..0876977 100644 --- a/src/lib/Edje.h +++ b/src/lib/Edje.h @@ -114,8 +114,7 @@ typedef enum _Edje_Part_Type EDJE_PART_TYPE_BOX = 8, EDJE_PART_TYPE_TABLE = 9, EDJE_PART_TYPE_EXTERNAL = 10, - EDJE_PART_TYPE_PROXY = 11, - EDJE_PART_TYPE_LAST = 12 + EDJE_PART_TYPE_LAST = 11 } Edje_Part_Type; typedef enum _Edje_Text_Effect @@ -149,7 +148,8 @@ typedef enum _Edje_Action_Type EDJE_ACTION_TYPE_FOCUS_OBJECT = 10, EDJE_ACTION_TYPE_PARAM_COPY = 11, EDJE_ACTION_TYPE_PARAM_SET = 12, - EDJE_ACTION_TYPE_LAST = 13 + EDJE_ACTION_TYPE_HIDE_VISIBLE_PASSWORD = 13, + EDJE_ACTION_TYPE_LAST = 14 } Edje_Action_Type; typedef enum _Edje_Tween_Mode diff --git a/src/lib/edje_cache.c b/src/lib/edje_cache.c index b463a8a..6368ba0 100644 --- a/src/lib/edje_cache.c +++ b/src/lib/edje_cache.c @@ -60,7 +60,6 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) INIT_EMP_BOTH(RECTANGLE, Edje_Part_Description_Common, ce); INIT_EMP_BOTH(TEXT, Edje_Part_Description_Text, ce); INIT_EMP_BOTH(IMAGE, Edje_Part_Description_Image, ce); - INIT_EMP_BOTH(PROXY, Edje_Part_Description_Proxy, ce); INIT_EMP_BOTH(SWALLOW, Edje_Part_Description_Common, ce); INIT_EMP_BOTH(TEXTBLOCK, Edje_Part_Description_Text, ce); INIT_EMP_BOTH(GROUP, Edje_Part_Description_Common, ce); diff --git a/src/lib/edje_calc.c b/src/lib/edje_calc.c index efd1ecf..fc22f47 100644 --- a/src/lib/edje_calc.c +++ b/src/lib/edje_calc.c @@ -176,7 +176,6 @@ _edje_get_description_by_orientation(Edje *ed, Edje_Part_Description_Common *src EDIT_ALLOC_POOL_RTL(TEXT, Text, text); EDIT_ALLOC_POOL_RTL(TEXTBLOCK, Text, text); EDIT_ALLOC_POOL_RTL(IMAGE, Image, image); - EDIT_ALLOC_POOL_RTL(PROXY, Proxy, proxy); EDIT_ALLOC_POOL_RTL(BOX, Box, box); EDIT_ALLOC_POOL_RTL(TABLE, Table, table); EDIT_ALLOC_POOL_RTL(EXTERNAL, External, external_params); @@ -382,7 +381,11 @@ _edje_recalc(Edje *ed) } } if (ed->postponed) return; - evas_object_smart_changed(ed->obj); + //TODO: need to find out "when", "how" ed->obj can be deleted. + //if ed->obj can be deleted then this expception handling is granted. + //otherwise, we should fix app-usage and remove this handling. + if (ed->obj) + evas_object_smart_changed(ed->obj); ed->postponed = 1; } @@ -878,11 +881,11 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r, &ins_t, &ins_b); mw = ins_l + tw + ins_r; mh = ins_t + th + ins_b; - if (chosen_desc->text.min_x) +// if (chosen_desc->text.min_x) { if (mw > *minw) *minw = mw; } - if (chosen_desc->text.min_y) +// if (chosen_desc->text.min_y) { if (mh > *minh) *minh = mh; } @@ -1317,36 +1320,36 @@ _edje_part_recalc_single_drag(Edje_Real_Part *ep, static void _edje_part_recalc_single_fill(Edje_Real_Part *ep, - Edje_Part_Description_Spec_Fill *fill, + Edje_Part_Description_Spec_Image *desc, Edje_Calc_Params *params) { int fw; int fh; - params->smooth = fill->smooth; + params->smooth = desc->fill.smooth; - if (fill->type == EDJE_FILL_TYPE_TILE) + if (desc->fill.type == EDJE_FILL_TYPE_TILE) evas_object_image_size_get(ep->object, &fw, NULL); else fw = params->w; - params->type.common.fill.x = fill->pos_abs_x - + TO_INT(SCALE(fill->pos_rel_x, fw)); - params->type.common.fill.w = fill->abs_x - + TO_INT(SCALE(fill->rel_x, fw)); + params->type.common.fill.x = desc->fill.pos_abs_x + + TO_INT(SCALE(desc->fill.pos_rel_x, fw)); + params->type.common.fill.w = desc->fill.abs_x + + TO_INT(SCALE(desc->fill.rel_x, fw)); - if (fill->type == EDJE_FILL_TYPE_TILE) + if (desc->fill.type == EDJE_FILL_TYPE_TILE) evas_object_image_size_get(ep->object, NULL, &fh); else fh = params->h; - params->type.common.fill.y = fill->pos_abs_y - + TO_INT(SCALE(fill->pos_rel_y, fh)); - params->type.common.fill.h = fill->abs_y - + TO_INT(SCALE(fill->rel_y, fh)); + params->type.common.fill.y = desc->fill.pos_abs_y + + TO_INT(SCALE(desc->fill.pos_rel_y, fh)); + params->type.common.fill.h = desc->fill.abs_y + + TO_INT(SCALE(desc->fill.rel_y, fh)); - params->type.common.fill.angle = fill->angle; - params->type.common.fill.spread = fill->spread; + params->type.common.fill.angle = desc->fill.angle; + params->type.common.fill.spread = desc->fill.spread; } static void @@ -1485,9 +1488,7 @@ _edje_part_recalc_single(Edje *ed, /* fill */ if (ep->part->type == EDJE_PART_TYPE_IMAGE) - _edje_part_recalc_single_fill(ep, &((Edje_Part_Description_Image *)desc)->image.fill, params); - else if (ep->part->type == EDJE_PART_TYPE_PROXY) - _edje_part_recalc_single_fill(ep, &((Edje_Part_Description_Proxy *)desc)->proxy.fill, params); + _edje_part_recalc_single_fill(ep, &((Edje_Part_Description_Image *)desc)->image, params); /* colors */ if ((desc->color_class) && (*desc->color_class)) @@ -1566,7 +1567,6 @@ _edje_part_recalc_single(Edje *ed, case EDJE_PART_TYPE_TABLE: case EDJE_PART_TYPE_SWALLOW: case EDJE_PART_TYPE_GROUP: - case EDJE_PART_TYPE_PROXY: break; case EDJE_PART_TYPE_GRADIENT: /* FIXME: THIS ONE SHOULD NEVER BE TRIGGERED. */ @@ -1657,52 +1657,6 @@ _edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps, Edje_Part } static void -_edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Proxy *chosen_desc, FLOAT_T pos) -{ - Edje_Real_Part *pp; - int part_id; - - if (p3->type.common.fill.w == 0 || p3->type.common.fill.h == 0) - { - evas_object_image_source_set(ep->object, NULL); - return ; - } - - if (pos >= 0.5) { - part_id = ((Edje_Part_Description_Proxy*) ep->param2->description)->proxy.id; - } else { - part_id = chosen_desc->proxy.id; - } - - pp = ed->table_parts[part_id % ed->table_parts_size]; - - switch (pp->part->type) - { - case EDJE_PART_TYPE_IMAGE: - case EDJE_PART_TYPE_TEXT: - case EDJE_PART_TYPE_TEXTBLOCK: - case EDJE_PART_TYPE_RECTANGLE: - case EDJE_PART_TYPE_BOX: - case EDJE_PART_TYPE_TABLE: - case EDJE_PART_TYPE_PROXY: - evas_object_image_source_set(ep->object, pp->object); - break; - case EDJE_PART_TYPE_GRADIENT: - /* FIXME: THIS ONE SHOULD NEVER BE TRIGGERED. */ - break; - case EDJE_PART_TYPE_GROUP: - case EDJE_PART_TYPE_SWALLOW: - case EDJE_PART_TYPE_EXTERNAL: - evas_object_image_source_set(ep->object, pp->swallowed_object); - break; - } - - 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); -} - -static void _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Image *chosen_desc, FLOAT_T pos) { int image_id; @@ -2099,15 +2053,14 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags) switch (part_type) { case EDJE_PART_TYPE_IMAGE: - p3->type.common.spec.image.l = INTP(p1->type.common.spec.image.l, p2->type.common.spec.image.l, pos); - p3->type.common.spec.image.r = INTP(p1->type.common.spec.image.r, p2->type.common.spec.image.r, pos); - p3->type.common.spec.image.t = INTP(p1->type.common.spec.image.t, p2->type.common.spec.image.t, pos); - p3->type.common.spec.image.b = INTP(p1->type.common.spec.image.b, p2->type.common.spec.image.b, pos); - case EDJE_PART_TYPE_PROXY: p3->type.common.fill.x = INTP(p1->type.common.fill.x, p2->type.common.fill.x, pos); p3->type.common.fill.y = INTP(p1->type.common.fill.y, p2->type.common.fill.y, pos); p3->type.common.fill.w = INTP(p1->type.common.fill.w, p2->type.common.fill.w, pos); p3->type.common.fill.h = INTP(p1->type.common.fill.h, p2->type.common.fill.h, pos); + p3->type.common.spec.image.l = INTP(p1->type.common.spec.image.l, p2->type.common.spec.image.l, pos); + p3->type.common.spec.image.r = INTP(p1->type.common.spec.image.r, p2->type.common.spec.image.r, pos); + p3->type.common.spec.image.t = INTP(p1->type.common.spec.image.t, p2->type.common.spec.image.t, pos); + p3->type.common.spec.image.b = INTP(p1->type.common.spec.image.b, p2->type.common.spec.image.b, pos); break; case EDJE_PART_TYPE_TEXT: p3->type.text.size = INTP(p1->type.text.size, p2->type.text.size, pos); @@ -2164,7 +2117,6 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags) evas_object_image_scale_hint_set(ep->object, img_desc->image.scale_hint); } - case EDJE_PART_TYPE_PROXY: case EDJE_PART_TYPE_RECTANGLE: case EDJE_PART_TYPE_TEXTBLOCK: case EDJE_PART_TYPE_BOX: @@ -2205,9 +2157,6 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags) case EDJE_PART_TYPE_TEXT: _edje_text_recalc_apply(ed, ep, pf, (Edje_Part_Description_Text*) chosen_desc); break; - case EDJE_PART_TYPE_PROXY: - _edje_proxy_recalc_apply(ed, ep, pf, (Edje_Part_Description_Proxy*) chosen_desc, pos); - break; case EDJE_PART_TYPE_IMAGE: _edje_image_recalc_apply(ed, ep, pf, (Edje_Part_Description_Image*) chosen_desc, pos); break; diff --git a/src/lib/edje_data.c b/src/lib/edje_data.c index ea4bb24..23881b7 100644 --- a/src/lib/edje_data.c +++ b/src/lib/edje_data.c @@ -28,7 +28,6 @@ Eet_Data_Descriptor *_edje_edd_edje_part_description_rectangle = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_swallow = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_group = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_image = NULL; -Eet_Data_Descriptor *_edje_edd_edje_part_description_proxy = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_text = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_textblock = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_box = NULL; @@ -39,7 +38,6 @@ Eet_Data_Descriptor *_edje_edd_edje_part_description_rectangle_pointer = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_swallow_pointer = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_group_pointer = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_image_pointer = NULL; -Eet_Data_Descriptor *_edje_edd_edje_part_description_proxy_pointer = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_text_pointer = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_textblock_pointer = NULL; Eet_Data_Descriptor *_edje_edd_edje_part_description_box_pointer = NULL; @@ -71,7 +69,6 @@ Eet_Data_Descriptor *_edje_edd_edje_external_param = NULL; EMP(RECTANGLE, rectangle); EMP(TEXT, text); EMP(IMAGE, image); -EMP(PROXY, proxy); EMP(SWALLOW, swallow); EMP(TEXTBLOCK, textblock); EMP(GROUP, group); @@ -100,7 +97,6 @@ struct { { EDJE_PART_TYPE_BOX, "box" }, { EDJE_PART_TYPE_TABLE, "table" }, { EDJE_PART_TYPE_EXTERNAL, "external" }, - { EDJE_PART_TYPE_PROXY, "proxy" } }; static const char * @@ -180,7 +176,6 @@ _edje_edd_shutdown(void) FREED(_edje_edd_edje_part_description_swallow); FREED(_edje_edd_edje_part_description_group); FREED(_edje_edd_edje_part_description_image); - FREED(_edje_edd_edje_part_description_proxy); FREED(_edje_edd_edje_part_description_text); FREED(_edje_edd_edje_part_description_textblock); FREED(_edje_edd_edje_part_description_box); @@ -191,7 +186,6 @@ _edje_edd_shutdown(void) FREED(_edje_edd_edje_part_description_swallow_pointer); FREED(_edje_edd_edje_part_description_group_pointer); FREED(_edje_edd_edje_part_description_image_pointer); - FREED(_edje_edd_edje_part_description_proxy_pointer); FREED(_edje_edd_edje_part_description_text_pointer); FREED(_edje_edd_edje_part_description_textblock_pointer); FREED(_edje_edd_edje_part_description_box_pointer); @@ -289,7 +283,6 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.RECTANGLE", count.RECTANGLE, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.TEXT", count.TEXT, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.IMAGE", count.IMAGE, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.PROXY", count.PROXY, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.SWALLOW", count.SWALLOW, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.TEXTBLOCK", count.TEXTBLOCK, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.GROUP", count.GROUP, EET_T_INT); @@ -556,27 +549,6 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.spread", image.fill.spread, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.type", image.fill.type, EET_T_CHAR); - EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Proxy); - eddc.func.mem_free = mem_free_proxy; - eddc.func.mem_alloc = mem_alloc_proxy; - _edje_edd_edje_part_description_proxy = - eet_data_descriptor_file_new(&eddc); - EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON_SUB(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, common); - - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.id", proxy.id, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.smooth", proxy.fill.smooth, EET_T_CHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.pos_rel_x", proxy.fill.pos_rel_x, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.pos_abs_x", proxy.fill.pos_abs_x, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.rel_x", proxy.fill.rel_x, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.abs_x", proxy.fill.abs_x, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.pos_rel_y", proxy.fill.pos_rel_y, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.pos_abs_y", proxy.fill.pos_abs_y, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.rel_y", proxy.fill.rel_y, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.abs_y", proxy.fill.abs_y, EET_T_INT); - 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_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Text); eddc.func.mem_free = mem_free_text; eddc.func.mem_alloc = mem_alloc_text; @@ -676,7 +648,6 @@ _edje_edd_init(void) EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_swallow); EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_group); EDJE_DEFINE_POINTER_TYPE(Part_Description_Image, part_description_image); - EDJE_DEFINE_POINTER_TYPE(Part_Description_Proxy, part_description_proxy); EDJE_DEFINE_POINTER_TYPE(Part_Description_Text, part_description_text); EDJE_DEFINE_POINTER_TYPE(Part_Description_Text, part_description_textblock); EDJE_DEFINE_POINTER_TYPE(Part_Description_Box, part_description_box); @@ -692,7 +663,6 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "swallow", _edje_edd_edje_part_description_swallow); EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "group", _edje_edd_edje_part_description_group); EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "image", _edje_edd_edje_part_description_image); - EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "proxy", _edje_edd_edje_part_description_proxy); EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "text", _edje_edd_edje_part_description_text); EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "textblock", _edje_edd_edje_part_description_textblock); EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "box", _edje_edd_edje_part_description_box); @@ -716,7 +686,6 @@ _edje_edd_init(void) EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "swallow", swallow); EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "group", group); EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "image", image); - EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "proxy", proxy); EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "text", text); EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "textblock", textblock); EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "box", box); diff --git a/src/lib/edje_edit.c b/src/lib/edje_edit.c index 1b3de07..5c08002 100644 --- a/src/lib/edje_edit.c +++ b/src/lib/edje_edit.c @@ -2139,7 +2139,7 @@ _edje_edit_real_part_add(Evas_Object *obj, const char *name, Edje_Part_Type type if (ep->type == EDJE_PART_TYPE_RECTANGLE) rp->object = evas_object_rectangle_add(ed->evas); - else if (ep->type == EDJE_PART_TYPE_IMAGE || ep->type == EDJE_PART_TYPE_PROXY) + else if (ep->type == EDJE_PART_TYPE_IMAGE) rp->object = evas_object_image_add(ed->evas); else if (ep->type == EDJE_PART_TYPE_TEXT) { @@ -3163,28 +3163,6 @@ edje_edit_state_add(Evas_Object *obj, const char *part, const char *name, double img->image.fill.spread = 0; img->image.fill.type = EDJE_FILL_TYPE_SCALE; } - else if (rp->part->type == EDJE_PART_TYPE_PROXY) - { - Edje_Part_Description_Proxy *pro; - - pro = (Edje_Part_Description_Proxy*) pd; - - memset(&pro->proxy, 0, sizeof (pro->proxy)); - - pro->proxy.id = -1; - pro->proxy.fill.smooth = 1; - pro->proxy.fill.pos_rel_x = 0.0; - pro->proxy.fill.pos_abs_x = 0; - pro->proxy.fill.rel_x = 1.0; - pro->proxy.fill.abs_x = 0; - pro->proxy.fill.pos_rel_y = 0.0; - pro->proxy.fill.pos_abs_y = 0; - pro->proxy.fill.rel_y = 1.0; - pro->proxy.fill.abs_y = 0; - pro->proxy.fill.angle = 0; - pro->proxy.fill.spread = 0; - pro->proxy.fill.type = EDJE_FILL_TYPE_SCALE; - } else if (rp->part->type == EDJE_PART_TYPE_EXTERNAL) { Edje_Part_Description_External *external; @@ -3308,15 +3286,6 @@ edje_edit_state_copy(Evas_Object *obj, const char *part, const char *from, doubl switch (rp->part->type) { - case EDJE_PART_TYPE_PROXY: - { - Edje_Part_Description_Proxy *pro_to = (Edje_Part_Description_Proxy*) pdto; - Edje_Part_Description_Proxy *pro_from = (Edje_Part_Description_Proxy*) pdfrom; - - pro_to->proxy = pro_from->proxy; - - break; - } case EDJE_PART_TYPE_IMAGE: { Edje_Part_Description_Image *img_to = (Edje_Part_Description_Image*) pdto; @@ -3646,65 +3615,34 @@ FUNC_STATE_DOUBLE(aspect, max); EAPI double \ edje_edit_state_fill_##Type##_relative_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \ { \ + Edje_Part_Description_Image *img; \ + \ eina_error_set(0); \ \ GET_PD_OR_RETURN(0); \ \ - switch (rp->part->type) \ - { \ - case EDJE_PART_TYPE_IMAGE: \ - { \ - Edje_Part_Description_Image *img; \ - \ - img = (Edje_Part_Description_Image*) pd; \ - \ - return TO_DOUBLE(img->image.fill.Class##rel_##Value); \ - } \ - case EDJE_PART_TYPE_PROXY: \ - { \ - Edje_Part_Description_Proxy *pro; \ + if (rp->part->type != EDJE_PART_TYPE_IMAGE) \ + return 0; \ \ - pro = (Edje_Part_Description_Proxy*) pd; \ + img = (Edje_Part_Description_Image*) pd; \ \ - return TO_DOUBLE(pro->proxy.fill.Class##rel_##Value); \ - } \ - } \ - \ - return 0; \ + return TO_DOUBLE(img->image.fill.Class##rel_##Value); \ } \ EAPI void \ edje_edit_state_fill_##Type##_relative_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \ { \ + Edje_Part_Description_Image *img; \ + \ eina_error_set(0); \ \ GET_PD_OR_RETURN(); \ \ - switch (rp->part->type) \ - { \ - case EDJE_PART_TYPE_IMAGE: \ - { \ - Edje_Part_Description_Image *img; \ - \ - img = (Edje_Part_Description_Image*) pd; \ - \ - img->image.fill.Class##rel_##Value = FROM_DOUBLE(v); \ - \ - break; \ - } \ - case EDJE_PART_TYPE_PROXY: \ - { \ - Edje_Part_Description_Proxy *pro; \ - \ - pro = (Edje_Part_Description_Proxy*) pd; \ - \ - pro->proxy.fill.Class##rel_##Value = FROM_DOUBLE(v); \ + if (rp->part->type != EDJE_PART_TYPE_IMAGE) \ + return; \ \ - break; \ - } \ - default: \ - return; \ - } \ + img = (Edje_Part_Description_Image*) pd; \ \ + img->image.fill.Class##rel_##Value = FROM_DOUBLE(v); \ edje_object_calc_force(obj); \ } @@ -3712,62 +3650,34 @@ FUNC_STATE_DOUBLE(aspect, max); EAPI int \ edje_edit_state_fill_##Type##_offset_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \ { \ + Edje_Part_Description_Image *img; \ + \ eina_error_set(0); \ \ GET_PD_OR_RETURN(0); \ \ - switch (rp->part->type) \ - { \ - case EDJE_PART_TYPE_IMAGE: \ - { \ - Edje_Part_Description_Image *img; \ - \ - img = (Edje_Part_Description_Image*) pd; \ - \ - return img->image.fill.Class##abs_##Value; \ - } \ - case EDJE_PART_TYPE_PROXY: \ - { \ - Edje_Part_Description_Proxy *pro; \ + if (rp->part->type != EDJE_PART_TYPE_IMAGE) \ + return 0; \ \ - pro = (Edje_Part_Description_Proxy*) pd; \ + img = (Edje_Part_Description_Image*) pd; \ \ - return pro->proxy.fill.Class##abs_##Value; \ - } \ - } \ - return 0; \ + return img->image.fill.Class##abs_##Value; \ } \ EAPI void \ edje_edit_state_fill_##Type##_offset_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \ { \ + Edje_Part_Description_Image *img; \ + \ eina_error_set(0); \ \ GET_PD_OR_RETURN(); \ \ - switch (rp->part->type) \ - { \ - case EDJE_PART_TYPE_IMAGE: \ - { \ - Edje_Part_Description_Image *img; \ - \ - img = (Edje_Part_Description_Image*) pd; \ - \ - img->image.fill.Class##abs_##Value = FROM_DOUBLE(v); \ - return; \ - } \ - case EDJE_PART_TYPE_PROXY: \ - { \ - Edje_Part_Description_Proxy *pro; \ - \ - pro = (Edje_Part_Description_Proxy*) pd; \ + if (rp->part->type != EDJE_PART_TYPE_IMAGE) \ + return; \ \ - pro->proxy.fill.Class##abs_##Value = FROM_DOUBLE(v); \ - return; \ - } \ - default: \ - return; \ - } \ + img = (Edje_Part_Description_Image*) pd; \ \ + img->image.fill.Class##abs_##Value = FROM_DOUBLE(v); \ edje_object_calc_force(obj); \ } @@ -6965,7 +6875,7 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s //Fill BUF_APPEND(I5"fill {\n"); - if (!img->image.fill.smooth) + if (rp->part->type == EDJE_PART_TYPE_IMAGE && !img->image.fill.smooth) BUF_APPEND(I6"smooth: 0;\n"); //TODO Support spread @@ -6994,45 +6904,6 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s BUF_APPEND(I5"}\n"); } - if (rp->part->type == EDJE_PART_TYPE_PROXY) - { - Edje_Part_Description_Proxy *pro; - - pro = (Edje_Part_Description_Proxy *) pd; - - //Fill - - BUF_APPEND(I5"fill {\n"); - if (!pro->proxy.fill.smooth) - BUF_APPEND(I6"smooth: 0;\n"); - //TODO Support spread - //TODO Support source - - if (pro->proxy.fill.pos_rel_x || pro->proxy.fill.pos_rel_y || - pro->proxy.fill.pos_abs_x || pro->proxy.fill.pos_abs_y) - { - BUF_APPEND(I6"origin {\n"); - if (pro->proxy.fill.pos_rel_x || pro->proxy.fill.pos_rel_y) - BUF_APPENDF(I7"relative: %g %g;\n", TO_DOUBLE(pro->proxy.fill.pos_rel_x), TO_DOUBLE(pro->proxy.fill.pos_rel_y)); - if (pro->proxy.fill.pos_abs_x || pro->proxy.fill.pos_abs_y) - BUF_APPENDF(I7"offset: %d %d;\n", pro->proxy.fill.pos_abs_x, pro->proxy.fill.pos_abs_y); - BUF_APPEND(I6"}\n"); - } - - if (TO_DOUBLE(pro->proxy.fill.rel_x) != 1.0 || TO_DOUBLE(pro->proxy.fill.rel_y) != 1.0 || - pro->proxy.fill.abs_x || pro->proxy.fill.abs_y) - { - BUF_APPEND(I6"size {\n"); - if (pro->proxy.fill.rel_x != 1.0 || pro->proxy.fill.rel_y != 1.0) - BUF_APPENDF(I7"relative: %g %g;\n", TO_DOUBLE(pro->proxy.fill.rel_x), TO_DOUBLE(pro->proxy.fill.rel_y)); - if (pro->proxy.fill.abs_x || pro->proxy.fill.abs_y) - BUF_APPENDF(I7"offset: %d %d;\n", pro->proxy.fill.abs_x, pro->proxy.fill.abs_y); - BUF_APPEND(I6"}\n"); - } - - BUF_APPEND(I5"}\n"); - } - //Text if (rp->part->type == EDJE_PART_TYPE_TEXT) { diff --git a/src/lib/edje_entry.c b/src/lib/edje_entry.c index 254a837..2fa9349 100644 --- a/src/lib/edje_entry.c +++ b/src/lib/edje_entry.c @@ -47,7 +47,6 @@ struct _Entry Evas_Textblock_Cursor *sel_start, *sel_end; Evas_Textblock_Cursor *cursor_user, *cursor_user_extra; Evas_Textblock_Cursor *preedit_start, *preedit_end; - Ecore_Timer *pw_timer; Eina_List *sel; Eina_List *anchors; Eina_List *anchorlist; @@ -1042,7 +1041,7 @@ _anchors_update(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o, Entry *en) evas_object_show(ob); sel->obj_bg = ob; en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_bg); - + ob = edje_object_add(en->rp->edje->evas); edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source6); evas_object_smart_member_add(ob, smart); @@ -1052,7 +1051,7 @@ _anchors_update(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o, Entry *en) evas_object_show(ob); sel->obj_fg = ob; en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_fg); - + ob = evas_object_rectangle_add(en->rp->edje->evas); evas_object_color_set(ob, 0, 0, 0, 0); evas_object_smart_member_add(ob, smart); @@ -1074,7 +1073,7 @@ _anchors_update(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o, Entry *en) if (an->item) { Evas_Coord cx, cy, cw, ch; - + if (!evas_textblock_cursor_format_item_geometry_get (an->start, &cx, &cy, &cw, &ch)) continue; @@ -1084,7 +1083,7 @@ _anchors_update(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o, Entry *en) else { Evas_Textblock_Rectangle *r; - + r = range->data; *(&(sel->rect)) = *r; if (sel->obj_bg) @@ -1225,7 +1224,7 @@ _anchors_get(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) { if (an) { - /* + /* if (!firsttext) { if (an->name) free(an->name); @@ -1309,6 +1308,7 @@ _delete(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, Entry *en __UNUSED_ void _edje_entry_hide_visible_password(Edje_Real_Part *rp) { + Entry *en = rp->entry_data;/*remove this line*/ const Evas_Object_Textblock_Node_Format *node; node = evas_textblock_node_format_first_get(rp->object); for (; node ; node = evas_textblock_node_format_next_get(node)) @@ -1323,20 +1323,11 @@ _edje_entry_hide_visible_password(Edje_Real_Part *rp) } } } - _edje_entry_real_part_configure(rp); + _edje_entry_real_part_configure(rp); _edje_emit(rp->edje, "entry,changed", rp->part->name); -} - -static Eina_Bool -_password_timer_cb(void *data) -{ - Entry *en = (Entry *)data; - _edje_entry_hide_visible_password(en->rp); - /*count characters*/ + /*remove the below 2 lines*/ if (en->func) en->func(en->data, NULL); - en->pw_timer = NULL; - return ECORE_CALLBACK_CANCEL; } static void @@ -1700,25 +1691,19 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v // if PASSWORD_SHOW_LAST_CHARACTER mode, appending it with password tag if (rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD_SHOW_LAST_CHARACTER) - { - _edje_entry_hide_visible_password(en->rp); - /*if inputtin text is not allowed, dont allow text input*/ - if (en->func) - if (en->func(en->data, (void *)ev->string)) - return; - evas_object_textblock_text_markup_prepend(en->cursor, ""); - evas_object_textblock_text_markup_prepend(en->cursor, ev->string); - evas_object_textblock_text_markup_prepend(en->cursor, ""); - if (en->pw_timer) - { - ecore_timer_del(en->pw_timer); - en->pw_timer = NULL; - } - en->pw_timer = ecore_timer_add(2.0, _password_timer_cb, en); + { + _edje_entry_hide_visible_password(en->rp); + /*remove the below 3 lines*/ + if (en->func) + if (en->func(en->data, (void *)ev->string)) + return; + _text_filter_format_prepend(en, en->cursor, "+ password=off"); + _text_filter_markup_prepend(en, en->cursor, ev->string); + _text_filter_format_prepend(en, en->cursor, "- password"); } else { - /*if inputtin text is not allowed, dont allow text input*/ + /*remove the below 3 lines*/ if (en->func) if (en->func(en->data, (void *)ev->string)) return; @@ -1812,7 +1797,16 @@ _edje_entry_select_word(Edje_Real_Part *rp) str = eina_strbuf_new(); ct = _edje_entry_cursor_content_get(rp, EDJE_CURSOR_MAIN); - if (!ct || strlen(ct) == 0) return; + if (!ct || strlen(ct) == 0) + { + if (_edje_entry_cursor_prev(rp, EDJE_CURSOR_MAIN)) + { + ct = _edje_entry_cursor_content_get(rp, EDJE_CURSOR_MAIN); + if (!ct || strlen(ct) == 0) return; + } + else + return; + } block_type = _get_char_type(ct); @@ -1858,8 +1852,7 @@ _edje_entry_select_word(Edje_Real_Part *rp) static void _edje_entry_mouse_double_clicked(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { - Edje* ed = data; - Edje_Real_Part *rp = ed->focused_part; + Edje_Real_Part *rp = data; Entry *en; if (!rp) return; en = rp->entry_data; @@ -1876,17 +1869,18 @@ _long_press(void *data) { Edje_Real_Part *rp = data; Entry *en; - if (!rp) return; + if (!rp) return ECORE_CALLBACK_CANCEL; en = rp->entry_data; if (en->longpress_timer) { ecore_timer_del(en->longpress_timer); en->longpress_timer = NULL; - } - + } + en->long_pressed = EINA_TRUE; en->longpress_timer = NULL; + return ECORE_CALLBACK_CANCEL; } static void @@ -1904,7 +1898,7 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS en = rp->entry_data; en->double_clicked = EINA_FALSE; en->long_pressed = EINA_FALSE; - + if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) return; @@ -1926,7 +1920,7 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS return; } #endif - + en->select_mod_start = EINA_FALSE; en->select_mod_end = EINA_FALSE; if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_DEFAULT) @@ -1947,7 +1941,7 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS evas_object_geometry_get(rp->object, &x, &y, &w, &h); en->cx = ev->canvas.x - x; en->cy = ev->canvas.y - y; - + if (en->rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE) { evas_textblock_cursor_char_coord_set(en->cursor, en->cx, en->cy); @@ -1958,14 +1952,14 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS { Evas_Coord lx, ly, lw, lh; int line; - + line = evas_textblock_cursor_line_coord_set(en->cursor, en->cy); if (line == -1) _curs_end(en->cursor, rp->object, en); else { int lnum; - + lnum = evas_textblock_cursor_line_geometry_get(en->cursor, &lx, &ly, &lw, &lh); if (lnum < 0) { @@ -1983,19 +1977,19 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS } if (dosel) { - if ((en->have_selection) && + if ((en->have_selection) && ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT))) { Eina_List *first, *last; FLOAT_T sc; - + first = en->sel; last = eina_list_last(en->sel); if (first && last) { Evas_Textblock_Rectangle *r1, *r2; Evas_Coord d, d1, d2; - + r1 = first->data; r2 = last->data; d = r1->x - en->cx; @@ -2010,7 +2004,7 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS if (sc == ZERO) sc = _edje_scale; d = (Evas_Coord)MUL(FROM_INT(20), sc); // FIXME: maxing number! d = d * d; - + if (d1 < d2) { if (d1 <= d) @@ -2055,11 +2049,11 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS if (en->rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE) { - if (en->longpress_timer) ecore_timer_del(en->longpress_timer); - en->longpress_timer = ecore_timer_add(1.0, _long_press, data); + if (en->longpress_timer) ecore_timer_del(en->longpress_timer); + en->longpress_timer = ecore_timer_add(1.0, _long_press, data); } else - _edje_entry_real_part_configure(rp); + _edje_entry_real_part_configure(rp); } static void @@ -2085,7 +2079,11 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED } if (en->double_clicked) return; - if (en->long_pressed) return; + if (en->long_pressed) + { + en->long_pressed = EINA_FALSE; + return; + } #ifdef HAVE_ECORE_IMF if (en->imf_context) @@ -2133,7 +2131,7 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED if (rp->part->select_mode != EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE) { if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT)) - { + { if (en->select_allow) { if (en->had_sel) @@ -2150,7 +2148,7 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED } else evas_textblock_cursor_copy(en->cursor, en->sel_end); - + if (en->selecting) { if (en->have_selection) @@ -2175,7 +2173,7 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED #endif _caps_mode_check(en); - + _edje_entry_real_part_configure(rp); } @@ -2204,10 +2202,26 @@ _edje_part_mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS return; } #endif - + if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE) { _edje_entry_real_part_configure(rp); + if (en->long_pressed) + { + tc = evas_object_textblock_cursor_new(rp->object); + evas_textblock_cursor_copy(en->cursor, tc); + evas_object_geometry_get(rp->object, &x, &y, &w, &h); + + en->cx = ev->cur.canvas.x - x; + en->cy = ev->cur.canvas.y - y; + evas_textblock_cursor_char_coord_set(en->cursor, en->cx, en->cy); + + if (evas_textblock_cursor_compare(tc, en->cursor)) + _edje_emit(rp->edje, "cursor,changed", rp->part->name); + evas_textblock_cursor_free(tc); + + _edje_emit(en->rp->edje, "magnifier,changed", en->rp->part->name); + } } else { @@ -2230,7 +2244,7 @@ _edje_part_mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS else _curs_lin_end(en->cursor, rp->object, en); } - + if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) || (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE)) { @@ -2367,7 +2381,7 @@ _edje_entry_top_handler_mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Objec } _edje_entry_real_part_configure(rp); - + _edje_emit(en->rp->edje, "handler,moving", en->rp->part->name); } @@ -2461,6 +2475,8 @@ _edje_entry_bottom_handler_mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Ob } _edje_entry_real_part_configure(rp); + + _edje_emit(en->rp->edje, "handler,moving", en->rp->part->name); } static void @@ -2599,8 +2615,7 @@ _edje_entry_real_part_init(Edje_Real_Part *rp) { ob = edje_object_add(en->rp->edje->evas); edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source3); - evas_object_smart_member_add(ob, smart); - evas_object_stack_above(ob, rp->object); + evas_object_layer_set(ob, EVAS_LAYER_MAX - 2); en->block_handler_top = ob; en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, en->block_handler_top); evas_object_event_callback_add(ob, EVAS_CALLBACK_MOUSE_DOWN, _edje_entry_top_handler_mouse_down_cb, en->rp); @@ -2612,8 +2627,7 @@ _edje_entry_real_part_init(Edje_Real_Part *rp) { ob = edje_object_add(en->rp->edje->evas); edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source2); - evas_object_smart_member_add(ob, smart); - evas_object_stack_above(ob, rp->object); + evas_object_layer_set(ob, EVAS_LAYER_MAX - 2); en->block_handler_btm = ob; en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, en->block_handler_btm); evas_object_event_callback_add(ob, EVAS_CALLBACK_MOUSE_DOWN, _edje_entry_bottom_handler_mouse_down_cb, en->rp); @@ -2678,7 +2692,7 @@ _edje_entry_real_part_init(Edje_Real_Part *rp) } done: en->cursor = (Evas_Textblock_Cursor *)evas_object_textblock_cursor_get(rp->object); - + edje_object_signal_callback_add(rp->edje->obj, "mouse,down,1,double", rp->part->name, _edje_entry_mouse_double_clicked, rp); } @@ -2695,15 +2709,23 @@ _edje_entry_real_part_shutdown(Edje_Real_Part *rp) #endif rp->edje->subobjs = eina_list_remove(rp->edje->subobjs, en->cursor_bg); rp->edje->subobjs = eina_list_remove(rp->edje->subobjs, en->cursor_fg); + rp->edje->subobjs = eina_list_remove(rp->edje->subobjs, en->block_handler_top); + rp->edje->subobjs = eina_list_remove(rp->edje->subobjs, en->block_handler_btm); evas_object_del(en->cursor_bg); evas_object_del(en->cursor_fg); - if (en->pw_timer) + if (en->block_handler_top) + evas_object_del(en->block_handler_top); + if (en->block_handler_btm) + evas_object_del(en->block_handler_btm); + + if (en->longpress_timer) { - ecore_timer_del(en->pw_timer); - en->pw_timer = NULL; + ecore_timer_del(en->longpress_timer); + en->longpress_timer = NULL; } + #ifdef HAVE_ECORE_IMF if (rp->part->entry_mode >= EDJE_ENTRY_EDIT_MODE_EDITABLE) { @@ -2918,9 +2940,11 @@ _edje_entry_select_all(Edje_Real_Part *rp) #endif _edje_entry_real_part_configure(rp); - + en->select_allow = EINA_TRUE; en->had_sel = EINA_TRUE; + + _edje_emit(en->rp->edje, "selection,end", en->rp->part->name); } void @@ -3083,7 +3107,7 @@ _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow) return; en->select_allow = allow; - + if ((allow) && (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE)) { _edje_entry_select_word(rp); @@ -3104,7 +3128,7 @@ _edje_entry_textinput_callback_set(Edje_Real_Part * rp, Edje_elm_function func, { Entry *en = rp->entry_data; if (!en) return; - + en->func = func; en->data = data; } @@ -3633,23 +3657,16 @@ _edje_entry_imf_event_commit_cb(void *data, int type __UNUSED__, void *event) if (rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD_SHOW_LAST_CHARACTER) { - _edje_entry_hide_visible_password(en->rp); + _edje_entry_hide_visible_password(en->rp); /* if inputtin text is not allowed, dont allow text input */ if (en->func) { - if (en->func(en->data, (void *)ev->str)) return ECORE_CALLBACK_PASS_ON; + if (en->func(en->data, (void *)ev->str)) return ECORE_CALLBACK_PASS_ON; } - evas_object_textblock_text_markup_prepend(en->cursor, ""); - evas_object_textblock_text_markup_prepend(en->cursor, ev->str); - evas_object_textblock_text_markup_prepend(en->cursor, ""); - - if (en->pw_timer) - { - ecore_timer_del(en->pw_timer); - en->pw_timer = NULL; - } - en->pw_timer = ecore_timer_add(2.0, _password_timer_cb, en); + _text_filter_format_prepend(en, tc, "+ password=off"); + _text_filter_markup_prepend(en, tc, ev->str); + _text_filter_format_prepend(en, tc, "- password"); } else { @@ -3719,7 +3736,6 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void * if (en->imf_context != ev->ctx) return ECORE_CALLBACK_PASS_ON; -// ecore_imf_context_preedit_string_get(en->imf_context, &preedit_string, &cursor_pos); ecore_imf_context_preedit_string_with_attributes_get(en->imf_context, &preedit_string, &attrs, &cursor_pos); if (!strcmp(preedit_string, "")) @@ -3749,7 +3765,7 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void * /* insert preedit character(s) */ //xx - if (strlen(preedit_string) > 0) + if (strlen(preedit_string) > 0) { buf = eina_strbuf_new(); if (attrs) @@ -3805,7 +3821,7 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void * evas_textblock_cursor_pos_set(en->cursor, preedit_start_pos + cursor_pos); } - /* count characters*/ + /* count characters*/ if (en->func) en->func(en->data, NULL); diff --git a/src/lib/edje_load.c b/src/lib/edje_load.c index 1e828b1..fef632d 100644 --- a/src/lib/edje_load.c +++ b/src/lib/edje_load.c @@ -464,7 +464,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g case EDJE_PART_TYPE_RECTANGLE: rp->object = evas_object_rectangle_add(ed->evas); break; - case EDJE_PART_TYPE_PROXY: case EDJE_PART_TYPE_IMAGE: rp->object = evas_object_image_add(ed->evas); break; @@ -1258,7 +1257,6 @@ _edje_collection_free(Edje_File *edf, Edje_Part_Collection *ec, Edje_Part_Collec eina_mempool_del(ce->mp.RECTANGLE); eina_mempool_del(ce->mp.TEXT); eina_mempool_del(ce->mp.IMAGE); - eina_mempool_del(ce->mp.PROXY); eina_mempool_del(ce->mp.SWALLOW); eina_mempool_del(ce->mp.TEXTBLOCK); eina_mempool_del(ce->mp.GROUP); @@ -1271,7 +1269,6 @@ _edje_collection_free(Edje_File *edf, Edje_Part_Collection *ec, Edje_Part_Collec eina_mempool_del(ce->mp_rtl.RECTANGLE); eina_mempool_del(ce->mp_rtl.TEXT); eina_mempool_del(ce->mp_rtl.IMAGE); - eina_mempool_del(ce->mp_rtl.PROXY); eina_mempool_del(ce->mp_rtl.SWALLOW); eina_mempool_del(ce->mp_rtl.TEXTBLOCK); eina_mempool_del(ce->mp_rtl.GROUP); @@ -1347,7 +1344,6 @@ _edje_collection_free_part_description_free(int type, FREE_POOL(RECTANGLE, ce, desc); FREE_POOL(TEXT, ce, desc); FREE_POOL(IMAGE, ce, desc); - FREE_POOL(PROXY, ce, desc); FREE_POOL(SWALLOW, ce, desc); FREE_POOL(TEXTBLOCK, ce, desc); FREE_POOL(GROUP, ce, desc); diff --git a/src/lib/edje_private.h b/src/lib/edje_private.h index b0576a4..dc96619 100644 --- a/src/lib/edje_private.h +++ b/src/lib/edje_private.h @@ -277,7 +277,6 @@ typedef struct _Edje_Part_Api Edje_Part_Api; typedef struct _Edje_Part_Dragable Edje_Part_Dragable; typedef struct _Edje_Part_Image_Id Edje_Part_Image_Id; typedef struct _Edje_Part_Description_Image Edje_Part_Description_Image; -typedef struct _Edje_Part_Description_Proxy Edje_Part_Description_Proxy; typedef struct _Edje_Part_Description_Text Edje_Part_Description_Text; typedef struct _Edje_Part_Description_Box Edje_Part_Description_Box; typedef struct _Edje_Part_Description_Table Edje_Part_Description_Table; @@ -286,7 +285,6 @@ typedef struct _Edje_Part_Description_Common Edje_Part_Description_Commo typedef struct _Edje_Part_Description_Spec_Fill Edje_Part_Description_Spec_Fill; typedef struct _Edje_Part_Description_Spec_Border Edje_Part_Description_Spec_Border; typedef struct _Edje_Part_Description_Spec_Image Edje_Part_Description_Spec_Image; -typedef struct _Edje_Part_Description_Spec_Proxy Edje_Part_Description_Spec_Proxy; typedef struct _Edje_Part_Description_Spec_Text Edje_Part_Description_Spec_Text; typedef struct _Edje_Part_Description_Spec_Box Edje_Part_Description_Spec_Box; typedef struct _Edje_Part_Description_Spec_Table Edje_Part_Description_Spec_Table; @@ -581,7 +579,6 @@ struct _Edje_Program_After /* the action to run after another action */ TYPE RECTANGLE; \ TYPE TEXT; \ TYPE IMAGE; \ - TYPE PROXY; \ TYPE SWALLOW; \ TYPE TEXTBLOCK; \ TYPE GROUP; \ @@ -836,8 +833,6 @@ struct _Edje_Part_Description_Spec_Border struct _Edje_Part_Description_Spec_Image { - Edje_Part_Description_Spec_Fill fill; - Edje_Part_Image_Id **tweens; /* list of Edje_Part_Image_Id */ unsigned int tweens_count; /* number of tweens */ @@ -846,13 +841,7 @@ struct _Edje_Part_Description_Spec_Image Eina_Bool set; /* if image condition it's content */ Edje_Part_Description_Spec_Border border; -}; - -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 */ }; struct _Edje_Part_Description_Spec_Text @@ -908,12 +897,6 @@ struct _Edje_Part_Description_Image Edje_Part_Description_Spec_Image image; }; -struct _Edje_Part_Description_Proxy -{ - Edje_Part_Description_Common common; - Edje_Part_Description_Spec_Proxy proxy; -}; - struct _Edje_Part_Description_Text { Edje_Part_Description_Common common; @@ -973,8 +956,6 @@ typedef struct _Edje_Signals_Sources_Patterns Edje_Signals_Sources_Patterns; typedef Eina_Bool(*Edje_elm_function) (void *data, void *input_data); struct _Edje { - Evas_Object *clipper; /* a big rect to clip this Edje to */ - Evas *evas; /* the Evas this Edje belongs to */ const Edje_Smart_Api *api; const char *path; const char *group; @@ -983,7 +964,9 @@ struct _Edje Evas_Coord x, y, w, h; Edje_Size min; double paused_at; + Evas *evas; /* the Evas this Edje belongs to */ Evas_Object *obj; /* the smart object */ + Evas_Object *clipper; /* a big rect to clip this Edje to */ Edje_File *file; /* the file the data comes form */ Edje_Part_Collection *collection; /* the description being used */ Eina_List *actions; /* currently running actions */ @@ -1448,7 +1431,6 @@ extern Eina_Mempool *_edje_real_part_state_mp; extern Eina_Mempool *_emp_RECTANGLE; extern Eina_Mempool *_emp_TEXT; extern Eina_Mempool *_emp_IMAGE; -extern Eina_Mempool *_emp_PROXY; extern Eina_Mempool *_emp_SWALLOW; extern Eina_Mempool *_emp_TEXTBLOCK; extern Eina_Mempool *_emp_GROUP; @@ -1530,6 +1512,7 @@ const char * _edje_text_class_font_get(Edje *ed, Edje_Real_Part *_edje_real_part_get(const Edje *ed, const char *part); Edje_Real_Part *_edje_real_part_recursive_get(const Edje *ed, const char *part); +Edje *_edje_recursive_get(Edje *ed, const char *part, Edje_Real_Part **orp); Edje_Color_Class *_edje_color_class_find(Edje *ed, const char *color_class); void _edje_color_class_member_add(Edje *ed, const char *color_class); void _edje_color_class_member_del(Edje *ed, const char *color_class); @@ -1543,7 +1526,7 @@ void _edje_text_class_member_del(Edje *ed, const char *text_class); void _edje_text_class_members_free(void); void _edje_text_class_hash_free(void); -Edje *_edje_fetch(const Evas_Object *obj) EINA_PURE; +Edje *_edje_fetch(const Evas_Object *obj); int _edje_freeze(Edje *ed); int _edje_thaw(Edje *ed); int _edje_block(Edje *ed); diff --git a/src/lib/edje_program.c b/src/lib/edje_program.c index c21a248..cab227b 100644 --- a/src/lib/edje_program.c +++ b/src/lib/edje_program.c @@ -963,6 +963,13 @@ _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, if (_edje_block_break(ed)) goto break_prog; } break; + case EDJE_ACTION_TYPE_HIDE_VISIBLE_PASSWORD: + { + Edje_Real_Part *part; + part = ed->table_parts[pr->param.dst % ed->table_parts_size]; + _edje_entry_hide_visible_password(part); + } + break; default: // _edje_emit(ed, "program,start", pr->name); // _edje_emit(ed, "program,stop", pr->name); @@ -1001,7 +1008,7 @@ _edje_emit(Edje *ed, const char *sig, const char *src) if (ed->delete_me) return; - sep = strchr(sig, EDJE_PART_PATH_SEPARATOR); + sep = strrchr(sig, EDJE_PART_PATH_SEPARATOR); /* If we are not sending the signal to a part of the child, the * signal if for ourself @@ -1009,120 +1016,56 @@ _edje_emit(Edje *ed, const char *sig, const char *src) if (sep) { Edje_Real_Part *rp = NULL; - const char *newsig; Edje *ed2; - char *part; - char *idx; + char *newsig; size_t length; + char *part; - /* the signal contains a colon, split the signal into "parts:signal" */ - length = sep - sig + 1; + /* the signal contains a colon, split the signal into "parts:signal", + * use _edje_real_part_recursive_get_helper to find the real part. + */ + length = strlen(sig) + 1; part = alloca(length); - memcpy(part, sig, length - 1); - part[length - 1] = '\0'; + memcpy(part, sig, length); - newsig = sep + 1; + newsig = part + (sep - sig); - /* lookup for alias */ - if (ed->collection && ed->collection->alias) - { - char *alias; - - alias = eina_hash_find(ed->collection->alias, part); - if (alias) { - char *aliased; - int alien; - int nslen; - - alien = strlen(alias); - nslen = strlen(newsig); - length = alien + nslen + 2; - - aliased = alloca(length); - memcpy(aliased, alias, alien); - aliased[alien] = EDJE_PART_PATH_SEPARATOR; - memcpy(aliased + alien + 1, newsig, nslen + 1); - - _edje_emit(ed, aliased, src); - return; - } - } + *newsig = '\0'; + newsig++; - /* search for the index if present and remove it from the part */ - idx = strchr(part, EDJE_PART_PATH_SEPARATOR_INDEXL); - if (idx) + ed2 = _edje_recursive_get(ed, part, &rp); + if (ed2 && ed2 != ed) { - char *end; - - end = strchr(idx + 1, EDJE_PART_PATH_SEPARATOR_INDEXR); - if (end && end != idx + 1) - { - char *tmp; - - tmp = alloca(end - idx - 1); - memcpy(tmp, idx + 1, end - idx - 1); - tmp[end - idx - 1] = '\0'; - *idx = '\0'; - idx = tmp; - } - else - { - idx = NULL; - } + _edje_emit(ed2, newsig, src); } - - /* search for the right part now */ - rp = _edje_real_part_get(ed, part); - if (!rp) goto end; - - switch (rp->part->type) + else if (rp) { - case EDJE_PART_TYPE_GROUP: - if (!rp->swallowed_object) goto end; - ed2 = _edje_fetch(rp->swallowed_object); - if (!ed2) goto end; + switch (rp->part->type) + { + case EDJE_PART_TYPE_EXTERNAL: + if (!rp->swallowed_object) break ; - _edje_emit(ed2, newsig, src); - break; + _edje_external_signal_emit(rp->swallowed_object, newsig, src); + break ; + case EDJE_PART_TYPE_BOX: + case EDJE_PART_TYPE_TABLE: + _edje_emit(rp->edje, newsig, src); + break ; + case EDJE_PART_TYPE_GROUP: + if (!rp->swallowed_object) break; - case EDJE_PART_TYPE_EXTERNAL: - if (!rp->swallowed_object) break ; + ed2 = _edje_fetch(rp->swallowed_object); + if (!ed2) break; - if (!idx) - { - _edje_external_signal_emit(rp->swallowed_object, newsig, src); - } - else - { - Evas_Object *child; - - child = _edje_children_get(rp, idx); - ed2 = _edje_fetch(child); - if (!ed2) goto end; - _edje_emit(ed2, newsig, src); - } - break ; - - case EDJE_PART_TYPE_BOX: - case EDJE_PART_TYPE_TABLE: - if (idx) - { - Evas_Object *child; - - child = _edje_children_get(rp, idx); - ed2 = _edje_fetch(child); - if (!ed2) goto end; _edje_emit(ed2, newsig, src); - } - break ; - - default: - fprintf(stderr, "SPANK SPANK SPANK !!!\nYou should never be here !\n"); - break; + break ; + default: + fprintf(stderr, "SPANK SPANK SPANK !!!\nYou should never be here !\n"); + break; + } } } - end: emsg.sig = sig; emsg.src = src; _edje_message_send(ed, EDJE_QUEUE_SCRIPT, EDJE_MESSAGE_SIGNAL, 0, &emsg); diff --git a/src/lib/edje_smart.c b/src/lib/edje_smart.c index 884579e..358e6b6 100644 --- a/src/lib/edje_smart.c +++ b/src/lib/edje_smart.c @@ -6,12 +6,14 @@ static void _edje_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y); static void _edje_smart_resize(Evas_Object * obj, Evas_Coord w, Evas_Coord h); static void _edje_smart_show(Evas_Object * obj); static void _edje_smart_hide(Evas_Object * obj); +static void _edje_smart_color_set(Evas_Object * obj, int r, int g, int b, int a); +static void _edje_smart_clip_set(Evas_Object * obj, Evas_Object * clip); +static void _edje_smart_clip_unset(Evas_Object * obj); static void _edje_smart_calculate(Evas_Object * obj); static Eina_Bool _edje_smart_file_set(Evas_Object *obj, const char *file, const char *group); static Edje_Smart_Api _edje_smart_class = EDJE_SMART_API_INIT_NAME_VERSION("edje"); -static Evas_Smart_Class _edje_smart_parent; static Evas_Smart *_edje_smart = NULL; Eina_List *_edje_edjes = NULL; @@ -32,12 +34,12 @@ edje_object_add(Evas *evas) Evas_Object *e; if (!_edje_smart) { - memset(&_edje_smart_parent, 0, sizeof(_edje_smart_parent)); _edje_object_smart_set(&_edje_smart_class); _edje_smart = evas_smart_class_new((Evas_Smart_Class *)&_edje_smart_class); } e = evas_object_smart_add(evas, _edje_smart); + ed = _edje_fetch(e); return e; } @@ -48,22 +50,18 @@ _edje_object_smart_set(Edje_Smart_Api *sc) if (!sc) return; - evas_object_smart_clipped_smart_set(&sc->base); - - _edje_smart_parent.add = sc->base.add; /* Save parent class */ sc->base.add = _edje_smart_add; - _edje_smart_parent.del = sc->base.del; /* Save parent class */ sc->base.del = _edje_smart_del; - /* we'll handle move thank you */ sc->base.move = _edje_smart_move; sc->base.resize = _edje_smart_resize; - _edje_smart_parent.show = sc->base.show; /* Save parent class */ sc->base.show = _edje_smart_show; - _edje_smart_parent.hide = sc->base.hide; /* Save parent class */ sc->base.hide = _edje_smart_hide; + sc->base.color_set = _edje_smart_color_set; + sc->base.clip_set = _edje_smart_clip_set; + sc->base.clip_unset = _edje_smart_clip_unset; sc->base.calculate = _edje_smart_calculate; - //sc->base.member_add = NULL; - //sc->base.member_del = NULL; + sc->base.member_add = NULL; + sc->base.member_del = NULL; sc->file_set = _edje_smart_file_set; } @@ -239,10 +237,12 @@ _edje_smart_show(Evas_Object * obj) { Edje *ed; - _edje_smart_parent.show(obj); ed = evas_object_smart_data_get(obj); if (!ed) return; if (evas_object_visible_get(obj)) return; + if (evas_object_visible_get(ed->clipper)) return; + if ((ed->collection) && (evas_object_clipees_get(ed->clipper))) + evas_object_show(ed->clipper); if (_edje_script_only(ed)) { _edje_script_only_show(ed); @@ -261,10 +261,12 @@ _edje_smart_hide(Evas_Object * obj) { Edje *ed; - _edje_smart_parent.hide(obj); ed = evas_object_smart_data_get(obj); if (!ed) return; if (!evas_object_visible_get(obj)) return; + if (!evas_object_visible_get(ed->clipper)) return; + if ((ed->collection) && (evas_object_clipees_get(ed->clipper))) + evas_object_hide(ed->clipper); if (_edje_script_only(ed)) { _edje_script_only_hide(ed); @@ -279,6 +281,41 @@ _edje_smart_hide(Evas_Object * obj) } static void +_edje_smart_color_set(Evas_Object * obj, int r, int g, int b, int a) +{ + Edje *ed; + + ed = evas_object_smart_data_get(obj); + if (!ed) return; + evas_object_color_set(ed->clipper, r, g, b, a); +// _edje_emit(ed, "color_set", NULL); +} + +static void +_edje_smart_clip_set(Evas_Object * obj, Evas_Object * clip) +{ + Edje *ed; + + ed = evas_object_smart_data_get(obj); + if (!ed) return; + if (evas_object_clip_get(obj) == clip) return; + evas_object_clip_set(ed->clipper, clip); +// _edje_emit(ed, "clip_set", NULL); +} + +static void +_edje_smart_clip_unset(Evas_Object * obj) +{ + Edje *ed; + + ed = evas_object_smart_data_get(obj); + if (!ed) return; + if (!evas_object_clip_get(obj)) return; + evas_object_clip_unset(ed->clipper); +// _edje_emit(ed, "clip_unset", NULL); +} + +static void _edje_smart_calculate(Evas_Object *obj) { Edje *ed; diff --git a/src/lib/edje_util.c b/src/lib/edje_util.c index ac5bce8..305ffb0 100644 --- a/src/lib/edje_util.c +++ b/src/lib/edje_util.c @@ -42,6 +42,7 @@ static void _edje_object_image_preload_cb(void *data, Evas *e, Evas_Object *obj, static void _edje_object_signal_preload_cb(void *data, Evas_Object *obj, const char *emission, const char *source); Edje_Real_Part *_edje_real_part_recursive_get_helper(const Edje *ed, char **path); +static Edje *_edje_recursive_get_helper(Edje *ed, char **path, Edje_Real_Part **orp); /************************** API Routines **************************/ @@ -2021,7 +2022,7 @@ edje_object_part_text_autocapitalization_set(const Evas_Object *obj, const char { Edje *ed; Edje_Real_Part *rp; - + ed = _edje_fetch(obj); if ((!ed) || (!part)) return; rp = _edje_real_part_recursive_get(ed, (char *)part); @@ -2073,7 +2074,7 @@ edje_object_part_text_imf_context_get(const Evas_Object *obj, const char *part) ed = _edje_fetch(obj); if ((!ed) || (!part)) return NULL; - + rp = _edje_real_part_recursive_get(ed, (char *)part); if (!rp) return NULL; @@ -2134,12 +2135,10 @@ edje_object_part_text_input_panel_enabled_get(const Evas_Object *obj, const char } /** - * @brief Advances the cursor to the next cursor position. - * @see evas_textblock_cursor_char_next + * @brief XX * * @param obj A valid Evas_Object handle * @param part The part name - * @param cur The edje cursor to advance */ EAPI Eina_Bool edje_object_part_text_cursor_next(Evas_Object *obj, const char *part, Edje_Cursor cur) @@ -2159,12 +2158,10 @@ edje_object_part_text_cursor_next(Evas_Object *obj, const char *part, Edje_Curso } /** - * @brief Moves the cursor to the previous char - * @see evas_textblock_cursor_char_prev + * @brief XX * * @param obj A valid Evas_Object handle * @param part The part name - * @param cur the edje cursor to work on */ EAPI Eina_Bool edje_object_part_text_cursor_prev(Evas_Object *obj, const char *part, Edje_Cursor cur) @@ -2184,11 +2181,10 @@ edje_object_part_text_cursor_prev(Evas_Object *obj, const char *part, Edje_Curso } /** - * @brief Move the cursor to the char above the current cursor position. + * @brief XX * * @param obj A valid Evas_Object handle * @param part The part name - * @param cur the edje cursor to work on */ EAPI Eina_Bool edje_object_part_text_cursor_up(Evas_Object *obj, const char *part, Edje_Cursor cur) @@ -2208,11 +2204,10 @@ edje_object_part_text_cursor_up(Evas_Object *obj, const char *part, Edje_Cursor } /** - * @brief Moves the cursor to the char below the current cursor position. + * @brief XX * * @param obj A valid Evas_Object handle * @param part The part name - * @param cur the edje cursor to work on */ EAPI Eina_Bool edje_object_part_text_cursor_down(Evas_Object *obj, const char *part, Edje_Cursor cur) @@ -2232,12 +2227,10 @@ edje_object_part_text_cursor_down(Evas_Object *obj, const char *part, Edje_Curso } /** - * @brief Moves the cursor to the beginning of the text part - * @see evas_textblock_cursor_paragraph_first + * @brief XX * * @param obj A valid Evas_Object handle * @param part The part name - * @param cur the edje cursor to work on */ EAPI void edje_object_part_text_cursor_begin_set(Evas_Object *obj, const char *part, Edje_Cursor cur) @@ -2256,12 +2249,10 @@ edje_object_part_text_cursor_begin_set(Evas_Object *obj, const char *part, Edje_ } /** - * @brief Moves the cursor to the end of the text part. - * @see evas_textblock_cursor_paragraph_last + * @brief XX * * @param obj A valid Evas_Object handle * @param part The part name - * @param cur the edje cursor to work on */ EAPI void edje_object_part_text_cursor_end_set(Evas_Object *obj, const char *part, Edje_Cursor cur) @@ -2280,12 +2271,10 @@ edje_object_part_text_cursor_end_set(Evas_Object *obj, const char *part, Edje_Cu } /** - * @brief Copy the cursor to another cursor. + * @brief XX * * @param obj A valid Evas_Object handle * @param part The part name - * @param sry the cursor to copy from - * @param dst the cursor to copy to */ EAPI void edje_object_part_text_cursor_copy(Evas_Object *obj, const char *part, Edje_Cursor src, Edje_Cursor dst) @@ -2304,12 +2293,10 @@ edje_object_part_text_cursor_copy(Evas_Object *obj, const char *part, Edje_Curso } /** - * @brief Move the cursor to the beginning of the line. - * @see evas_textblock_cursor_line_char_first + * @brief XX * * @param obj A valid Evas_Object handle * @param part The part name - * @param cur the edje cursor to work on */ EAPI void edje_object_part_text_cursor_line_begin_set(Evas_Object *obj, const char *part, Edje_Cursor cur) @@ -2328,12 +2315,10 @@ edje_object_part_text_cursor_line_begin_set(Evas_Object *obj, const char *part, } /** - * @brief Move the cursor to the end of the line. - * @see evas_textblock_cursor_line_char_last + * @brief XX * * @param obj A valid Evas_Object handle * @param part The part name - * @param cur the edje cursor to work on */ EAPI void edje_object_part_text_cursor_line_end_set(Evas_Object *obj, const char *part, Edje_Cursor cur) @@ -2382,13 +2367,10 @@ edje_object_part_text_cursor_coord_set(Evas_Object *obj, const char *part, } /** - * @brief Returns whether the cursor points to a format. - * @see evas_textblock_cursor_is_format + * @brief XX * * @param obj A valid Evas_Object handle * @param part The part name - * @param cur The cursor to adjust. - * @return EINA_TRUE if it's true, EINA_FALSE otherwise. */ EAPI Eina_Bool edje_object_part_text_cursor_is_format_get(const Evas_Object *obj, const char *part, Edje_Cursor cur) @@ -2408,13 +2390,10 @@ edje_object_part_text_cursor_is_format_get(const Evas_Object *obj, const char *p } /** - * @brief Return true if the cursor points to a visible format - * For example \t, \n, item and etc. - * @see evas_textblock_cursor_format_is_visible_get + * @brief XX * * @param obj A valid Evas_Object handle * @param part The part name - * @param cur The cursor to adjust. */ EAPI Eina_Bool edje_object_part_text_cursor_is_visible_format_get(const Evas_Object *obj, const char *part, Edje_Cursor cur) @@ -2434,12 +2413,10 @@ edje_object_part_text_cursor_is_visible_format_get(const Evas_Object *obj, const } /** - * @brief Returns the content (char) at the cursor position. - * @see evas_textblock_cursor_content_get + * @brief XX * * @param obj A valid Evas_Object handle * @param part The part name - * @param cur The cursor to use */ EAPI const char * edje_object_part_text_cursor_content_get(const Evas_Object *obj, const char *part, Edje_Cursor cur) @@ -4736,6 +4713,22 @@ _edje_real_part_recursive_get(const Edje *ed, const char *part) return rp; } +Edje * +_edje_recursive_get(Edje *ed, const char *part, Edje_Real_Part **orp) +{ + Edje *oed; + char **path; + + path = eina_str_split(part, EDJE_PART_PATH_SEPARATOR_STRING, 0); + if (!path) return NULL; + + oed = _edje_recursive_get_helper(ed, path, orp); + + free(*path); + free(path); + return oed; +} + Evas_Object * _edje_children_get(Edje_Real_Part *rp, const char *partid) { @@ -4881,6 +4874,85 @@ _edje_real_part_recursive_get_helper(const Edje *ed, char **path) } /* Private Routines */ +static Edje * +_edje_recursive_get_helper(Edje *ed, char **path, Edje_Real_Part **orp) +{ + Evas_Object *child; + Edje_Real_Part *rp; + char *idx = NULL; + + if (!path[0]) + return NULL; + + if (ed->collection && ed->collection->alias) + { + char *alias; + + alias = _edje_merge_path(eina_hash_find(ed->collection->alias, path[0]), path + 1); + if (alias) { + Edje *tmp; + + tmp = _edje_recursive_get(ed, alias, orp); + free(alias); + return tmp; + } + } + + //printf(" lookup: %s on %s\n", path[0], ed->parent ? ed->parent : "-"); + idx = strchr(path[0], EDJE_PART_PATH_SEPARATOR_INDEXL); + if (idx) + { + char *end; + + end = strchr(idx + 1, EDJE_PART_PATH_SEPARATOR_INDEXR); + if (end) + { + *end = '\0'; + *idx = '\0'; + idx++; + } + } + + rp = _edje_real_part_get(ed, path[0]); + if (!rp) return NULL; + + if (!path[1] && !idx) + { + *orp = rp; + return rp->edje; + } + + switch (rp->part->type) + { + case EDJE_PART_TYPE_GROUP: + if (!rp->swallowed_object) return NULL; + ed = _edje_fetch(rp->swallowed_object); + if (!ed) return NULL; + path++; + + if (!path[0]) return ed; + return _edje_recursive_get_helper(ed, path, orp); + case EDJE_PART_TYPE_BOX: + case EDJE_PART_TYPE_TABLE: + case EDJE_PART_TYPE_EXTERNAL: + if (!idx) + { + *orp = rp; + return NULL; + } + path++; + + child = _edje_children_get(rp, idx); + + ed = _edje_fetch(child); + if (!ed) return NULL; + if (!path[0]) return ed; + return _edje_recursive_get_helper(ed, path, orp); + default: + return NULL; + } +} + Edje_Real_Part * _edje_real_part_get(const Edje *ed, const char *part) { @@ -5211,7 +5283,7 @@ _edje_real_part_swallow_hints_update(Edje_Real_Part *rp) rp->swallow_params.min.h = h1; if (w2 > 0) rp->swallow_params.max.w = w2; if (h2 > 0) rp->swallow_params.max.h = h2; - switch (am) + switch (am) { case EVAS_ASPECT_CONTROL_NONE: rp->swallow_params.aspect.mode = EDJE_ASPECT_CONTROL_NONE;