forked from enlightenment/efl
Revert "edje_cc: fix detecting missing part for insert_before/after"
This reverts commit 2ca99b8b68
.
This breaks elm compile:
EDJ default.edj
edje_cc: Critical. In group "genlist_arrow": Unable to find part "sel_bevel" for insert_after in part "arrow_img_l".
This commit is contained in:
parent
3dcd903a53
commit
8b11d04ded
|
@ -240,6 +240,7 @@ char *mem_strdup(const char *s);
|
||||||
#define SZ sizeof
|
#define SZ sizeof
|
||||||
|
|
||||||
void using_file(const char *filename, const char type);
|
void using_file(const char *filename, const char type);
|
||||||
|
Eina_Bool needed_part_exists(Edje_Part_Collection *pc, const char *name);
|
||||||
|
|
||||||
void error_and_abort(Eet_File *ef, const char *fmt, ...);
|
void error_and_abort(Eet_File *ef, const char *fmt, ...);
|
||||||
|
|
||||||
|
|
|
@ -5982,12 +5982,16 @@ st_collections_group_parts_part_physics_body(void)
|
||||||
static void
|
static void
|
||||||
st_collections_group_parts_part_insert_before(void)
|
st_collections_group_parts_part_insert_before(void)
|
||||||
{
|
{
|
||||||
|
/* Edje_Part_Collection *pc; */
|
||||||
Edje_Part_Parser *epp;
|
Edje_Part_Parser *epp;
|
||||||
|
char *name;
|
||||||
|
|
||||||
check_arg_count(1);
|
check_arg_count(1);
|
||||||
|
|
||||||
|
/* pc = eina_list_data_get(eina_list_last(edje_collections)); */
|
||||||
|
name = parse_str(0);
|
||||||
epp = (Edje_Part_Parser *)current_part;
|
epp = (Edje_Part_Parser *)current_part;
|
||||||
epp->reorder.insert_before = parse_str(0);
|
epp->reorder.insert_before = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -6006,12 +6010,16 @@ st_collections_group_parts_part_insert_before(void)
|
||||||
static void
|
static void
|
||||||
st_collections_group_parts_part_insert_after(void)
|
st_collections_group_parts_part_insert_after(void)
|
||||||
{
|
{
|
||||||
|
/* Edje_Part_Collection *pc; */
|
||||||
Edje_Part_Parser *epp;
|
Edje_Part_Parser *epp;
|
||||||
|
char *name;
|
||||||
|
|
||||||
check_arg_count(1);
|
check_arg_count(1);
|
||||||
|
|
||||||
|
/* pc = eina_list_data_get(eina_list_last(edje_collections)); */
|
||||||
|
name = parse_str(0);
|
||||||
epp = (Edje_Part_Parser *)current_part;
|
epp = (Edje_Part_Parser *)current_part;
|
||||||
epp->reorder.insert_after = parse_str(0);
|
epp->reorder.insert_after = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2595,8 +2595,7 @@ reorder_parts(void)
|
||||||
{
|
{
|
||||||
ep = (Edje_Part_Parser *)pc->parts[i];
|
ep = (Edje_Part_Parser *)pc->parts[i];
|
||||||
if (ep->reorder.insert_before && ep->reorder.insert_after)
|
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\".",
|
ERR("Unable to use together insert_before and insert_after in part \"%s\".", pc->parts[i]->name);
|
||||||
pc->part, pc->parts[i]->name);
|
|
||||||
|
|
||||||
if (ep->reorder.done)
|
if (ep->reorder.done)
|
||||||
{
|
{
|
||||||
|
@ -2610,13 +2609,15 @@ reorder_parts(void)
|
||||||
if (ep->reorder.insert_before &&
|
if (ep->reorder.insert_before &&
|
||||||
!strcmp(ep->reorder.insert_before, pc->parts[j]->name))
|
!strcmp(ep->reorder.insert_before, pc->parts[j]->name))
|
||||||
{
|
{
|
||||||
|
needed_part_exists(pc, ep->reorder.insert_before);
|
||||||
|
|
||||||
ep2 = (Edje_Part_Parser *)pc->parts[j];
|
ep2 = (Edje_Part_Parser *)pc->parts[j];
|
||||||
if (ep2->reorder.after)
|
if (ep2->reorder.after)
|
||||||
error_and_abort(NULL, "In group \"%s\": The part \"%s\" is ambiguous ordered part.",
|
ERR("The part \"%s\" is ambiguous ordered part.",
|
||||||
pc->part, pc->parts[i]->name);
|
pc->parts[i]->name);
|
||||||
if (ep2->reorder.linked_prev)
|
if (ep2->reorder.linked_prev)
|
||||||
error_and_abort(NULL, "In group \"%s\": Unable to insert two or more parts in same part \"%s\".",
|
ERR("Unable to insert two or more parts in same part \"%s\".",
|
||||||
pc->part, pc->parts[j]->name);
|
pc->parts[j]->name);
|
||||||
/* Need it to be able to insert an element before the first */
|
/* Need it to be able to insert an element before the first */
|
||||||
if (j == 0) k = 0;
|
if (j == 0) k = 0;
|
||||||
else k = j - 1;
|
else k = j - 1;
|
||||||
|
@ -2633,13 +2634,13 @@ reorder_parts(void)
|
||||||
else if (ep->reorder.insert_after &&
|
else if (ep->reorder.insert_after &&
|
||||||
!strcmp(ep->reorder.insert_after, pc->parts[j]->name))
|
!strcmp(ep->reorder.insert_after, pc->parts[j]->name))
|
||||||
{
|
{
|
||||||
|
needed_part_exists(pc, ep->reorder.insert_after);
|
||||||
|
|
||||||
ep2 = (Edje_Part_Parser *)pc->parts[j];
|
ep2 = (Edje_Part_Parser *)pc->parts[j];
|
||||||
if (ep2->reorder.before)
|
if (ep2->reorder.before)
|
||||||
error_and_abort(NULL, "In group \"%s\": The part \"%s\" is ambiguous ordered part.",
|
ERR("The part \"%s\" is ambiguous ordered part.", pc->parts[i]->name);
|
||||||
pc->part, pc->parts[i]->name);
|
|
||||||
if (ep2->reorder.linked_next)
|
if (ep2->reorder.linked_next)
|
||||||
error_and_abort(NULL, "In group \"%s\": Unable to insert two or more parts in same part \"%s\".",
|
ERR("Unable to insert two or more parts in same part \"%s\".", pc->parts[j]->name);
|
||||||
pc->part, pc->parts[j]->name);
|
|
||||||
k = j;
|
k = j;
|
||||||
found = EINA_TRUE;
|
found = EINA_TRUE;
|
||||||
ep2->reorder.linked_next += ep->reorder.linked_next + 1;
|
ep2->reorder.linked_next += ep->reorder.linked_next + 1;
|
||||||
|
@ -2658,7 +2659,7 @@ reorder_parts(void)
|
||||||
|
|
||||||
if (((i > k) && ((i - ep->reorder.linked_prev) <= k))
|
if (((i > k) && ((i - ep->reorder.linked_prev) <= k))
|
||||||
|| ((i < k) && ((i + ep->reorder.linked_next) >= 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);
|
ERR("The part order is wrong. It has circular dependency.");
|
||||||
|
|
||||||
amount = ep->reorder.linked_prev + ep->reorder.linked_next + 1;
|
amount = ep->reorder.linked_prev + ep->reorder.linked_next + 1;
|
||||||
linked = i - ep->reorder.linked_prev;
|
linked = i - ep->reorder.linked_prev;
|
||||||
|
@ -2698,15 +2699,6 @@ reorder_parts(void)
|
||||||
ep->reorder.done = EINA_TRUE;
|
ep->reorder.done = EINA_TRUE;
|
||||||
free(parts);
|
free(parts);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4121,3 +4113,29 @@ using_file(const char *filename, const char type)
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Eina_Bool
|
||||||
|
needed_part_exists(Edje_Part_Collection *pc, const char *name)
|
||||||
|
{
|
||||||
|
Eina_Bool found;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
found = EINA_FALSE;
|
||||||
|
|
||||||
|
for (i = 0; i < pc->parts_count; i++)
|
||||||
|
{
|
||||||
|
if (!strcmp(pc->parts[i]->name, name))
|
||||||
|
{
|
||||||
|
found = EINA_TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
ERR("Unable to find part name \"%s\" needed in group \"%s\".",
|
||||||
|
name, pc->part);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue