From 825a3d837a33f226c879cd02ad15c3fba57e8b2c Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 23 Jan 2012 23:30:42 +1000 Subject: Update the EFL to what I'm actually using, coz I'm using some stuff not yet released. --- libraries/edje/src/Makefile.in | 2 - libraries/edje/src/bin/Makefile.in | 2 - libraries/edje/src/bin/edje_cc.h | 1 + libraries/edje/src/bin/edje_cc_handlers.c | 129 +++--- libraries/edje/src/bin/edje_cc_out.c | 35 +- libraries/edje/src/bin/edje_cc_parse.c | 6 - libraries/edje/src/bin/edje_decc.c | 3 +- libraries/edje/src/bin/edje_inspector.c | 202 +++++----- libraries/edje/src/bin/edje_multisense_convert.c | 2 +- libraries/edje/src/bin/epp/Makefile.in | 2 - libraries/edje/src/bin/epp/cppmain.c | 13 +- libraries/edje/src/examples/Makefile.am | 104 ++--- libraries/edje/src/examples/Makefile.in | 135 +++---- libraries/edje/src/examples/Vera.ttf | Bin 0 -> 65932 bytes libraries/edje/src/examples/lua_script.edc | 12 + libraries/edje/src/examples/multisense.edc | 139 +++++++ libraries/edje/src/examples/signals-messages.edc | 8 +- libraries/edje/src/lib/Edje.h | 40 +- libraries/edje/src/lib/Makefile.in | 2 - libraries/edje/src/lib/edje_cache.c | 13 +- libraries/edje/src/lib/edje_calc.c | 447 ++++++++++++--------- libraries/edje/src/lib/edje_callbacks.c | 5 + libraries/edje/src/lib/edje_data.c | 3 + libraries/edje/src/lib/edje_edit.c | 131 +++--- libraries/edje/src/lib/edje_embryo.c | 2 + libraries/edje/src/lib/edje_entry.c | 350 +++++++++------- libraries/edje/src/lib/edje_load.c | 151 +++---- libraries/edje/src/lib/edje_lua2.c | 269 ++++++++++++- libraries/edje/src/lib/edje_main.c | 5 +- libraries/edje/src/lib/edje_message_queue.c | 4 +- libraries/edje/src/lib/edje_module.c | 4 +- libraries/edje/src/lib/edje_multisense.c | 12 +- libraries/edje/src/lib/edje_private.h | 13 +- libraries/edje/src/lib/edje_program.c | 4 +- libraries/edje/src/lib/edje_util.c | 44 +- libraries/edje/src/modules/Makefile.in | 2 - .../edje/src/modules/alsa_snd_player/Makefile.in | 2 - .../edje/src/modules/eet_snd_reader/Makefile.in | 2 - .../src/modules/multisense_factory/Makefile.in | 2 - .../multisense_factory/multisense_factory.c | 66 +-- libraries/edje/src/tests/Makefile.in | 2 - 41 files changed, 1450 insertions(+), 920 deletions(-) create mode 100644 libraries/edje/src/examples/Vera.ttf create mode 100644 libraries/edje/src/examples/multisense.edc (limited to 'libraries/edje/src') diff --git a/libraries/edje/src/Makefile.in b/libraries/edje/src/Makefile.in index 532d75b..fc05386 100644 --- a/libraries/edje/src/Makefile.in +++ b/libraries/edje/src/Makefile.in @@ -193,8 +193,6 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/libraries/edje/src/bin/Makefile.in b/libraries/edje/src/bin/Makefile.in index 877bcb2..07bf025 100644 --- a/libraries/edje/src/bin/Makefile.in +++ b/libraries/edje/src/bin/Makefile.in @@ -291,8 +291,6 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/libraries/edje/src/bin/edje_cc.h b/libraries/edje/src/bin/edje_cc.h index bcd31a1..d0c6d22 100644 --- a/libraries/edje/src/bin/edje_cc.h +++ b/libraries/edje/src/bin/edje_cc.h @@ -138,6 +138,7 @@ struct _Edje_Part_Parser /* global fn calls */ void data_setup(void); void data_write(void); +void data_queue_group_lookup(const char *name, Edje_Part *part); void data_queue_part_lookup(Edje_Part_Collection *pc, const char *name, int *dest); void data_queue_copied_part_lookup(Edje_Part_Collection *pc, int *src, int *dest); void data_queue_program_lookup(Edje_Part_Collection *pc, const char *name, int *dest); diff --git a/libraries/edje/src/bin/edje_cc_handlers.c b/libraries/edje/src/bin/edje_cc_handlers.c index 8bfc262..f74fa12 100644 --- a/libraries/edje/src/bin/edje_cc_handlers.c +++ b/libraries/edje/src/bin/edje_cc_handlers.c @@ -172,6 +172,7 @@ static void st_collections_group_parts_part_description_visible(void); static void st_collections_group_parts_part_description_align(void); static void st_collections_group_parts_part_description_fixed(void); static void st_collections_group_parts_part_description_min(void); +static void st_collections_group_parts_part_description_minmul(void); static void st_collections_group_parts_part_description_max(void); static void st_collections_group_parts_part_description_step(void); static void st_collections_group_parts_part_description_aspect(void); @@ -261,12 +262,9 @@ static void st_collections_group_programs_program_after(void); static void st_collections_group_programs_program_api(void); static void ob_collections_group_programs_program_script(void); - -#ifdef ENABLE_MULTISENSE static void st_collections_group_sound_sample_name(void); static void st_collections_group_sound_sample_source(void); static void st_collections_group_sound_tone(void); -#endif /*****/ @@ -305,14 +303,13 @@ New_Statement_Handler statement_handlers[] = {"collections.color_classes.color_class.color", st_color_class_color}, /* dup */ {"collections.color_classes.color_class.color2", st_color_class_color2}, /* dup */ {"collections.color_classes.color_class.color3", st_color_class_color3}, /* dup */ -#ifdef ENABLE_MULTISENSE + {"collections.sounds.sample.name", st_collections_group_sound_sample_name}, {"collections.sounds.sample.source", st_collections_group_sound_sample_source}, {"collections.group.sounds.sample.name", st_collections_group_sound_sample_name}, /* dup */ {"collections.group.sounds.sample.source", st_collections_group_sound_sample_source}, /* dup */ {"collections.sounds.tone", st_collections_group_sound_tone}, {"collections.group.sounds.tone", st_collections_group_sound_tone}, /* dup */ -#endif {"collections.group.name", st_collections_group_name}, {"collections.group.inherit", st_collections_group_inherit}, {"collections.group.script_only", st_collections_group_script_only}, @@ -438,6 +435,7 @@ New_Statement_Handler statement_handlers[] = {"collections.group.parts.part.description.align", st_collections_group_parts_part_description_align}, {"collections.group.parts.part.description.fixed", st_collections_group_parts_part_description_fixed}, {"collections.group.parts.part.description.min", st_collections_group_parts_part_description_min}, + {"collections.group.parts.part.description.minmul", st_collections_group_parts_part_description_minmul}, {"collections.group.parts.part.description.max", st_collections_group_parts_part_description_max}, {"collections.group.parts.part.description.step", st_collections_group_parts_part_description_step}, {"collections.group.parts.part.description.aspect", st_collections_group_parts_part_description_aspect}, @@ -677,14 +675,13 @@ New_Object_Handler object_handlers[] = {"collections.styles.style", ob_styles_style}, /* dup */ {"collections.color_classes", NULL}, /* dup */ {"collections.color_classes.color_class", ob_color_class}, /* dup */ -#ifdef ENABLE_MULTISENSE {"collections.sounds", NULL}, {"collections.group.sounds", NULL}, /* dup */ {"collections.sounds.sample", NULL}, {"collections.group.sounds.sample", NULL}, /* dup */ -#endif {"collections.group", ob_collections_group}, {"collections.group.data", NULL}, + {"collections.group.limits", NULL}, {"collections.group.script", ob_collections_group_script}, {"collections.group.lua_script", ob_collections_group_lua_script}, {"collections.group.externals", NULL}, /* dup */ @@ -1836,12 +1833,6 @@ st_styles_style_tag(void) stl->tags = eina_list_append(stl->tags, tag); } -#ifdef ENABLE_MULTISENSE -/* add to below doc -sounds { } - */ -#endif - /** @page edcref @block @@ -1851,6 +1842,7 @@ sounds { } .. group { } group { } + sounds { } .. } @description @@ -1866,8 +1858,7 @@ ob_collections(void) edje_file->collection = eina_hash_string_small_new(NULL); } -#ifdef ENABLE_MULTISENSE -/* * delete space before * +/** @page edcref @block sounds @@ -1980,7 +1971,7 @@ st_collections_group_sound_sample_name(void) } -/* * delete space before * +/** @page edcref @property source @@ -2016,7 +2007,7 @@ st_collections_group_sound_sample_source(void) check_arg_count(1); } -/* * delete space before * +/** @page edcref @property tone @@ -2079,7 +2070,6 @@ st_collections_group_sound_tone(void) tone->value = value; tone->id = edje_file->sound_dir->tones_count - 1; } -#endif /** @edcsection{group,Group sub blocks} @@ -2677,14 +2667,14 @@ st_collections_group_orientation(void) @block limits @context - group { + group { limits { - vertical: "limit_name" height_barrier; - horizontal: "limit_name" width_barrier; - .. - } - .. - } + vertical: "limit_name" height_barrier; + horizontal: "limit_name" width_barrier; + .. + } + .. + } .. @description This block is used to trigger some signal when the Edje object is resized. @@ -2696,10 +2686,10 @@ st_collections_group_orientation(void) @parameters [name] [height barrier] @effect - It will send a signal: "limit,name,over" when the object is resized and pass - the limit by growing over it. And it will send: "limit,name,below" when - it pass below that limit. - This limit will be applied on the y absis. + It will send a signal: "limit,name,over" when the object is resized and pass + the limit by growing over it. And it will send: "limit,name,below" when + it pass below that limit. + This limit will be applied on the y absis and is expressed in pixels. @endproperty */ static void @@ -2734,10 +2724,10 @@ st_collections_group_limits_vertical(void) @parameters [name] [width barrier] @effect - It will send a signal: "limit,name,over" when the object is resized and pass - the limit by growing over it. And it will send: "limit,name,below" when - it pass below that limit. - This limit will be applied on the x absis. + It will send a signal: "limit,name,over" when the object is resized and pass + the limit by growing over it. And it will send: "limit,name,below" when + it pass below that limit. + This limit will be applied on the x absis and is expressed in pixels. @endproperty */ static void @@ -3224,6 +3214,7 @@ st_collections_group_parts_part_source(void) //FIXME: validate this somehow (need to decide on the format also) current_part->source = parse_str(0); + data_queue_group_lookup(current_part->source, current_part); } /** @@ -3245,6 +3236,7 @@ st_collections_group_parts_part_source2(void) //FIXME: validate this somehow (need to decide on the format also) current_part->source2 = parse_str(0); + data_queue_group_lookup(current_part->source2, current_part); } /** @@ -3266,6 +3258,7 @@ st_collections_group_parts_part_source3(void) //FIXME: validate this somehow (need to decide on the format also) current_part->source3 = parse_str(0); + data_queue_group_lookup(current_part->source3, current_part); } /** @@ -3287,6 +3280,7 @@ st_collections_group_parts_part_source4(void) //FIXME: validate this somehow (need to decide on the format also) current_part->source4 = parse_str(0); + data_queue_group_lookup(current_part->source4, current_part); } /** @@ -3308,6 +3302,7 @@ st_collections_group_parts_part_source5(void) //FIXME: validate this somehow (need to decide on the format also) current_part->source5 = parse_str(0); + data_queue_group_lookup(current_part->source5, current_part); } /** @@ -3329,6 +3324,7 @@ st_collections_group_parts_part_source6(void) //FIXME: validate this somehow (need to decide on the format also) current_part->source6 = parse_str(0); + data_queue_group_lookup(current_part->source6, current_part); } /** @@ -3439,10 +3435,9 @@ st_collections_group_parts_part_entry_mode(void) [MODE] @effect Sets the selection mode for a textblock part to one of: - @li DEFAULT - @li EXPLICIT - DEFAULT selection mode is what you would expect on any desktop. Press - mouse, drag and release to end. EXPLICIT mode requires the application + @li DEFAULT selection mode is what you would expect on any desktop. Press + mouse, drag and release to end. + @li EXPLICITmode requires the application controlling the edje object has to explicitly begin and end selection modes, and the selection itself is dragable at both ends. @endproperty @@ -3466,11 +3461,9 @@ st_collections_group_parts_part_select_mode(void) [MODE] @effect Sets the cursor mode for a textblock part to one of: - @li UNDER - @li BEFORE - UNDER cursor mode means the cursor will draw below the character pointed + @li UNDER cursor mode means the cursor will draw below the character pointed at. That's the default. - BEFORE cursor mode means the cursor is drawn as a vertical line before + @li BEFORE cursor mode means the cursor is drawn as a vertical line before the current character, just like many other GUI toolkits handle it. @endproperty */ @@ -3816,6 +3809,7 @@ static void st_collections_group_parts_part_box_items_item_source(void) check_arg_count(1); current_item->source = parse_str(0); + data_queue_group_lookup(current_item->source, current_part); } /** @@ -4140,6 +4134,9 @@ ob_collections_group_parts_part_description(void) ed->map.persp_on = 0; ed->persp.zplane = 0; ed->persp.focal = 1000; + ed->minmul.have = 1; + ed->minmul.w = FROM_INT(1); + ed->minmul.h = FROM_INT(1); } /** @@ -4558,6 +4555,27 @@ st_collections_group_parts_part_description_min(void) /** @page edcref @property + minmul + @parameters + [width multipler] [height multiplier] + @effect + A multiplier FORCIBLY applied to whatever minimum size is only during + minimum size calculation. + @endproperty + @since 1.2 +*/ +static void +st_collections_group_parts_part_description_minmul(void) +{ + check_arg_count(2); + + current_desc->minmul.w = FROM_DOUBLE(parse_float_range(0, 0, 999999)); + current_desc->minmul.h = FROM_DOUBLE(parse_float_range(1, 0, 999999)); +} + +/** + @page edcref + @property max @parameters [width] [height] @@ -4605,7 +4623,7 @@ st_collections_group_parts_part_description_step(void) Normally width and height can be resized to any values independently. The aspect property forces the width to height ratio to be kept between the minimum and maximum set. For example, "1.0 1.0" will increase the - width a pixel for every pixel added to heigh. The default value is + width a pixel for every pixel added to height. The default value is "0.0 0.0" disabling aspect. @endproperty */ @@ -4626,7 +4644,7 @@ st_collections_group_parts_part_description_aspect(void) [DIMENSION] @effect Sets the scope of the "aspect" property to a given dimension. Available - options are BOTH, VERTICAL, HORIZONTAL and NONE + options are BOTH, VERTICAL, HORIZONTAL, SOURCE and NONE @endproperty */ static void @@ -4639,6 +4657,7 @@ st_collections_group_parts_part_description_aspect_preference(void) "VERTICAL", EDJE_ASPECT_PREFER_VERTICAL, "HORIZONTAL", EDJE_ASPECT_PREFER_HORIZONTAL, "BOTH", EDJE_ASPECT_PREFER_BOTH, + "SOURCE", EDJE_ASPECT_PREFER_SOURCE, NULL); } @@ -7236,15 +7255,6 @@ st_collections_group_programs_program_in(void) current_program->in.range = parse_float_range(1, 0.0, 999999999.0); } -#ifdef ENABLE_MULTISENSE -/* add to docs below -, PLAY_SAMPLE, PLAY_TONE - - action: PLAY_SAMPLE "sample name";\n - action: PLAY_TONE "tone name" duration in seconds ( Range 0.1 to 10.0 );\n -*/ -#endif - /** @page edcref @property @@ -7254,7 +7264,7 @@ st_collections_group_programs_program_in(void) @effect Action to be performed by the program. Valid actions are: STATE_SET, ACTION_STOP, SIGNAL_EMIT, DRAG_VAL_SET, DRAG_VAL_STEP, DRAG_VAL_PAGE, - FOCUS_SET, PARAM_COPY, PARAM_SET + FOCUS_SET, PARAM_COPY, PARAM_SET, PLAY_SAMPLE, PLAY_TONE Only one action can be specified per program. Examples:\n action: STATE_SET "statename" 0.5;\n action: ACTION_STOP;\n @@ -7266,6 +7276,8 @@ st_collections_group_programs_program_in(void) action: FOCUS_OBJECT;\n action: PARAM_COPY "src_part" "src_param" "dst_part" "dst_param";\n action: PARAM_SET "part" "param" "value";\n + action: PLAY_SAMPLE "sample name";\n + action: PLAY_TONE "tone name" duration in seconds ( Range 0.1 to 10.0 );\n @endproperty */ static void @@ -7273,6 +7285,7 @@ st_collections_group_programs_program_action(void) { Edje_Part_Collection *pc; Edje_Program *ep; + int i; pc = eina_list_data_get(eina_list_last(edje_collections)); ep = current_program; @@ -7288,10 +7301,8 @@ 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, -#ifdef ENABLE_MULTISENSE "PLAY_SAMPLE", EDJE_ACTION_TYPE_SOUND_SAMPLE, "PLAY_TONE", EDJE_ACTION_TYPE_SOUND_TONE, -#endif NULL); if (ep->action == EDJE_ACTION_TYPE_STATE_SET) { @@ -7303,11 +7314,8 @@ st_collections_group_programs_program_action(void) ep->state = parse_str(1); ep->state2 = parse_str(2); } -#ifdef ENABLE_MULTISENSE else if (ep->action == EDJE_ACTION_TYPE_SOUND_SAMPLE) { - int i; - ep->sample_name = parse_str(1); for (i = 0; i < (int)edje_file->sound_dir->samples_count; i++) { @@ -7324,8 +7332,6 @@ st_collections_group_programs_program_action(void) } else if (ep->action == EDJE_ACTION_TYPE_SOUND_TONE) { - int i; - ep->tone_name = parse_str(1); for (i = 0; i < (int)edje_file->sound_dir->tones_count; i++) { @@ -7340,7 +7346,6 @@ st_collections_group_programs_program_action(void) } ep->duration = parse_float_range(2, 0.1, 10.0); } -#endif else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_SET) { ep->value = parse_float(1); @@ -7402,14 +7407,12 @@ st_collections_group_programs_program_action(void) case EDJE_ACTION_TYPE_PARAM_SET: check_arg_count(4); break; -#ifdef ENABLE_MULTISENSE case EDJE_ACTION_TYPE_SOUND_SAMPLE: check_arg_count(3); break; case EDJE_ACTION_TYPE_SOUND_TONE: check_arg_count(3); break; -#endif default: check_arg_count(3); } diff --git a/libraries/edje/src/bin/edje_cc_out.c b/libraries/edje/src/bin/edje_cc_out.c index 443a702..5050ad4 100644 --- a/libraries/edje/src/bin/edje_cc_out.c +++ b/libraries/edje/src/bin/edje_cc_out.c @@ -72,6 +72,7 @@ struct _Program_Lookup struct _Group_Lookup { char *name; + Edje_Part *part; }; struct _String_Lookup @@ -808,8 +809,8 @@ data_write_groups(Eet_File *ef, int *collection_num) if (verbose) { - printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" collection entry\n", - progname, bytes, (bytes + 512) / 1024, buf); + printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" aka \"%s\" collection entry\n", + progname, bytes, (bytes + 512) / 1024, buf, pc->part); } } @@ -1371,13 +1372,16 @@ reorder_parts(void) } void -data_queue_group_lookup(char *name) +data_queue_group_lookup(const char *name, Edje_Part *part) { Group_Lookup *gl; + if (!name || !name[0]) return; + gl = mem_alloc(SZ(Group_Lookup)); group_lookups = eina_list_append(group_lookups, gl); gl->name = mem_strdup(name); + gl->part = part; } void @@ -1698,15 +1702,38 @@ data_process_lookups(void) { Edje_Part_Collection_Directory_Entry *de; + if (group->part) + { + if (group->part->type != EDJE_PART_TYPE_GROUP + && group->part->type != EDJE_PART_TYPE_TEXTBLOCK + && group->part->type != EDJE_PART_TYPE_BOX + && group->part->type != EDJE_PART_TYPE_TABLE) + goto free_group; + } + de = eina_hash_find(edje_file->collection, group->name); if (!de) + { + Eina_Bool found = EINA_FALSE; + + EINA_LIST_FOREACH(aliases, l, de) + if (strcmp(de->entry, group->name) == 0) + { + found = EINA_TRUE; + break; + } + if (!found) de = NULL; + } + + if (!de) { ERR("%s: Error. Unable to find group name \"%s\".", progname, group->name); exit(-1); } + free_group: free(group->name); free(group); } @@ -1914,7 +1941,7 @@ _data_queue_program_lookup(Edje_Part_Collection *pc, char *name, char *ptr, int static void _data_queue_group_lookup(Edje_Part_Collection *pc __UNUSED__, char *name, char *ptr __UNUSED__, int len __UNUSED__) { - data_queue_group_lookup(name); + data_queue_group_lookup(name, NULL); } static void _data_queue_image_pc_lookup(Edje_Part_Collection *pc __UNUSED__, char *name, char *ptr, int len) diff --git a/libraries/edje/src/bin/edje_cc_parse.c b/libraries/edje/src/bin/edje_cc_parse.c index ae68e00..adc08d3 100644 --- a/libraries/edje/src/bin/edje_cc_parse.c +++ b/libraries/edje/src/bin/edje_cc_parse.c @@ -238,8 +238,6 @@ next_token(char *p, char *end, char **new_p, int *delim) int in_comment_sa = 0; int had_quote = 0; int is_escaped = 0; - char *cpp_token_line = NULL; - char *cpp_token_file = NULL; *delim = 0; if (p >= end) return NULL; @@ -249,8 +247,6 @@ next_token(char *p, char *end, char **new_p, int *delim) { in_comment_ss = 0; in_comment_cpp = 0; - cpp_token_line = NULL; - cpp_token_file = NULL; line++; } if ((!in_comment_ss) && (!in_comment_sa)) @@ -275,8 +271,6 @@ next_token(char *p, char *end, char **new_p, int *delim) /* their line format is * #line [??] */ - cpp_token_line = NULL; - cpp_token_file = NULL; pp = p; while ((pp < end) && (*pp != '\n')) diff --git a/libraries/edje/src/bin/edje_decc.c b/libraries/edje/src/bin/edje_decc.c index 1b79e13..ac776e9 100644 --- a/libraries/edje/src/bin/edje_decc.c +++ b/libraries/edje/src/bin/edje_decc.c @@ -69,7 +69,6 @@ main(int argc, char **argv) eina_shutdown(); exit(-1); } - eina_log_level_set(EINA_LOG_LEVEL_INFO); progname = argv[0]; for (i = 1; i < argc; i++) { @@ -104,7 +103,7 @@ main(int argc, char **argv) if (!decomp()) return -1; output(); - printf("WARNING! If any Image or audio data was encoded in a LOSSY way, then\n" + fprintf(stderr, "WARNING! If any Image or audio data was encoded in a LOSSY way, then\n" "re-encoding will drop quality even more. You need access to the original\n" "data to ensure no loss of quality.\n"); eet_close(ef); diff --git a/libraries/edje/src/bin/edje_inspector.c b/libraries/edje/src/bin/edje_inspector.c index ed3baaf..093de86 100644 --- a/libraries/edje/src/bin/edje_inspector.c +++ b/libraries/edje/src/bin/edje_inspector.c @@ -263,20 +263,20 @@ border_fill_name_get(int id) } static void -state_details(Evas_Object *ed, const char *part, const char *state, double value) +state_details(Evas_Object *ed, const char *ppart, const char *state, double value) { - Edje_Part_Type t = edje_edit_part_type_get(ed, part); + Edje_Part_Type t = edje_edit_part_type_get(ed, ppart); double dx, dy; const char *str, *str2; int x, y, r, g, b, a; if (detail < 1) return; - b = edje_edit_state_visible_get(ed, part, state, value); + b = edje_edit_state_visible_get(ed, ppart, state, value); if (machine) printf("VISIBLE: %d\n", b); else if (!b) puts(INDENT4 "visible: 0;"); - edje_edit_state_color_get(ed, part, state, value, &r, &g, &b, &a); + edje_edit_state_color_get(ed, ppart, state, value, &r, &g, &b, &a); if (machine) printf("COLOR-R: %d\nCOLOR-G: %d\nCOLOR-B: %d\nCOLOR-A: %d\n", r, g, b, a); else if ((r != 255) || (g != 255) || (b != 255) || (a != 255)) @@ -284,14 +284,14 @@ state_details(Evas_Object *ed, const char *part, const char *state, double value if (detail > 1) { - edje_edit_state_color2_get(ed, part, state, value, &r, &g, &b, &a); + edje_edit_state_color2_get(ed, ppart, state, value, &r, &g, &b, &a); if (machine) printf("COLOR2-R: %d\nCOLOR2-G: %d\nCOLOR2-B: %d\nCOLOR2-A: %d\n", r, g, b, a); else if ((r != 255) || (g != 255) || (b != 255) || (a != 255)) printf(INDENT4 "color2: %d %d %d %d;\n", r, g, b, a); - edje_edit_state_color3_get(ed, part, state, value, &r, &g, &b, &a); + edje_edit_state_color3_get(ed, ppart, state, value, &r, &g, &b, &a); if (machine) printf("COLOR3-R: %d\nCOLOR3-G: %d\nCOLOR3-B: %d\nCOLOR3-A: %d\n", r, g, b, a); @@ -299,19 +299,19 @@ state_details(Evas_Object *ed, const char *part, const char *state, double value printf(INDENT4 "color3: %d %d %d %d;\n", r, g, b, a); } - dx = edje_edit_state_align_x_get(ed, part, state, value); - dy = edje_edit_state_align_y_get(ed, part, state, value); + dx = edje_edit_state_align_x_get(ed, ppart, state, value); + dy = edje_edit_state_align_y_get(ed, ppart, state, value); if (machine) printf("ALIGN-X: %g\nALIGN-Y: %g\n", dx, dy); else if (FDIFF(dx, 0.5) || FDIFF(dy, 0.5)) printf(INDENT4 "align: %g %g;\n", dx, dy); - x = edje_edit_state_min_w_get(ed, part, state, value); - y = edje_edit_state_min_h_get(ed, part, state, value); + x = edje_edit_state_min_w_get(ed, ppart, state, value); + y = edje_edit_state_min_h_get(ed, ppart, state, value); if (machine) printf("MIN-W: %d\nMIN-H: %d\n", x, y); else if ((x) || (y)) printf(INDENT4 "min: %d %d;\n", x, y); - x = edje_edit_state_max_w_get(ed, part, state, value); - y = edje_edit_state_max_h_get(ed, part, state, value); + x = edje_edit_state_max_w_get(ed, ppart, state, value); + y = edje_edit_state_max_h_get(ed, ppart, state, value); if (machine) printf("MAX-W: %d\nMAX-H: %d\n", x, y); else if ((x != -1) || (y != -1)) printf(INDENT4 "max: %d %d;\n", x, y); @@ -320,30 +320,30 @@ state_details(Evas_Object *ed, const char *part, const char *state, double value if (detail > 1) { - dx = edje_edit_state_aspect_min_get(ed, part, state, value); - dy = edje_edit_state_aspect_max_get(ed, part, state, value); + dx = edje_edit_state_aspect_min_get(ed, ppart, state, value); + dy = edje_edit_state_aspect_max_get(ed, ppart, state, value); if (machine) printf("ASPECT-MIN: %g\nASPECT-MAX: %g\n", dx, dy); else if (FDIFF(dx, 0.0) || FDIFF(dy, 0.0)) printf(INDENT4 "aspect: %g %g;\n", dx, dy); - x = edje_edit_state_aspect_pref_get(ed, part, state, value); + x = edje_edit_state_aspect_pref_get(ed, ppart, state, value); str = aspect_pref_name_get(x); if (machine) printf("ASPECT-PREFERENCE: %s\n", str); else if (x) printf(INDENT4 "aspect_preference: %s;\n", str); /* do not free this str! */ - str = edje_edit_state_color_class_get(ed, part, state, value); + str = edje_edit_state_color_class_get(ed, ppart, state, value); if (machine) printf("COLOR_CLASS: %s\n", str ? str : ""); else if (str) printf(INDENT4 "color_class: \"%s\";\n", str); edje_edit_string_free(str); } - dx = edje_edit_state_rel1_relative_x_get(ed, part, state, value); - dy = edje_edit_state_rel1_relative_y_get(ed, part, state, value); - x = edje_edit_state_rel1_offset_x_get(ed, part, state, value); - y = edje_edit_state_rel1_offset_y_get(ed, part, state, value); - str = edje_edit_state_rel1_to_x_get(ed, part, state, value); - str2 = edje_edit_state_rel1_to_y_get(ed, part, state, value); + dx = edje_edit_state_rel1_relative_x_get(ed, ppart, state, value); + dy = edje_edit_state_rel1_relative_y_get(ed, ppart, state, value); + x = edje_edit_state_rel1_offset_x_get(ed, ppart, state, value); + y = edje_edit_state_rel1_offset_y_get(ed, ppart, state, value); + str = edje_edit_state_rel1_to_x_get(ed, ppart, state, value); + str2 = edje_edit_state_rel1_to_y_get(ed, ppart, state, value); if (FDIFF(dx, 0.0) || FDIFF(dy, 0.0) || (x) || (y) || (str) || (str2)) { if (machine) puts("REL1-BEGIN"); @@ -372,12 +372,12 @@ state_details(Evas_Object *ed, const char *part, const char *state, double value edje_edit_string_free(str); edje_edit_string_free(str2); - dx = edje_edit_state_rel2_relative_x_get(ed, part, state, value); - dy = edje_edit_state_rel2_relative_y_get(ed, part, state, value); - x = edje_edit_state_rel2_offset_x_get(ed, part, state, value); - y = edje_edit_state_rel2_offset_y_get(ed, part, state, value); - str = edje_edit_state_rel2_to_x_get(ed, part, state, value); - str2 = edje_edit_state_rel2_to_y_get(ed, part, state, value); + dx = edje_edit_state_rel2_relative_x_get(ed, ppart, state, value); + dy = edje_edit_state_rel2_relative_y_get(ed, ppart, state, value); + x = edje_edit_state_rel2_offset_x_get(ed, ppart, state, value); + y = edje_edit_state_rel2_offset_y_get(ed, ppart, state, value); + str = edje_edit_state_rel2_to_x_get(ed, ppart, state, value); + str2 = edje_edit_state_rel2_to_y_get(ed, ppart, state, value); if (FDIFF(dx, 1.0) || FDIFF(dy, 1.0) || (x != -1) || (y != -1) || (str) || (str2)) { @@ -410,7 +410,7 @@ state_details(Evas_Object *ed, const char *part, const char *state, double value if (t == EDJE_PART_TYPE_IMAGE) { - str = edje_edit_state_image_get(ed, part, state, value); + str = edje_edit_state_image_get(ed, ppart, state, value); if (machine) printf("IMAGE-BEGIN\nNORMAL: %s\n", str ? str : ""); else if (detail > 1) @@ -429,7 +429,7 @@ state_details(Evas_Object *ed, const char *part, const char *state, double value double dx2, dy2; Eina_Bool has_orgin, has_size; - tweens = edje_edit_state_tweens_list_get(ed, part, state, value); + tweens = edje_edit_state_tweens_list_get(ed, ppart, state, value); EINA_LIST_FOREACH(tweens, l, str) { if (machine) printf("TWEEN: %s\n", str); @@ -438,14 +438,14 @@ state_details(Evas_Object *ed, const char *part, const char *state, double value edje_edit_string_list_free(tweens); edje_edit_state_image_border_get - (ed, part, state, value, &bl, &br, &bt, &bb); + (ed, ppart, state, value, &bl, &br, &bt, &bb); if (machine) printf("BORDER-LEFT: %d\nBORDER-RIGHT: %d\n" "BORDER-TOP: %d\nBORDER-BOTTOM: %d\n", bl, br, bt, bb); else if ((bl) || (br) || (bt) || (bb)) printf(INDENT5 "border: %d %d %d %d;\n", bl, br, bt, bb); - x = edje_edit_state_image_border_fill_get(ed, part, state, value); + x = edje_edit_state_image_border_fill_get(ed, ppart, state, value); str = border_fill_name_get(x); if (machine) printf("BORDER-FILL: %s\n", str); else if (x != 1) printf(INDENT5 "middle: %s;\n", str); @@ -454,22 +454,22 @@ state_details(Evas_Object *ed, const char *part, const char *state, double value // TODO support image.fill.smooth dx = edje_edit_state_fill_origin_relative_x_get - (ed, part, state, value); + (ed, ppart, state, value); dy = edje_edit_state_fill_origin_relative_y_get - (ed, part, state, value); + (ed, ppart, state, value); x = edje_edit_state_fill_origin_offset_x_get - (ed, part, state, value); + (ed, ppart, state, value); y = edje_edit_state_fill_origin_offset_y_get - (ed, part, state, value); + (ed, ppart, state, value); dx2 = edje_edit_state_fill_size_relative_x_get - (ed, part, state, value); + (ed, ppart, state, value); dy2 = edje_edit_state_fill_size_relative_y_get - (ed, part, state, value); + (ed, ppart, state, value); x2 = edje_edit_state_fill_size_offset_x_get - (ed, part, state, value); + (ed, ppart, state, value); y2 = edje_edit_state_fill_size_offset_y_get - (ed, part, state, value); + (ed, ppart, 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)); @@ -531,22 +531,22 @@ state_details(Evas_Object *ed, const char *part, const char *state, double value // TODO support proxy.fill.smooth dx = edje_edit_state_fill_origin_relative_x_get - (ed, part, state, value); + (ed, ppart, state, value); dy = edje_edit_state_fill_origin_relative_y_get - (ed, part, state, value); + (ed, ppart, state, value); x = edje_edit_state_fill_origin_offset_x_get - (ed, part, state, value); + (ed, ppart, state, value); y = edje_edit_state_fill_origin_offset_y_get - (ed, part, state, value); + (ed, ppart, state, value); dx2 = edje_edit_state_fill_size_relative_x_get - (ed, part, state, value); + (ed, ppart, state, value); dy2 = edje_edit_state_fill_size_relative_y_get - (ed, part, state, value); + (ed, ppart, state, value); x2 = edje_edit_state_fill_size_offset_x_get - (ed, part, state, value); + (ed, ppart, state, value); y2 = edje_edit_state_fill_size_offset_y_get - (ed, part, state, value); + (ed, ppart, 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)); @@ -600,34 +600,34 @@ state_details(Evas_Object *ed, const char *part, const char *state, double value if (machine) puts("TEXT-BEGIN"); else puts(INDENT4 "text {"); - str = edje_edit_state_text_get(ed, part, state, value); + str = edje_edit_state_text_get(ed, ppart, state, value); if (machine) printf("TEXT: %s\n", str ? str : ""); else if (str) printf(INDENT5 "text: \"%s\";\n", str); edje_edit_string_free(str); - str = edje_edit_state_font_get(ed, part, state, value); + str = edje_edit_state_font_get(ed, ppart, state, value); if (machine) printf("FONT: %s\n", str ? str : ""); else if (str) printf(INDENT5 "font: \"%s\";\n", str); edje_edit_string_free(str); - x = edje_edit_state_text_size_get(ed, part, state, value); + x = edje_edit_state_text_size_get(ed, ppart, state, value); if (machine) printf("SIZE: %d\n", x); else if (x > 0) printf(INDENT5 "size: %d;\n", x); // TODO text_class - dx = edje_edit_state_text_align_x_get(ed, part, state, value); - dy = edje_edit_state_text_align_y_get(ed, part, state, value); + dx = edje_edit_state_text_align_x_get(ed, ppart, state, value); + dy = edje_edit_state_text_align_y_get(ed, ppart, state, value); if (machine) printf("TEXT-ALIGN-X: %g\nTEXT-ALIGN-Y: %g\n", dx, dy); else if (FDIFF(dx, 0.5) || FDIFF(dy, 0.5)) printf(INDENT5 "align: %g %g;\n", dx, dy); - x = edje_edit_state_text_fit_x_get(ed, part, state, value); - y = edje_edit_state_text_fit_y_get(ed, part, state, value); + x = edje_edit_state_text_fit_x_get(ed, ppart, state, value); + y = edje_edit_state_text_fit_y_get(ed, ppart, state, value); if (machine) printf("TEXT-FIT-X: %d\nTEXT-FIT-Y: %d\n", x, y); else if ((x) || (y)) printf(INDENT5 "fit: %d %d;\n", x, y); - dx = edje_edit_state_text_elipsis_get(ed, part, state, value); + dx = edje_edit_state_text_elipsis_get(ed, ppart, state, value); if (machine) printf("TEXT-ELIPSIS: %g\n", dx); else if (FDIFF(dx, 0.5)) printf(INDENT5 "elipsis: %g;\n", dx); @@ -640,7 +640,7 @@ state_details(Evas_Object *ed, const char *part, const char *state, double value const Edje_External_Param *p; params = edje_edit_state_external_params_list_get - (ed, part, state, value); + (ed, ppart, state, value); if (params) { @@ -766,16 +766,16 @@ _api_name_fix(const char *orig) } static char * -_part_api_name_get(Evas_Object *ed, const char *part) +_part_api_name_get(Evas_Object *ed, const char *ppart) { - const char *orig = edje_edit_part_api_name_get(ed, part); + const char *orig = edje_edit_part_api_name_get(ed, ppart); char *fix = _api_name_fix(orig); edje_edit_string_free(orig); return fix; } static void -part_details(Evas_Object *ed, const char *part) +part_details(Evas_Object *ed, const char *ppart) { Eina_List *states, *l; Eina_Bool b; @@ -786,8 +786,8 @@ part_details(Evas_Object *ed, const char *part) if (machine) puts("PART-DETAILS-BEGIN"); - str = api =_part_api_name_get(ed, part); - str2 = edje_edit_part_api_description_get(ed, part); + str = api =_part_api_name_get(ed, ppart); + str2 = edje_edit_part_api_description_get(ed, ppart); if (machine) { printf("API-NAME: %s\n", str ? str : ""); @@ -798,67 +798,67 @@ part_details(Evas_Object *ed, const char *part) free(api); edje_edit_string_free(str2); - b = edje_edit_part_mouse_events_get(ed, part); + b = edje_edit_part_mouse_events_get(ed, ppart); if (machine) printf("MOUSE_EVENTS: %d\n", b); else if (!b) puts(INDENT3 "mouse_events: 0;"); if (detail > 1) { - b = edje_edit_part_repeat_events_get(ed, part); + b = edje_edit_part_repeat_events_get(ed, ppart); if (machine) printf("REPEAT_EVENTS: %d\n", b); else if (b) puts(INDENT3 "repeat_events: 1;"); - b = edje_edit_part_scale_get(ed, part); + b = edje_edit_part_scale_get(ed, ppart); if (machine) printf("SCALE: %d\n", b); else if (b) puts(INDENT3 "scale: 1;"); } - str = edje_edit_part_clip_to_get(ed, part); + str = edje_edit_part_clip_to_get(ed, ppart); if (machine) printf("CLIP_TO: %s\n", str ? str : ""); else if (str) printf(INDENT3 "clip_to: \"%s\";\n", str); edje_edit_string_free(str); - str = edje_edit_part_source_get(ed, part); + str = edje_edit_part_source_get(ed, ppart); if (machine) printf("SOURCE: %s\n", str ? str : ""); else if (str) printf(INDENT3 "source: \"%s\";\n", str); edje_edit_string_free(str); if (detail > 1) { - if (edje_edit_part_type_get(ed, part) == EDJE_PART_TYPE_TEXT) + if (edje_edit_part_type_get(ed, ppart) == EDJE_PART_TYPE_TEXT) { - str = text_effect_name_get(edje_edit_part_effect_get(ed, part)); + str = text_effect_name_get(edje_edit_part_effect_get(ed, ppart)); if (machine) printf("EFFECT: %s\n", str ? str : ""); else if (str) printf(INDENT3 "effect: %s;\n", str); /* do not free this str! */ } - if (edje_edit_part_drag_x_get(ed, part) || - edje_edit_part_drag_y_get(ed, part)) + if (edje_edit_part_drag_x_get(ed, ppart) || + edje_edit_part_drag_y_get(ed, ppart)) { int dir, step, count; if (machine) puts("DRAGABLE-BEGIN"); else puts(INDENT3 "dragable {"); - dir = edje_edit_part_drag_x_get(ed, part); - step = edje_edit_part_drag_step_x_get(ed, part); - count = edje_edit_part_drag_count_x_get(ed, part); + dir = edje_edit_part_drag_x_get(ed, ppart); + step = edje_edit_part_drag_step_x_get(ed, ppart); + count = edje_edit_part_drag_count_x_get(ed, ppart); if (machine) printf("DRAG-X: %d %d %d\n", dir, step, count); else printf(INDENT4 "x: %d %d %d;\n", dir, step, count); - dir = edje_edit_part_drag_y_get(ed, part); - step = edje_edit_part_drag_step_y_get(ed, part); - count = edje_edit_part_drag_count_y_get(ed, part); + dir = edje_edit_part_drag_y_get(ed, ppart); + step = edje_edit_part_drag_step_y_get(ed, ppart); + count = edje_edit_part_drag_count_y_get(ed, ppart); if (machine) printf("DRAG-Y: %d %d %d\n", dir, step, count); else printf(INDENT4 "y: %d %d %d;\n", dir, step, count); - str = edje_edit_part_drag_confine_get(ed, part); + str = edje_edit_part_drag_confine_get(ed, ppart); if (machine) printf("DRAG-CONFINE: %s\n", str ? str : ""); else if (str) printf(INDENT4 "confine: \"%s\";\n", str); edje_edit_string_free(str); - str = edje_edit_part_drag_event_get(ed, part); + str = edje_edit_part_drag_event_get(ed, ppart); if (machine) printf("DRAG-EVENTS: %s\n", str ? str : ""); else if (str) printf(INDENT4 "events: \"%s\";\n", str); edje_edit_string_free(str); @@ -868,7 +868,7 @@ part_details(Evas_Object *ed, const char *part) } } - states = edje_edit_part_states_list_get(ed, part); + states = edje_edit_part_states_list_get(ed, ppart); EINA_LIST_FOREACH(states, l, str) { char state[512], *delim; @@ -879,7 +879,7 @@ part_details(Evas_Object *ed, const char *part) delim++; value = strtod(delim, NULL); state_begin(state, value); - state_details(ed, part, state, value); + state_details(ed, ppart, state, value); state_end(); } edje_edit_string_list_free(states); @@ -1047,9 +1047,9 @@ program_end(void) static char * -_program_api_name_get(Evas_Object *ed, const char *program) +_program_api_name_get(Evas_Object *ed, const char *pprogram) { - const char *orig = edje_edit_program_api_name_get(ed, program); + const char *orig = edje_edit_program_api_name_get(ed, pprogram); char *fix = _api_name_fix(orig); edje_edit_string_free(orig); return fix; @@ -1071,7 +1071,7 @@ _transition_name_get(Edje_Tween_Mode mode) } static void -program_details(Evas_Object *ed, const char *program) +program_details(Evas_Object *ed, const char *pprogram) { const char *str, *str2; char *api; @@ -1080,8 +1080,8 @@ program_details(Evas_Object *ed, const char *program) if (machine) puts("PROGRAM-DETAILS-BEGIN"); - str = api =_program_api_name_get(ed, program); - str2 = edje_edit_program_api_description_get(ed, program); + str = api =_program_api_name_get(ed, pprogram); + str2 = edje_edit_program_api_description_get(ed, pprogram); if (machine) { printf("API-NAME: %s\n", str ? str : ""); @@ -1092,12 +1092,12 @@ program_details(Evas_Object *ed, const char *program) free(api); edje_edit_string_free(str2); - str = edje_edit_program_signal_get(ed, program); + str = edje_edit_program_signal_get(ed, pprogram); if (machine) printf("SIGNAL: %s\n", str ? str : ""); else if (str) printf(INDENT3 "signal: \"%s\";\n", str); edje_edit_string_free(str); - str = edje_edit_program_source_get(ed, program); + str = edje_edit_program_source_get(ed, pprogram); if (machine) printf("SOURCE: %s\n", str ? str : ""); else if (str) printf(INDENT3 "source: \"%s\";\n", str); edje_edit_string_free(str); @@ -1105,7 +1105,7 @@ program_details(Evas_Object *ed, const char *program) if (detail >= 1) { Eina_List *lst, *l; - Edje_Action_Type type = edje_edit_program_action_get(ed, program); + Edje_Action_Type type = edje_edit_program_action_get(ed, pprogram); switch (type) { case EDJE_ACTION_TYPE_ACTION_STOP: @@ -1113,18 +1113,18 @@ program_details(Evas_Object *ed, const char *program) else puts(INDENT3 "action: ACTION_STOP;"); break; case EDJE_ACTION_TYPE_STATE_SET: - str = edje_edit_program_state_get(ed, program); + str = edje_edit_program_state_get(ed, pprogram); if (machine) printf("ACTION: STATE_SET\nACTION-STATE: %s %g\n", - str, edje_edit_program_value_get(ed, program)); + str, edje_edit_program_value_get(ed, pprogram)); else printf(INDENT3 "action: STATE_SET \"%s\" %2.1f;\n", - str, edje_edit_program_value_get(ed, program)); + str, edje_edit_program_value_get(ed, pprogram)); edje_edit_string_free(str); break; case EDJE_ACTION_TYPE_SIGNAL_EMIT: - str = edje_edit_program_state_get(ed, program); - str2 = edje_edit_program_state2_get(ed, program); + str = edje_edit_program_state_get(ed, pprogram); + str2 = edje_edit_program_state2_get(ed, pprogram); if (machine) printf("ACTION: SIGNAL_EMIT\nACTION-SIGNAL: %s\n" "ACTION-SOURCE: %s\n", @@ -1146,7 +1146,7 @@ program_details(Evas_Object *ed, const char *program) //~ eina_strbuf_append(buf, I4"action: DRAG_VAL_PAGE TODO;\n"); //~ break; default: - ERR("Unhandled program action type %d", type); + ERR("Unhandled pprogram action type %d", type); break; } @@ -1154,11 +1154,11 @@ program_details(Evas_Object *ed, const char *program) { double from, range; - from = edje_edit_program_transition_time_get(ed, program); + from = edje_edit_program_transition_time_get(ed, pprogram); if (from > 0.0) { str = _transition_name_get - (edje_edit_program_transition_get(ed, program)); + (edje_edit_program_transition_get(ed, pprogram)); if (machine) printf("TRANSITION-NAME: %s\nTRANSITION-DURATION: %g\n", str, from); @@ -1166,8 +1166,8 @@ program_details(Evas_Object *ed, const char *program) /* do not free str! */ } - from = edje_edit_program_in_from_get(ed, program); - range = edje_edit_program_in_range_get(ed, program); + from = edje_edit_program_in_from_get(ed, pprogram); + range = edje_edit_program_in_range_get(ed, pprogram); if (FDIFF(from, 0.0) || FDIFF(range, 0.0)) { if (machine) @@ -1176,13 +1176,13 @@ program_details(Evas_Object *ed, const char *program) } } - lst = edje_edit_program_targets_get(ed, program); + lst = edje_edit_program_targets_get(ed, pprogram); EINA_LIST_FOREACH(lst, l, str) if (machine) printf("TARGET: %s\n", str); else printf(INDENT3 "target: \"%s\";\n", str); edje_edit_string_list_free(lst); - lst = edje_edit_program_afters_get(ed, program); + lst = edje_edit_program_afters_get(ed, pprogram); EINA_LIST_FOREACH(lst, l, str) if (machine) printf("AFTER: %s\n", str); else printf(INDENT3 "after: \"%s\";\n", str); diff --git a/libraries/edje/src/bin/edje_multisense_convert.c b/libraries/edje/src/bin/edje_multisense_convert.c index d37d218..62c2f67 100644 --- a/libraries/edje/src/bin/edje_multisense_convert.c +++ b/libraries/edje/src/bin/edje_multisense_convert.c @@ -12,7 +12,7 @@ # endif Edje_Sound_Encode * -_edje_multisense_encode(const char *filename, Edje_Sound_Sample *sample, double quality) +_edje_multisense_encode(const char *filename, Edje_Sound_Sample *sample, double quality __UNUSED__) { SF_INFO sfinfo; SNDFILE* sfile; diff --git a/libraries/edje/src/bin/epp/Makefile.in b/libraries/edje/src/bin/epp/Makefile.in index 2ef2e56..c1a8ee5 100644 --- a/libraries/edje/src/bin/epp/Makefile.in +++ b/libraries/edje/src/bin/epp/Makefile.in @@ -225,8 +225,6 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/libraries/edje/src/bin/epp/cppmain.c b/libraries/edje/src/bin/epp/cppmain.c index 45b67b5..ea0a0b2 100644 --- a/libraries/edje/src/bin/epp/cppmain.c +++ b/libraries/edje/src/bin/epp/cppmain.c @@ -44,7 +44,9 @@ main(int argc, char **argv) int argi = 1; /* Next argument to handle. */ struct cpp_options *opts = &options; enum cpp_token kind; - int got_text; +#if EPP_DEBUG + int got_text = 0; +#endif p = argv[0] + strlen(argv[0]); #ifndef __EMX__ @@ -76,7 +78,6 @@ main(int argc, char **argv) else if (!freopen(opts->out_fname, "w", stdout)) cpp_pfatal_with_name(&parse_in, opts->out_fname); - got_text = 0; for (i = 0;; i++) { kind = cpp_get_token(&parse_in); @@ -108,7 +109,9 @@ main(int argc, char **argv) case CPP_COMMA: case CPP_SEMICOLON: case CPP_3DOTS: - got_text = 1; +#if EPP_DEBUG + got_text = 1; +#endif continue; case CPP_COMMENT: @@ -130,7 +133,9 @@ main(int argc, char **argv) exit(FATAL_EXIT_CODE); } parse_in.limit = parse_in.token_buffer; - got_text = 0; +#if EPP_DEBUG + got_text = 0; +#endif } done: diff --git a/libraries/edje/src/examples/Makefile.am b/libraries/edje/src/examples/Makefile.am index 20e2c81..579f148 100644 --- a/libraries/edje/src/examples/Makefile.am +++ b/libraries/edje/src/examples/Makefile.am @@ -1,12 +1,15 @@ MAINTAINERCLEANFILES = Makefile.in -pkglibdir = $(datadir)/$(PACKAGE)/examples +examplesdir = $(datadir)/$(PACKAGE)/examples + if ENABLE_MULTISENSE MULTISENSE_EDC_FILE = multisense.edc SND_DIR = -sd $(srcdir) endif + #put here all EDCs one needs to the examples -EDCS = basic.edc \ +EDCS = \ + basic.edc \ swallow.edc \ text.edc \ table.edc \ @@ -20,26 +23,48 @@ EDCS = basic.edc \ sigtest.edc \ $(MULTISENSE_EDC_FILE) +.edc.edj: + $(edje_cc) -v -fd $(srcdir) -id $(srcdir) $(SND_DIR) $< $(builddir)/$(@F) + +EDJS = $(EDCS:%.edc=%.edj) + filesdir = $(datadir)/$(PACKAGE)/examples -files_DATA = +files_DATA = \ + $(EDCS) \ + bubble.png \ + red.png \ + test.png \ + Vera.ttf \ + edje-basic.c \ + edje-swallow.c \ + edje-text.c \ + edje-table.c \ + edje-box.c \ + edje-box2.c \ + edje-drag.c \ + edje-signals-messages.c \ + edje-color-class.c \ + edje-perspective.c \ + edje-animations.c \ + sigtest.c + +EXTRA_DIST = $(files_DATA) if BUILD_EXAMPLES AM_CPPFLAGS = \ --I. \ --I$(top_srcdir)/src/lib \ --I$(top_srcdir)/src/lib/include \ --DPACKAGE_BIN_DIR=\"$(bindir)\" \ --DPACKAGE_LIB_DIR=\"$(libdir)\" \ --DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ --DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" - -pkglib_PROGRAMS = + -I. \ + -I$(top_srcdir)/src/lib \ + -I$(top_srcdir)/src/lib/include \ + -DPACKAGE_BIN_DIR=\"$(bindir)\" \ + -DPACKAGE_LIB_DIR=\"$(libdir)\" \ + -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ + -DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" \ + @EDJE_CFLAGS@ -#the ones using ecore_evas follow -AM_CPPFLAGS += @EDJE_CFLAGS@ +files_DATA += $(EDJS) -pkglib_PROGRAMS += \ +examples_PROGRAMS = \ edje-basic \ edje-swallow \ edje-text \ @@ -55,53 +80,4 @@ pkglib_PROGRAMS += \ LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_LIBS@ -.edc.edj: - $(edje_cc) -v -id $(srcdir) $(SND_DIR) $< $(builddir)/$(@F) - -EDJS = $(EDCS:%.edc=%.edj) - -files_DATA += $(EDJS) - -endif # if BUILD_EXAMPLES - -if INSTALL_EXAMPLES - -#put here additional data when installing examples -files_DATA += \ - $(srcdir)/bubble.png \ - $(srcdir)/red.png \ - $(srcdir)/test.png \ - $(srcdir)/Vera.ttf - -files_DATA += \ - $(EDCS) \ - $(srcdir)/edje-basic.c \ - $(srcdir)/edje-swallow.c \ - $(srcdir)/edje-text.c \ - $(srcdir)/edje-table.c \ - $(srcdir)/edje-box.c \ - $(srcdir)/edje-box2.c \ - $(srcdir)/edje-drag.c \ - $(srcdir)/edje-signals-messages.c \ - $(srcdir)/edje-color-class.c \ - $(srcdir)/edje-perspective.c \ - $(srcdir)/edje-animations.c \ - $(srcdir)/sigtest.c endif - -EXTRA_DIST = $(EDCS) \ - $(srcdir)/bubble.png \ - $(srcdir)/red.png \ - $(srcdir)/test.png \ - $(srcdir)/edje-basic.c \ - $(srcdir)/edje-swallow.c \ - $(srcdir)/edje-text.c \ - $(srcdir)/edje-table.c \ - $(srcdir)/edje-box.c \ - $(srcdir)/edje-box2.c \ - $(srcdir)/edje-drag.c \ - $(srcdir)/edje-signals-messages.c \ - $(srcdir)/edje-color-class.c \ - $(srcdir)/edje-perspective.c \ - $(srcdir)/edje-animations.c \ - $(srcdir)/sigtest.c diff --git a/libraries/edje/src/examples/Makefile.in b/libraries/edje/src/examples/Makefile.in index bde628f..7f867e0 100644 --- a/libraries/edje/src/examples/Makefile.in +++ b/libraries/edje/src/examples/Makefile.in @@ -19,6 +19,7 @@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 @@ -34,7 +35,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@BUILD_EXAMPLES_TRUE@pkglib_PROGRAMS = edje-basic$(EXEEXT) \ +@BUILD_EXAMPLES_TRUE@am__append_1 = $(EDJS) +@BUILD_EXAMPLES_TRUE@examples_PROGRAMS = edje-basic$(EXEEXT) \ @BUILD_EXAMPLES_TRUE@ edje-swallow$(EXEEXT) edje-text$(EXEEXT) \ @BUILD_EXAMPLES_TRUE@ edje-table$(EXEEXT) edje-box$(EXEEXT) \ @BUILD_EXAMPLES_TRUE@ edje-box2$(EXEEXT) edje-drag$(EXEEXT) \ @@ -42,24 +44,6 @@ host_triplet = @host@ @BUILD_EXAMPLES_TRUE@ edje-color-class$(EXEEXT) \ @BUILD_EXAMPLES_TRUE@ edje-perspective$(EXEEXT) \ @BUILD_EXAMPLES_TRUE@ edje-animations$(EXEEXT) sigtest$(EXEEXT) -@BUILD_EXAMPLES_TRUE@am__append_1 = $(EDJS) - -#put here additional data when installing examples -@INSTALL_EXAMPLES_TRUE@am__append_2 = $(srcdir)/bubble.png \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/red.png $(srcdir)/test.png \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/Vera.ttf $(EDCS) \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-basic.c \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-swallow.c \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-text.c \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-table.c \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-box.c \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-box2.c \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-drag.c \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-signals-messages.c \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-color-class.c \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-perspective.c \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-animations.c \ -@INSTALL_EXAMPLES_TRUE@ $(srcdir)/sigtest.c subdir = src/examples DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -77,8 +61,8 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(filesdir)" -PROGRAMS = $(pkglib_PROGRAMS) +am__installdirs = "$(DESTDIR)$(examplesdir)" "$(DESTDIR)$(filesdir)" +PROGRAMS = $(examples_PROGRAMS) edje_animations_SOURCES = edje-animations.c edje_animations_OBJECTS = edje-animations.$(OBJEXT) edje_animations_LDADD = $(LDADD) @@ -201,7 +185,6 @@ DATA = $(files_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -pkglibdir = $(datadir)/$(PACKAGE)/examples ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALSA_CFLAGS = @ALSA_CFLAGS@ @@ -296,8 +279,6 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ @@ -385,10 +366,13 @@ top_srcdir = @top_srcdir@ version_info = @version_info@ vimdir = @vimdir@ MAINTAINERCLEANFILES = Makefile.in +examplesdir = $(datadir)/$(PACKAGE)/examples @ENABLE_MULTISENSE_TRUE@MULTISENSE_EDC_FILE = multisense.edc @ENABLE_MULTISENSE_TRUE@SND_DIR = -sd $(srcdir) + #put here all EDCs one needs to the examples -EDCS = basic.edc \ +EDCS = \ + basic.edc \ swallow.edc \ text.edc \ table.edc \ @@ -402,36 +386,24 @@ EDCS = basic.edc \ sigtest.edc \ $(MULTISENSE_EDC_FILE) +EDJS = $(EDCS:%.edc=%.edj) filesdir = $(datadir)/$(PACKAGE)/examples -files_DATA = $(am__append_1) $(am__append_2) - -#the ones using ecore_evas follow -@BUILD_EXAMPLES_TRUE@AM_CPPFLAGS = -I. -I$(top_srcdir)/src/lib \ -@BUILD_EXAMPLES_TRUE@ -I$(top_srcdir)/src/lib/include \ -@BUILD_EXAMPLES_TRUE@ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -@BUILD_EXAMPLES_TRUE@ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -@BUILD_EXAMPLES_TRUE@ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ -@BUILD_EXAMPLES_TRUE@ -DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" \ -@BUILD_EXAMPLES_TRUE@ @EDJE_CFLAGS@ $(am__empty) -@BUILD_EXAMPLES_TRUE@LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_LIBS@ -@BUILD_EXAMPLES_TRUE@EDJS = $(EDCS:%.edc=%.edj) -EXTRA_DIST = $(EDCS) \ - $(srcdir)/bubble.png \ - $(srcdir)/red.png \ - $(srcdir)/test.png \ - $(srcdir)/edje-basic.c \ - $(srcdir)/edje-swallow.c \ - $(srcdir)/edje-text.c \ - $(srcdir)/edje-table.c \ - $(srcdir)/edje-box.c \ - $(srcdir)/edje-box2.c \ - $(srcdir)/edje-drag.c \ - $(srcdir)/edje-signals-messages.c \ - $(srcdir)/edje-color-class.c \ - $(srcdir)/edje-perspective.c \ - $(srcdir)/edje-animations.c \ - $(srcdir)/sigtest.c +files_DATA = $(EDCS) bubble.png red.png test.png Vera.ttf edje-basic.c \ + edje-swallow.c edje-text.c edje-table.c edje-box.c edje-box2.c \ + edje-drag.c edje-signals-messages.c edje-color-class.c \ + edje-perspective.c edje-animations.c sigtest.c $(am__append_1) +EXTRA_DIST = $(files_DATA) +@BUILD_EXAMPLES_TRUE@AM_CPPFLAGS = \ +@BUILD_EXAMPLES_TRUE@ -I. \ +@BUILD_EXAMPLES_TRUE@ -I$(top_srcdir)/src/lib \ +@BUILD_EXAMPLES_TRUE@ -I$(top_srcdir)/src/lib/include \ +@BUILD_EXAMPLES_TRUE@ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ +@BUILD_EXAMPLES_TRUE@ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ +@BUILD_EXAMPLES_TRUE@ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ +@BUILD_EXAMPLES_TRUE@ -DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" \ +@BUILD_EXAMPLES_TRUE@ @EDJE_CFLAGS@ +@BUILD_EXAMPLES_TRUE@LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_LIBS@ all: all-am .SUFFIXES: @@ -466,10 +438,10 @@ $(top_srcdir)/configure: $(am__configure_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -install-pkglibPROGRAMS: $(pkglib_PROGRAMS) +install-examplesPROGRAMS: $(examples_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_PROGRAMS)'; test -n "$(pkglibdir)" || list=; \ + test -z "$(examplesdir)" || $(MKDIR_P) "$(DESTDIR)$(examplesdir)" + @list='$(examples_PROGRAMS)'; test -n "$(examplesdir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ @@ -486,23 +458,23 @@ install-pkglibPROGRAMS: $(pkglib_PROGRAMS) while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibdir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibdir)$$dir" || exit $$?; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(examplesdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(examplesdir)$$dir" || exit $$?; \ } \ ; done -uninstall-pkglibPROGRAMS: +uninstall-examplesPROGRAMS: @$(NORMAL_UNINSTALL) - @list='$(pkglib_PROGRAMS)'; test -n "$(pkglibdir)" || list=; \ + @list='$(examples_PROGRAMS)'; test -n "$(examplesdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkglibdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkglibdir)" && rm -f $$files + echo " ( cd '$(DESTDIR)$(examplesdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(examplesdir)" && rm -f $$files -clean-pkglibPROGRAMS: - @list='$(pkglib_PROGRAMS)'; test -n "$$list" || exit 0; \ +clean-examplesPROGRAMS: + @list='$(examples_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ @@ -701,7 +673,7 @@ check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: - for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(filesdir)"; do \ + for dir in "$(DESTDIR)$(examplesdir)" "$(DESTDIR)$(filesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -732,7 +704,7 @@ maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am -clean-am: clean-generic clean-libtool clean-pkglibPROGRAMS \ +clean-am: clean-examplesPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am @@ -753,13 +725,13 @@ info: info-am info-am: -install-data-am: install-filesDATA +install-data-am: install-examplesPROGRAMS install-filesDATA install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-pkglibPROGRAMS +install-exec-am: install-html: install-html-am @@ -799,28 +771,29 @@ ps: ps-am ps-am: -uninstall-am: uninstall-filesDATA uninstall-pkglibPROGRAMS +uninstall-am: uninstall-examplesPROGRAMS uninstall-filesDATA .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-filesDATA \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-pkglibPROGRAMS \ +.PHONY: CTAGS GTAGS all all-am check check-am clean \ + clean-examplesPROGRAMS clean-generic clean-libtool ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am \ + install-examplesPROGRAMS install-exec install-exec-am \ + install-filesDATA install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-filesDATA \ - uninstall-pkglibPROGRAMS + tags uninstall uninstall-am uninstall-examplesPROGRAMS \ + uninstall-filesDATA -@BUILD_EXAMPLES_TRUE@.edc.edj: -@BUILD_EXAMPLES_TRUE@ $(edje_cc) -v -id $(srcdir) $(SND_DIR) $< $(builddir)/$(@F) +.edc.edj: + $(edje_cc) -v -fd $(srcdir) -id $(srcdir) $(SND_DIR) $< $(builddir)/$(@F) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/libraries/edje/src/examples/Vera.ttf b/libraries/edje/src/examples/Vera.ttf new file mode 100644 index 0000000..58cd6b5 Binary files /dev/null and b/libraries/edje/src/examples/Vera.ttf differ diff --git a/libraries/edje/src/examples/lua_script.edc b/libraries/edje/src/examples/lua_script.edc index 24e8ebe..23c2926 100644 --- a/libraries/edje/src/examples/lua_script.edc +++ b/libraries/edje/src/examples/lua_script.edc @@ -104,6 +104,10 @@ collections { print("lua::init ... " .. D.val); edje.echo("lua::echo('hello world')"); + --// How to check the edje version. + version = edje.version(); + print("The edje version number is " .. version.major .. "." .. version.minor); + --// actually add the timer to call mycb in 1.23 sec D.tim = edje.timer(1.23, mycb); D.tra = edje.transition(5.0, mycb3); @@ -168,6 +172,14 @@ collections { print(D.text:text()); D.text:show(); + --// Put a few bogus API calls here to test the bogus API protection, + --// If the bogus API protection works, these should get ignored, but everything else runs smoothly. + --// Otherwise, the map is not done, the bubbles are not done, but the timers keep runinng. + bogus.failme(1, "two", D.rect); + temp = bogus.failme2(); + D.text.bogus(); + edje.bogus2(); + --// Fun with maps! D.map = edje.map(4); --// 4 is the only supported map size at the moment. --// These all do the same thing. diff --git a/libraries/edje/src/examples/multisense.edc b/libraries/edje/src/examples/multisense.edc new file mode 100644 index 0000000..5a3cf79 --- /dev/null +++ b/libraries/edje/src/examples/multisense.edc @@ -0,0 +1,139 @@ +#if 0 +collections { + sounds { + sample { + name: "sound_name1" RAW; + source: "8806__jovica__basic-sine-wave-g-1.wav"; +// source: "sample.wav"; +// source: "sample-flac10k.wav"; +// source: "sample-flac10k-mono.wav"; + } +// sample { +// name: "sound_name2" COMP; +// source: "sample.wav"; +// } +/* + sample { + name: "sound_name3" LOSSY 0.5; + source: "sample.wav"; + } + sample { + name: "sound_name4" AS_IS; + source: "sample.wav"; + } + */ + sample { +// name: "sound_name5" AS_IS; +// name: "sound_name5" COMP; + name: "sound_name5" RAW; +// source: "sample-ogg.wav"; + source: "sample-ogg-mono.wav"; +// source: "sample-ogg10k.wav"; +// source: "sample-flac10k.wav"; +// source: "sample-flac10k-mono.wav"; + } + sample { + name: "sound_name6" AS_IS; +// name: "sound_name6" LOSSY 45.0; + source: "sample-flac44k-mono.wav"; +// source: "sample-flac.wav"; +// source: "sample.ogg"; + } + tone: "tone-name" 2600; + } + group { + name: "example_group"; + parts { + part { + name: "sample_bg"; + type: RECT; + mouse_events: 1; + description { + state: "default" 0.0; + min: 300 150; + max: 300 150; + color: 200 200 200 100; + align: 0.5 0.0; + rel1 { + relative: 0.0 0.0; + } + } + } + part { + name: "sample_text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1.to: "sample_bg"; + rel2.to: "sample_bg"; + text { + font: "Sans"; + size: 20; + text: "Play Sound Sample"; + } + } + } + part { + name: "tone_bg"; + type: RECT; + mouse_events: 1; + description { + state: "default" 0.0; + min: 300 150; + max: 300 150; + align: 0.5 0.0; + color: 180 180 180 100; + rel1 { + relative: 0.0 1.0; + to: "sample_bg"; + } + } + } + part { + name: "tone_text"; + type: TEXT; + mouse_events: 1; + repeat_events : 1; + description { + state: "default" 0.0; + rel1.to: "tone_bg"; + rel2.to: "tone_bg"; + text { + font: "Sans"; + size: 20; + text: "Play Tone"; + } + } + } + programs { + program { + name: "click_sample1"; + signal: "mouse,down,1"; + source: "sample_bg"; + action: PLAY_SAMPLE "sound_name1" 1.0; + } + program { + name: "click_sample2"; + signal: "mouse,down,2"; + source: "sample_bg"; + action: PLAY_SAMPLE "sound_name5" 1.0; + } + program { + name: "click_sample3"; + signal: "mouse,down,3"; + source: "sample_bg"; + action: PLAY_SAMPLE "sound_name6" 1.0; + } + program { + name: "click_tone"; + signal: "mouse,down,1"; + source: "tone_bg"; + action: PLAY_TONE "tone-name" 0.1; + } + } + } + } +} +#endif diff --git a/libraries/edje/src/examples/signals-messages.edc b/libraries/edje/src/examples/signals-messages.edc index 45d9c58..b251368 100644 --- a/libraries/edje/src/examples/signals-messages.edc +++ b/libraries/edje/src/examples/signals-messages.edc @@ -105,10 +105,10 @@ collections { if ((type == MSG_INT_SET) && (id == MSG_COLOR)) { new r, g, b, a; - r = getarg(3); - g = getarg(4); - b = getarg(5); - a = getarg(6); + r = getarg(2); + g = getarg(3); + b = getarg(4); + a = getarg(5); set_color_class("cc", r, g, b, a); } diff --git a/libraries/edje/src/lib/Edje.h b/libraries/edje/src/lib/Edje.h index c8094b4..6413014 100644 --- a/libraries/edje/src/lib/Edje.h +++ b/libraries/edje/src/lib/Edje.h @@ -377,6 +377,13 @@ part of Edje's API: @author Sebastian Dransfeld @author Tom Hacohen @author Aharon Hillel +@author Shilpa Singh +@author Mike Blumenkrantz +@author billiob (Boris Faure) +@author Govindaraju SM +@author Prince Kumar Dubey +@author David Seikel Please contact to get in contact with the developers and maintainers. @@ -472,7 +479,7 @@ extern "C" { #endif #define EDJE_VERSION_MAJOR 1 -#define EDJE_VERSION_MINOR 0 +#define EDJE_VERSION_MINOR 2 typedef struct _Edje_Version { @@ -794,7 +801,7 @@ typedef enum _Edje_External_Param_Flags EDJE_EXTERNAL_PARAM_FLAGS_STATE) /**< Convenience flag that sets property as GET, SET and STATE. */ } Edje_External_Param_Flags; -typedef enum +typedef enum _Edje_Input_Panel_Layout { EDJE_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */ EDJE_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */ @@ -804,7 +811,10 @@ typedef enum EDJE_INPUT_PANEL_LAYOUT_IP, /**< IP layout */ EDJE_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */ EDJE_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */ - EDJE_INPUT_PANEL_LAYOUT_INVALID + EDJE_INPUT_PANEL_LAYOUT_INVALID, /**< Never use this */ + EDJE_INPUT_PANEL_LAYOUT_HEX, /**< Hexadecimal layout @since 1.2 */ + EDJE_INPUT_PANEL_LAYOUT_TERMINAL, /**< Command-line terminal layout @since 1.2 */ + EDJE_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */ } Edje_Input_Panel_Layout; /** @@ -1650,8 +1660,21 @@ EAPI void edje_box_layout_register (const char *name, Evas_Object * } * * @endcode + * + * @note You can get a callback every time edje re-calculates the object + * (either due to animation or some kind of signal or input). This is called + * in-line just after the recalculation has occured. It is a good idea not + * to go and delete or alter the object inside this callbacks, simply make + * a note that the recalculation has taken place and then do somethnig about + * it outside the callback. to register a callback use code like: + * + * @code + * evas_object_smart_callback_add(edje_obj, "recalc", my_cb, my_cb_data); + * @endcode + * + * @see evas_object_smart_callback_add() * - * @note before creating the first Edje object in your code, remember + * @note Before creating the first Edje object in your code, remember * to initialize the library, with edje_init(), or unexpected behavior * might occur. */ @@ -2757,12 +2780,15 @@ EAPI Eina_Bool edje_object_part_text_cursor_is_visible_format_get(const E /** * @brief Returns the content (char) at the cursor position. * @see evas_textblock_cursor_content_get + * + * You must free the return (if not NULL) after you are done with it. * * @param obj A valid Evas_Object handle * @param part The part name * @param cur The cursor to use + * @return The character string pointed to (may be a multi-byte utf8 sequence) terminated by a nul byte. */ -EAPI const char *edje_object_part_text_cursor_content_get (const Evas_Object *obj, const char *part, Edje_Cursor cur); +EAPI char *edje_object_part_text_cursor_content_get (const Evas_Object *obj, const char *part, Edje_Cursor cur); /** * @brief Sets the cursor position to the given value @@ -2941,7 +2967,9 @@ EAPI Eina_Bool edje_object_part_swallow (Evas_Object *obj, const c * * Causes the edje to regurgitate a previously swallowed object. :) * - * @note @p obj_swallow will @b not be deleted. + * @note @p obj_swallow will @b not be deleted or hidden. + * @note @p obj_swallow may appear shown on the evas depending on its state when + * it got unswallowed. Make sure you delete it or hide it if you do not want it to. */ EAPI void edje_object_part_unswallow (Evas_Object *obj, Evas_Object *obj_swallow); diff --git a/libraries/edje/src/lib/Makefile.in b/libraries/edje/src/lib/Makefile.in index cf73390..e67d90c 100644 --- a/libraries/edje/src/lib/Makefile.in +++ b/libraries/edje/src/lib/Makefile.in @@ -230,8 +230,6 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/libraries/edje/src/lib/edje_cache.c b/libraries/edje/src/lib/edje_cache.c index a8b355f..0ce6b30 100644 --- a/libraries/edje/src/lib/edje_cache.c +++ b/libraries/edje/src/lib/edje_cache.c @@ -128,18 +128,11 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) } static Edje_File * -_edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret) +_edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, time_t mtime) { Edje_File *edf; Edje_Part_Collection *edc; Eet_File *ef; - struct stat st; - - if (stat(file, &st) != 0) - { - *error_ret = EDJE_LOAD_ERROR_DOES_NOT_EXIST; - return NULL; - } ef = eet_open(file, EET_FILE_MODE_READ); if (!ef) @@ -156,7 +149,7 @@ _edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Co } edf->ef = ef; - edf->mtime = st.st_mtime; + edf->mtime = mtime; if (edf->version != EDJE_FILE_VERSION) { @@ -262,7 +255,7 @@ open_new: if (!_edje_file_hash) _edje_file_hash = eina_hash_string_small_new(NULL); - edf = _edje_file_open(file, coll, error_ret, edc_ret); + edf = _edje_file_open(file, coll, error_ret, edc_ret, st.st_mtime); if (!edf) return NULL; diff --git a/libraries/edje/src/lib/edje_calc.c b/libraries/edje/src/lib/edje_calc.c index d9fd51d..213e266 100644 --- a/libraries/edje/src/lib/edje_calc.c +++ b/libraries/edje/src/lib/edje_calc.c @@ -8,7 +8,8 @@ static void _edje_part_recalc_single(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *center, Edje_Real_Part *light, Edje_Real_Part *persp, Edje_Real_Part *rel1_to_x, Edje_Real_Part *rel1_to_y, Edje_Real_Part *rel2_to_x, Edje_Real_Part *rel2_to_y, - Edje_Real_Part *confine_to, Edje_Calc_Params *params); + Edje_Real_Part *confine_to, Edje_Calc_Params *params, + FLOAT_T pos); void _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T v1, FLOAT_T v2) @@ -115,6 +116,7 @@ _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T ep->description_pos = npos; ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ep->invalidate = 1; #endif @@ -304,6 +306,179 @@ _edje_part_description_find(Edje *ed, Edje_Real_Part *rp, const char *name, return ret; } +static int +_edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps, Edje_Part_Description_Image *st, Edje_Part_Image_Id *imid) +{ + Edje_Image_Directory_Set_Entry *entry; + Edje_Image_Directory_Set *set = NULL; + Eina_List *l; + int w = 0; + int h = 0; + int id; + + if (!st && !imid) + return -1; + + if (st && !st->image.set) + return st->image.id; + + if (imid && !imid->set) + return imid->id; + + if (imid) + id = imid->id; + else + id = st->image.id; + + evas_object_geometry_get(obj, NULL, NULL, &w, &h); + + if (eps && *eps) + { + if ((*eps)->id == id) + set = (*eps)->set; + + if (set) + if ((*eps)->entry->size.min.w <= w && w <= (*eps)->entry->size.max.w) + if ((*eps)->entry->size.min.h <= h && h <= (*eps)->entry->size.max.h) + return (*eps)->entry->id; + } + + if (!set) + set = ed->file->image_dir->sets + id; + + EINA_LIST_FOREACH(set->entries, l, entry) + { + if (entry->size.min.w <= w && w <= entry->size.max.w) + if (entry->size.min.h <= h && h <= entry->size.max.h) + { + if (eps) + { + if (!*eps) + *eps = calloc(1, sizeof (Edje_Real_Part_Set)); + + if (*eps) + { + (*eps)->entry = entry; + (*eps)->set = set; + (*eps)->id = id; + } + } + return entry->id; + } + } + + return -1; +} + +static void +_edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T pos) +{ + int image_id; + int image_count, image_num; + + image_id = _edje_image_find(ep->object, ed, + &ep->param1.set, + (Edje_Part_Description_Image*) ep->param1.description, + NULL); + if (image_id < 0) + { + Edje_Image_Directory_Entry *ie; + + if (!ed->file->image_dir) ie = NULL; + else ie = ed->file->image_dir->entries + (-image_id) - 1; + if ((ie) && + (ie->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) && + (ie->entry)) + { + evas_object_image_file_set(ep->object, ie->entry, NULL); + } + } + else + { + image_count = 2; + if (ep->param2) + image_count += ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens_count; + image_num = TO_INT(MUL(pos, SUB(FROM_INT(image_count), + FROM_DOUBLE(0.5)))); + if (image_num > (image_count - 1)) + image_num = image_count - 1; + if (image_num == 0) + { + image_id = _edje_image_find(ep->object, ed, + &ep->param1.set, + (Edje_Part_Description_Image*) ep->param1.description, + NULL); + } + else + if (ep->param2) + { + if (image_num == (image_count - 1)) + { + image_id = _edje_image_find(ep->object, ed, + &ep->param2->set, + (Edje_Part_Description_Image*) ep->param2->description, + NULL); + } + else + { + Edje_Part_Image_Id *imid; + + imid = ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens[image_num - 1]; + image_id = _edje_image_find(ep->object, ed, NULL, NULL, imid); + } + } + if (image_id < 0) + { + ERR("¨Part \"%s\" has description, " + "\"%s\" %3.3f with a missing image id!!!", + ep->part->name, + ep->param1.description->state.name, + ep->param1.description->state.value); + } + else + { + char buf[1024]; + + /* Replace snprint("edje/images/%i") == memcpy + itoa */ +#define IMAGES "edje/images/" + memcpy(buf, IMAGES, strlen(IMAGES)); + eina_convert_itoa(image_id, buf + strlen(IMAGES)); /* No need to check length as 2³² need only 10 characteres. */ + + evas_object_image_file_set(ep->object, ed->file->path, buf); + if (evas_object_image_load_error_get(ep->object) != EVAS_LOAD_ERROR_NONE) + { + ERR("Error loading image collection \"%s\" from " + "file \"%s\". Missing EET Evas loader module?", + buf, ed->file->path); + switch (evas_object_image_load_error_get(ep->object)) + { + case EVAS_LOAD_ERROR_GENERIC: + ERR("Error type: EVAS_LOAD_ERROR_GENERIC"); + break; + case EVAS_LOAD_ERROR_DOES_NOT_EXIST: + ERR("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST"); + break; + case EVAS_LOAD_ERROR_PERMISSION_DENIED: + ERR("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED"); + break; + case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED: + ERR("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED"); + break; + case EVAS_LOAD_ERROR_CORRUPT_FILE: + ERR("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE"); + break; + case EVAS_LOAD_ERROR_UNKNOWN_FORMAT: + ERR("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT"); + break; + default: + ERR("Error type: ???"); + break; + } + } + } + } +} + static void _edje_real_part_rel_to_apply(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_State *state) { @@ -398,6 +573,7 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl _edje_external_recalc_apply(ed, ep, NULL, chosen_desc); ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ep->invalidate = 1; #endif @@ -423,17 +599,23 @@ _edje_recalc(Edje *ed) return; } } - if (ed->postponed) return; - evas_object_smart_changed(ed->obj); - ed->postponed = 1; +// XXX: dont need this with current smart calc infra. remove me later +// if (ed->postponed) return; +// if (!ed->calc_only) + evas_object_smart_changed(ed->obj); +// XXX: dont need this with current smart calc infra. remove me later +// ed->postponed = 1; } void _edje_recalc_do(Edje *ed) { unsigned int i; + Eina_Bool need_calc; - ed->postponed = 0; +// XXX: dont need this with current smart calc infra. remove me later +// ed->postponed = 0; + need_calc = evas_object_smart_need_recalculate_get(ed->obj); evas_object_smart_need_recalculate_set(ed->obj, 0); if (!ed->dirty) return; ed->have_mapped_part = 0; @@ -460,6 +642,14 @@ _edje_recalc_do(Edje *ed) ed->all_part_change = 0; ed->text_part_change = 0; #endif + if (!ed->calc_only) + { + if (ed->recalc_call) + evas_object_smart_callback_call(ed->obj, "recalc", NULL); + } + else + evas_object_smart_need_recalculate_set(ed->obj, need_calc); + ed->recalc_call = 0; } void @@ -527,6 +717,7 @@ _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y) ep->drag->tmp.x = 0; ep->drag->need_reset = 0; ed->dirty = 1; + ed->recalc_call = 1; } if (ep->drag->y != y || ep->drag->tmp.y) @@ -535,6 +726,7 @@ _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y) ep->drag->tmp.y = 0; ep->drag->need_reset = 0; ed->dirty = 1; + ed->recalc_call = 1; } #ifdef EDJE_CALC_CACHE @@ -598,11 +790,13 @@ _edje_part_recalc_single_rel(Edje *ed, } static Edje_Internal_Aspect -_edje_part_recalc_single_aspect(Edje_Real_Part *ep, +_edje_part_recalc_single_aspect(Edje *ed, + Edje_Real_Part *ep, Edje_Part_Description_Common *desc, Edje_Calc_Params *params, int *minw, int *minh, - int *maxw, int *maxh) + int *maxw, int *maxh, + FLOAT_T pos) { Edje_Internal_Aspect apref = EDJE_ASPECT_PREFER_NONE; FLOAT_T aspect, amax, amin; @@ -612,6 +806,17 @@ _edje_part_recalc_single_aspect(Edje_Real_Part *ep, else aspect = DIV(FROM_INT(params->w), FROM_INT(params->h)); amax = desc->aspect.max; amin = desc->aspect.min; + if (desc->aspect.prefer == EDJE_ASPECT_PREFER_SOURCE && + ep->part->type == EDJE_PART_TYPE_IMAGE) + { + Evas_Coord w, h; + + /* We only need pose to find the right image that would be displayed, + and the right aspect ratio in that case */ + _edje_real_part_image_set(ed, ep, pos); + evas_object_image_size_get(ep->object, &w, &h); + amin = amax = DIV(FROM_INT(w), FROM_INT(h)); + } if ((ep->swallow_params.aspect.w > 0) && (ep->swallow_params.aspect.h > 0)) amin = amax = @@ -693,6 +898,7 @@ _edje_part_recalc_single_aspect(Edje_Real_Part *ep, if ((amin > ZERO) && (aspect < amin)) new_h = DIV(FROM_INT(params->w), amin); break; + case EDJE_ASPECT_PREFER_SOURCE: case EDJE_ASPECT_PREFER_BOTH: /* keep both dimensions in check */ /* adjust for max aspect (width / height) */ @@ -1255,6 +1461,7 @@ _edje_part_recalc_single_min(Edje_Part_Description_Common *desc, minh = tmp; break; } + case EDJE_ASPECT_PREFER_SOURCE: case EDJE_ASPECT_PREFER_BOTH: tmp = minh * params->w / h; if (tmp >= minw) @@ -1321,6 +1528,7 @@ _edje_part_recalc_single_max(Edje_Part_Description_Common *desc, maxh = tmp; break; } + case EDJE_ASPECT_PREFER_SOURCE: case EDJE_ASPECT_PREFER_BOTH: tmp = maxh * params->w / h; if (tmp <= maxw) @@ -1481,6 +1689,15 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, if (ep->swallow_params.min.w > desc->min.w) *minw = ep->swallow_params.min.w; + if (ep->edje->calc_only) + { + if (desc->minmul.have) + { + FLOAT_T mmw = desc->minmul.w; + if (mmw != FROM_INT(1)) *minw = TO_INT(SCALE(mmw, *minw)); + } + } + /* XXX TODO: remove need of EDJE_INF_MAX_W, see edje_util.c */ if ((ep->swallow_params.max.w <= 0) || (ep->swallow_params.max.w == EDJE_INF_MAX_W)) @@ -1508,6 +1725,8 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, *maxw = ep->swallow_params.max.w; } } + if ((ep->edje->calc_only) && (desc->minmul.have) && + (desc->minmul.w != FROM_INT(1))) *maxw = *minw; if (*maxw >= 0) { if (*maxw < *minw) *maxw = *minw; @@ -1518,6 +1737,16 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, if (ep->swallow_params.min.h > desc->min.h) *minh = ep->swallow_params.min.h; + if (ep->edje->calc_only) + { + if (desc->minmul.have) + { + FLOAT_T mmh = desc->minmul.h; + if (mmh != FROM_INT(1)) *minh = TO_INT(SCALE(mmh, *minh)); + } + } + + /* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */ if ((ep->swallow_params.max.h <= 0) || (ep->swallow_params.max.h == EDJE_INF_MAX_H)) @@ -1544,7 +1773,9 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, if (ep->swallow_params.max.h < *maxh) *maxh = ep->swallow_params.max.h; } - } + } + if ((ep->edje->calc_only) && (desc->minmul.have) && + (desc->minmul.h != FROM_INT(1))) *maxh = *minh; if (*maxh >= 0) { if (*maxh < *minh) *maxh = *minh; @@ -1665,7 +1896,8 @@ _edje_part_recalc_single(Edje *ed, Edje_Real_Part *rel2_to_x, Edje_Real_Part *rel2_to_y, Edje_Real_Part *confine_to, - Edje_Calc_Params *params) + Edje_Calc_Params *params, + FLOAT_T pos) { Edje_Color_Class *cc = NULL; Edje_Internal_Aspect apref; @@ -1675,12 +1907,12 @@ _edje_part_recalc_single(Edje *ed, sc = ed->scale; if (sc == ZERO) sc = _edje_scale; _edje_part_recalc_single_min_max(sc, ep, desc, &minw, &minh, &maxw, &maxh); - + /* relative coords of top left & bottom right */ _edje_part_recalc_single_rel(ed, ep, desc, rel1_to_x, rel1_to_y, rel2_to_x, rel2_to_y, params); /* aspect */ - apref = _edje_part_recalc_single_aspect(ep, desc, params, &minw, &minh, &maxw, &maxh); + apref = _edje_part_recalc_single_aspect(ed, ep, desc, params, &minw, &minh, &maxw, &maxh, pos); /* size step */ _edje_part_recalc_single_step(desc, params); @@ -1855,77 +2087,13 @@ _edje_table_recalc_apply(Edje *ed __UNUSED__, } } -static int -_edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps, Edje_Part_Description_Image *st, Edje_Part_Image_Id *imid) -{ - Edje_Image_Directory_Set_Entry *entry; - Edje_Image_Directory_Set *set = NULL; - Eina_List *l; - int w = 0; - int h = 0; - int id; - - if (!st && !imid) - return -1; - - if (st && !st->image.set) - return st->image.id; - - if (imid && !imid->set) - return imid->id; - - if (imid) - id = imid->id; - else - id = st->image.id; - - evas_object_geometry_get(obj, NULL, NULL, &w, &h); - - if (eps && *eps) - { - if ((*eps)->id == id) - set = (*eps)->set; - - if (set) - if ((*eps)->entry->size.min.w <= w && w <= (*eps)->entry->size.max.w) - if ((*eps)->entry->size.min.h <= h && h <= (*eps)->entry->size.max.h) - return (*eps)->entry->id; - } - - if (!set) - set = ed->file->image_dir->sets + id; - - EINA_LIST_FOREACH(set->entries, l, entry) - { - if (entry->size.min.w <= w && w <= entry->size.max.w) - if (entry->size.min.h <= h && h <= entry->size.max.h) - { - if (eps) - { - if (!*eps) - *eps = calloc(1, sizeof (Edje_Real_Part_Set)); - - if (*eps) - { - (*eps)->entry = entry; - (*eps)->set = set; - (*eps)->id = id; - } - } - return entry->id; - } - } - - return -1; -} - 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 = -1; - if (pos >= 0.5) + if (pos >= FROM_DOUBLE(0.5)) part_id = ((Edje_Part_Description_Proxy*) ep->param2->description)->proxy.id; else part_id = chosen_desc->proxy.id; @@ -1967,8 +2135,6 @@ _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj 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; - int image_count, image_num; FLOAT_T sc; sc = ed->scale; @@ -2003,107 +2169,7 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj else if (chosen_desc->image.border.no_fill == 2) evas_object_image_border_center_fill_set(ep->object, EVAS_BORDER_FILL_SOLID); - image_id = _edje_image_find(ep->object, ed, - &ep->param1.set, - (Edje_Part_Description_Image*) ep->param1.description, - NULL); - if (image_id < 0) - { - Edje_Image_Directory_Entry *ie; - - if (!ed->file->image_dir) ie = NULL; - else ie = ed->file->image_dir->entries + (-image_id) - 1; - if ((ie) && - (ie->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) && - (ie->entry)) - { - evas_object_image_file_set(ep->object, ie->entry, NULL); - } - } - else - { - image_count = 2; - if (ep->param2) - image_count += ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens_count; - image_num = TO_INT(MUL(pos, SUB(FROM_INT(image_count), - FROM_DOUBLE(0.5)))); - if (image_num > (image_count - 1)) - image_num = image_count - 1; - if (image_num == 0) - { - image_id = _edje_image_find(ep->object, ed, - &ep->param1.set, - (Edje_Part_Description_Image*) ep->param1.description, - NULL); - } - else - if (ep->param2) - { - if (image_num == (image_count - 1)) - { - image_id = _edje_image_find(ep->object, ed, - &ep->param2->set, - (Edje_Part_Description_Image*) ep->param2->description, - NULL); - } - else - { - Edje_Part_Image_Id *imid; - - imid = ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens[image_num - 1]; - image_id = _edje_image_find(ep->object, ed, NULL, NULL, imid); - } - } - if (image_id < 0) - { - ERR("¨Part \"%s\" has description, " - "\"%s\" %3.3f with a missing image id!!!", - ep->part->name, - ep->param1.description->state.name, - ep->param1.description->state.value); - } - else - { - char buf[1024]; - - /* Replace snprint("edje/images/%i") == memcpy + itoa */ -#define IMAGES "edje/images/" - memcpy(buf, IMAGES, strlen(IMAGES)); - eina_convert_itoa(image_id, buf + strlen(IMAGES)); /* No need to check length as 2³² need only 10 characteres. */ - - evas_object_image_file_set(ep->object, ed->file->path, buf); - if (evas_object_image_load_error_get(ep->object) != EVAS_LOAD_ERROR_NONE) - { - ERR("Error loading image collection \"%s\" from " - "file \"%s\". Missing EET Evas loader module?", - buf, ed->file->path); - switch (evas_object_image_load_error_get(ep->object)) - { - case EVAS_LOAD_ERROR_GENERIC: - ERR("Error type: EVAS_LOAD_ERROR_GENERIC"); - break; - case EVAS_LOAD_ERROR_DOES_NOT_EXIST: - ERR("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST"); - break; - case EVAS_LOAD_ERROR_PERMISSION_DENIED: - ERR("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED"); - break; - case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED: - ERR("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED"); - break; - case EVAS_LOAD_ERROR_CORRUPT_FILE: - ERR("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE"); - break; - case EVAS_LOAD_ERROR_UNKNOWN_FORMAT: - ERR("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT"); - break; - default: - ERR("Error type: ???"); - break; - } - } - } - } + _edje_real_part_image_set(ed, ep, pos); } static Edje_Real_Part * @@ -2299,13 +2365,15 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta Edje_Real_Part *pp; int part_id = -1; - if (pos >= 0.5) + if (pos >= FROM_DOUBLE(0.5)) part_id = ((Edje_Part_Description_Proxy*) ep->param2->description)->proxy.id; else part_id = ((Edje_Part_Description_Proxy*) chosen_desc)->proxy.id; pp = _edje_real_part_state_get(ed, ep, flags, part_id, NULL); +#ifdef EDJE_CALC_CACHE if (pp && pp->invalidate) proxy_invalidate = EINA_TRUE; +#endif } /* Recalc if needed the map center && light source */ @@ -2355,7 +2423,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta _edje_part_recalc_single(ed, ep, ep->param1.description, chosen_desc, center[0], light[0], persp[0], ep->param1.rel1_to_x, ep->param1.rel1_to_y, ep->param1.rel2_to_x, ep->param1.rel2_to_y, confine_to, - p1); + p1, pos); #ifdef EDJE_CALC_CACHE ep->param1.state = ed->state; @@ -2400,10 +2468,15 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta ((ep->part->type == EDJE_PART_TYPE_TEXT || ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) && ed->text_part_change)) #endif { - _edje_part_recalc_single(ed, ep, ep->param2->description, chosen_desc, center[1], light[1], persp[1], - ep->param2->rel1_to_x, ep->param2->rel1_to_y, ep->param2->rel2_to_x, ep->param2->rel2_to_y, + _edje_part_recalc_single(ed, ep, ep->param2->description, + chosen_desc, + center[1], light[1], persp[1], + ep->param2->rel1_to_x, + ep->param2->rel1_to_y, + ep->param2->rel2_to_x, + ep->param2->rel2_to_y, confine_to, - p2); + p2, pos); #ifdef EDJE_CALC_CACHE ep->param2->state = ed->state; #endif @@ -2449,7 +2522,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta p3->req.y = INTP(p1->req.y, p2->req.y, pos); p3->req.w = INTP(p1->req.w, p2->req.w, pos); p3->req.h = INTP(p1->req.h, p2->req.h, pos); - + if (ep->part->dragable.x) { p3->req_drag.x = INTP(p1->req_drag.x, p2->req_drag.x, pos); @@ -2543,11 +2616,11 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta } else if (p1->persp_on) { - memcpy(&p3->map.persp, &p1->map.persp, sizeof (p1->map.light)); + memcpy(&p3->map.persp, &p1->map.persp, sizeof (p1->map.persp)); } else if (p2->persp_on) { - memcpy(&p3->map.persp, &p2->map.persp, sizeof (p2->map.light)); + memcpy(&p3->map.persp, &p2->map.persp, sizeof (p2->map.persp)); } } diff --git a/libraries/edje/src/lib/edje_callbacks.c b/libraries/edje/src/lib/edje_callbacks.c index e0b0eae..2b02891 100644 --- a/libraries/edje/src/lib/edje_callbacks.c +++ b/libraries/edje/src/lib/edje_callbacks.c @@ -134,6 +134,7 @@ _edje_mouse_down_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi _edje_emit(ed, buf, events->part->name); } ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -157,6 +158,7 @@ _edje_mouse_down_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi rp->drag->val.y = dy; if (!ignored) _edje_emit(ed, "drag", rp->part->name); + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; @@ -235,6 +237,7 @@ _edje_mouse_up_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void if (rp->drag->down.count == 0) { rp->drag->need_reset = 1; + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; @@ -314,6 +317,7 @@ _edje_mouse_move_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi rp->drag->tmp.x = ev->cur.canvas.x - rp->drag->down.x; if (rp->part->dragable.y) rp->drag->tmp.y = ev->cur.canvas.y - rp->drag->down.y; + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; @@ -332,6 +336,7 @@ _edje_mouse_move_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi rp->drag->val.y = dy; if (!ignored) _edje_emit(ed, "drag", rp->part->name); + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; diff --git a/libraries/edje/src/lib/edje_data.c b/libraries/edje/src/lib/edje_data.c index 6b7b395..32b17b6 100644 --- a/libraries/edje/src/lib/edje_data.c +++ b/libraries/edje/src/lib/edje_data.c @@ -451,6 +451,9 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "align.y", align.y, EDJE_T_FLOAT); \ EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "fixed.w", fixed.w, EET_T_UCHAR); \ EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "fixed.h", fixed.h, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "minmul.have", minmul.have, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "minmul.w", minmul.w, EDJE_T_FLOAT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "minmul.h", minmul.h, EDJE_T_FLOAT); \ EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.w", min.w, EET_T_INT); \ EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.h", min.h, EET_T_INT); \ EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.w", max.w, EET_T_INT); \ diff --git a/libraries/edje/src/lib/edje_edit.c b/libraries/edje/src/lib/edje_edit.c index 901a1b1..eec5e04 100644 --- a/libraries/edje/src/lib/edje_edit.c +++ b/libraries/edje/src/lib/edje_edit.c @@ -20,14 +20,18 @@ EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED = 0 ; EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_REFERENCED = 0; EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST = 0; -/* Get ed(Edje*) from obj(Evas_Object*) */ -#define GET_ED_OR_RETURN(RET) \ - Edje *ed; \ +/* Get eed(Edje_Edit*) from obj(Evas_Object*) */ +#define GET_EED_OR_RETURN(RET) \ Edje_Edit *eed; \ if (!evas_object_smart_type_check_ptr(obj, _edje_edit_type)) \ return RET; \ eed = evas_object_smart_data_get(obj); \ - if (!eed) return RET; \ + if (!eed) return RET; + +/* Get ed(Edje*) from obj(Evas_Object*) */ +#define GET_ED_OR_RETURN(RET) \ + Edje *ed; \ + GET_EED_OR_RETURN(RET); \ ed = (Edje *)eed; /* Get rp(Edje_Real_Part*) from obj(Evas_Object*) and part(char*) */ @@ -388,72 +392,59 @@ _edje_real_part_free(Edje_Real_Part *rp) static Eina_Bool _edje_import_font_file(Edje *ed, const char *path, const char *entry) { + Eina_File *f; + Eet_File *eetf = NULL; void *fdata = NULL; long fsize = 0; /* Read font data from file */ - { - FILE *f = fopen(path, "rb"); - if (!f) - { - ERR("Unable to open font file \"%s\"", path); - return EINA_FALSE; - } + f = eina_file_open(path, 0); + if (!f) + { + ERR("Unable to open font file \"%s\"", path); + return EINA_FALSE; + } - fseek(f, 0, SEEK_END); - fsize = ftell(f); - rewind(f); - fdata = malloc(fsize); - if (!fdata) - { - ERR("Unable to alloc font file \"%s\"", path); - fclose(f); - return EINA_FALSE; - } - if (fread(fdata, fsize, 1, f) != 1) - { - free(fdata); - fclose(f); - ERR("Unable to read all of font file \"%s\"", path); - return EINA_FALSE; - } - fclose(f); - } + fsize = eina_file_size_get(f); + fdata = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); + if (!fdata) + { + ERR("Unable to map font file \"%s\"", path); + goto on_error; + } /* Write font to edje file */ - { - /* open the eet file */ - Eet_File *eetf = eet_open(ed->path, EET_FILE_MODE_READ_WRITE); - if (!eetf) - { - ERR("Unable to open \"%s\" for writing output", ed->path); - free(fdata); - return EINA_FALSE; - } + eetf = eet_open(ed->path, EET_FILE_MODE_READ_WRITE); + if (!eetf) + { + ERR("Unable to open \"%s\" for writing output", ed->path); + goto on_error; + } - if (eet_write(eetf, entry, fdata, fsize, 1) <= 0) - { - ERR("Unable to write font part \"%s\" as \"%s\" part entry", - path, entry); - eet_close(eetf); - free(fdata); - return EINA_FALSE; - } + if (eet_write(eetf, entry, fdata, fsize, 1) <= 0) + { + ERR("Unable to write font part \"%s\" as \"%s\" part entry", + path, entry); + goto on_error; + } - free(fdata); + /* write the edje_file */ + if (!_edje_edit_edje_file_save(eetf, ed->file)) + goto on_error; - /* write the edje_file */ - if (!_edje_edit_edje_file_save(eetf, ed->file)) - { - eet_delete(eetf, entry); - eet_close(eetf); - return EINA_FALSE; - } + eet_close(eetf); - eet_close(eetf); - } + eina_file_map_free(f, fdata); + eina_file_close(f); return EINA_TRUE; + + on_error: + if (eetf) eet_close(eetf); + eina_file_map_free(f, fdata); + eina_file_close(f); + + return EINA_FALSE; } @@ -4791,7 +4782,7 @@ edje_edit_image_id_get(Evas_Object *obj, const char *image_name) { eina_error_set(0); - GET_ED_OR_RETURN(-1); + GET_EED_OR_RETURN(-1); return _edje_image_id_find(eed, image_name); } @@ -5174,7 +5165,6 @@ EAPI Eina_Bool edje_edit_program_add(Evas_Object *obj, const char *name) { Edje_Program *epr; - Edje_Part_Collection *pc; eina_error_set(0); @@ -5191,7 +5181,7 @@ edje_edit_program_add(Evas_Object *obj, const char *name) if (!epr) return EINA_FALSE; //Add program to group - pc = ed->collection; + // pc = ed->collection; /* By default, source and signal are empty, so they fill in nocmp category */ ed->collection->programs.nocmp = realloc(ed->collection->programs.nocmp, @@ -5237,7 +5227,6 @@ edje_edit_program_del(Evas_Object *obj, const char *prog) Eina_List *l, *l_next; Edje_Program_Target *prt; Edje_Program_After *pa; - Edje_Part_Collection *pc; Edje_Program *p; Program_Script *ps, *old_ps; int id, i; @@ -5248,7 +5237,7 @@ edje_edit_program_del(Evas_Object *obj, const char *prog) GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); - pc = ed->collection; + //pc = ed->collection; //Remove program from programs list id = epr->id; @@ -5737,7 +5726,7 @@ edje_edit_program_action_set(Evas_Object *obj, const char *prog, Edje_Action_Typ eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); + GET_EED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); //printf("SET ACTION for program: %s [%d]\n", prog, action); @@ -6081,7 +6070,7 @@ edje_edit_script_set(Evas_Object *obj, const char *code) { eina_error_set(0); - GET_ED_OR_RETURN(); + GET_EED_OR_RETURN(); free(eed->embryo_source); free(eed->embryo_processed); @@ -6104,7 +6093,7 @@ edje_edit_script_program_get(Evas_Object *obj, const char *prog) eina_error_set(0); - GET_ED_OR_RETURN(NULL); + GET_EED_OR_RETURN(NULL); GET_EPR_OR_RETURN(NULL); if (epr->action != EDJE_ACTION_TYPE_SCRIPT) @@ -6124,7 +6113,7 @@ edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *cod eina_error_set(0); - GET_ED_OR_RETURN(); + GET_EED_OR_RETURN(); GET_EPR_OR_RETURN(); if (epr->action != EDJE_ACTION_TYPE_SCRIPT) @@ -6550,7 +6539,7 @@ almost_out: EAPI Eina_Bool edje_edit_script_compile(Evas_Object *obj) { - GET_ED_OR_RETURN(EINA_FALSE); + GET_EED_OR_RETURN(EINA_FALSE); if (!eed->script_need_recompile) return EINA_TRUE; @@ -6561,7 +6550,7 @@ edje_edit_script_compile(Evas_Object *obj) EAPI const Eina_List * edje_edit_script_error_list_get(Evas_Object *obj) { - GET_ED_OR_RETURN(NULL); + GET_EED_OR_RETURN(NULL); return eed->errors; } @@ -6643,7 +6632,7 @@ _edje_generate_source_of_program(Evas_Object *obj, const char *program, Eina_Str const char *api_name, *api_description; Edje_Program *epr; - GET_ED_OR_RETURN(EINA_FALSE); + GET_EED_OR_RETURN(EINA_FALSE); epr = _edje_program_get_byname(obj, program); @@ -6816,7 +6805,7 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s if (pd->aspect.min || pd->aspect.max) BUF_APPENDF(I5"aspect: %g %g;\n", TO_DOUBLE(pd->aspect.min), TO_DOUBLE(pd->aspect.max)); if (pd->aspect.prefer) - BUF_APPENDF(I5"aspect_preference: %s;\n", prefers[pd->aspect.prefer]); + BUF_APPENDF(I5"aspect_preference: %s;\n", prefers[(int) pd->aspect.prefer]); if (pd->color_class) BUF_APPENDF(I5"color_class: \"%s\";\n", pd->color_class); @@ -7786,7 +7775,7 @@ edje_edit_print_internal_status(Evas_Object *obj) */ eina_error_set(0); - GET_ED_OR_RETURN(); + GET_EED_OR_RETURN(); _edje_generate_source(obj); /* diff --git a/libraries/edje/src/lib/edje_embryo.c b/libraries/edje/src/lib/edje_embryo.c index c89a4f4..1ad2377 100644 --- a/libraries/edje/src/lib/edje_embryo.c +++ b/libraries/edje/src/lib/edje_embryo.c @@ -674,6 +674,7 @@ _edje_embryo_fn_set_min_size(Embryo_Program *ep, Embryo_Cell *params) if (h < 0.0) h = 0.0; ed->collection->prop.min.w = w; ed->collection->prop.min.h = h; + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; @@ -701,6 +702,7 @@ _edje_embryo_fn_set_max_size(Embryo_Program *ep, Embryo_Cell *params) if (h < 0.0) h = 0.0; ed->collection->prop.max.w = w; ed->collection->prop.max.h = h; + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; diff --git a/libraries/edje/src/lib/edje_entry.c b/libraries/edje/src/lib/edje_entry.c index e25397a..563497d 100644 --- a/libraries/edje/src/lib/edje_entry.c +++ b/libraries/edje/src/lib/edje_entry.c @@ -2,9 +2,9 @@ #ifdef HAVE_ECORE_IMF static Eina_Bool _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos); -static Eina_Bool _edje_entry_imf_event_commit_cb(void *data, int type, void *event); -static Eina_Bool _edje_entry_imf_event_preedit_changed_cb(void *data, int type, void *event); -static Eina_Bool _edje_entry_imf_event_delete_surrounding_cb(void *data, int type, void *event); +static void _edje_entry_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info); +static void _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx, void *event_info); +static void _edje_entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx, void *event); #endif typedef struct _Entry Entry; @@ -39,10 +39,6 @@ struct _Entry #ifdef HAVE_ECORE_IMF Eina_Bool have_preedit : 1; Ecore_IMF_Context *imf_context; - - Ecore_Event_Handler *imf_ee_handler_commit; - Ecore_Event_Handler *imf_ee_handler_delete; - Ecore_Event_Handler *imf_ee_handler_changed; #endif }; @@ -272,20 +268,6 @@ _curs_update_from_curs(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, Entr *cy += (ch / 2); } -static void -_curs_back(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, - Entry *en __UNUSED__) -{ - evas_textblock_cursor_char_prev(c); -} - -static void -_curs_next(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, - Entry *en __UNUSED__) -{ - evas_textblock_cursor_char_next(c); -} - static int _curs_line_last_get(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o, Entry *en __UNUSED__) { @@ -415,6 +397,7 @@ static void _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) { if (!en->sel_end) return; + _edje_entry_imf_context_reset(en); _sel_enable(c, o, en); if (!evas_textblock_cursor_compare(c, en->sel_end)) return; evas_textblock_cursor_copy(c, en->sel_end); @@ -424,13 +407,13 @@ _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) en->selection = NULL; } _edje_emit(en->rp->edje, "selection,changed", en->rp->part->name); - _edje_entry_imf_context_reset(en); } static void _sel_preextend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) { if (!en->sel_end) return; + _edje_entry_imf_context_reset(en); _sel_enable(c, o, en); if (!evas_textblock_cursor_compare(c, en->sel_start)) return; evas_textblock_cursor_copy(c, en->sel_start); @@ -440,7 +423,6 @@ _sel_preextend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) en->selection = NULL; } _edje_emit(en->rp->edje, "selection,changed", en->rp->part->name); - _edje_entry_imf_context_reset(en); } static void @@ -1107,6 +1089,10 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v } #endif + if ((!strcmp(ev->key, "Escape")) || + (!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter"))) + _edje_entry_imf_context_reset(en); + old_cur_pos = evas_textblock_cursor_pos_get(en->cursor); control = evas_key_modifier_is_set(ev->modifiers, "Control"); @@ -1138,6 +1124,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v } _sel_clear(en->cursor, rp->object, en); _edje_emit(ed, "entry,key,up", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); } else if (!strcmp(ev->key, "Down") || !strcmp(ev->key, "KP_Down")) { @@ -1157,6 +1144,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v } _sel_clear(en->cursor, rp->object, en); _edje_emit(ed, "entry,key,down", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); } else if (!strcmp(ev->key, "Left") || !strcmp(ev->key, "KP_Left")) { @@ -1165,13 +1153,16 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v if (shift) _sel_start(en->cursor, rp->object, en); else _sel_clear(en->cursor, rp->object, en); } - _curs_back(en->cursor, rp->object, en); + evas_textblock_cursor_char_prev(en->cursor); + /* If control is pressed, go to the start of the word */ + if (control) evas_textblock_cursor_word_start(en->cursor); if (en->select_allow) { if (shift) _sel_extend(en->cursor, rp->object, en); } _sel_clear(en->cursor, rp->object, en); _edje_emit(ed, "entry,key,left", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } else if (!strcmp(ev->key, "Right") || !strcmp(ev->key, "KP_Right")) @@ -1181,20 +1172,31 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v if (shift) _sel_start(en->cursor, rp->object, en); else _sel_clear(en->cursor, rp->object, en); } - _curs_next(en->cursor, rp->object, en); + /* If control is pressed, go to the start of the word */ + if (control) evas_textblock_cursor_word_end(en->cursor); + evas_textblock_cursor_char_next(en->cursor); if (en->select_allow) { if (shift) _sel_extend(en->cursor, rp->object, en); } _sel_clear(en->cursor, rp->object, en); _edje_emit(ed, "entry,key,right", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } else if (!strcmp(ev->key, "BackSpace")) { - if (control) + if (control && !en->have_selection) { // del to start of previous word + _sel_start(en->cursor, rp->object, en); + + evas_textblock_cursor_char_prev(en->cursor); + evas_textblock_cursor_word_start(en->cursor); + + _sel_extend(en->cursor, rp->object, en); + + _range_del_emit(ed, en->cursor, rp->object, en); } else if ((alt) && (shift)) { @@ -1224,6 +1226,14 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v if (control) { // del to end of next word + _sel_start(en->cursor, rp->object, en); + + evas_textblock_cursor_word_end(en->cursor); + evas_textblock_cursor_char_next(en->cursor); + + _sel_extend(en->cursor, rp->object, en); + + _range_del_emit(ed, en->cursor, rp->object, en); } else if (shift) { @@ -1281,10 +1291,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v _edje_emit(ed, "entry,key,end", rp->part->name); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } - else if (!strcmp(ev->key, "Shift_L") || !strcmp(ev->key, "Shift_R")) - { - return; - } else if ((control) && (!strcmp(ev->key, "v"))) { _edje_emit(ed, "entry,paste,request", rp->part->name); @@ -1303,13 +1309,11 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v } else if ((control) && ((!strcmp(ev->key, "c") || (!strcmp(ev->key, "Insert"))))) { - // FIXME: copy - save selection _edje_emit(ed, "entry,copy,notify", rp->part->name); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } else if ((control) && ((!strcmp(ev->key, "x") || (!strcmp(ev->key, "m"))))) { - // FIXME: cut - save selection, delete seletion _edje_emit(ed, "entry,cut,notify", rp->part->name); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } @@ -1336,7 +1340,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v else if ((control) && (!strcmp(ev->key, "w"))) { _sel_clear(en->cursor, rp->object, en); - // select current word + // select current word? ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } else if (!strcmp(ev->key, "Tab")) @@ -1361,10 +1365,10 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v _sel_clear(en->cursor, rp->object, en); info->change.insert.pos = evas_textblock_cursor_pos_get(en->cursor); - info->change.insert.content = eina_stringshare_add("<\t>"); + info->change.insert.content = eina_stringshare_add(""); //yy -// evas_textblock_cursor_format_prepend(en->cursor, "\t"); - _text_filter_format_prepend(en, en->cursor, "\t"); +// evas_textblock_cursor_format_prepend(en->cursor, "tab"); + _text_filter_format_prepend(en, en->cursor, "tab"); _anchors_get(en->cursor, rp->object, en); _edje_emit(ed, "entry,changed", rp->part->name); _edje_emit_full(ed, "entry,changed,user", rp->part->name, @@ -1427,19 +1431,20 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v info->change.insert.pos = evas_textblock_cursor_pos_get(en->cursor); - if (shift) + if (shift || + evas_object_textblock_legacy_newline_get(rp->object)) { //yy -// evas_textblock_cursor_format_prepend(en->cursor, "\n"); - _text_filter_format_prepend(en, en->cursor, "\n"); - info->change.insert.content = eina_stringshare_add("<\n>"); +// evas_textblock_cursor_format_prepend(en->cursor, "br"); + _text_filter_format_prepend(en, en->cursor, "br"); + info->change.insert.content = eina_stringshare_add("
"); } else { //yy // evas_textblock_cursor_format_prepend(en->cursor, "ps"); _text_filter_format_prepend(en, en->cursor, "ps"); - info->change.insert.content = eina_stringshare_add(""); + info->change.insert.content = eina_stringshare_add(""); } _anchors_get(en->cursor, rp->object, en); _edje_emit(ed, "entry,changed", rp->part->name); @@ -1499,7 +1504,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v if (!cursor_changed && (old_cur_pos != evas_textblock_cursor_pos_get(en->cursor))) _edje_emit(ed, "cursor,changed", rp->part->name); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_entry_real_part_configure(rp); } @@ -1576,6 +1580,8 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS } #endif + _edje_entry_imf_context_reset(en); + en->select_mod_start = EINA_FALSE; en->select_mod_end = EINA_FALSE; if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_DEFAULT) @@ -1690,10 +1696,12 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS } } if (evas_textblock_cursor_compare(tc, en->cursor)) - _edje_emit(rp->edje, "cursor,changed", rp->part->name); + { + _edje_emit(rp->edje, "cursor,changed", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); + } evas_textblock_cursor_free(tc); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_entry_real_part_configure(rp); @@ -1733,6 +1741,8 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED } #endif + _edje_entry_imf_context_reset(en); + 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); @@ -1799,10 +1809,12 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED en->selecting = EINA_FALSE; } if (evas_textblock_cursor_compare(tc, en->cursor)) - _edje_emit(rp->edje, "cursor,changed", rp->part->name); + { + _edje_emit(rp->edje, "cursor,changed", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); + } evas_textblock_cursor_free(tc); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_entry_real_part_configure(rp); } @@ -1893,7 +1905,10 @@ _edje_part_mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS _sel_update(en->cursor, rp->object, en); } if (evas_textblock_cursor_compare(tc, en->cursor)) - _edje_emit(rp->edje, "cursor,changed", rp->part->name); + { + _edje_emit(rp->edje, "cursor,changed", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); + } evas_textblock_cursor_free(tc); _edje_entry_imf_context_reset(en); @@ -2014,6 +2029,8 @@ _edje_entry_real_part_init(Edje_Real_Part *rp) evas_object_pass_events_set(en->cursor_fg, EINA_TRUE); _edje_subobj_register(en->rp->edje, en->cursor_fg); + evas_object_textblock_legacy_newline_set(rp->object, EINA_TRUE); + if (rp->part->entry_mode >= EDJE_ENTRY_EDIT_MODE_EDITABLE) { evas_object_show(en->cursor_bg); @@ -2055,9 +2072,9 @@ _edje_entry_real_part_init(Edje_Real_Part *rp) ecore_imf_context_retrieve_surrounding_callback_set(en->imf_context, _edje_entry_imf_retrieve_surrounding_cb, rp->edje); - en->imf_ee_handler_commit = ecore_event_handler_add(ECORE_IMF_EVENT_COMMIT, _edje_entry_imf_event_commit_cb, rp->edje); - en->imf_ee_handler_delete = ecore_event_handler_add(ECORE_IMF_EVENT_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb, rp->edje); - en->imf_ee_handler_changed = ecore_event_handler_add(ECORE_IMF_EVENT_PREEDIT_CHANGED, _edje_entry_imf_event_preedit_changed_cb, rp->edje); + ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _edje_entry_imf_event_commit_cb, rp->edje); + ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb, rp->edje); + ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _edje_entry_imf_event_preedit_changed_cb, rp->edje); ecore_imf_context_input_mode_set(en->imf_context, rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD ? ECORE_IMF_INPUT_MODE_INVISIBLE : ECORE_IMF_INPUT_MODE_FULL); @@ -2094,23 +2111,9 @@ _edje_entry_real_part_shutdown(Edje_Real_Part *rp) { if (en->imf_context) { - if (en->imf_ee_handler_commit) - { - ecore_event_handler_del(en->imf_ee_handler_commit); - en->imf_ee_handler_commit = NULL; - } - - if (en->imf_ee_handler_delete) - { - ecore_event_handler_del(en->imf_ee_handler_delete); - en->imf_ee_handler_delete = NULL; - } - - if (en->imf_ee_handler_changed) - { - ecore_event_handler_del(en->imf_ee_handler_changed); - en->imf_ee_handler_changed = NULL; - } + ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _edje_entry_imf_event_commit_cb); + ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb); + ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _edje_entry_imf_event_preedit_changed_cb); ecore_imf_context_del(en->imf_context); en->imf_context = NULL; @@ -2189,7 +2192,7 @@ _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text) { Entry *en = rp->entry_data; if (!en) return; - + _edje_entry_imf_context_reset(en); // set text as markup _sel_clear(en->cursor, rp->object, en); evas_object_textblock_text_markup_set(rp->object, text); @@ -2228,6 +2231,8 @@ _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text) { Entry *en = rp->entry_data; if (!en) return; + _edje_entry_imf_context_reset(en); + // prepend markup @ cursor pos if (en->have_selection) _range_del(en->cursor, rp->object, en); @@ -2239,9 +2244,7 @@ _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text) _edje_emit(rp->edje, "entry,changed", rp->part->name); _edje_emit(rp->edje, "cursor,changed", rp->part->name); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); - _edje_entry_real_part_configure(rp); } @@ -2278,6 +2281,9 @@ _edje_entry_select_all(Edje_Real_Part *rp) { Entry *en = rp->entry_data; if (!en) return; + + _edje_entry_imf_context_reset(en); + _sel_clear(en->cursor, rp->object, en); _curs_start(en->cursor, rp->object, en); _sel_enable(en->cursor, rp->object, en); @@ -2285,7 +2291,6 @@ _edje_entry_select_all(Edje_Real_Part *rp) _curs_end(en->cursor, rp->object, en); _sel_extend(en->cursor, rp->object, en); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_entry_real_part_configure(rp); } @@ -2295,12 +2300,14 @@ _edje_entry_select_begin(Edje_Real_Part *rp) { Entry *en = rp->entry_data; if (!en) return; + + _edje_entry_imf_context_reset(en); + _sel_clear(en->cursor, rp->object, en); _sel_enable(en->cursor, rp->object, en); _sel_start(en->cursor, rp->object, en); _sel_extend(en->cursor, rp->object, en); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_entry_real_part_configure(rp); @@ -2311,9 +2318,9 @@ _edje_entry_select_extend(Edje_Real_Part *rp) { Entry *en = rp->entry_data; if (!en) return; + _edje_entry_imf_context_reset(en); _sel_extend(en->cursor, rp->object, en); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_entry_real_part_configure(rp); @@ -2560,13 +2567,14 @@ _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur) Entry *en = rp->entry_data; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return EINA_FALSE; + + _edje_entry_imf_context_reset(en); + if (!evas_textblock_cursor_char_next(c)) { return EINA_FALSE; } _sel_update(c, rp->object, rp->entry_data); - - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); @@ -2580,6 +2588,9 @@ _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur) Entry *en = rp->entry_data; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return EINA_FALSE; + + _edje_entry_imf_context_reset(en); + if (!evas_textblock_cursor_char_prev(c)) { if (evas_textblock_cursor_paragraph_prev(c)) goto ok; @@ -2588,7 +2599,6 @@ _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur) ok: _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); @@ -2604,6 +2614,9 @@ _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur) Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch; int ln; if (!c) return EINA_FALSE; + + _edje_entry_imf_context_reset(en); + ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); ln--; if (ln < 0) return EINA_FALSE; @@ -2620,7 +2633,6 @@ _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur) } _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); @@ -2636,6 +2648,9 @@ _edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur) Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch; int ln; if (!c) return EINA_FALSE; + + _edje_entry_imf_context_reset(en); + ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); ln++; if (!evas_object_textblock_line_number_geometry_get(rp->object, ln, @@ -2651,7 +2666,6 @@ _edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur) } _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); _edje_entry_real_part_configure(rp); @@ -2664,10 +2678,12 @@ _edje_entry_cursor_begin(Edje_Real_Part *rp, Edje_Cursor cur) Entry *en = rp->entry_data; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return; + + _edje_entry_imf_context_reset(en); + evas_textblock_cursor_paragraph_first(c); _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); _edje_entry_real_part_configure(rp); @@ -2679,10 +2695,12 @@ _edje_entry_cursor_end(Edje_Real_Part *rp, Edje_Cursor cur) Entry *en = rp->entry_data; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return; + + _edje_entry_imf_context_reset(en); + _curs_end(c, rp->object, rp->entry_data); _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); @@ -2715,10 +2733,11 @@ _edje_entry_cursor_line_begin(Edje_Real_Part *rp, Edje_Cursor cur) Entry *en = rp->entry_data; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return; + _edje_entry_imf_context_reset(en); + evas_textblock_cursor_line_char_first(c); _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); @@ -2731,10 +2750,10 @@ _edje_entry_cursor_line_end(Edje_Real_Part *rp, Edje_Cursor cur) Entry *en = rp->entry_data; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return; + _edje_entry_imf_context_reset(en); evas_textblock_cursor_line_char_last(c); _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); _edje_entry_real_part_configure(rp); @@ -2766,7 +2785,7 @@ _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur) return evas_textblock_cursor_format_is_visible_get(c); } -const char * +char * _edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur) { static char *s = NULL; @@ -2793,10 +2812,10 @@ _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos) if (evas_textblock_cursor_pos_get(c) == pos) return; + _edje_entry_imf_context_reset(en); evas_textblock_cursor_pos_set(c, pos); _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); _edje_entry_real_part_configure(rp); @@ -2891,43 +2910,33 @@ _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx __UNU return EINA_TRUE; } -static Eina_Bool -_edje_entry_imf_event_commit_cb(void *data, int type __UNUSED__, void *event) +static void +_edje_entry_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx __UNUSED__, void *event_info) { Edje *ed = data; Edje_Real_Part *rp = ed->focused_part; Entry *en; - Ecore_IMF_Event_Commit *ev = event; - Evas_Textblock_Cursor *tc; - Eina_Bool cursor_move = EINA_FALSE; + char *commit_str = event_info; + int start_pos; - if ((!rp) || (!ev) || (!ev->str)) return ECORE_CALLBACK_PASS_ON; + if ((!rp)) return; en = rp->entry_data; if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) - return ECORE_CALLBACK_PASS_ON; - - if (!en->imf_context) return ECORE_CALLBACK_PASS_ON; - if (en->imf_context != ev->ctx) return ECORE_CALLBACK_PASS_ON; + return; if (en->have_selection) { - if (strcmp(ev->str, "")) + if (strcmp(commit_str, "")) { /* delete selected characters */ - _range_del(en->cursor, rp->object, en); + _range_del_emit(ed, en->cursor, rp->object, en); _sel_clear(en->cursor, rp->object, en); } } - tc = evas_object_textblock_cursor_new(rp->object); - - /* calculate the cursor position to insert commit string */ - if (en->preedit_start) - evas_textblock_cursor_copy(en->preedit_start, tc); - else - evas_textblock_cursor_copy(en->cursor, tc); + start_pos = evas_textblock_cursor_pos_get(en->cursor); #ifdef HAVE_ECORE_IMF /* delete preedit characters */ @@ -2935,17 +2944,16 @@ _edje_entry_imf_event_commit_cb(void *data, int type __UNUSED__, void *event) _preedit_clear(en); #endif - if (evas_textblock_cursor_compare(en->cursor, tc)) - cursor_move = EINA_TRUE; if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && _edje_password_show_last) _edje_entry_hide_visible_password(en->rp); if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && _edje_password_show_last && (!en->preedit_start)) { - _text_filter_format_prepend(en, tc, "+ password=off"); - _text_filter_markup_prepend(en, tc, ev->str); - _text_filter_format_prepend(en, tc, "- password"); + _text_filter_format_prepend(en, en->cursor, "+ password=off"); + _text_filter_text_prepend(en, en->cursor, commit_str); + _text_filter_format_prepend(en, en->cursor, "- password"); + if (en->pw_timer) { ecore_timer_del(en->pw_timer); @@ -2955,51 +2963,54 @@ _edje_entry_imf_event_commit_cb(void *data, int type __UNUSED__, void *event) _password_timer_cb, en); } else - _text_filter_text_prepend(en, tc, ev->str); - - if (!cursor_move) - { - /* move cursor to the end of commit string */ - evas_textblock_cursor_copy(tc, en->cursor); - } + _text_filter_text_prepend(en, en->cursor, commit_str); - evas_textblock_cursor_free(tc); _edje_entry_imf_cursor_info_set(en); _anchors_get(en->cursor, rp->object, en); _edje_emit(rp->edje, "entry,changed", rp->part->name); - _edje_emit(ed, "entry,changed,user", rp->part->name); - _edje_emit(ed, "cursor,changed", rp->part->name); - return ECORE_CALLBACK_DONE; + { + Edje_Entry_Change_Info *info = calloc(1, sizeof(*info)); + info->insert = EINA_TRUE; + info->change.insert.pos = start_pos; + info->change.insert.content = eina_stringshare_add(commit_str); + info->change.insert.plain_length = + eina_unicode_utf8_get_len(info->change.insert.content); + _edje_emit_full(ed, "entry,changed,user", rp->part->name, + info, _free_entry_change_info); + _edje_emit(ed, "cursor,changed", rp->part->name); + } } -static Eina_Bool -_edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void *event) +static void +_edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx __UNUSED__, void *event_info __UNUSED__) { Edje *ed = data; Edje_Real_Part *rp = ed->focused_part; Entry *en; - Ecore_IMF_Event_Preedit_Changed *ev = event; int cursor_pos; int preedit_start_pos, preedit_end_pos; char *preedit_string; int i; Eina_Bool preedit_end_state = EINA_FALSE; + Eina_List *attrs = NULL, *l = NULL; + Ecore_IMF_Preedit_Attr *attr; + Eina_Strbuf *buf; - if ((!rp) || (!ev)) return ECORE_CALLBACK_PASS_ON; + if ((!rp)) return; en = rp->entry_data; if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) - return ECORE_CALLBACK_PASS_ON; - - if (!en->imf_context) return ECORE_CALLBACK_PASS_ON; + return; - if (en->imf_context != ev->ctx) return ECORE_CALLBACK_PASS_ON; + if (!en->imf_context) return; - ecore_imf_context_preedit_string_get(en->imf_context, &preedit_string, &cursor_pos); - if (!preedit_string) return ECORE_CALLBACK_PASS_ON; + ecore_imf_context_preedit_string_with_attributes_get(en->imf_context, + &preedit_string, + &attrs, &cursor_pos); + if (!preedit_string) return; if (!strcmp(preedit_string, "")) preedit_end_state = EINA_TRUE; @@ -3007,7 +3018,7 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void * if (en->have_selection && !preedit_end_state) { /* delete selected characters */ - _range_del(en->cursor, rp->object, en); + _range_del_emit(ed, en->cursor, rp->object, en); _sel_clear(en->cursor, rp->object, en); } @@ -3017,23 +3028,51 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void * preedit_start_pos = evas_textblock_cursor_pos_get(en->cursor); /* insert preedit character(s) */ - if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && - _edje_password_show_last) + if (strlen(preedit_string) > 0) { - _text_filter_format_prepend(en, en->cursor, "+ password=off"); - _text_filter_markup_prepend(en, en->cursor, preedit_string); - _text_filter_format_prepend(en, en->cursor, "- password"); - if (en->pw_timer) + buf = eina_strbuf_new(); + if (attrs) { - ecore_timer_del(en->pw_timer); - en->pw_timer = NULL; + EINA_LIST_FOREACH(attrs, l, attr) + { + if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB1) + { + eina_strbuf_append(buf, ""); + eina_strbuf_append_n(buf, preedit_string + attr->start_index, + attr->end_index - attr->start_index); + eina_strbuf_append(buf, ""); + } + + else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB2 || + attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB3) + { + eina_strbuf_append(buf, ""); + eina_strbuf_append_n(buf, preedit_string + attr->start_index, + attr->end_index - attr->start_index); + eina_strbuf_append(buf, ""); + } + } } - en->pw_timer = ecore_timer_add(_edje_password_show_last_timeout, - _password_timer_cb, en); - } - else - { - _text_filter_markup_prepend(en, en->cursor, preedit_string); + if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && + _edje_password_show_last) + { + _edje_entry_hide_visible_password(en->rp); + _text_filter_format_prepend(en, en->cursor, "+ password=off"); + _text_filter_markup_prepend(en, en->cursor, eina_strbuf_string_get(buf)); + _text_filter_format_prepend(en, en->cursor, "- password"); + if (en->pw_timer) + { + ecore_timer_del(en->pw_timer); + en->pw_timer = NULL; + } + en->pw_timer = ecore_timer_add(_edje_password_show_last_timeout, + _password_timer_cb, en); + } + else + { + _text_filter_markup_prepend(en, en->cursor, eina_strbuf_string_get(buf)); + } + eina_strbuf_free(buf); } if (!preedit_end_state) @@ -3066,29 +3105,30 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void * _edje_emit(rp->edje, "preedit,changed", rp->part->name); _edje_emit(ed, "cursor,changed", rp->part->name); - free(preedit_string); + /* delete attribute list */ + if (attrs) + { + EINA_LIST_FREE(attrs, attr) free(attr); + } - return ECORE_CALLBACK_DONE; + free(preedit_string); } -static Eina_Bool -_edje_entry_imf_event_delete_surrounding_cb(void *data, int type __UNUSED__, void *event) +static void +_edje_entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx __UNUSED__, void *event_info) { Edje *ed = data; Edje_Real_Part *rp = ed->focused_part; Entry *en; - Ecore_IMF_Event_Delete_Surrounding *ev = event; + Ecore_IMF_Event_Delete_Surrounding *ev = event_info; Evas_Textblock_Cursor *del_start, *del_end; int cursor_pos; - if ((!rp) || (!ev)) return ECORE_CALLBACK_PASS_ON; + if ((!rp) || (!ev)) return; en = rp->entry_data; if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) - return ECORE_CALLBACK_PASS_ON; - - if (!en->imf_context) return ECORE_CALLBACK_PASS_ON; - if (en->imf_context != ev->ctx) return ECORE_CALLBACK_PASS_ON; + return; cursor_pos = evas_textblock_cursor_pos_get(en->cursor); @@ -3102,8 +3142,6 @@ _edje_entry_imf_event_delete_surrounding_cb(void *data, int type __UNUSED__, voi evas_textblock_cursor_free(del_start); evas_textblock_cursor_free(del_end); - - return ECORE_CALLBACK_DONE; } #endif diff --git a/libraries/edje/src/lib/edje_load.c b/libraries/edje/src/lib/edje_load.c index 644bb7c..8fe5842 100644 --- a/libraries/edje/src/lib/edje_load.c +++ b/libraries/edje/src/lib/edje_load.c @@ -262,6 +262,10 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g { Edje *ed; Evas *tev; + Edje_Real_Part *rp; + Eina_List *textblocks = NULL; + Eina_List *sources = NULL; + Eina_List *externals = NULL; Eina_List *old_swallows; unsigned int n; Eina_List *parts = NULL; @@ -323,7 +327,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g else { unsigned int i; - int errors = 0; /* colorclass stuff */ for (i = 0; i < ed->collection->parts_count; ++i) @@ -333,8 +336,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g ep = ed->collection->parts[i]; - if (errors) - break; /* Register any color classes in this parts descriptions. */ if ((ep->default_desc) && (ep->default_desc->color_class)) _edje_color_class_member_add(ed, ep->default_desc->color_class); @@ -353,12 +354,12 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g for (n = 0; n < ed->collection->parts_count; n++) { Edje_Part *ep; - Edje_Real_Part *rp; ep = ed->collection->parts[n]; rp = eina_mempool_malloc(_edje_real_part_mp, sizeof(Edje_Real_Part)); if (!rp) { + /* FIXME: destroy all allocated ressource, need to have a common exit point */ ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; evas_event_thaw(tev); evas_event_thaw_eval(tev); @@ -373,7 +374,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g if (!rp->drag) { ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; - free(rp); + eina_mempool_free(_edje_real_part_mp, rp); evas_event_thaw(tev); evas_event_thaw_eval(tev); return 0; @@ -407,9 +408,12 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g rp->object = evas_object_text_add(ed->base.evas); evas_object_text_font_source_set(rp->object, ed->path); break; - case EDJE_PART_TYPE_SWALLOW: case EDJE_PART_TYPE_GROUP: + sources = eina_list_append(sources, rp); + case EDJE_PART_TYPE_SWALLOW: case EDJE_PART_TYPE_EXTERNAL: + if (ep->type == EDJE_PART_TYPE_EXTERNAL) + externals = eina_list_append(externals, rp); rp->object = evas_object_rectangle_add(ed->base.evas); evas_object_color_set(rp->object, 0, 0, 0, 0); evas_object_pass_events_set(rp->object, 1); @@ -417,13 +421,16 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g _edje_callbacks_focus_add(rp->object, ed, rp); break; case EDJE_PART_TYPE_TEXTBLOCK: + textblocks = eina_list_append(textblocks, rp); rp->object = evas_object_textblock_add(ed->base.evas); break; case EDJE_PART_TYPE_BOX: + sources = eina_list_append(sources, rp); rp->object = evas_object_box_add(ed->base.evas); rp->anim = _edje_box_layout_anim_new(rp->object); break; case EDJE_PART_TYPE_TABLE: + sources = eina_list_append(sources, rp); rp->object = evas_object_table_add(ed->base.evas); break; case EDJE_PART_TYPE_GRADIENT: @@ -463,7 +470,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g } if (n > 0) { - Edje_Real_Part *rp; Eina_List *l; ed->table_parts = malloc(sizeof(Edje_Real_Part *) * n); @@ -519,7 +525,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g } rp->swallow_params.min.w = 0; - rp->swallow_params.min.w = 0; + rp->swallow_params.min.h = 0; rp->swallow_params.max.w = -1; rp->swallow_params.max.h = -1; @@ -587,8 +593,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g _edje_var_init(ed); for (i = 0; i < ed->table_parts_size; i++) { - Edje_Real_Part *rp; - rp = ed->table_parts[i]; evas_object_show(rp->object); if (_edje_block_break(ed)) break; @@ -599,6 +603,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g _edje_dragable_pos_set(ed, rp, rp->drag->val.x, rp->drag->val.y); } } + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; @@ -606,11 +611,28 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g if ((evas_object_clipees_get(ed->base.clipper)) && (evas_object_visible_get(obj))) evas_object_show(ed->base.clipper); - + /* instantiate 'internal swallows' */ - for (i = 0; i < ed->table_parts_size; i++) + EINA_LIST_FREE(externals, rp) + { + Edje_Part_Description_External *external; + Evas_Object *child_obj; + + external = (Edje_Part_Description_External *) rp->part->default_desc; + child_obj = _edje_external_type_add(rp->part->source, + evas_object_evas_get(ed->obj), ed->obj, + external->external_params, rp->part->name); + if (child_obj) + { + _edje_real_part_swallow(rp, child_obj, EINA_TRUE); + rp->param1.external_params = _edje_external_params_parse(child_obj, + external->external_params); + _edje_external_recalc_apply(ed, rp, NULL, rp->chosen_description); + } + } + + EINA_LIST_FREE(sources, rp) { - Edje_Real_Part *rp; /* XXX: curr_item and pack_it don't require to be NULL since * XXX: they are just used when source != NULL and type == BOX, * XXX: and they're always set in this case, but GCC fails to @@ -620,8 +642,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g unsigned int item_count = 0; Edje_Pack_Element *pack_it = NULL; const char *source = NULL; - - rp = ed->table_parts[i]; switch (rp->part->type) { @@ -643,25 +663,9 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g } } break; - case EDJE_PART_TYPE_EXTERNAL: - { - Edje_Part_Description_External *external; - Evas_Object *child_obj; - - external = (Edje_Part_Description_External *) rp->part->default_desc; - child_obj = _edje_external_type_add(rp->part->source, - evas_object_evas_get(ed->obj), ed->obj, - external->external_params, rp->part->name); - if (child_obj) - { - _edje_real_part_swallow(rp, child_obj, EINA_TRUE); - rp->param1.external_params = _edje_external_params_parse(child_obj, - external->external_params); - _edje_external_recalc_apply(ed, rp, NULL, rp->chosen_description); - } - } - continue; default: + /* This list should only be filled by group, box or table, nothing else. */ + abort(); continue; } @@ -682,6 +686,11 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g { if (data == group_path_entry) { + ERR("recursive loop group '%s' already included inside part '%s' of group '%s' from file '%s'", + group_path_entry, rp->part->name, group, file); + textblocks = eina_list_free(textblocks); + externals = eina_list_free(externals); + sources = eina_list_free(sources); _edje_thaw(ed); _edje_unblock(ed); _edje_unref(ed); @@ -698,7 +707,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g return 0; } } - + child_obj = edje_object_add(ed->base.evas); group_path = eina_list_append(group_path, group_path_entry); if (rp->part->type == EDJE_PART_TYPE_GROUP) @@ -708,11 +717,16 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g if (!_edje_object_file_set_internal(child_obj, file, source, rp->part->name, group_path)) { + ERR("impossible to set part '%s' of group '%s' from file '%s' to '%s'", + rp->part->name, group_path_entry, file, source); + textblocks = eina_list_free(textblocks); + externals = eina_list_free(externals); + sources = eina_list_free(sources); _edje_thaw(ed); _edje_unblock(ed); _edje_unref(ed); _edje_file_del(ed); - + if (group_path_started) { while (group_path) @@ -794,56 +808,51 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g { const char *name; Evas_Object *swallow; - + name = eina_list_data_get(old_swallows); old_swallows = eina_list_remove_list(old_swallows, old_swallows); - + swallow = eina_list_data_get(old_swallows); old_swallows = eina_list_remove_list(old_swallows, old_swallows); - + edje_object_part_swallow(obj, name, swallow); eina_stringshare_del(name); } } - + _edje_recalc(ed); _edje_thaw(ed); _edje_unblock(ed); _edje_unref(ed); ed->load_error = EDJE_LOAD_ERROR_NONE; _edje_emit(ed, "load", NULL); - /* instantiate 'internal swallows' */ - for (i = 0; i < ed->table_parts_size; i++) - { - Edje_Real_Part *rp; - - rp = ed->table_parts[i]; - if ((rp->part->type == EDJE_PART_TYPE_TEXTBLOCK) && - (rp->part->default_desc)) - { - Edje_Part_Description_Text *text; - Edje_Style *stl = NULL; - const char *style; - - text = (Edje_Part_Description_Text *) rp->part->default_desc; - style = edje_string_get(&text->text.style); - if (style) - { - Eina_List *l; - - EINA_LIST_FOREACH(ed->file->styles, l, stl) - { - if ((stl->name) && (!strcmp(stl->name, style))) break; - stl = NULL; - } - } - if (stl) - { - if (evas_object_textblock_style_get(rp->object) != stl->style) - evas_object_textblock_style_set(rp->object, stl->style); - } - } - } + + /* instantiate 'internal textblock style' */ + EINA_LIST_FREE(textblocks, rp) + if (rp->part->default_desc) + { + Edje_Part_Description_Text *text; + Edje_Style *stl = NULL; + const char *style; + + text = (Edje_Part_Description_Text *) rp->part->default_desc; + style = edje_string_get(&text->text.style); + if (style) + { + Eina_List *l; + + EINA_LIST_FOREACH(ed->file->styles, l, stl) + { + if ((stl->name) && (!strcmp(stl->name, style))) break; + stl = NULL; + } + } + if (stl) + { + if (evas_object_textblock_style_get(rp->object) != stl->style) + evas_object_textblock_style_set(rp->object, stl->style); + } + } } _edje_entry_init(ed); evas_event_thaw(tev); diff --git a/libraries/edje/src/lib/edje_lua2.c b/libraries/edje/src/lib/edje_lua2.c index 2318af9..1d167e9 100644 --- a/libraries/edje/src/lib/edje_lua2.c +++ b/libraries/edje/src/lib/edje_lua2.c @@ -376,7 +376,7 @@ _elua_gc(lua_State *L) // Stack usage [-0, +0, e] // nil ~ static char * -_elua_push_name(lua_State *L, char *q, int index) // Stack usage [-0, +1, e or m] +_elua_push_name(lua_State *L, char *q, int idx) // Stack usage [-0, +1, e or m] { char *p = q; char temp = '\0'; @@ -387,8 +387,8 @@ _elua_push_name(lua_State *L, char *q, int index) // Stack usage [-0, +1, e or q++; temp = *q; *q = '\0'; - if (index > 0) - lua_getfield(L, index, p); // Stack usage [-0, +1, e] + if (idx > 0) + lua_getfield(L, idx, p); // Stack usage [-0, +1, e] else lua_pushstring(L, p); // Stack usage [-0, +1, m] *q = temp; @@ -614,6 +614,7 @@ static int _elua_echo(lua_State *L); static int _elua_date(lua_State *L); static int _elua_looptime(lua_State *L); static int _elua_seconds(lua_State *L); +static int _elua_version(lua_State *L); static int _elua_objgeom(lua_State *L); static int _elua_objpos(lua_State *L); @@ -649,6 +650,7 @@ static const struct luaL_reg _elua_edje_funcs [] = {"date", _elua_date}, // get date in a table {"looptime", _elua_looptime}, // get loop time {"seconds", _elua_seconds}, // get seconds + {"version", _elua_version}, // edje version // query edje - size, pos {"geom", _elua_objgeom}, // get while edje object geometry in canvas @@ -801,6 +803,25 @@ _elua_seconds(lua_State *L) // Stack usage [-0, +1, -] return 1; } +/** +@page luaref +@subsubsection edje_version edje:version() + +Retrieves the current edje version number. + +@returns A table with these fields: + - integer major: The edje version major number. + - integer minor: The edje version minor number. + +@since 1.2.0 +*/ +static int +_elua_version(lua_State *L) // Stack usage [-4, +5, em] +{ + _elua_ret(L, "%major %minor", EDJE_VERSION_MAJOR, EDJE_VERSION_MINOR); // Stack usage [-4, +5, em] + return 1; +} + //------------- /** @page luaref @@ -2936,7 +2957,9 @@ static int _elua_line_xy(lua_State *L) // Stack usage [ The lua evas map class includes functions for dealing with evas map objects. The evas map objects must have been previously created by lua using the lua -map object creation function edje:map(). +map object creation function edje:map(). The evas map system is complex, rather +than repeat the copious documentation here, please refer to the evas map +documentation. It has pictures and everything. B-) In the following, "map_object" is a place holder for any lua variable that holds a reference to an evas map object. @@ -2980,8 +3003,18 @@ static const struct luaL_reg _elua_evas_map_funcs [] = /** @page luaref -@subsubsection map_alpha map_object:alpha() +@subsubsection map_alpha map_object:alpha(alpha) + +Get (and optionally set) the maps alpha mode. + +Wraps evas_map_alpha_set(). +@param alpha The alpha mode. + +Note that the argument is optional, without it this function just queries the +current value. + +@return A boolean reflecting the alpha mode. @since 1.1.0 */ @@ -3008,6 +3041,11 @@ _elua_map_alpha(lua_State *L) // Stack usage [ @page luaref @subsubsection map_clockwise map_object:clockwise() +Get the maps clockwise state. + +Wraps evas_map_util_clockwise_get(). + +@return A boolean reflecting if the map is clockwise or not. @since 1.1.0 */ @@ -3025,8 +3063,30 @@ _elua_map_clockwise(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_colour map_object:colour() +@subsubsection map_colour map_object:colour(index, r, g, b, a) +Gets or sets colour information for the map. There are two variations, with or +without the index. With the index parameter it gets (and optionally sets) the +colour of the point the index refers to, without it sets the colour for the +entire map. + +Wraps evas_map_point_color_set() or evas_map_util_points_color_set() + +@param index Which point to change the colour of. +@param r The new red value. +@param g The new green value. +@param b The new blue value. +@param a The new alpha value. + +Note that the arguments are optional, without them this function just queries +the current values. The colour arguments can be separate values, or named +fields in a table. + +@return A table with these fields: + - integer r: The red value. + - integer g: The green value. + - integer b: The blue value. + - integer a: The alpha value. @since 1.1.0 */ @@ -3073,8 +3133,24 @@ _elua_map_colour(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_coord map_object:coord() +@subsubsection map_coord map_object:coord(index, x, y, z) + +Gets (and optionally sets) the 3D coordinates of a point on the map. + +Wraps evas_map_point_coord_set(). + +@param x The x coordinate of the point. +@param y The y coordinate of the point. +@param z The z coordinate of the point. + +Note that the arguments are optional, without them this function just queries +the current values. The coordinate arguments can be separate values, or named +fields in a table. +@return A table with these fields: + - integer x: The x coordinate of the point. + - integer y: The y coordinate of the point. + - integer z: The z coordinate of the point. @since 1.1.0 */ @@ -3104,8 +3180,21 @@ _elua_map_coord(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_lighting map_object:lighting() +@subsubsection map_lighting map_object:lighting(x, y, z, r, g, b, ar, ag, ab) + +Set the 3D lights for the map. The three triplets can be tables. +Wraps evas_map_util_3d_lighting(). + +@param x The x coordinate of the light point. +@param y The y coordinate of the light point. +@param z The z coordinate of the light point. +@param r The new red value of the light point. +@param g The new green value of the light point. +@param b The new blue value of the light point. +@param ar The new red value of the ambient light. +@param ag The new green value of the ambient light. +@param ab The new blue value of the ambient light. @since 1.1.0 */ @@ -3133,8 +3222,18 @@ _elua_map_lighting(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_perspective map_object:perspective() +@subsubsection map_perspective map_object:perspective(x, y, z, f) + +Apply a perspective transform to the map. + +Wraps evas_map_util_3d_perspective(). +The arguments can be separate values, or named fields in a table. + +@param x The perspective distance X coordinate +@param y The perspective distance Y coordinate +@param z The "0" z plane value +@param f The focal distance @since 1.1.0 */ @@ -3156,8 +3255,28 @@ _elua_map_perspective(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_populate map_object:populate() +@subsubsection map_populate map_object:populate(...) + +Populate the points in a map, in one of three different methods. + +1) Wraps evas_map_util_points_populate_from_object(). + +@param source An evas object to copy points from. + +2) Wraps evas_map_util_paints_populate_from_object_full(). + +@param source An evas object to copy points from. +@param z Common Z coordinate hint for all four points. +3) Wraps evas_map_util_points_populate_from_geometry(). + +The first four arguments can be separate values, or named fields in a table. + +@param x Point X coordinate +@param y Point Y coordinate +@param w Width to use to calculate second and third points. +@param h Height to use to calculate third and fourth points. +@param z Common Z coordinate hint for all four points. @since 1.1.0 */ @@ -3210,8 +3329,17 @@ _elua_map_populate(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_rotate map_object:rotate() +@subsubsection map_rotate map_object:rotate(degrees, x, y) + +Rotate the maps coordinates in 2D. +Wraps evas_map_util_rotate(). + +The coordinates can be separate values, or named fields in a table. + +@param degrees Amount of degrees from 0.0 to 360.0 to rotate. +@param x Rotation's centre horizontal position. +@param y Rotation's centre vertical position. @since 1.1.0 */ @@ -3238,8 +3366,21 @@ _elua_map_rotate(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_rotate3d map_object:rotate3d() +@subsubsection map_rotate3d map_object:rotate3d(dx, dy, dz, x, y, z) + +Rotate the maps coordinates in 3D. +Wraps evas_map_util_3d_rotate(). + +The coordinates can be separate values, or named fields in a table. The same +with the rotation. + +@param dx Amount of degrees from 0.0 to 360.0 to rotate around X axis. +@param dy Amount of degrees from 0.0 to 360.0 to rotate around Y axis. +@param dz Amount of degrees from 0.0 to 360.0 to rotate around Z axis. +@param x Rotation's centre horizontal position. +@param y Rotation's centre vertical position. +@param z Rotation's centre vertical position. @since 1.1.0 */ @@ -3265,8 +3406,18 @@ _elua_map_rotate3d(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_smooth map_object:smooth() +@subsubsection map_smooth map_object:smooth(smooth) + +Get (and optionally set) the maps smooth mode. + +Wraps evas_map_smooth_set(). + +@param smooth The smooth mode. + +Note that the argument is optional, without it this function just queries the +current value. +@return A boolean reflecting the smooth mode. @since 1.1.0 */ @@ -3291,8 +3442,23 @@ _elua_map_smooth(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_uv map_object:uv() +@subsubsection map_uv map_object:uv(index, u, v) + +Gets (and optionally sets) the texture U and V texture coordinates for this map. + +Wraps evas_map_point_image_uv_set(). + +@param index Index of the point to change. Must be smaller than map size. +@param u The X coordinate within the image/texture source. +@param v The Y coordinate within the image/texture source. + +Note that the U,V arguments are optional, without them this function just queries +the current values. The coordinate arguments can be separate values, or named +fields in a table. +@return A table with these fields: + - number u: The X coordinate within the image/texture source. + - number v: The Y coordinate within the image/texture source. @since 1.1.0 */ @@ -3322,8 +3488,18 @@ _elua_map_uv(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_zoom map_object:zoom() +@subsubsection map_zoom map_object:zoom(x, y, x, y) + +Apply a zoom to the map. + +Wraps evas_map_util_zoom(). +The arguments can be two separate values, or named fields in a table. + +@param x The horizontal zoom amount. +@param y The vertical zoom amount. +@param x The X coordinate of the centre of the zoom. +@param y The Y coordinate of the centre of the zoom. @since 1.1.0 */ @@ -3530,7 +3706,7 @@ _elua_text_font(lua_State *L) // Stack usage [ @page luaref @subsubsection text_text text_object:text(text) -Get (and optionally set) the actual tetx for this text object. +Get (and optionally set) the actual text for this text object. Wraps evas_object_text_text_set(). @@ -3569,25 +3745,80 @@ _elua_text_text(lua_State *L) // Stack usage [ //--------------------------------------------------------------------------// + +// A metatable and functions so that calling non existant API does not crash Lua scripts. + +static int _elua_bogan_nilfunc(lua_State *L); +static int _elua_bogan_index(lua_State *L); + +static const struct luaL_reg _elua_bogan_funcs [] = +{ + {"nilfunc", _elua_bogan_nilfunc}, // Just return a nil. + {"__index", _elua_bogan_index}, // Return the above func. + + {NULL, NULL} // end +}; + +static int +_elua_bogan_nilfunc(lua_State *L) +{ + lua_getglobal(L, "nil"); + return 1; +} + +static int +_elua_bogan_index(lua_State *L) +{ + const char *key; + + key = lua_tostring(L, 2); + LE("%s does not exist!", key); + lua_pushcfunction(L, _elua_bogan_nilfunc); + return 1; +} + +static void +_elua_bogan_protect(lua_State *L) // Stack usage [-3, +3, m] +{ + lua_pushnil(L); // Stack usage [-0, +1, -] + luaL_newmetatable(L, "bogan"); // Stack usage [-0, +1, m] + luaL_register(L, 0, _elua_bogan_funcs); // Stack usage [-1, +1, m] + lua_setmetatable(L, -2); // Stack usage [-1, +0, -] + lua_pop(L, 1); // Stack usage [-1, +0, -] +} + +//--------------------------------------------------------------------------// + // Brain dead inheritance thingy, built for speed. Kinda. Part 1. static void _elua_add_functions(lua_State *L, const char *api, const luaL_Reg *funcs, const char *meta, const char *parent, const char *base) // Stack usage [-3, +5, m] if inheriting [-6, +11, em] { + // Create an api table, fill it full of the methods. luaL_register(L, api, funcs); // Stack usage [-0, +1, m] + // Set the api metatable to the bogan metatable. + luaL_getmetatable(L, "bogan"); // Stack usage [-0, +1, -] + lua_setmetatable(L, -2); // Stack usage [-1, +0, -] + // Creat a meta metatable. luaL_newmetatable(L, meta); // Stack usage [-0, +1, m] + // Put the gc functions in the metatable. luaL_register(L, 0, _elua_edje_gc_funcs); // Stack usage [-1, +1, m] + // Create an __index entry in the metatable, make it point to the api table. lua_pushliteral(L, "__index"); // Stack usage [-0, +1, m] lua_pushvalue(L, -3); // Stack usage [-0, +1, -] lua_rawset(L, -3); // Stack usage [-2, +0, m] + // Later this metatable is used as the metatable for newly created objects of this class. if (base && parent) { // Inherit from base lua_getglobal(L, base); // Stack usage [-0, +1, e] + // Create a new parent metatable. luaL_newmetatable(L, parent); // Stack usage [-0, +1, m] + // Create an __index entry in the metatable, make it point to the base table. lua_pushliteral(L, "__index"); // Stack usage [-0, +1, m] lua_pushvalue(L, -3); // Stack usage [-0, +1, -] lua_rawset(L, -3); // Stack usage [-2, +0, m] + // Set the metatable for the api table to the parent metatable. lua_getglobal(L, api); // Stack usage [-0, +1, e] luaL_getmetatable(L, parent); // Stack usage [-0, +1, -] lua_setmetatable(L, -2); // Stack usage [-1, +0, -] @@ -3695,7 +3926,11 @@ _edje_lua2_script_init(Edje *ed) // Stack usage lua_call(L, 1, 0); // Stack usage [-2, +0, m] } + _elua_bogan_protect(L); // Stack usage [+3, -3, m] + luaL_register(L, _elua_edje_api, _elua_edje_funcs); // Stack usage [-0, +1, m] + luaL_getmetatable(L, "bogan"); // Stack usage [-0, +1, -] + lua_setmetatable(L, -2); // Stack usage [-1, +0, -] luaL_newmetatable(L, _elua_edje_meta); // Stack usage [-0, +1, m] luaL_register(L, 0, _elua_edje_gc_funcs); // Stack usage [-1, +1, m] @@ -3737,6 +3972,8 @@ _edje_lua2_script_init(Edje *ed) // Stack usage { int err; + /* This ends up pushing a function onto the stack for the lua_pcall() below to use. + * The function is the compiled code. */ err = luaL_loadbuffer(L, data, size, "edje_lua_script"); // Stack usage [-0, +1, m] if (err) { diff --git a/libraries/edje/src/lib/edje_main.c b/libraries/edje/src/lib/edje_main.c index cf443c7..5d011ad 100644 --- a/libraries/edje/src/lib/edje_main.c +++ b/libraries/edje/src/lib/edje_main.c @@ -22,10 +22,7 @@ edje_init(void) srand(time(NULL)); if (!eina_init()) - { - fprintf(stderr, "Edje: Eina init failed"); - return --_edje_init_count; - } + return --_edje_init_count; _edje_default_log_dom = eina_log_domain_register ("edje", EDJE_DEFAULT_LOG_COLOR); diff --git a/libraries/edje/src/lib/edje_message_queue.c b/libraries/edje/src/lib/edje_message_queue.c index 1a313a5..5628ccc 100644 --- a/libraries/edje/src/lib/edje_message_queue.c +++ b/libraries/edje/src/lib/edje_message_queue.c @@ -364,8 +364,8 @@ _edje_message_propornot_send(Edje *ed, Edje_Queue queue, Edje_Message_Type type, } if (_injob > 0) { - if (_job_loss_timer) ecore_timer_del(_job_loss_timer); - _job_loss_timer = ecore_timer_add(0.001, _edje_job_loss_timer, NULL); + if (!_job_loss_timer) + _job_loss_timer = ecore_timer_add(0.001, _edje_job_loss_timer, NULL); } else { diff --git a/libraries/edje/src/lib/edje_module.c b/libraries/edje/src/lib/edje_module.c index effcee1..358295b 100644 --- a/libraries/edje/src/lib/edje_module.c +++ b/libraries/edje/src/lib/edje_module.c @@ -136,12 +136,12 @@ edje_available_modules_get(void) snprintf(tmp, sizeof (tmp), "%s/%s/" EDJE_MODULE_NAME, info->path, MODULE_ARCH #ifdef EDJE_EXTRA_MODULE_NAME - , ecore_file_file_get(info->path) + , info->path + info->name_start #endif ); if (ecore_file_exists(tmp)) - result = eina_list_append(result, eina_stringshare_add(ecore_file_file_get(info->path))); + result = eina_list_append(result, eina_stringshare_add(info->path + info->name_start)); } eina_iterator_free(it); diff --git a/libraries/edje/src/lib/edje_multisense.c b/libraries/edje/src/lib/edje_multisense.c index f9c7f91..f3324e7 100644 --- a/libraries/edje/src/lib/edje_multisense.c +++ b/libraries/edje/src/lib/edje_multisense.c @@ -351,8 +351,10 @@ _edje_multisense_internal_sound_sample_play(Edje *ed, const char *sample_name, c command.type.sample.speed = speed; size = write(command_pipe[1], &command, sizeof(command)); #else - ed = NULL; // warning shh - if (speed > 0) sample_name = NULL; // warning shh + // warning shh + (void) ed; + (void) sample_name; + (void) speed; #endif return (size == sizeof(Edje_Multisense_Sound_Action)); } @@ -371,8 +373,10 @@ _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const command.type.tone.duration = duration; size = write(command_pipe[1], &command, sizeof(command)); #else - ed = NULL; // warning shh - if (duration > 0) tone_name = NULL; // warning shh + // warning shh + (void) ed; + (void) duration; + (void) tone_name; #endif return (size == sizeof(Edje_Multisense_Sound_Action)); diff --git a/libraries/edje/src/lib/edje_private.h b/libraries/edje/src/lib/edje_private.h index cbb3e03..8bf18eb 100644 --- a/libraries/edje/src/lib/edje_private.h +++ b/libraries/edje/src/lib/edje_private.h @@ -192,7 +192,8 @@ typedef enum EDJE_ASPECT_PREFER_NONE, EDJE_ASPECT_PREFER_VERTICAL, EDJE_ASPECT_PREFER_HORIZONTAL, - EDJE_ASPECT_PREFER_BOTH + EDJE_ASPECT_PREFER_BOTH, + EDJE_ASPECT_PREFER_SOURCE } Edje_Internal_Aspect; struct _Edje_Perspective @@ -232,7 +233,7 @@ struct _Edje_Color struct _Edje_Aspect_Prefer { FLOAT_T min, max; - Edje_Internal_Aspect prefer; + char prefer; }; struct _Edje_Aspect @@ -834,6 +835,11 @@ struct _Edje_Part_Description_Common unsigned char w, h; /* width or height is fixed in side (cannot expand with Edje object size) */ } fixed; + struct { // only during recalc + unsigned char have; + FLOAT_T w, h; + } minmul; + Edje_Size min, max; Edje_Position step; /* size stepping by n pixels, 0 = none */ Edje_Aspect_Prefer aspect; @@ -1138,6 +1144,7 @@ struct _Edje unsigned int all_part_change : 1; #endif unsigned int have_mapped_part : 1; + unsigned int recalc_call : 1; }; struct _Edje_Calc_Params @@ -1915,7 +1922,7 @@ void _edje_entry_cursor_line_end(Edje_Real_Part *rp, Edje_Cursor cur); Eina_Bool _edje_entry_cursor_coord_set(Edje_Real_Part *rp, Edje_Cursor cur, int x, int y); Eina_Bool _edje_entry_cursor_is_format_get(Edje_Real_Part *rp, Edje_Cursor cur); Eina_Bool _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur); -const char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur); +char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur); void _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos); int _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur); void _edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout layout); diff --git a/libraries/edje/src/lib/edje_program.c b/libraries/edje/src/lib/edje_program.c index 505b6a2..d80c7c9 100644 --- a/libraries/edje/src/lib/edje_program.c +++ b/libraries/edje/src/lib/edje_program.c @@ -992,7 +992,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f break ; default: - fprintf(stderr, "SPANK SPANK SPANK !!!\nYou should never be here !\n"); + ERR("SPANK SPANK SPANK !!!\nYou should never be here !"); break; } } @@ -1621,6 +1621,7 @@ _edje_param_native_set(Edje_Real_Part *rp, const char *name, const Edje_External if (param->type != EDJE_EXTERNAL_PARAM_TYPE_DOUBLE) return EINA_FALSE; rp->drag->size.x = FROM_DOUBLE(CLAMP(param->d, 0.0, 1.0)); + rp->edje->recalc_call = 1; rp->edje->dirty = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; @@ -1633,6 +1634,7 @@ _edje_param_native_set(Edje_Real_Part *rp, const char *name, const Edje_External if (param->type != EDJE_EXTERNAL_PARAM_TYPE_DOUBLE) return EINA_FALSE; rp->drag->size.y = FROM_DOUBLE(CLAMP(param->d, 0.0, 1.0)); + rp->edje->recalc_call = 1; rp->edje->dirty = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; diff --git a/libraries/edje/src/lib/edje_util.c b/libraries/edje/src/lib/edje_util.c index dbb37a7..2205ba3 100644 --- a/libraries/edje/src/lib/edje_util.c +++ b/libraries/edje/src/lib/edje_util.c @@ -438,6 +438,7 @@ edje_color_class_set(const char *color_class, int r, int g, int b, int a, int r2 ed = eina_list_data_get(members); ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; #endif @@ -504,6 +505,7 @@ edje_color_class_del(const char *color_class) ed = eina_list_data_get(members); ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; #endif @@ -583,6 +585,7 @@ edje_object_color_class_set(Evas_Object *obj, const char *color_class, int r, in cc->b3 = b3; cc->a3 = a3; ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; #endif @@ -611,6 +614,7 @@ edje_object_color_class_set(Evas_Object *obj, const char *color_class, int r, in cc->a3 = a3; ed->color_classes = eina_list_append(ed->color_classes, cc); ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; #endif @@ -693,6 +697,7 @@ edje_object_color_class_del(Evas_Object *obj, const char *color_class) } ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; #endif @@ -752,6 +757,7 @@ edje_text_class_set(const char *text_class, const char *font, Evas_Font_Size siz ed = eina_list_data_get(members); ed->dirty = 1; + ed->recalc_call = 1; _edje_textblock_style_all_update(ed); #ifdef EDJE_CALC_CACHE ed->text_part_change = 1; @@ -847,6 +853,7 @@ edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char /* Update edje */ ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->text_part_change = 1; #endif @@ -881,6 +888,7 @@ edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char /* Add to edje's text class list */ ed->text_classes = eina_list_append(ed->text_classes, tc); ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->text_part_change = 1; #endif @@ -1005,6 +1013,7 @@ _edje_object_part_text_raw_set(Evas_Object *obj, Edje_Real_Part *rp, const char else if (text) rp->text.text = eina_stringshare_add(text); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -1039,6 +1048,7 @@ _edje_object_part_text_raw_append(Evas_Object *obj, Edje_Real_Part *rp, const ch } } rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -1307,6 +1317,7 @@ edje_object_part_text_insert(Evas_Object *obj, const char *part, const char *tex if (rp->part->entry_mode <= EDJE_ENTRY_EDIT_MODE_NONE) return; _edje_entry_text_markup_insert(rp, text); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -1328,6 +1339,7 @@ edje_object_part_text_append(Evas_Object *obj, const char *part, const char *tex if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return; _edje_object_part_text_raw_append(obj, rp, part, text); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -1675,7 +1687,7 @@ edje_object_part_text_cursor_is_visible_format_get(const Evas_Object *obj, const return 0; } -EAPI const char * +EAPI char * edje_object_part_text_cursor_content_get(const Evas_Object *obj, const char *part, Edje_Cursor cur) { Edje *ed; @@ -1908,6 +1920,13 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw // XXX: by Sachiel, January 21th 2009, 19:30 UTC _edje_recalc_do(ed); + rp = evas_object_data_get(obj_swallow, "\377 edje.swallowing_part"); + if (rp) + { + /* The object is already swallowed somewhere, unswallow it first */ + edje_object_part_unswallow(rp->edje->obj, obj_swallow); + } + rp = _edje_real_part_recursive_get(ed, (char *)part); if (!rp) return EINA_FALSE; if (rp->part->type != EDJE_PART_TYPE_SWALLOW) @@ -1929,6 +1948,7 @@ _recalc_extern_parent(Evas_Object *obj) ed = _edje_fetch(parent); ed->dirty = 1; + ed->recalc_call = 1; // ZZZ: ??? _edje_recalc(ed); } @@ -2110,11 +2130,7 @@ _edje_box_layout_external_new(const char *name, Evas_Object_Box_Layout func, voi name_len = strlen(name) + 1; l = malloc(sizeof(Edje_Box_Layout) + name_len); - if (!l) - { - perror("malloc"); - return NULL; - } + if (!l) return NULL; l->func = func; l->layout_data_get = layout_data_get; @@ -2224,6 +2240,7 @@ edje_object_part_unswallow(Evas_Object *obj __UNUSED__, Evas_Object *obj_swallow rp->swallow_params.max.w = 0; rp->swallow_params.max.h = 0; rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -2684,6 +2701,7 @@ edje_object_part_drag_size_set(Evas_Object *obj, const char *part, double dw, do rp->drag->size.x = FROM_DOUBLE(dw); rp->drag->size.y = FROM_DOUBLE(dh); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3018,6 +3036,7 @@ _edje_box_child_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *child __UNUS Edje_Real_Part *rp = data; rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3031,6 +3050,7 @@ _edje_box_child_add(Edje_Real_Part *rp, Evas_Object *child) (child, EVAS_CALLBACK_DEL, _edje_box_child_del_cb, rp); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3044,6 +3064,7 @@ _edje_box_child_remove(Edje_Real_Part *rp, Evas_Object *child) (child, EVAS_CALLBACK_DEL, _edje_box_child_del_cb, rp); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3186,6 +3207,7 @@ _edje_table_child_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *child __UN Edje_Real_Part *rp = data; rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3199,6 +3221,7 @@ _edje_table_child_add(Edje_Real_Part *rp, Evas_Object *child) (child, EVAS_CALLBACK_DEL, _edje_table_child_del_cb, rp); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3212,6 +3235,7 @@ _edje_table_child_remove(Edje_Real_Part *rp, Evas_Object *child) (child, EVAS_CALLBACK_DEL, _edje_table_child_del_cb, rp); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3314,6 +3338,7 @@ _edje_perspective_obj_del(void *data, __UNUSED__ Evas *e, __UNUSED__ Evas_Object if (!ed) continue; ed->persp = NULL; ed->dirty = 1; + ed->recalc_call = 1; _edje_recalc_do(ed); } free(ps); @@ -3367,6 +3392,7 @@ edje_perspective_set(Edje_Perspective *ps, Evas_Coord px, Evas_Coord py, Evas_Co if (!ed->persp) { ed->dirty = 1; + ed->recalc_call = 1; _edje_recalc_do(ed); } } @@ -3381,6 +3407,7 @@ edje_perspective_set(Edje_Perspective *ps, Evas_Coord px, Evas_Coord py, Evas_Co if (!ed->persp) { ed->dirty = 1; + ed->recalc_call = 1; _edje_recalc_do(ed); } } @@ -3414,6 +3441,7 @@ edje_perspective_global_set(Edje_Perspective *ps, Eina_Bool global) if (!ed->persp) { ed->dirty = 1; + ed->recalc_call = 1; _edje_recalc_do(ed); } } @@ -3453,6 +3481,7 @@ edje_object_perspective_set(Evas_Object *obj, Edje_Perspective *ps) ed->persp = ps; if (ps) ps->users = eina_list_append(ps->users, obj); ed->dirty = 1; + ed->recalc_call = 1; _edje_recalc_do(ed); } @@ -4075,6 +4104,7 @@ _edje_object_part_swallow_changed_hints_cb(void *data, __UNUSED__ Evas *e, __UNU rp = data; _edje_real_part_swallow_hints_update(rp); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; _edje_recalc(rp->edje); return; } @@ -4096,6 +4126,7 @@ _edje_real_part_swallow(Edje_Real_Part *rp, if (hints_update) _edje_real_part_swallow_hints_update(rp); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; _edje_recalc(rp->edje); return; } @@ -4139,6 +4170,7 @@ _edje_real_part_swallow(Edje_Real_Part *rp, evas_object_precise_is_inside_set(obj_swallow, 1); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; _edje_recalc(rp->edje); } diff --git a/libraries/edje/src/modules/Makefile.in b/libraries/edje/src/modules/Makefile.in index 55c47d6..5e81050 100644 --- a/libraries/edje/src/modules/Makefile.in +++ b/libraries/edje/src/modules/Makefile.in @@ -193,8 +193,6 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/libraries/edje/src/modules/alsa_snd_player/Makefile.in b/libraries/edje/src/modules/alsa_snd_player/Makefile.in index ce68f41..1fe2fb1 100644 --- a/libraries/edje/src/modules/alsa_snd_player/Makefile.in +++ b/libraries/edje/src/modules/alsa_snd_player/Makefile.in @@ -210,8 +210,6 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/libraries/edje/src/modules/eet_snd_reader/Makefile.in b/libraries/edje/src/modules/eet_snd_reader/Makefile.in index f4d99bb..12d0487 100644 --- a/libraries/edje/src/modules/eet_snd_reader/Makefile.in +++ b/libraries/edje/src/modules/eet_snd_reader/Makefile.in @@ -211,8 +211,6 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/libraries/edje/src/modules/multisense_factory/Makefile.in b/libraries/edje/src/modules/multisense_factory/Makefile.in index ed0c3e4..8fbc0aa 100644 --- a/libraries/edje/src/modules/multisense_factory/Makefile.in +++ b/libraries/edje/src/modules/multisense_factory/Makefile.in @@ -208,8 +208,6 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/libraries/edje/src/modules/multisense_factory/multisense_factory.c b/libraries/edje/src/modules/multisense_factory/multisense_factory.c index f89ae9b..8b17be1 100644 --- a/libraries/edje/src/modules/multisense_factory/multisense_factory.c +++ b/libraries/edje/src/modules/multisense_factory/multisense_factory.c @@ -1,33 +1,33 @@ -#include "config.h" -#include "edje_private.h" - -#define DEFAULT_SAMPLERATE 44100 - -#ifdef HAVE_LIBREMIX -EAPI RemixBase * -multisense_sound_player_get(Edje_Multisense_Env *msenv) -{ - RemixEnv *env = msenv->remixenv; - RemixPlugin *player_plugin; - RemixBase *player; - - player_plugin = remix_find_plugin(env, "alsa_snd_player"); - if (!player_plugin) - { - WRN("ALSA player_plugin init fail\n"); - return remix_monitor_new(env); - } - player = remix_new(env, player_plugin, NULL); - return player; -} -#endif - -EAPI Eina_Bool -multisense_factory_init(Edje_Multisense_Env *env) -{ -#ifdef HAVE_LIBREMIX - remix_set_samplerate(env->remixenv, DEFAULT_SAMPLERATE); - remix_set_channels(env->remixenv, REMIX_STEREO); -#endif - return EINA_TRUE; -} +#include "config.h" +#include "edje_private.h" + +#define DEFAULT_SAMPLERATE 44100 + +#ifdef HAVE_LIBREMIX +EAPI RemixBase * +multisense_sound_player_get(Edje_Multisense_Env *msenv) +{ + RemixEnv *env = msenv->remixenv; + RemixPlugin *player_plugin; + RemixBase *player; + + player_plugin = remix_find_plugin(env, "alsa_snd_player"); + if (!player_plugin) + { + WRN("ALSA player_plugin init fail\n"); + return remix_monitor_new(env); + } + player = remix_new(env, player_plugin, NULL); + return player; +} +#endif + +EAPI Eina_Bool +multisense_factory_init(Edje_Multisense_Env *env __UNUSED__) +{ +#ifdef HAVE_LIBREMIX + remix_set_samplerate(env->remixenv, DEFAULT_SAMPLERATE); + remix_set_channels(env->remixenv, REMIX_STEREO); +#endif + return EINA_TRUE; +} diff --git a/libraries/edje/src/tests/Makefile.in b/libraries/edje/src/tests/Makefile.in index f610548..ff5193e 100644 --- a/libraries/edje/src/tests/Makefile.in +++ b/libraries/edje/src/tests/Makefile.in @@ -189,8 +189,6 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ -- cgit v1.1