NULL, NULL, NULL);
ephysics_body_move(ep->body, ep->edje->x + pf->x,
ep->edje->y + pf->y, z);
+ ep->x = pf->x;
+ ep->y = pf->y;
+ ep->w = pf->w;
+ ep->h = pf->h;
}
ephysics_body_mass_set(ep->body, pf->physics.mass);
}
}
static void
+_edje_physics_body_update_cb(void *data, EPhysics_Body *body, void *event_info __UNUSED__)
+{
+ Edje_Real_Part *rp = data;
+ ephysics_body_geometry_get(body, &(rp->x), &(rp->y), NULL,
+ &(rp->w), &(rp->h), NULL);
+ ephysics_body_evas_object_update(body);
+ rp->edje->dirty = EINA_TRUE;
+}
+
+static void
_edje_physics_body_add(Edje_Real_Part *rp, EPhysics_World *world)
{
Eina_Bool resize = EINA_TRUE;
}
ephysics_body_evas_object_set(rp->body, rp->object, resize);
+ ephysics_body_event_callback_add(rp->body, EPHYSICS_CALLBACK_BODY_UPDATE,
+ _edje_physics_body_update_cb, rp);
}
#endif
}
else
{
+#ifdef HAVE_EPHYSICS
+ if (!ep->body)
+ {
+#endif
evas_object_map_enable_set(mo, 0);
evas_object_map_set(mo, NULL);
+#ifdef HAVE_EPHYSICS
+ }
+#endif
}
}
}
+#ifdef HAVE_EPHYSICS
+ ep->prev_description = chosen_desc;
+ if (!ep->body)
+ {
+#endif
ep->x = pf->x;
ep->y = pf->y;
ep->w = pf->w;
ep->h = pf->h;
-
- ep->calculated |= flags;
- ep->calculating = FLAG_NONE;
-
#ifdef HAVE_EPHYSICS
- ep->prev_description = chosen_desc;
+ }
#endif
+ ep->calculated |= flags;
+ ep->calculating = FLAG_NONE;
#ifdef EDJE_CALC_CACHE
if (ep->calculated == FLAG_XY)
ssp->sources_patterns = edje_match_programs_source_init(all, j);
}
+#ifdef HAVE_EPHYSICS
+static void
+_edje_physics_world_update_cb(void *data, EPhysics_World *world __UNUSED__, void *event_info __UNUSED__)
+{
+ Edje *edje = data;
+ _edje_recalc_do(edje);
+}
+#endif
+
int
_edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *group, const char *parent, Eina_List *group_path, Eina_Array *nested)
{
{
ephysics_init();
ed->world = ephysics_world_new();
+ ephysics_world_event_callback_add(
+ ed->world, EPHYSICS_CALLBACK_WORLD_UPDATE,
+ _edje_physics_world_update_cb, ed);
}
#endif