* edje: More cleanup of Edje_Real_Part.

SVN revision: 41683
This commit is contained in:
Cedric BAIL 2009-08-11 10:32:21 +00:00
parent 7047c5f561
commit 9807d2e4c8
5 changed files with 26 additions and 22 deletions

View File

@ -198,7 +198,7 @@ _edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, double *x, double *y)
{
if ((ep->part->dragable.x != 0) || (ep->part->dragable.y != 0))
{
if (ep->confine_to)
if (ep->drag.confine_to)
{
double dx, dy, dw, dh;
int ret = 0;
@ -208,13 +208,13 @@ _edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, double *x, double *y)
else if (ep->part->dragable.x != 0) ret = 1;
else if (ep->part->dragable.y != 0) ret = 2;
dx = ep->x - ep->confine_to->x;
dw = ep->confine_to->w - ep->w;
dx = ep->x - ep->drag.confine_to->x;
dw = ep->drag.confine_to->w - ep->w;
if (dw != 0.0) dx /= dw;
else dx = 0.0;
dy = ep->y - ep->confine_to->y;
dh = ep->confine_to->h - ep->h;
dy = ep->y - ep->drag.confine_to->y;
dh = ep->drag.confine_to->h - ep->h;
if (dh != 0) dy /= dh;
else dy = 0.0;
@ -1509,11 +1509,11 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
#endif
}
}
if (ep->confine_to)
if (ep->drag.confine_to)
{
_edje_part_recalc(ed, ep->confine_to, flags);
_edje_part_recalc(ed, ep->drag.confine_to, flags);
#ifdef EDJE_CALC_CACHE
statec = ep->confine_to->state;
statec = ep->drag.confine_to->state;
#endif
}
// if (ep->text.source) _edje_part_recalc(ed, ep->text.source, flags);
@ -1546,7 +1546,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
{
_edje_part_recalc_single(ed, ep, ep->param1.description, chosen_desc,
ep->param1.rel1_to_x, ep->param1.rel1_to_y, ep->param1.rel2_to_x, ep->param1.rel2_to_y,
ep->confine_to,
ep->drag.confine_to,
p1,
flags);
#ifdef EDJE_CALC_CACHE
@ -1576,7 +1576,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
{
_edje_part_recalc_single(ed, ep, ep->param2.description, chosen_desc,
ep->param2.rel1_to_x, ep->param2.rel1_to_y, ep->param2.rel2_to_x, ep->param2.rel2_to_y,
ep->confine_to,
ep->drag.confine_to,
p2,
flags);
#ifdef EDJE_CALC_CACHE

View File

@ -463,7 +463,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
}
}
if (rp->part->dragable.confine_id >= 0)
rp->confine_to = ed->table_parts[rp->part->dragable.confine_id % ed->table_parts_size];
rp->drag.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)

View File

@ -786,6 +786,7 @@ struct _Edje_Real_Part_Drag
} tmp;
unsigned char need_reset : 1; // 4
Edje_Real_Part *events_to; // 4
Edje_Real_Part *confine_to; // 4
}; // 104 // FIME: make drag pointer to struct optional
struct _Edje_Real_Part
@ -793,23 +794,27 @@ struct _Edje_Real_Part
Edje *edje; // 4
Edje_Part *part; // 4
Evas_Object *object; // 4
Evas_Object *swallowed_object; // 4 // FIXME: move with swallow_params data
int x, y, w, h; // 16
Edje_Rectangle req; // 16
Eina_List *items; // 4 //FIXME: only if table/box
void *entry_data; // 4 // FIXME: move to entry section
Evas_Object *cursorbg_object; // 4 // FIXME: move to entry section
Evas_Object *cursorfg_object; // 4 // FIXME: move to entry section
int x, y, w, h; // 16
Edje_Rectangle req; // 16
Edje_Position offset; // 8 // FIXME: move to text section
Evas_Object *swallowed_object; // 4 // FIXME: move with swallow_params data
struct {
Edje_Size min, max; // 16
Edje_Aspect aspect; // 12
} swallow_params; // 28 // FIXME: only if type SWALLOW
Edje_Real_Part_Drag drag; // 104 // FIME: make drag pointer to struct optional
struct {
Edje_Real_Part *source; // 4
Edje_Real_Part *text_source; // 4
const char *text; // 4
Edje_Position offset; // 8 text only
const char *font; // 4 text only
const char *style; // 4 text only
int size; // 4 text only
@ -837,7 +842,6 @@ struct _Edje_Real_Part
int state; // 4
#endif
Edje_Real_Part *confine_to; // 4 // fixme - make part of drag
Edje_Real_Part *clip_to; // 4
Edje_Running_Program *program; // 4

View File

@ -129,13 +129,13 @@ _edje_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y)
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);
evas_object_move(ep->object, ed->x + ep->x + ep->text.offset.x, ed->y + ep->y + ep->text.offset.y);
if (ep->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
_edje_entry_real_part_configure(ep);
if (ep->swallowed_object)
{
evas_object_geometry_get(ep->swallowed_object, &ox, &oy, NULL, NULL);
evas_object_move(ep->swallowed_object, ed->x + ep->x + ep->offset.x, ed->y + ep->y +ep->offset.y);
evas_object_move(ep->swallowed_object, ed->x + ep->x + ep->text.offset.x, ed->y + ep->y + ep->text.offset.y);
}
}
// _edje_emit(ed, "move", NULL);

View File

@ -550,12 +550,12 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
evas_object_text_font_set(ep->object, font, size);
evas_object_text_text_set(ep->object, text);
part_get_geometry(ep, &tw, &th);
ep->offset.x = ((sw - tw) * params->type.text.align.x);
ep->offset.y = ((sh - th) * params->type.text.align.y);
ep->text.offset.x = ((sw - tw) * params->type.text.align.x);
ep->text.offset.y = ((sh - th) * params->type.text.align.y);
evas_object_move(ep->object,
ed->x + params->x + ep->offset.x,
ed->y + params->y + ep->offset.y);
ed->x + params->x + ep->text.offset.x,
ed->y + params->y + ep->text.offset.y);
if (params->visible) evas_object_show(ep->object);
else evas_object_hide(ep->object);