aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/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/lib/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/lib/edje')
-rw-r--r--src/lib/edje/edje_cache.c14
-rw-r--r--src/lib/edje/edje_data.c2
-rw-r--r--src/lib/edje/edje_edit.c22
-rw-r--r--src/lib/edje/edje_embryo.c4
-rw-r--r--src/lib/edje/edje_message_queue.c4
-rw-r--r--src/lib/edje/edje_private.h2
-rw-r--r--src/lib/edje/edje_var.c8
7 files changed, 28 insertions, 28 deletions
diff --git a/src/lib/edje/edje_cache.c b/src/lib/edje/edje_cache.c
index 23ced3c684..bf635f0dc3 100644
--- a/src/lib/edje/edje_cache.c
+++ b/src/lib/edje/edje_cache.c
@@ -106,7 +106,7 @@ _edje_programs_patterns_init(Edje_Part_Collection *edc)
if (getenv("EDJE_DUMP_PROGRAMS"))
{
- INF("Group '%s' programs:", edc->part);
+ INF("Group '%s' programs:", edc->name);
#define EDJE_DUMP_PROGRAM(Section) \
for (i = 0; i < edc->programs.Section##_count; i++) \
INF(#Section " for ('%s', '%s')", edc->programs.Section[i]->signal, edc->programs.Section[i]->source);
@@ -171,7 +171,7 @@ _edje_file_coll_open(Edje_File *edf, const char *coll)
EINA_LIST_FOREACH(edf->collection_cache, l, edc)
{
- if (!strcmp(edc->part, coll))
+ if (!strcmp(edc->name, coll))
{
edc->references = 1;
ce->ref = edc;
@@ -190,7 +190,7 @@ _edje_file_coll_open(Edje_File *edf, const char *coll)
if (!edc) return NULL;
edc->references = 1;
- edc->part = ce->entry;
+ edc->name = ce->entry;
/* For Edje file build with Edje 1.0 */
if (edf->version <= 3 && edf->minor <= 1)
@@ -614,7 +614,7 @@ _edje_cache_coll_clean(Edje_File *edf)
edc = eina_list_data_get(eina_list_last(edf->collection_cache));
edf->collection_cache = eina_list_remove_list(edf->collection_cache, eina_list_last(edf->collection_cache));
- ce = eina_hash_find(edf->collection, edc->part);
+ ce = eina_hash_find(edf->collection, edc->name);
_edje_collection_free(edf, edc, ce);
}
}
@@ -633,7 +633,7 @@ _edje_cache_coll_flush(Edje_File *edf)
edf->collection_cache = eina_list_remove_list(edf->collection_cache,
last);
- ce = eina_hash_find(edf->collection, edc->part);
+ ce = eina_hash_find(edf->collection, edc->name);
_edje_collection_free(edf, edc, ce);
}
}
@@ -646,10 +646,10 @@ _edje_cache_coll_unref(Edje_File *edf, Edje_Part_Collection *edc)
edc->references--;
if (edc->references != 0) return;
- ce = eina_hash_find(edf->collection, edc->part);
+ ce = eina_hash_find(edf->collection, edc->name);
if (!ce)
{
- ERR("Something is wrong with reference count of '%s'.", edc->part);
+ ERR("Something is wrong with reference count of '%s'.", edc->name);
}
else if (ce->ref)
{
diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c
index 941a614313..984504ef6e 100644
--- a/src/lib/edje/edje_data.c
+++ b/src/lib/edje/edje_data.c
@@ -1423,7 +1423,7 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.min.h", prop.min.h, EET_T_INT);
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, "part", part, EET_T_STRING);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "name", name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.orientation", prop.orientation, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "broadcast_signal", broadcast_signal, EET_T_UCHAR);
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 2527598c69..8a731eef85 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -1799,7 +1799,7 @@ edje_edit_group_copy(Evas_Object *obj, const char *group_name, const char *copy_
_mempools_add(de);
epc->id = id;
- epc->part = eina_stringshare_add(copy_name);
+ epc->name = eina_stringshare_add(copy_name);
snprintf(buf, sizeof(buf), "edje/collections/%i", epc->id);
eet_data_write(eetf, _edje_edd_edje_part_collection, buf, epc, 1);
@@ -1908,7 +1908,7 @@ edje_edit_group_add(Evas_Object *obj, const char *name)
pc->parts = NULL;
pc->data = NULL;
pc->script = NULL;
- pc->part = eina_stringshare_add(name);
+ pc->name = eina_stringshare_add(name);
//cd = _alloc(sizeof(Code));
//codes = eina_list_append(codes, cd);
@@ -1944,7 +1944,7 @@ edje_edit_group_del(Evas_Object *obj, const char *group_name)
EINA_LIST_FOREACH(ed->file->collection_cache, l, g)
{
- if (strcmp(g->part, e->entry) == 0)
+ if (strcmp(g->name, e->entry) == 0)
{
ed->file->collection_cache =
eina_list_remove_list(ed->file->collection_cache, l);
@@ -1988,8 +1988,8 @@ edje_edit_group_del(Evas_Object *obj, const char *group_name)
{
ed->file->collection_cache =
eina_list_remove_list(ed->file->collection_cache, l);
- e_del = eina_hash_find(ed->file->collection, g->part);
- eina_hash_del(ed->file->collection, g->part, e_del);
+ e_del = eina_hash_find(ed->file->collection, g->name);
+ eina_hash_del(ed->file->collection, g->name, e_del);
_edje_collection_free(ed->file, g, e_del);
}
}
@@ -2022,22 +2022,22 @@ edje_edit_group_name_set(Evas_Object *obj, const char *new_name)
pc = ed->collection;
- if (!strcmp(pc->part, new_name)) return EINA_TRUE;
+ if (!strcmp(pc->name, new_name)) return EINA_TRUE;
if (edje_edit_group_exist(obj, new_name)) return EINA_FALSE;
- _edje_edit_group_references_update(obj, pc->part, new_name);
+ _edje_edit_group_references_update(obj, pc->name, new_name);
//printf("Set name of current group: %s [id: %d][new name: %s]\n",
- // pc->part, pc->id, new_name);
+ // pc->name, pc->id, new_name);
- //if (pc->part && ed->file->free_strings) eina_stringshare_del(pc->part); TODO FIXME
- pce = eina_hash_find(ed->file->collection, pc->part);
+ //if (pc->name && ed->file->free_strings) eina_stringshare_del(pc->name); TODO FIXME
+ pce = eina_hash_find(ed->file->collection, pc->name);
eina_hash_move(ed->file->collection, pce->entry, new_name);
pce->entry = eina_stringshare_add(new_name);
- pc->part = pce->entry;
+ pc->name = pce->entry;
eina_stringshare_replace(&ed->group, new_name);
return EINA_TRUE;
diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c
index b5b3b6663f..ada48800a3 100644
--- a/src/lib/edje/edje_embryo.c
+++ b/src/lib/edje/edje_embryo.c
@@ -4728,7 +4728,7 @@ _edje_embryo_test_run(Edje *ed, Edje_Program *pr, const char *sig, const char *s
"SIGNAL: '%s', "
"SOURCE: '%s', "
"ERROR: '%s'",
- ed->collection->part,
+ ed->collection->name,
ed->file->path,
fname, pr->name,
sig, src,
@@ -4743,7 +4743,7 @@ _edje_embryo_test_run(Edje *ed, Edje_Program *pr, const char *sig, const char *s
"SIGNAL: '%s', "
"SOURCE: '%s', "
"ERROR: 'Script exceeded maximum allowed cycle count of %i'",
- ed->collection->part,
+ ed->collection->name,
ed->file->path,
fname, pr->name,
sig, src,
diff --git a/src/lib/edje/edje_message_queue.c b/src/lib/edje/edje_message_queue.c
index b7ecdf3e95..dd422b655f 100644
--- a/src/lib/edje/edje_message_queue.c
+++ b/src/lib/edje/edje_message_queue.c
@@ -822,7 +822,7 @@ _edje_message_process(Edje_Message *em)
"OBJECT FILE: '%s', "
"ENTRY POINT: '%s', "
"ERROR: '%s'",
- em->edje->collection->part,
+ em->edje->collection->name,
em->edje->file->path,
"message",
embryo_error_string_get(embryo_program_error_get(em->edje->collection->script)));
@@ -834,7 +834,7 @@ _edje_message_process(Edje_Message *em)
"OBJECT FILE: '%s', "
"ENTRY POINT: '%s', "
"ERROR: 'Script exceeded maximum allowed cycle count of %i'",
- em->edje->collection->part,
+ em->edje->collection->name,
em->edje->file->path,
"message",
embryo_program_max_cycle_run_get(em->edje->collection->script));
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 2c12ea6a51..1c02ee6ad5 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -1090,7 +1090,7 @@ struct _Edje_Part_Collection
Eina_Hash *aliased; /* invert match of alias */
Embryo_Program *script; /* all the embryo script code for this group */
- const char *part;
+ const char *name; /* group name */
#ifdef EDJE_PROGRAM_CACHE
struct {
diff --git a/src/lib/edje/edje_var.c b/src/lib/edje/edje_var.c
index 3bc3ebf0b2..cf1be4f900 100644
--- a/src/lib/edje/edje_var.c
+++ b/src/lib/edje/edje_var.c
@@ -37,7 +37,7 @@ _edje_var_timer_cb(void *data)
"OBJECT NAME: '%s', "
"OBJECT FILE: '%s', "
"ERROR: '%s'",
- ed->collection->part,
+ ed->collection->name,
ed->file->path,
embryo_error_string_get(embryo_program_error_get(ed->collection->script)));
}
@@ -47,7 +47,7 @@ _edje_var_timer_cb(void *data)
"OBJECT NAME: '%s', "
"OBJECT FILE: '%s', "
"ERROR: 'Script exceeded maximum allowed cycle count of %i'",
- ed->collection->part,
+ ed->collection->name,
ed->file->path,
embryo_program_max_cycle_run_get(ed->collection->script));
}
@@ -116,7 +116,7 @@ _edje_var_anim_cb(void *data EINA_UNUSED)
"OBJECT NAME: '%s', "
"OBJECT FILE: '%s', "
"ERROR: '%s'",
- ed->collection->part,
+ ed->collection->name,
ed->file->path,
embryo_error_string_get(embryo_program_error_get(ed->collection->script)));
}
@@ -126,7 +126,7 @@ _edje_var_anim_cb(void *data EINA_UNUSED)
"OBJECT NAME: '%s', "
"OBJECT FILE: '%s', "
"ERROR: 'Script exceeded maximum allowed cycle count of %i'",
- ed->collection->part,
+ ed->collection->name,
ed->file->path,
embryo_program_max_cycle_run_get(ed->collection->script));
}