forked from enlightenment/efl
Edje part geometry querying added.
Only does something if part geom has been calculated. Maybe this should return an int as to whether or not its actually giving the geometry values? SVN revision: 7099
This commit is contained in:
parent
9ab9ba283d
commit
c22eea281c
|
@ -19,6 +19,8 @@ extern "C" {
|
|||
void edje_signal_callback_add(Evas_Object *o, const char *emission, const char *source, void (*func) (void *data, Evas_Object *o, const char *emission, const char *source), void *data);
|
||||
void *edje_signal_callback_del(Evas_Object *o, const char *emission, const char *source, void (*func) (void *data, Evas_Object *o, const char *emission, const char *source));
|
||||
void edje_signal_emit(Evas_Object *o, const char *emission, const char *source);
|
||||
|
||||
void edje_part_geometry_get(Evas_Object *o, char *part, int *x, int *y, int *w, int *h);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -36,3 +36,26 @@ _edje_thaw(Edje *ed)
|
|||
_edje_recalc(ed);
|
||||
return ed->freeze;
|
||||
}
|
||||
|
||||
void
|
||||
edje_part_geometry_get(Evas_Object *o, char *part, int *x, int *y, int *w, int *h )
|
||||
{
|
||||
Evas_List *l;
|
||||
Edje *ed;
|
||||
|
||||
ed = _edje_fetch(o);
|
||||
|
||||
for (l = ed->parts; l; l = l->next)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
rp = l->data;
|
||||
|
||||
if (!strcmp(rp->part->name, part) && rp->calculated)
|
||||
{
|
||||
if (x) *x = rp->x;
|
||||
if (y) *y = rp->y;
|
||||
if (w) *w = rp->w;
|
||||
if (h) *h = rp->h;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue