Remove part list, using table everywhere instead
SVN revision: 30085
This commit is contained in:
parent
f1d6383852
commit
e954849ee1
|
@ -137,7 +137,7 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl
|
|||
void
|
||||
_edje_recalc(Edje *ed)
|
||||
{
|
||||
Evas_List *l;
|
||||
int i;
|
||||
|
||||
if (!ed->dirty) return;
|
||||
if (ed->freeze)
|
||||
|
@ -145,19 +145,19 @@ _edje_recalc(Edje *ed)
|
|||
ed->recalc = 1;
|
||||
if (!ed->calc_only) return;
|
||||
}
|
||||
for (l = ed->parts; l; l = l->next)
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *ep;
|
||||
|
||||
ep = l->data;
|
||||
ep = ed->table_parts[i];
|
||||
ep->calculated = FLAG_NONE;
|
||||
ep->calculating = FLAG_NONE;
|
||||
}
|
||||
for (l = ed->parts; l; l = l->next)
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *ep;
|
||||
|
||||
ep = l->data;
|
||||
ep = ed->table_parts[i];
|
||||
if (ep->calculated != FLAG_XY)
|
||||
_edje_part_recalc(ed, ep, (~ep->calculated) & FLAG_XY);
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
{
|
||||
Edje *ed;
|
||||
int n;
|
||||
Evas_List *parts = NULL;
|
||||
Evas_List *old_swallows;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
|
@ -60,6 +61,7 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
if (ed->collection)
|
||||
{
|
||||
Evas_List *l;
|
||||
int i;
|
||||
int errors = 0;
|
||||
|
||||
/* colorclass stuff */
|
||||
|
@ -94,7 +96,7 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
return 0;
|
||||
}
|
||||
rp->part = ep;
|
||||
ed->parts = evas_list_append(ed->parts, rp);
|
||||
parts = evas_list_append(parts, rp);
|
||||
rp->param1.description = ep->default_desc;
|
||||
rp->chosen_description = rp->param1.description;
|
||||
if (!rp->param1.description)
|
||||
|
@ -149,30 +151,33 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
}
|
||||
if (n > 0)
|
||||
{
|
||||
/* FIXME: keeping a table AND a list is just bad - nuke list */
|
||||
Edje_Real_Part *rp;
|
||||
ed->table_parts = malloc(sizeof(Edje_Real_Part *) * n);
|
||||
ed->table_parts_size = n;
|
||||
/* FIXME: check malloc return */
|
||||
n = 0;
|
||||
for (l = ed->parts; l; l = l->next)
|
||||
for (l = parts; l; l = l->next)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
rp = l->data;
|
||||
ed->table_parts[n] = rp;
|
||||
n++;
|
||||
}
|
||||
evas_list_free(parts);
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->param1.description->rel1.id_x >= 0)
|
||||
rp->param1.rel1_to_x = evas_list_nth(ed->parts, rp->param1.description->rel1.id_x);
|
||||
rp->param1.rel1_to_x = ed->table_parts[rp->param1.description->rel1.id_x % ed->table_parts_size];
|
||||
if (rp->param1.description->rel1.id_y >= 0)
|
||||
rp->param1.rel1_to_y = evas_list_nth(ed->parts, rp->param1.description->rel1.id_y);
|
||||
rp->param1.rel1_to_y = ed->table_parts[rp->param1.description->rel1.id_y % ed->table_parts_size];
|
||||
if (rp->param1.description->rel2.id_x >= 0)
|
||||
rp->param1.rel2_to_x = evas_list_nth(ed->parts, rp->param1.description->rel2.id_x);
|
||||
rp->param1.rel2_to_x = ed->table_parts[rp->param1.description->rel2.id_x % ed->table_parts_size];
|
||||
if (rp->param1.description->rel2.id_y >= 0)
|
||||
rp->param1.rel2_to_y = evas_list_nth(ed->parts, rp->param1.description->rel2.id_y);
|
||||
rp->param1.rel2_to_y = ed->table_parts[rp->param1.description->rel2.id_y % ed->table_parts_size];
|
||||
_edje_text_part_on_add_clippers(ed, rp);
|
||||
if (rp->part->clip_to_id >= 0)
|
||||
{
|
||||
rp->clip_to = evas_list_nth(ed->parts, rp->part->clip_to_id);
|
||||
rp->clip_to = ed->table_parts[rp->part->clip_to_id % ed->table_parts_size];
|
||||
if (rp->clip_to)
|
||||
{
|
||||
evas_object_pass_events_set(rp->clip_to->object, 1);
|
||||
|
@ -180,14 +185,13 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
}
|
||||
}
|
||||
if (rp->part->dragable.confine_id >= 0)
|
||||
rp->confine_to = evas_list_nth(ed->parts, rp->part->dragable.confine_id);
|
||||
rp->confine_to = ed->table_parts[rp->part->dragable.confine_id % ed->table_parts_size];
|
||||
|
||||
/* replay events for dragable */
|
||||
if (rp->part->dragable.events_id >= 0)
|
||||
{
|
||||
rp->events_to =
|
||||
evas_list_nth(ed->parts,
|
||||
rp->part->dragable.events_id);
|
||||
ed->table_parts[rp->part->dragable.events_id % ed->table_parts_size];
|
||||
/* events_to may be used only with dragable */
|
||||
if (!rp->events_to->part->dragable.x &&
|
||||
!rp->events_to->part->dragable.y)
|
||||
|
@ -205,9 +209,9 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
rp->param1.description->text.id_text_source = -1;
|
||||
}
|
||||
if (rp->param1.description->text.id_source >= 0)
|
||||
rp->text.source = evas_list_nth(ed->parts, rp->param1.description->text.id_source);
|
||||
rp->text.source = ed->table_parts[rp->param1.description->text.id_source % ed->table_parts_size];
|
||||
if (rp->param1.description->text.id_text_source >= 0)
|
||||
rp->text.text_source = evas_list_nth(ed->parts, rp->param1.description->text.id_text_source);
|
||||
rp->text.text_source = ed->table_parts[rp->param1.description->text.id_text_source % ed->table_parts_size];
|
||||
}
|
||||
}
|
||||
n = evas_list_count(ed->collection->programs);
|
||||
|
@ -232,11 +236,11 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
|||
_edje_freeze(ed);
|
||||
if (ed->collection->script) _edje_embryo_script_init(ed);
|
||||
_edje_var_init(ed);
|
||||
for (l = ed->parts; l; l = l->next)
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
rp = l->data;
|
||||
rp = ed->table_parts[i];
|
||||
evas_object_show(rp->object);
|
||||
if (_edje_block_break(ed)) break;
|
||||
if (rp->part->dragable.x < 0) rp->drag.val.x = 1.0;
|
||||
|
@ -479,14 +483,14 @@ static Evas_List *
|
|||
_edje_swallows_collect(Edje *ed)
|
||||
{
|
||||
Evas_List *swallows = NULL;
|
||||
Evas_List *l;
|
||||
if (!ed->file || !ed->parts) return NULL;
|
||||
int i;
|
||||
if (!ed->file || !ed->table_parts) return NULL;
|
||||
|
||||
for (l = ed->parts; l; l = l->next)
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
rp = l->data;
|
||||
rp = ed->table_parts[i];
|
||||
if (!rp->swallowed_object) continue;
|
||||
swallows = evas_list_append(swallows, evas_stringshare_add(rp->part->name));
|
||||
swallows = evas_list_append(swallows, rp->swallowed_object);
|
||||
|
@ -522,14 +526,14 @@ _edje_file_del(Edje *ed)
|
|||
_edje_cache_file_unref(ed->file);
|
||||
ed->file = NULL;
|
||||
}
|
||||
if (ed->parts)
|
||||
if (ed->table_parts)
|
||||
{
|
||||
while (ed->parts)
|
||||
int i;
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
rp = ed->parts->data;
|
||||
ed->parts = evas_list_remove(ed->parts, rp);
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->object)
|
||||
{
|
||||
_edje_text_real_part_on_del(ed, rp);
|
||||
|
@ -562,7 +566,6 @@ _edje_file_del(Edje *ed)
|
|||
|
||||
free(rp);
|
||||
}
|
||||
ed->parts = NULL;
|
||||
}
|
||||
if (ed->actions)
|
||||
{
|
||||
|
|
|
@ -585,7 +585,6 @@ struct _Edje
|
|||
Evas_Object *clipper; /* a big rect to clip this Edje to */
|
||||
Edje_File *file; /* the file the data comes form */
|
||||
Edje_Part_Collection *collection; /* the description being used */
|
||||
Evas_List *parts; /* private list of parts */
|
||||
Evas_List *actions; /* currently running actions */
|
||||
Evas_List *callbacks;
|
||||
Evas_List *pending_actions;
|
||||
|
|
|
@ -91,7 +91,7 @@ static void
|
|||
_edje_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
Edje *ed;
|
||||
Evas_List *l;
|
||||
int i;
|
||||
|
||||
ed = evas_object_smart_data_get(obj);
|
||||
if (!ed) return;
|
||||
|
@ -100,12 +100,12 @@ _edje_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y)
|
|||
ed->y = y;
|
||||
// evas_object_move(ed->clipper, ed->x, ed->y);
|
||||
|
||||
for (l = ed->parts; l; l = l->next)
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *ep;
|
||||
Evas_Coord ox, oy;
|
||||
|
||||
ep = l->data;
|
||||
ep = ed->table_parts[i];
|
||||
evas_object_geometry_get(ep->object, &ox, &oy, NULL, NULL);
|
||||
evas_object_move(ep->object, ed->x + ep->x + ep->offset.x, ed->y + ep->y +ep->offset.y);
|
||||
if (ep->swallowed_object)
|
||||
|
|
|
@ -75,7 +75,7 @@ _edje_text_part_on_add_clippers(Edje *ed, Edje_Real_Part *ep)
|
|||
o = l->data;
|
||||
if (ep->part->clip_to_id >= 0)
|
||||
{
|
||||
ep->clip_to = evas_list_nth(ed->parts, ep->part->clip_to_id);
|
||||
ep->clip_to = ed->table_parts[ep->part->clip_to_id % ed->table_parts_size];
|
||||
if (ep->clip_to)
|
||||
{
|
||||
evas_object_pass_events_set(ep->clip_to->object, 1);
|
||||
|
|
|
@ -1022,15 +1022,15 @@ EAPI void
|
|||
edje_object_part_unswallow(Evas_Object *obj, Evas_Object *obj_swallow)
|
||||
{
|
||||
Edje *ed;
|
||||
Evas_List *l;
|
||||
int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!obj_swallow)) return;
|
||||
for (l = ed->parts; l; l = l->next)
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
rp = l->data;
|
||||
rp = ed->table_parts[i];
|
||||
if (rp->swallowed_object == obj_swallow)
|
||||
{
|
||||
evas_object_smart_member_del(rp->swallowed_object);
|
||||
|
@ -1195,7 +1195,7 @@ edje_object_size_min_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
|
|||
ok = 1;
|
||||
while (ok)
|
||||
{
|
||||
Evas_List *l;
|
||||
int i;
|
||||
|
||||
ok = 0;
|
||||
ed->dirty = 1;
|
||||
|
@ -1206,13 +1206,13 @@ edje_object_size_min_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
|
|||
maxh = 0;
|
||||
}
|
||||
pep = NULL;
|
||||
for (l = ed->parts; l; l = l->next)
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *ep;
|
||||
int w, h;
|
||||
int didw;
|
||||
|
||||
ep = l->data;
|
||||
ep = ed->table_parts[i];
|
||||
w = ep->w - ep->req.w;
|
||||
h = ep->h - ep->req.h;
|
||||
didw = 0;
|
||||
|
@ -1710,13 +1710,13 @@ edje_object_part_drag_page(Evas_Object *obj, const char *part, double dx, double
|
|||
Edje_Real_Part *
|
||||
_edje_real_part_get(Edje *ed, const char *part)
|
||||
{
|
||||
Evas_List *l;
|
||||
int i;
|
||||
|
||||
for (l = ed->parts; l; l = l->next)
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
rp = l->data;
|
||||
rp = ed->table_parts[i];
|
||||
if ((rp->part->name) && (!strcmp(rp->part->name, part))) return rp;
|
||||
}
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue