aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/edje
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2018-06-07 17:53:12 +0900
committerHermet Park <hermetpark@gmail.com>2018-06-07 17:53:12 +0900
commit7fb47fc064b8f429242b4d5cdf57071475087821 (patch)
tree6f8f581a58c6e974f63a1bb8ff2f582b5e9cc3cb /src/bin/edje
parentedje_cc: fixup edje_collections_lookup hash ids during collection pruning (diff)
downloadefl-7fb47fc064b8f429242b4d5cdf57071475087821.tar.gz
edje: code refactoring for readibility.
collection.part is too ambigious, since group has parts as well. Normally we regard it as "name" (of group) instead of part.
Diffstat (limited to 'src/bin/edje')
-rw-r--r--src/bin/edje/edje_cc_handlers.c24
-rw-r--r--src/bin/edje/edje_cc_out.c42
-rw-r--r--src/bin/edje/edje_cc_script.c2
-rw-r--r--src/bin/edje/edje_pick.c2
4 files changed, 35 insertions, 35 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 6d987edb8f..8f4a94ef8c 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -1589,7 +1589,7 @@ New_Object_Handler object_handlers[] =
{"collections.group.physics.world", NULL},
#endif
PROGRAM_OBJECTS("collections.group.parts.part.description")
- PROGRAM_OBJECTS("collections.group.parts.part")
+ PROGRAM_OBJECTS("collections.group.parts.name")
PROGRAM_OBJECTS("collections.group.parts")
PROGRAM_OBJECTS("collections.group")
};
@@ -4473,7 +4473,7 @@ _group_name(char *name)
goto double_named_group;
current_de->entry = name;
- current_pc->part = current_de->entry;
+ current_pc->name = current_de->entry;
older = eina_hash_find(edje_file->collection, current_de->entry);
if (older) eina_hash_del(edje_file->collection, current_de->entry, older);
@@ -4487,7 +4487,7 @@ _group_name(char *name)
pc = eina_list_nth(edje_collections, older->id);
INF("overriding alias ('%s' => '%s') by group '%s'",
- alias->entry, pc->part,
+ alias->entry, pc->name,
current_de->entry);
aliases = eina_list_remove_list(aliases, l);
free(alias);
@@ -5074,7 +5074,7 @@ st_collections_group_inherit(void)
{
free(parent_name);
pc2 = eina_list_nth(edje_collections, alias->id);
- parent_name = strdup(pc2->part);
+ parent_name = strdup(pc2->name);
break;
}
}
@@ -5083,7 +5083,7 @@ st_collections_group_inherit(void)
{
EINA_LIST_FOREACH(edje_collections, l, pc2)
{
- if (!strcmp(parent_name, pc2->part))
+ if (!strcmp(parent_name, pc2->name))
break;
}
}
@@ -5293,7 +5293,7 @@ st_collections_group_inherit(void)
Code_Program *cp, *cp2;
Edje_Part_Collection_Directory_Entry *de;
- de = eina_hash_find(edje_file->collection, pc2->part);
+ de = eina_hash_find(edje_file->collection, pc2->name);
cd2 = eina_list_nth(codes, de->id);
cd = eina_list_data_get(eina_list_last(codes));
@@ -5306,7 +5306,7 @@ st_collections_group_inherit(void)
if (cd->shared)
{
WRN("%s:%i. script block in group \"%s\" will be overwritten by inheriting "
- "from group \"%s\".", file_in, line - 1, pc->part, pc2->part);
+ "from group \"%s\".", file_in, line - 1, pc->name, pc2->name);
free(cd->shared);
}
if (cd->original)
@@ -5417,7 +5417,7 @@ st_collections_group_alias(void)
pc = eina_list_nth(edje_collections, tmp->id);
INF("overriding alias ('%s' => '%s') to ('%s' => '%s')",
- tmp->entry, pc->part,
+ tmp->entry, pc->name,
alias->entry, current_de->entry);
aliases = eina_list_remove_list(aliases, l);
free(tmp);
@@ -6487,7 +6487,7 @@ _part_type_set(unsigned int type)
dummy->type = ep->type + 2;
if (previous)
{
- new = _edje_part_description_alloc(type, pc->part, ep->name);
+ new = _edje_part_description_alloc(type, pc->name, ep->name);
eina_hash_add(desc_hash, &new, ep);
eina_hash_set(desc_hash, &previous, dummy);
parent_desc = previous;
@@ -6504,7 +6504,7 @@ _part_type_set(unsigned int type)
for (i = 0; i < ep->other.desc_count; i++)
{
previous = ep->other.desc[i];
- new = _edje_part_description_alloc(type, pc->part, ep->name);
+ new = _edje_part_description_alloc(type, pc->name, ep->name);
eina_hash_add(desc_hash, &new, ep);
eina_hash_set(desc_hash, &previous, dummy);
parent_desc = previous;
@@ -8513,7 +8513,7 @@ ob_collections_group_parts_part_description(void)
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = current_part;
- ed = _edje_part_description_alloc(ep->type, pc->part, ep->name);
+ ed = _edje_part_description_alloc(ep->type, pc->name, ep->name);
eina_hash_add(desc_hash, &ed, ep);
ed->rel1.id_x = -1;
@@ -9599,7 +9599,7 @@ st_collections_group_parts_part_description_color3(void)
&& current_part->type != EDJE_PART_TYPE_TEXTBLOCK)
{
ERR("Setting color3 in part %s from %s not of type TEXT or TEXTBLOCK.",
- current_part->name, pc->part);
+ current_part->name, pc->name);
exit(-1);
}
diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index 345fe79cfb..00275cce4f 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -403,7 +403,7 @@ check_image_part_desc(Edje_Part_Collection *pc, Edje_Part *ep,
if (epd->image.id == -1 && epd->common.visible)
WRN("Collection %s(%i): image attributes missing for "
"part \"%s\", description \"%s\" %f",
- pc->part, pc->id, ep->name, epd->common.state.name, epd->common.state.value);
+ pc->name, pc->id, ep->name, epd->common.state.name, epd->common.state.value);
for (i = 0; i < epd->image.tweens_count; ++i)
{
@@ -422,7 +422,7 @@ _source_group_find(const char *source)
if (!source) return NULL;
EINA_LIST_FOREACH(edje_collections, l, pc2)
{
- if (!strcmp(pc2->part, source))
+ if (!strcmp(pc2->name, source))
return pc2;
}
return NULL;
@@ -469,9 +469,9 @@ check_text_part_desc(Edje_Part_Collection *pc, Edje_Part *ep,
return;
}
- error_and_abort(ef, "Collection \"%s\" Part \"%s\" Description \"%s\" [%.3f]: "
+ error_and_abort(ef, "Group \"%s\" Part \"%s\" Description \"%s\" [%.3f]: "
"text.source point to a non TEXT part \"%s\"!",
- pc->part, ep->name, epd->common.state.name,
+ pc->name, ep->name, epd->common.state.name,
epd->common.state.value, pc->parts[epd->text.id_source]->name);
}
@@ -489,9 +489,9 @@ check_text_part_desc(Edje_Part_Collection *pc, Edje_Part *ep,
return;
}
- error_and_abort(ef, "Collection \"%s\" Part \"%s\" Description \"%s\" [%.3f]: "
+ error_and_abort(ef, "Group \"%s\" Part \"%s\" Description \"%s\" [%.3f]: "
"text.text_source point to a non TEXT part \"%s\"!",
- pc->part, ep->name, epd->common.state.name,
+ pc->name, ep->name, epd->common.state.name,
epd->common.state.value, pc->parts[epd->text.id_text_source]->name);
}
}
@@ -513,7 +513,7 @@ check_source_links(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef, Eina_L
EINA_LIST_FOREACH(edje_collections, l, pc_source)
{
/* Find sourced group */
- if (ep->source && pc_source->part && strcmp(ep->source, pc_source->part) == 0)
+ if (ep->source && pc_source->name && strcmp(ep->source, pc_source->name) == 0)
{
/* Go through every part to find parts with type GROUP */
for (i = 0; i < pc_source->parts_count; ++i)
@@ -530,7 +530,7 @@ check_source_links(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef, Eina_L
"already included inside "
"part '%s' of group '%s'",
data, pc_source->parts[i]->name,
- pc->part);
+ pc->name);
}
}
group_path = eina_list_append(group_path, ep->source);
@@ -2848,7 +2848,7 @@ reorder_parts(void)
ep = (Edje_Part_Parser *)pc->parts[i];
if (ep->reorder.insert_before && ep->reorder.insert_after)
error_and_abort(NULL, "In group \"%s\": Unable to use together insert_before and insert_after in part \"%s\".",
- pc->part, pc->parts[i]->name);
+ pc->name, pc->parts[i]->name);
if (ep->reorder.done)
{
@@ -2865,10 +2865,10 @@ reorder_parts(void)
ep2 = (Edje_Part_Parser *)pc->parts[j];
if (ep2->reorder.after)
error_and_abort(NULL, "In group \"%s\": The part \"%s\" is ambiguous ordered part.",
- pc->part, pc->parts[i]->name);
+ pc->name, pc->parts[i]->name);
if (ep2->reorder.linked_prev)
error_and_abort(NULL, "In group \"%s\": Unable to insert two or more parts in same part \"%s\".",
- pc->part, pc->parts[j]->name);
+ pc->name, pc->parts[j]->name);
/* Need it to be able to insert an element before the first */
if (j == 0) k = 0;
else k = j - 1;
@@ -2888,10 +2888,10 @@ reorder_parts(void)
ep2 = (Edje_Part_Parser *)pc->parts[j];
if (ep2->reorder.before)
error_and_abort(NULL, "In group \"%s\": The part \"%s\" is ambiguous ordered part.",
- pc->part, pc->parts[i]->name);
+ pc->name, pc->parts[i]->name);
if (ep2->reorder.linked_next)
error_and_abort(NULL, "In group \"%s\": Unable to insert two or more parts in same part \"%s\".",
- pc->part, pc->parts[j]->name);
+ pc->name, pc->parts[j]->name);
k = j;
found = EINA_TRUE;
ep2->reorder.linked_next += ep->reorder.linked_next + 1;
@@ -2910,7 +2910,7 @@ reorder_parts(void)
if (((i > k) && ((i - ep->reorder.linked_prev) <= k))
|| ((i < k) && ((i + ep->reorder.linked_next) >= k)))
- error_and_abort(NULL, "In group \"%s\": The part order is wrong. It has circular dependency.", pc->part);
+ error_and_abort(NULL, "In group \"%s\": The part order is wrong. It has circular dependency.", pc->name);
amount = ep->reorder.linked_prev + ep->reorder.linked_next + 1;
linked = i - ep->reorder.linked_prev;
@@ -2954,10 +2954,10 @@ reorder_parts(void)
{
if (ep->reorder.insert_before)
error_and_abort(NULL, "In group \"%s\": Unable to find part \"%s\" for insert_before in part \"%s\".",
- pc->part, ep->reorder.insert_before, pc->parts[i]->name);
+ pc->name, ep->reorder.insert_before, pc->parts[i]->name);
else
error_and_abort(NULL, "In group \"%s\": Unable to find part \"%s\" for insert_after in part \"%s\".",
- pc->part, ep->reorder.insert_after, pc->parts[i]->name);
+ pc->name, ep->reorder.insert_after, pc->parts[i]->name);
}
}
}
@@ -3208,7 +3208,7 @@ copied_program_anonymous_lookup_delete(Edje_Part_Collection *pc, int *dest)
Edje_Part_Collection_Directory_Entry *de;
Eina_List *l2, *ll2;
- de = eina_hash_find(edje_file->collection, pl->pc->part);
+ de = eina_hash_find(edje_file->collection, pl->pc->name);
cd = eina_list_nth(codes, de->id);
EINA_LIST_FOREACH_SAFE(cd->programs, l2, ll2, cp)
@@ -3716,13 +3716,13 @@ data_process_lookups(void)
unsigned int id = 0;
unsigned int i;
- if (!pc->part)
+ if (!pc->name)
{
ERR("A collection without a name was detected, that's not allowed.");
exit(-1);
}
- find = eina_hash_find(edje_file->collection, pc->part);
+ find = eina_hash_find(edje_file->collection, pc->name);
if (find && find->id == pc->id)
{
if (((Edje_Part_Collection_Parser *)pc)->inherit_only)
@@ -3756,7 +3756,7 @@ data_process_lookups(void)
if (pc->id == alias->id)
alias->id = id;
- find = eina_hash_find(edje_file->collection, pc->part);
+ find = eina_hash_find(edje_file->collection, pc->name);
if (pc->id != find->id) find = NULL;
de = eina_hash_find(edje_collections_lookup, &pc->id);
@@ -3832,7 +3832,7 @@ data_process_lookups(void)
if ((i == part->key.pc->parts_count) && (!((Edje_Part_Collection_Parser *)part->key.pc)->inherit_only))
{
ERR("Unable to find part name \"%s\" needed in group '%s'.",
- alias, part->key.pc->part);
+ alias, part->key.pc->name);
exit(-1);
}
}
diff --git a/src/bin/edje/edje_cc_script.c b/src/bin/edje/edje_cc_script.c
index 2e52ac1c2f..35d4fe9072 100644
--- a/src/bin/edje/edje_cc_script.c
+++ b/src/bin/edje/edje_cc_script.c
@@ -347,7 +347,7 @@ _push_symbol(Eina_List **total, Code_Symbol *sym, Edje_Part_Collection *pc)
if (!strcmp(sym2->name, sym->name))
{
WRN("Symbols in group \"%s\" have same name \"%s\". Latter defined "
- "will shadow former one.", pc->part, sym->name);
+ "will shadow former one.", pc->name, sym->name);
list = eina_list_remove(list, sym2);
break;
}
diff --git a/src/bin/edje/edje_pick.c b/src/bin/edje/edje_pick.c
index 2079d92cee..a4ec7b5cd0 100644
--- a/src/bin/edje/edje_pick.c
+++ b/src/bin/edje/edje_pick.c
@@ -1589,7 +1589,7 @@ _edje_pick_collection_process(Edje_Part_Collection *edc, Edje_File *edf, Edje_Fi
/* Update all IDs, NAMES in current collection */
Edje_Part_Collection_Directory_Entry *ce;
- ce = eina_hash_find(o->collection, edc->part);
+ ce = eina_hash_find(o->collection, edc->name);
edc->id = ce->id;
_edje_pick_resources_process(edc, edf, o);