edje: check existence of group at compile time also.

SVN revision: 66336
This commit is contained in:
Cedric BAIL 2011-12-19 17:25:00 +00:00
parent 4c282db931
commit 92b831be2e
5 changed files with 41 additions and 2 deletions

View File

@ -243,3 +243,7 @@
* 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.

View File

@ -1,9 +1,11 @@
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:
-------------------------

View File

@ -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);

View File

@ -3212,6 +3212,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);
}
/**
@ -3233,6 +3234,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);
}
/**
@ -3254,6 +3256,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);
}
/**
@ -3275,6 +3278,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);
}
/**
@ -3296,6 +3300,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);
}
/**
@ -3317,6 +3322,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);
}
/**
@ -3804,6 +3810,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);
}
/**

View File

@ -72,6 +72,7 @@ struct _Program_Lookup
struct _Group_Lookup
{
char *name;
Edje_Part *part;
};
struct _String_Lookup
@ -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 || 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
@ -1698,8 +1702,28 @@ data_process_lookups(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\".",
@ -1707,6 +1731,7 @@ data_process_lookups(void)
exit(-1);
}
free_group:
free(group->name);
free(group);
}
@ -1914,7 +1939,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)