* Fix wrong call to free() in edje_load.
* Reduce parts walk to the strict minimum.
+
+2011-12-19 Cedric Bail
+
+ * Check existence of group at compile time also.
Edje 1.1.0
Changes since Edje 1.1.0:
+-------------------------
Improvements:
* speedup load time of Edje file.
+ * check existence of group at compile time also.
Changes since Edje 1.0.0:
-------------------------
/* 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);
//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);
}
/**
//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);
}
/**
//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);
}
/**
//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);
}
/**
//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);
}
/**
//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);
}
/**
check_arg_count(1);
current_item->source = parse_str(0);
+ data_queue_group_lookup(current_item->source, current_part);
}
/**
struct _Group_Lookup
{
char *name;
+ Edje_Part *part;
};
struct _String_Lookup
}
void
-data_queue_group_lookup(char *name)
+data_queue_group_lookup(const char *name, Edje_Part *part)
{
Group_Lookup *gl;
+ if (!name || strlen(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
{
Edje_Part_Collection_Directory_Entry *de;
+ if (!group->part
+ || (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);
}
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)