Enlightenment CVS committal Author : raster Project : e17 Module : libs/edje
Dir : e17/libs/edje/src/lib Modified Files: Makefile.am edje_data.c edje_embryo.c edje_load.c edje_message_queue.c edje_private.h edje_smart.c Added Files: edje_script_only.c Log Message: start some serious work on script_only edje objects - for efficiency sake i'm having an almost parallel codepath for script_only objects - they dont get to use the older edje api calls for part defined objects. they will have a new set of calls specifically for them. it's partly done - very little available now, but will expand. lots of fixme's. =================================================================== RCS file: /cvs/e/e17/libs/edje/src/lib/Makefile.am,v retrieving revision 1.41 retrieving revision 1.42 diff -u -3 -r1.41 -r1.42 --- Makefile.am 12 Mar 2008 16:32:35 -0000 1.41 +++ Makefile.am 30 May 2008 11:20:49 -0000 1.42 @@ -38,7 +38,8 @@ edje_cache.c \ edje_match.c \ edje_textblock_styles.c \ -edje_edit.c +edje_edit.c \ +edje_script_only.c libedje_la_LIBADD = -lm @EDJE_LIBS@ libedje_la_DEPENDENCIES = $(top_builddir)/config.h =================================================================== RCS file: /cvs/e/e17/libs/edje/src/lib/edje_data.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -3 -r1.44 -r1.45 --- edje_data.c 29 May 2008 02:00:04 -0000 1.44 +++ edje_data.c 30 May 2008 11:20:49 -0000 1.45 @@ -387,5 +387,5 @@ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.max.w", prop.max.w, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.max.h", prop.max.h, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "id", id, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "script_only", id, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "script_only", script_only, EET_T_UCHAR); } =================================================================== RCS file: /cvs/e/e17/libs/edje/src/lib/edje_embryo.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -3 -r1.62 -r1.63 --- edje_embryo.c 19 May 2008 04:38:40 -0000 1.62 +++ edje_embryo.c 30 May 2008 11:20:49 -0000 1.63 @@ -182,54 +182,6 @@ * */ -#define CHKPARAM(n) if (params[0] != (sizeof(Embryo_Cell) * (n))) return 0; -#define GETSTR(str, par) { \ - Embryo_Cell *___cptr; \ - int ___l; \ - str = NULL; \ - if ((___cptr = embryo_data_address_get(ep, (par)))) { \ - ___l = embryo_data_string_length_get(ep, ___cptr); \ - if (((str) = alloca(___l + 1))) \ - embryo_data_string_get(ep, ___cptr, (str));}} -#define GETSTREVAS(str, par) { \ - if ((str)) { \ - if ((par) && (!strcmp((par), (str)))) return 0; \ - if ((par)) evas_stringshare_del((par)); \ - (par) = (char *)evas_stringshare_add((str)); } \ - else (par) = NULL; } -#define GETFLOAT(val, par) { \ - float *___cptr; \ - if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \ - val = *___cptr;}} -#define GETINT(val, par) { \ - int *___cptr; \ - if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \ - val = *___cptr;}} -#define SETSTR(str, par) { \ - Embryo_Cell *___cptr; \ - if ((___cptr = embryo_data_address_get(ep, (par)))) { \ - embryo_data_string_set(ep, str, ___cptr);}} -#define SETSTRALLOCATE(s) { \ - if (s) { \ - if (strlen((s)) < params[4]) { \ - SETSTR((s), params[3]); } \ - else { \ - char *ss; \ - ss = alloca(strlen((s)) + 1); \ - strcpy(ss, (s)); \ - ss[params[4] - 2] = 0; \ - SETSTR(ss, params[3]); }} \ - else \ - SETSTR("", params[3]);} -#define SETFLOAT(val, par) { \ - float *___cptr; \ - if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \ - *___cptr = (float)val;}} -#define SETINT(val, par) { \ - int *___cptr; \ - if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \ - *___cptr = (int)val;}} - /* get_int(id) */ static Embryo_Cell _edje_embryo_fn_get_int(Embryo_Program *ep, Embryo_Cell *params) =================================================================== RCS file: /cvs/e/e17/libs/edje/src/lib/edje_load.c,v retrieving revision 1.124 retrieving revision 1.125 diff -u -3 -r1.124 -r1.125 --- edje_load.c 10 Apr 2008 08:58:19 -0000 1.124 +++ edje_load.c 30 May 2008 11:20:49 -0000 1.125 @@ -248,6 +248,7 @@ old_swallows = _edje_swallows_collect(ed); + if (_edje_script_only(ed)) _edje_script_only_shutdown(ed); _edje_file_del(ed); if (ed->path) evas_stringshare_del(ed->path); @@ -256,318 +257,324 @@ ed->part = evas_stringshare_add(part); ed->load_error = EDJE_LOAD_ERROR_NONE; - _edje_file_add(ed); + _edje_file_add(ed); _edje_textblock_styles_add(ed); _edje_textblock_style_all_update(ed); if (ed->collection) { - Evas_List *l; - int i; - int errors = 0; - - /* colorclass stuff */ - for (l = ed->collection->parts; (l && ! errors); l = l->next) - { - Edje_Part *ep; - Evas_List *hist = NULL; - - /* Register any color classes in this parts descriptions. */ - ep = l->data; - if ((ep->default_desc) && (ep->default_desc->color_class)) - _edje_color_class_member_add(ed, ep->default_desc->color_class); - for (hist = ep->other_desc; hist; hist = hist->next) - { - Edje_Part_Description *desc; - - desc = hist->data; - if (desc->color_class) - _edje_color_class_member_add(ed, desc->color_class); - } - } - /* build real parts */ - for (n = 0, l = ed->collection->parts; l; l = l->next, n++) + printf("%s %s = %i\n", file, part, ed->collection->script_only); + if (ed->collection->script_only) + _edje_script_only_init(ed); + else { - Edje_Part *ep; - Edje_Real_Part *rp; - - ep = l->data; - rp = calloc(1, sizeof(Edje_Real_Part)); - if (!rp) - { - ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; - return 0; - } - rp->edje = ed; - _edje_ref(rp->edje); - rp->part = ep; - parts = evas_list_append(parts, rp); - rp->param1.description = ep->default_desc; - rp->chosen_description = rp->param1.description; - if (!rp->param1.description) - printf("EDJE ERROR: no default part description!\n"); - if (ep->type == EDJE_PART_TYPE_RECTANGLE) - rp->object = evas_object_rectangle_add(ed->evas); - else if (ep->type == EDJE_PART_TYPE_IMAGE) - rp->object = evas_object_image_add(ed->evas); - else if (ep->type == EDJE_PART_TYPE_TEXT) - { - _edje_text_part_on_add(ed, rp); - rp->object = evas_object_text_add(ed->evas); - evas_object_text_font_source_set(rp->object, ed->path); - } - else if (ep->type == EDJE_PART_TYPE_SWALLOW || ep->type == EDJE_PART_TYPE_GROUP) - { - rp->object = evas_object_rectangle_add(ed->evas); - evas_object_color_set(rp->object, 0, 0, 0, 0); - evas_object_pass_events_set(rp->object, 1); - evas_object_pointer_mode_set(rp->object, EVAS_OBJECT_POINTER_MODE_NOGRAB); - } - else if (ep->type == EDJE_PART_TYPE_TEXTBLOCK) - rp->object = evas_object_textblock_add(ed->evas); - else if (ep->type == EDJE_PART_TYPE_GRADIENT) - rp->object = evas_object_gradient_add(ed->evas); - else - printf("EDJE ERROR: wrong part type %i!\n", ep->type); - if (rp->object) - { - evas_object_smart_member_add(rp->object, ed->obj); - evas_object_layer_set(rp->object, evas_object_layer_get(ed->obj)); - if (ep->type != EDJE_PART_TYPE_SWALLOW && ep->type != EDJE_PART_TYPE_GROUP) + Evas_List *l; + int i; + int errors = 0; + + /* colorclass stuff */ + for (l = ed->collection->parts; (l && ! errors); l = l->next) + { + Edje_Part *ep; + Evas_List *hist = NULL; + + /* Register any color classes in this parts descriptions. */ + ep = l->data; + if ((ep->default_desc) && (ep->default_desc->color_class)) + _edje_color_class_member_add(ed, ep->default_desc->color_class); + for (hist = ep->other_desc; hist; hist = hist->next) { - if (ep->mouse_events) - { - _edje_callbacks_add(rp->object, ed, rp); - if (ep->repeat_events) - evas_object_repeat_events_set(rp->object, 1); - - if (ep->pointer_mode != EVAS_OBJECT_POINTER_MODE_AUTOGRAB) - evas_object_pointer_mode_set(rp->object, ep->pointer_mode); - } - else - { - evas_object_pass_events_set(rp->object, 1); - evas_object_pointer_mode_set(rp->object, EVAS_OBJECT_POINTER_MODE_NOGRAB); - } - if (ep->precise_is_inside) - evas_object_precise_is_inside_set(rp->object, 1); + Edje_Part_Description *desc; + + desc = hist->data; + if (desc->color_class) + _edje_color_class_member_add(ed, desc->color_class); } - if (rp->part->clip_to_id < 0) - evas_object_clip_set(rp->object, ed->clipper); - } - rp->drag.step.x = ep->dragable.step_x; - rp->drag.step.y = ep->dragable.step_y; - rp->gradient_id = -1; - } - if (n > 0) - { - Edje_Real_Part *rp; - ed->table_parts = malloc(sizeof(Edje_Real_Part *) * n); - ed->table_parts_size = n; - /* FIXME: check malloc return */ - n = 0; - for (l = parts; l; l = l->next) - { - rp = l->data; - ed->table_parts[n] = rp; - n++; } - evas_list_free(parts); - for (i = 0; i < ed->table_parts_size; i++) + /* build real parts */ + for (n = 0, l = ed->collection->parts; l; l = l->next, n++) { - rp = ed->table_parts[i]; - if (rp->param1.description->rel1.id_x >= 0) - rp->param1.rel1_to_x = ed->table_parts[rp->param1.description->rel1.id_x % ed->table_parts_size]; - if (rp->param1.description->rel1.id_y >= 0) - rp->param1.rel1_to_y = ed->table_parts[rp->param1.description->rel1.id_y % ed->table_parts_size]; - if (rp->param1.description->rel2.id_x >= 0) - rp->param1.rel2_to_x = ed->table_parts[rp->param1.description->rel2.id_x % ed->table_parts_size]; - if (rp->param1.description->rel2.id_y >= 0) - rp->param1.rel2_to_y = ed->table_parts[rp->param1.description->rel2.id_y % ed->table_parts_size]; - _edje_text_part_on_add_clippers(ed, rp); - if (rp->part->clip_to_id >= 0) + Edje_Part *ep; + Edje_Real_Part *rp; + + ep = l->data; + rp = calloc(1, sizeof(Edje_Real_Part)); + if (!rp) + { + ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; + return 0; + } + rp->edje = ed; + _edje_ref(rp->edje); + rp->part = ep; + parts = evas_list_append(parts, rp); + rp->param1.description = ep->default_desc; + rp->chosen_description = rp->param1.description; + if (!rp->param1.description) + printf("EDJE ERROR: no default part description!\n"); + if (ep->type == EDJE_PART_TYPE_RECTANGLE) + rp->object = evas_object_rectangle_add(ed->evas); + else if (ep->type == EDJE_PART_TYPE_IMAGE) + rp->object = evas_object_image_add(ed->evas); + else if (ep->type == EDJE_PART_TYPE_TEXT) { - rp->clip_to = ed->table_parts[rp->part->clip_to_id % ed->table_parts_size]; - if (rp->clip_to) + _edje_text_part_on_add(ed, rp); + rp->object = evas_object_text_add(ed->evas); + evas_object_text_font_source_set(rp->object, ed->path); + } + else if (ep->type == EDJE_PART_TYPE_SWALLOW || ep->type == EDJE_PART_TYPE_GROUP) + { + rp->object = evas_object_rectangle_add(ed->evas); + evas_object_color_set(rp->object, 0, 0, 0, 0); + evas_object_pass_events_set(rp->object, 1); + evas_object_pointer_mode_set(rp->object, EVAS_OBJECT_POINTER_MODE_NOGRAB); + } + else if (ep->type == EDJE_PART_TYPE_TEXTBLOCK) + rp->object = evas_object_textblock_add(ed->evas); + else if (ep->type == EDJE_PART_TYPE_GRADIENT) + rp->object = evas_object_gradient_add(ed->evas); + else + printf("EDJE ERROR: wrong part type %i!\n", ep->type); + if (rp->object) + { + evas_object_smart_member_add(rp->object, ed->obj); +// evas_object_layer_set(rp->object, evas_object_layer_get(ed->obj)); + if (ep->type != EDJE_PART_TYPE_SWALLOW && ep->type != EDJE_PART_TYPE_GROUP) { - evas_object_pass_events_set(rp->clip_to->object, 1); - evas_object_pointer_mode_set(rp->clip_to->object, EVAS_OBJECT_POINTER_MODE_NOGRAB); - evas_object_clip_set(rp->object, rp->clip_to->object); + if (ep->mouse_events) + { + _edje_callbacks_add(rp->object, ed, rp); + if (ep->repeat_events) + evas_object_repeat_events_set(rp->object, 1); + + if (ep->pointer_mode != EVAS_OBJECT_POINTER_MODE_AUTOGRAB) + evas_object_pointer_mode_set(rp->object, ep->pointer_mode); + } + else + { + evas_object_pass_events_set(rp->object, 1); + evas_object_pointer_mode_set(rp->object, EVAS_OBJECT_POINTER_MODE_NOGRAB); + } + if (ep->precise_is_inside) + evas_object_precise_is_inside_set(rp->object, 1); } + if (rp->part->clip_to_id < 0) + evas_object_clip_set(rp->object, ed->clipper); } - if (rp->part->dragable.confine_id >= 0) - rp->confine_to = ed->table_parts[rp->part->dragable.confine_id % ed->table_parts_size]; - - /* replay events for dragable */ - if (rp->part->dragable.events_id >= 0) + rp->drag.step.x = ep->dragable.step_x; + rp->drag.step.y = ep->dragable.step_y; + rp->gradient_id = -1; + } + if (n > 0) + { + Edje_Real_Part *rp; + ed->table_parts = malloc(sizeof(Edje_Real_Part *) * n); + ed->table_parts_size = n; + /* FIXME: check malloc return */ + n = 0; + for (l = parts; l; l = l->next) { - rp->events_to = - ed->table_parts[rp->part->dragable.events_id % ed->table_parts_size]; - /* events_to may be used only with dragable */ - if (!rp->events_to->part->dragable.x && - !rp->events_to->part->dragable.y) - rp->events_to = NULL; + rp = l->data; + ed->table_parts[n] = rp; + n++; } - - rp->swallow_params.min.w = 0; - rp->swallow_params.min.w = 0; - rp->swallow_params.max.w = -1; - rp->swallow_params.max.h = -1; - - if (ed->file->feature_ver < 1) + evas_list_free(parts); + for (i = 0; i < ed->table_parts_size; i++) { - rp->param1.description->text.id_source = -1; - rp->param1.description->text.id_text_source = -1; + rp = ed->table_parts[i]; + if (rp->param1.description->rel1.id_x >= 0) + rp->param1.rel1_to_x = ed->table_parts[rp->param1.description->rel1.id_x % ed->table_parts_size]; + if (rp->param1.description->rel1.id_y >= 0) + rp->param1.rel1_to_y = ed->table_parts[rp->param1.description->rel1.id_y % ed->table_parts_size]; + if (rp->param1.description->rel2.id_x >= 0) + rp->param1.rel2_to_x = ed->table_parts[rp->param1.description->rel2.id_x % ed->table_parts_size]; + if (rp->param1.description->rel2.id_y >= 0) + rp->param1.rel2_to_y = ed->table_parts[rp->param1.description->rel2.id_y % ed->table_parts_size]; + _edje_text_part_on_add_clippers(ed, rp); + if (rp->part->clip_to_id >= 0) + { + rp->clip_to = ed->table_parts[rp->part->clip_to_id % ed->table_parts_size]; + if (rp->clip_to) + { + evas_object_pass_events_set(rp->clip_to->object, 1); + evas_object_pointer_mode_set(rp->clip_to->object, EVAS_OBJECT_POINTER_MODE_NOGRAB); + evas_object_clip_set(rp->object, rp->clip_to->object); + } + } + if (rp->part->dragable.confine_id >= 0) + rp->confine_to = ed->table_parts[rp->part->dragable.confine_id % ed->table_parts_size]; + + /* replay events for dragable */ + if (rp->part->dragable.events_id >= 0) + { + rp->events_to = + ed->table_parts[rp->part->dragable.events_id % ed->table_parts_size]; + /* events_to may be used only with dragable */ + if (!rp->events_to->part->dragable.x && + !rp->events_to->part->dragable.y) + rp->events_to = NULL; + } + + rp->swallow_params.min.w = 0; + rp->swallow_params.min.w = 0; + rp->swallow_params.max.w = -1; + rp->swallow_params.max.h = -1; + + if (ed->file->feature_ver < 1) + { + rp->param1.description->text.id_source = -1; + rp->param1.description->text.id_text_source = -1; + } + if (rp->param1.description->text.id_source >= 0) + rp->text.source = ed->table_parts[rp->param1.description->text.id_source % ed->table_parts_size]; + if (rp->param1.description->text.id_text_source >= 0) + rp->text.text_source = ed->table_parts[rp->param1.description->text.id_text_source % ed->table_parts_size]; } - if (rp->param1.description->text.id_source >= 0) - rp->text.source = ed->table_parts[rp->param1.description->text.id_source % ed->table_parts_size]; - if (rp->param1.description->text.id_text_source >= 0) - rp->text.text_source = ed->table_parts[rp->param1.description->text.id_text_source % ed->table_parts_size]; - } - } - - _edje_programs_patterns_init(ed); - - n = evas_list_count(ed->collection->programs); - if (n > 0) - { - /* FIXME: keeping a table AND a list is just bad - nuke list */ - ed->table_programs = malloc(sizeof(Edje_Program *) * n); - ed->table_programs_size = n; - /* FIXME: check malloc return */ - n = 0; - for (l = ed->collection->programs; l; l = l->next) - { - Edje_Program *pr; - - pr = l->data; - ed->table_programs[n] = pr; - n++; } - } - _edje_ref(ed); - _edje_block(ed); - _edje_freeze(ed); - if (ed->collection->script) _edje_embryo_script_init(ed); - _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; - if (rp->part->dragable.x < 0) rp->drag.val.x = 1.0; - if (rp->part->dragable.y < 0) rp->drag.val.x = 1.0; - _edje_dragable_pos_set(ed, rp, rp->drag.val.x, rp->drag.val.y); - } - ed->dirty = 1; - if ((evas_object_clipees_get(ed->clipper)) && - (evas_object_visible_get(obj))) - evas_object_show(ed->clipper); - - /* 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_GROUP) continue; - if (rp->part->source) - { - Evas_List *l; - Evas_Object *child_obj; - Edje *child_ed; - const char *group_path_entry = evas_stringshare_add(rp->part->source); - if (!group_path) + + _edje_programs_patterns_init(ed); + + n = evas_list_count(ed->collection->programs); + if (n > 0) + { + /* FIXME: keeping a table AND a list is just bad - nuke list */ + ed->table_programs = malloc(sizeof(Edje_Program *) * n); + ed->table_programs_size = n; + /* FIXME: check malloc return */ + n = 0; + for (l = ed->collection->programs; l; l = l->next) { - group_path = evas_list_append(NULL, evas_stringshare_add(part)); - group_path_started = 1; + Edje_Program *pr; + + pr = l->data; + ed->table_programs[n] = pr; + n++; } - /* make sure that this group isn't already in the tree of parents */ - for (l = group_path; l; l = l->next) + } + _edje_ref(ed); + _edje_block(ed); + _edje_freeze(ed); + if (ed->collection->script) _edje_embryo_script_init(ed); + _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; + if (rp->part->dragable.x < 0) rp->drag.val.x = 1.0; + if (rp->part->dragable.y < 0) rp->drag.val.x = 1.0; + _edje_dragable_pos_set(ed, rp, rp->drag.val.x, rp->drag.val.y); + } + ed->dirty = 1; + if ((evas_object_clipees_get(ed->clipper)) && + (evas_object_visible_get(obj))) + evas_object_show(ed->clipper); + + /* 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_GROUP) continue; + if (rp->part->source) { - if (l->data == group_path_entry) + Evas_List *l; + Evas_Object *child_obj; + Edje *child_ed; + const char *group_path_entry = evas_stringshare_add(rp->part->source); + if (!group_path) + { + group_path = evas_list_append(NULL, evas_stringshare_add(part)); + group_path_started = 1; + } + /* make sure that this group isn't already in the tree of parents */ + for (l = group_path; l; l = l->next) + { + if (l->data == group_path_entry) + { + _edje_thaw(ed); + _edje_unblock(ed); + _edje_unref(ed); + _edje_file_del(ed); + evas_stringshare_del(group_path_entry); + if (group_path_started) + { + evas_stringshare_del(group_path->data); + evas_list_free(group_path); + } + ed->load_error = EDJE_LOAD_ERROR_RECURSIVE_REFERENCE; + return 0; + } + } + + child_obj = edje_object_add(ed->evas); + group_path = evas_list_append(group_path, group_path_entry); + if (!_edje_object_file_set_internal(child_obj, file, rp->part->source, group_path)) { _edje_thaw(ed); _edje_unblock(ed); _edje_unref(ed); _edje_file_del(ed); - evas_stringshare_del(group_path_entry); + if (group_path_started) { - evas_stringshare_del(group_path->data); - evas_list_free(group_path); + while (group_path) + { + evas_stringshare_del(group_path->data); + group_path = evas_list_remove_list(group_path, group_path); + } } - ed->load_error = EDJE_LOAD_ERROR_RECURSIVE_REFERENCE; + ed->load_error = edje_object_load_error_get(child_obj); return 0; } + child_ed = _edje_fetch(child_obj); + child_ed->parent = evas_stringshare_add(rp->part->name); + + group_path = evas_list_remove(group_path, group_path_entry); + evas_stringshare_del(group_path_entry); + + edje_object_signal_callback_add(child_obj, "*", "*", _cb_signal_repeat, obj); + _edje_real_part_swallow(rp, child_obj); } - - child_obj = edje_object_add(ed->evas); - group_path = evas_list_append(group_path, group_path_entry); - if (!_edje_object_file_set_internal(child_obj, file, rp->part->source, group_path)) - { - _edje_thaw(ed); - _edje_unblock(ed); - _edje_unref(ed); - _edje_file_del(ed); - - if (group_path_started) - { - while (group_path) - { - evas_stringshare_del(group_path->data); - group_path = evas_list_remove_list(group_path, group_path); - } - } - ed->load_error = edje_object_load_error_get(child_obj); - return 0; - } - child_ed = _edje_fetch(child_obj); - child_ed->parent = evas_stringshare_add(rp->part->name); - - group_path = evas_list_remove(group_path, group_path_entry); - evas_stringshare_del(group_path_entry); - - edje_object_signal_callback_add(child_obj, "*", "*", _cb_signal_repeat, obj); - _edje_real_part_swallow(rp, child_obj); } - } - - if (group_path_started) - { - while (group_path) + + if (group_path_started) { - evas_stringshare_del(group_path->data); - group_path = evas_list_remove_list(group_path, group_path); + while (group_path) + { + evas_stringshare_del(group_path->data); + group_path = evas_list_remove_list(group_path, group_path); + } } - } - - /* reswallow any swallows that existed before setting the file */ - if (old_swallows) - { - while (old_swallows) + + /* reswallow any swallows that existed before setting the file */ + if (old_swallows) { - const char *name; - Evas_Object *swallow; - - name = old_swallows->data; - old_swallows = evas_list_remove_list(old_swallows, old_swallows); - - swallow = old_swallows->data; - old_swallows = evas_list_remove_list(old_swallows, old_swallows); - - edje_object_part_swallow(obj, name, swallow); - evas_stringshare_del(name); + while (old_swallows) + { + const char *name; + Evas_Object *swallow; + + name = old_swallows->data; + old_swallows = evas_list_remove_list(old_swallows, old_swallows); + + swallow = old_swallows->data; + old_swallows = evas_list_remove_list(old_swallows, old_swallows); + + edje_object_part_swallow(obj, name, swallow); + evas_stringshare_del(name); + } } + + _edje_recalc(ed); + _edje_thaw(ed); + _edje_unblock(ed); + _edje_unref(ed); } - - _edje_recalc(ed); - _edje_thaw(ed); - _edje_unblock(ed); - _edje_unref(ed); ed->load_error = EDJE_LOAD_ERROR_NONE; _edje_emit(ed, "load", NULL); return 1; =================================================================== RCS file: /cvs/e/e17/libs/edje/src/lib/edje_message_queue.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- edje_message_queue.c 1 Mar 2008 04:59:38 -0000 1.33 +++ edje_message_queue.c 30 May 2008 11:20:49 -0000 1.34 @@ -420,34 +420,10 @@ } void -_edje_message_process(Edje_Message *em) +_edje_message_parameters_push(Edje_Message *em) { - Embryo_Function fn; - void *pdata; int i; - - /* signals are only handled one way */ - if (em->type == EDJE_MESSAGE_SIGNAL) - { - _edje_emit_handle(em->edje, - ((Edje_Message_Signal *)em->msg)->sig, - ((Edje_Message_Signal *)em->msg)->src); - return; - } - /* if this has been queued up for the app then just call the callback */ - if (em->queue == EDJE_QUEUE_APP) - { - if (em->edje->message.func) - em->edje->message.func(em->edje->message.data, em->edje->obj, - em->type, em->id, em->msg); - return; - } - /* now this message is destined for the script message handler fn */ - if (!((em->edje->collection) && (em->edje->collection->script))) return; - fn = embryo_program_function_find(em->edje->collection->script, "message"); - if (fn == EMBRYO_FUNCTION_NONE) return; - /* reset the engine */ - _edje_embryo_script_reset(em->edje); + /* these params ALWAYS go on */ /* first param is the message type - always */ embryo_parameter_cell_push(em->edje->collection->script, @@ -556,6 +532,44 @@ default: break; } +} + +void +_edje_message_process(Edje_Message *em) +{ + Embryo_Function fn; + void *pdata; + + /* signals are only handled one way */ + if (em->type == EDJE_MESSAGE_SIGNAL) + { + _edje_emit_handle(em->edje, + ((Edje_Message_Signal *)em->msg)->sig, + ((Edje_Message_Signal *)em->msg)->src); + return; + } + /* if this has been queued up for the app then just call the callback */ + if (em->queue == EDJE_QUEUE_APP) + { + if (em->edje->message.func) + em->edje->message.func(em->edje->message.data, em->edje->obj, + em->type, em->id, em->msg); + return; + } + /* now this message is destined for the script message handler fn */ + if (!((em->edje->collection) && (em->edje->collection->script))) return; + if (_edje_script_only(em->edje)) + { + _edje_script_only_message(em->edje, em); + return; + } + fn = embryo_program_function_find(em->edje->collection->script, "message"); + if (fn == EMBRYO_FUNCTION_NONE) return; + /* reset the engine */ + _edje_embryo_script_reset(em->edje); + + _edje_message_parameters_push(em); + embryo_program_vm_push(em->edje->collection->script); _edje_embryo_globals_init(em->edje); pdata = embryo_program_data_get(em->edje->collection->script); =================================================================== RCS file: /cvs/e/e17/libs/edje/src/lib/edje_private.h,v retrieving revision 1.148 retrieving revision 1.149 diff -u -3 -r1.148 -r1.149 --- edje_private.h 29 May 2008 02:00:04 -0000 1.148 +++ edje_private.h 30 May 2008 11:20:49 -0000 1.149 @@ -647,6 +647,7 @@ /* for faster lookups to avoid nth list walks */ Edje_Real_Part **table_parts; Edje_Program **table_programs; + void *script_only_data; int table_programs_size; int table_parts_size; @@ -1147,6 +1148,7 @@ Edje_Message *_edje_message_new (Edje *ed, Edje_Queue queue, Edje_Message_Type type, int id); void _edje_message_free (Edje_Message *em); void _edje_message_send (Edje *ed, Edje_Queue queue, Edje_Message_Type type, int id, void *emsg); +void _edje_message_parameters_push (Edje_Message *em); void _edje_message_process (Edje_Message *em); void _edje_message_queue_process (void); void _edje_message_queue_clear (void); @@ -1165,4 +1167,61 @@ void _edje_embryo_globals_init(Edje *ed); +#define CHKPARAM(n) if (params[0] != (sizeof(Embryo_Cell) * (n))) return -1; +#define GETSTR(str, par) { \ + Embryo_Cell *___cptr; \ + int ___l; \ + str = NULL; \ + if ((___cptr = embryo_data_address_get(ep, (par)))) { \ + ___l = embryo_data_string_length_get(ep, ___cptr); \ + if (((str) = alloca(___l + 1))) \ + embryo_data_string_get(ep, ___cptr, (str)); } } +#define GETSTREVAS(str, par) { \ + if ((str)) { \ + if ((par) && (!strcmp((par), (str)))) return 0; \ + if ((par)) evas_stringshare_del((par)); \ + (par) = (char *)evas_stringshare_add((str)); } \ + else (par) = NULL; } +#define GETFLOAT(val, par) { \ + float *___cptr; \ + if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \ + val = *___cptr; } } +#define GETINT(val, par) { \ + int *___cptr; \ + if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \ + val = *___cptr; } } +#define SETSTR(str, par) { \ + Embryo_Cell *___cptr; \ + if ((___cptr = embryo_data_address_get(ep, (par)))) { \ + embryo_data_string_set(ep, str, ___cptr); } } +#define SETSTRALLOCATE(s) { \ + if (s) { \ + if (strlen((s)) < params[4]) { \ + SETSTR((s), params[3]); } \ + else { \ + char *ss; \ + ss = alloca(strlen((s)) + 1); \ + strcpy(ss, (s)); \ + ss[params[4] - 2] = 0; \ + SETSTR(ss, params[3]); } } \ + else \ + SETSTR("", params[3]); } +#define SETFLOAT(val, par) { \ + float *___cptr; \ + if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \ + *___cptr = (float)val; } } +#define SETINT(val, par) { \ + int *___cptr; \ + if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \ + *___cptr = (int)val; } } + +int _edje_script_only(Edje *ed); +void _edje_script_only_init(Edje *ed); +void _edje_script_only_shutdown(Edje *ed); +void _edje_script_only_show(Edje *ed); +void _edje_script_only_hide(Edje *ed); +void _edje_script_only_move(Edje *ed); +void _edje_script_only_resize(Edje *ed); +void _edje_script_only_message(Edje *ed, Edje_Message *em); + #endif =================================================================== RCS file: /cvs/e/e17/libs/edje/src/lib/edje_smart.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- edje_smart.c 5 Oct 2007 04:53:17 -0000 1.33 +++ edje_smart.c 30 May 2008 11:20:49 -0000 1.34 @@ -88,6 +88,7 @@ _edje_clean_objects(ed); _edje_edjes = evas_list_remove(_edje_edjes, obj); evas_object_smart_data_set(obj, NULL); + if (_edje_script_only(ed)) _edje_script_only_shutdown(ed); _edje_file_del(ed); _edje_unref(ed); } @@ -105,6 +106,12 @@ ed->y = y; // evas_object_move(ed->clipper, ed->x, ed->y); + if (_edje_script_only(ed)) + { + _edje_script_only_move(ed); + return; + } + for (i = 0; i < ed->table_parts_size; i++) { Edje_Real_Part *ep; @@ -146,6 +153,11 @@ if ((w == ed->w) && (h == ed->h)) return; ed->w = w; ed->h = h; + if (_edje_script_only(ed)) + { + _edje_script_only_resize(ed); + return; + } // evas_object_resize(ed->clipper, ed->w, ed->h); ed->dirty = 1; _edje_recalc(ed); @@ -162,6 +174,11 @@ if (evas_object_visible_get(ed->clipper)) return; if ((ed->collection) && (evas_object_clipees_get(ed->clipper))) evas_object_show(ed->clipper); + if (_edje_script_only(ed)) + { + _edje_script_only_show(ed); + return; + } _edje_emit(ed, "show", NULL); } @@ -175,6 +192,11 @@ if (!evas_object_visible_get(ed->clipper)) return; if ((ed->collection) && (evas_object_clipees_get(ed->clipper))) evas_object_hide(ed->clipper); + if (_edje_script_only(ed)) + { + _edje_script_only_hide(ed); + return; + } _edje_emit(ed, "hide", NULL); } ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs